Add avatar double click event

This commit is contained in:
Bill 2022-11-12 20:04:31 -05:00
parent a019c7e373
commit 1d782ebbf5
6 changed files with 19 additions and 6 deletions

View File

@ -16,7 +16,7 @@
"@fortawesome/fontawesome-svg-core": "^6.1.1",
"@fortawesome/free-solid-svg-icons": "^6.1.1",
"@fortawesome/react-fontawesome": "^0.2.0",
"@nitrots/nitro-renderer": "^1.4.6",
"@nitrots/nitro-renderer": "^1.4.7",
"@tanstack/react-virtual": "^3.0.0-beta.18",
"animate.css": "^4.1.1",
"cross-env": "^7.0.3",

View File

@ -11,6 +11,7 @@ export class RoomWidgetUpdateRoomObjectEvent extends RoomWidgetUpdateEvent
public static OBJECT_ROLL_OVER: string = 'RWUROE_OBJECT_ROLL_OVER';
public static OBJECT_ROLL_OUT: string = 'RWUROE_OBJECT_ROLL_OUT';
public static OBJECT_REQUEST_MANIPULATION: string = 'RWUROE_OBJECT_REQUEST_MANIPULATION';
public static OBJECT_DOUBLE_CLICKED: string = 'RWUROE_OBJECT_DOUBLE_CLICKED';
private _id: number;
private _category: number;

View File

@ -1,6 +1,7 @@
export * from './useFurniAddedEvent';
export * from './useFurniRemovedEvent';
export * from './useObjectDeselectedEvent';
export * from './useObjectDoubleClickedEvent';
export * from './useObjectRollOutEvent';
export * from './useObjectRollOverEvent';
export * from './useObjectSelectedEvent';

View File

@ -0,0 +1,7 @@
import { RoomWidgetUpdateRoomObjectEvent } from '../../../api';
import { useUiEvent } from '../../events';
export const useObjectDoubleClickedEvent = (handler: (event: RoomWidgetUpdateRoomObjectEvent) => void) =>
{
useUiEvent(RoomWidgetUpdateRoomObjectEvent.OBJECT_DOUBLE_CLICKED, handler);
}

View File

@ -123,7 +123,8 @@ const useRoomState = () =>
RoomEngineObjectEvent.REQUEST_MOVE,
RoomEngineObjectEvent.REQUEST_ROTATE,
RoomEngineObjectEvent.MOUSE_ENTER,
RoomEngineObjectEvent.MOUSE_LEAVE
RoomEngineObjectEvent.MOUSE_LEAVE,
RoomEngineObjectEvent.DOUBLE_CLICK
], event =>
{
if(RoomId.isRoomPreviewerId(event.roomId)) return;
@ -184,6 +185,9 @@ const useRoomState = () =>
case RoomEngineObjectEvent.MOUSE_LEAVE:
updateEvent = new RoomWidgetUpdateRoomObjectEvent(RoomWidgetUpdateRoomObjectEvent.OBJECT_ROLL_OUT, event.objectId, event.category, event.roomId);
break;
case RoomEngineObjectEvent.DOUBLE_CLICK:
updateEvent = new RoomWidgetUpdateRoomObjectEvent(RoomWidgetUpdateRoomObjectEvent.OBJECT_DOUBLE_CLICKED, event.objectId, event.category, event.roomId);
break;
}
if(updateEvent) DispatchUiEvent(updateEvent);

View File

@ -1484,10 +1484,10 @@
"@jridgewell/resolve-uri" "^3.0.3"
"@jridgewell/sourcemap-codec" "^1.4.10"
"@nitrots/nitro-renderer@^1.4.6":
version "1.4.6"
resolved "https://registry.yarnpkg.com/@nitrots/nitro-renderer/-/nitro-renderer-1.4.6.tgz#71907754d11e5f1d547926a7f81f477c115862db"
integrity sha512-hTneIlJlOfTMDjF3V5UpwxFYWs6Q9e+VDU+gHOUutdOfLG0IHgL3aoBgVSUf6J48npvfjvJSFStqTA1YDv94Ew==
"@nitrots/nitro-renderer@^1.4.7":
version "1.4.7"
resolved "https://registry.yarnpkg.com/@nitrots/nitro-renderer/-/nitro-renderer-1.4.7.tgz#1332c90bebe1d83827f7a7d57dc23f08a29ac004"
integrity sha512-704o6DDxhb3ug+zsBBmwdaATI/lhGNu/xMtdepMEZrPBkP/cFu0s5ofEsL1rkRJ0M6ceuTt+lCUsKgUXHxGWgg==
dependencies:
"@pixi/app" "~6.4.2"
"@pixi/basis" "~6.4.2"