mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-02-17 02:22:36 +01:00
Add avatar double click event
This commit is contained in:
parent
3a3c152f79
commit
dbe2388272
@ -14,6 +14,7 @@ export class RoomEngineObjectEvent extends RoomEngineEvent
|
|||||||
public static REQUEST_MANIPULATION: string = 'REOE_REQUEST_MANIPULATION';
|
public static REQUEST_MANIPULATION: string = 'REOE_REQUEST_MANIPULATION';
|
||||||
public static MOUSE_ENTER: string = 'REOE_MOUSE_ENTER';
|
public static MOUSE_ENTER: string = 'REOE_MOUSE_ENTER';
|
||||||
public static MOUSE_LEAVE: string = 'REOE_MOUSE_LEAVE';
|
public static MOUSE_LEAVE: string = 'REOE_MOUSE_LEAVE';
|
||||||
|
public static DOUBLE_CLICK: string = 'REOE_DOUBLE_CLICK';
|
||||||
|
|
||||||
private _objectId: number;
|
private _objectId: number;
|
||||||
private _category: number;
|
private _category: number;
|
||||||
|
@ -296,6 +296,9 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
|
|||||||
case RoomObjectMouseEvent.CLICK:
|
case RoomObjectMouseEvent.CLICK:
|
||||||
this.handleRoomObjectMouseClickEvent(event, roomId);
|
this.handleRoomObjectMouseClickEvent(event, roomId);
|
||||||
return;
|
return;
|
||||||
|
case RoomObjectMouseEvent.DOUBLE_CLICK:
|
||||||
|
this.handleRoomObjectMouseDoubleClickEvent(event, roomId);
|
||||||
|
return;
|
||||||
case RoomObjectMouseEvent.MOUSE_MOVE:
|
case RoomObjectMouseEvent.MOUSE_MOVE:
|
||||||
this.handleRoomObjectMouseMoveEvent(event, roomId);
|
this.handleRoomObjectMouseMoveEvent(event, roomId);
|
||||||
return;
|
return;
|
||||||
@ -491,6 +494,18 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private handleRoomObjectMouseDoubleClickEvent(event: RoomObjectMouseEvent, roomId: number): void
|
||||||
|
{
|
||||||
|
const id = event.objectId;
|
||||||
|
const type = event.objectType;
|
||||||
|
const category = this._roomEngine.getRoomObjectCategoryForType(type);
|
||||||
|
|
||||||
|
if(this._roomEngine.events)
|
||||||
|
{
|
||||||
|
this._roomEngine.events.dispatchEvent(new RoomEngineObjectEvent(RoomEngineObjectEvent.DOUBLE_CLICK, roomId, id, category));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private handleRoomObjectMouseMoveEvent(event: RoomObjectMouseEvent, roomId: number): void
|
private handleRoomObjectMouseMoveEvent(event: RoomObjectMouseEvent, roomId: number): void
|
||||||
{
|
{
|
||||||
if(!event) return;
|
if(!event) return;
|
||||||
|
@ -57,7 +57,7 @@ export class AvatarLogic extends MovingObjectLogic
|
|||||||
|
|
||||||
public getEventTypes(): string[]
|
public getEventTypes(): string[]
|
||||||
{
|
{
|
||||||
const types = [RoomObjectMouseEvent.CLICK, RoomObjectMoveEvent.POSITION_CHANGED, RoomObjectMouseEvent.MOUSE_ENTER, RoomObjectMouseEvent.MOUSE_LEAVE, RoomObjectFurnitureActionEvent.MOUSE_BUTTON, RoomObjectFurnitureActionEvent.MOUSE_ARROW];
|
const types = [RoomObjectMouseEvent.CLICK, RoomObjectMouseEvent.DOUBLE_CLICK, RoomObjectMoveEvent.POSITION_CHANGED, RoomObjectMouseEvent.MOUSE_ENTER, RoomObjectMouseEvent.MOUSE_LEAVE, RoomObjectFurnitureActionEvent.MOUSE_BUTTON, RoomObjectFurnitureActionEvent.MOUSE_ARROW];
|
||||||
|
|
||||||
return this.mergeTypes(super.getEventTypes(), types);
|
return this.mergeTypes(super.getEventTypes(), types);
|
||||||
}
|
}
|
||||||
@ -461,6 +461,9 @@ export class AvatarLogic extends MovingObjectLogic
|
|||||||
case MouseEventType.MOUSE_CLICK:
|
case MouseEventType.MOUSE_CLICK:
|
||||||
eventType = RoomObjectMouseEvent.CLICK;
|
eventType = RoomObjectMouseEvent.CLICK;
|
||||||
break;
|
break;
|
||||||
|
case MouseEventType.DOUBLE_CLICK:
|
||||||
|
eventType = RoomObjectMouseEvent.DOUBLE_CLICK;
|
||||||
|
break;
|
||||||
case MouseEventType.ROLL_OVER:
|
case MouseEventType.ROLL_OVER:
|
||||||
eventType = RoomObjectMouseEvent.MOUSE_ENTER;
|
eventType = RoomObjectMouseEvent.MOUSE_ENTER;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user