mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-22 22:30:52 +01:00
Add avatar double click event
This commit is contained in:
parent
a019c7e373
commit
1d782ebbf5
@ -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",
|
||||
|
@ -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;
|
||||
|
@ -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';
|
||||
|
7
src/hooks/rooms/engine/useObjectDoubleClickedEvent.ts
Normal file
7
src/hooks/rooms/engine/useObjectDoubleClickedEvent.ts
Normal 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);
|
||||
}
|
@ -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);
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user