From 0aac6f036798698030ba8fae058efb95747f3452 Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 17 Aug 2021 14:30:15 -0400 Subject: [PATCH] Fix some things --- .../friend-list/FriendEnteredRoomEvent.ts | 43 +++++++++++++++++-- .../camera/RoomWidgetCameraEvent.ts | 4 +- .../thumbnail/RoomWidgetThumbnailEvent.ts | 4 +- .../avatar-info/AvatarInfoWidgetView.tsx | 18 ++++---- 4 files changed, 52 insertions(+), 17 deletions(-) diff --git a/src/events/friend-list/FriendEnteredRoomEvent.ts b/src/events/friend-list/FriendEnteredRoomEvent.ts index 711d5e71..698e5407 100644 --- a/src/events/friend-list/FriendEnteredRoomEvent.ts +++ b/src/events/friend-list/FriendEnteredRoomEvent.ts @@ -1,11 +1,48 @@ -import { RoomWidgetObjectNameEvent } from '../../api'; +import { NitroEvent } from '@nitrots/nitro-renderer'; -export class FriendEnteredRoomEvent extends RoomWidgetObjectNameEvent +export class FriendEnteredRoomEvent extends NitroEvent { public static ENTERED: string = 'FERE_ENTERED'; + private _roomIndex: number; + private _category: number; + private _id: number; + private _name: string; + private _userType: number; + constructor(roomIndex: number, category: number, id: number, name: string, userType: number) { - super(FriendEnteredRoomEvent.ENTERED, roomIndex, category, id, name, userType); + super(FriendEnteredRoomEvent.ENTERED); + + this._roomIndex = roomIndex; + this._category = category; + this._id = id; + this._name = name; + this._userType = userType; + } + + public get roomIndex(): number + { + return this._roomIndex; + } + + public get category(): number + { + return this._category; + } + + public get id(): number + { + return this._id; + } + + public get name(): string + { + return this._name; + } + + public get userType(): number + { + return this._userType; } } diff --git a/src/events/room-widgets/camera/RoomWidgetCameraEvent.ts b/src/events/room-widgets/camera/RoomWidgetCameraEvent.ts index 46ed5e4b..8423d087 100644 --- a/src/events/room-widgets/camera/RoomWidgetCameraEvent.ts +++ b/src/events/room-widgets/camera/RoomWidgetCameraEvent.ts @@ -1,6 +1,6 @@ -import { RoomWidgetUpdateEvent } from '../../../api'; +import { NitroEvent } from '@nitrots/nitro-renderer'; -export class RoomWidgetCameraEvent extends RoomWidgetUpdateEvent +export class RoomWidgetCameraEvent extends NitroEvent { public static SHOW_CAMERA: string = 'NE_SHOW_CAMERA'; public static HIDE_CAMERA: string = 'NE_HIDE_CAMERA'; diff --git a/src/events/room-widgets/thumbnail/RoomWidgetThumbnailEvent.ts b/src/events/room-widgets/thumbnail/RoomWidgetThumbnailEvent.ts index 15b5efb6..dc62c6fc 100644 --- a/src/events/room-widgets/thumbnail/RoomWidgetThumbnailEvent.ts +++ b/src/events/room-widgets/thumbnail/RoomWidgetThumbnailEvent.ts @@ -1,6 +1,6 @@ -import { RoomWidgetUpdateEvent } from '../../../api'; +import { NitroEvent } from '@nitrots/nitro-renderer'; -export class RoomWidgetThumbnailEvent extends RoomWidgetUpdateEvent +export class RoomWidgetThumbnailEvent extends NitroEvent { public static SHOW_THUMBNAIL: string = 'NE_SHOW_THUMBNAIL'; public static HIDE_THUMBNAIL: string = 'NE_HIDE_THUMBNAIL'; diff --git a/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx b/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx index 47bf9416..47b29509 100644 --- a/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx +++ b/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx @@ -1,8 +1,6 @@ import { RoomEnterEffect, RoomObjectCategory } from '@nitrots/nitro-renderer'; import { FC, useCallback, useMemo, useState } from 'react'; import { GetRoomSession, GetSessionDataManager, RoomWidgetObjectNameEvent, RoomWidgetRoomEngineUpdateEvent, RoomWidgetRoomObjectMessage, RoomWidgetRoomObjectUpdateEvent, RoomWidgetUpdateDanceStatusEvent, RoomWidgetUpdateInfostandEvent, RoomWidgetUpdateInfostandFurniEvent, RoomWidgetUpdateInfostandPetEvent, RoomWidgetUpdateInfostandRentableBotEvent, RoomWidgetUpdateInfostandUserEvent, RoomWidgetUpdateRentableBotChatEvent, RoomWidgetUseProductBubbleEvent, UseProductItem } from '../../../../api'; -import { FriendEnteredRoomEvent } from '../../../../events'; -import { useUiEvent } from '../../../../hooks/events'; import { CreateEventDispatcherHook } from '../../../../hooks/events/event-dispatcher.base'; import { useRoomContext } from '../../context/RoomContext'; import { AvatarInfoWidgetAvatarView } from './views/avatar/AvatarInfoWidgetAvatarView'; @@ -256,15 +254,15 @@ export const AvatarInfoWidgetView: FC<{}> = props => CreateEventDispatcherHook(RoomWidgetUseProductBubbleEvent.USE_PRODUCT_BUBBLES, eventDispatcher, onRoomWidgetUseProductBubbleEvent); - const onFriendEnteredRoomEvent = useCallback((event: FriendEnteredRoomEvent) => - { - setNameBubbles(prevValue => - { - return [ ...prevValue, event ]; - }) - }, []); + // const onFriendEnteredRoomEvent = useCallback((event: FriendEnteredRoomEvent) => + // { + // setNameBubbles(prevValue => + // { + // return [ ...prevValue, event ]; + // }) + // }, []); - useUiEvent(FriendEnteredRoomEvent.ENTERED, onFriendEnteredRoomEvent); + // useUiEvent(FriendEnteredRoomEvent.ENTERED, onFriendEnteredRoomEvent); const decorateView = useMemo(() => {