From fe998d16398235d1e8b2c39bca5109da60a5abc6 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 12 Jul 2021 03:59:40 -0400 Subject: [PATCH] Lots of widget updates --- .../monsterplant-preview.png | Bin src/assets/styles/utils.scss | 4 + src/views/room/RoomView.tsx | 3 +- .../FurnitureContextMenuWidgetHandler.ts | 40 +++++ .../handlers/RoomWidgetAvatarInfoHandler.ts | 3 +- src/views/room/handlers/index.ts | 1 + src/views/room/widgets/RoomWidgets.types.ts | 3 - .../avatar-info/AvatarInfoWidgetView.scss | 20 +++ .../avatar-info/AvatarInfoWidgetView.tsx | 3 +- .../avatar-info/AvatarInfoWidgetView.types.ts | 4 - .../avatar/AvatarInfoWidgetAvatarView.tsx | 2 +- .../views/name/AvatarInfoWidgetNameView.tsx | 2 +- .../AvatarInfoWidgetOwnAvatarView.tsx | 2 +- .../own-pet/AvatarInfoWidgetOwnPetView.tsx | 4 +- .../AvatarInfoWidgetRentableBotView.tsx | 4 +- .../AvatarInfoUseProductConfirmView.tsx | 49 ++++--- .../use-product/AvatarInfoUseProductView.tsx | 4 +- .../room/widgets/camera/CameraWidgetView.tsx | 3 +- .../widgets/camera/CameraWidgetView.types.ts | 4 - .../room/widgets/chat-input/ChatInputView.tsx | 3 +- .../widgets/chat-input/ChatInputView.types.ts | 6 - .../room/widgets/chat/ChatWidgetView.tsx | 3 +- .../room/widgets/chat/ChatWidgetView.types.ts | 6 - .../widgets/context-menu/ContextMenuView.tsx | 83 ++++++++--- .../context-menu/ContextMenuView.types.ts | 1 + .../furniture/FurnitureWidget.types.ts | 4 - .../widgets/furniture/FurnitureWidgets.scss | 2 +- .../furniture/FurnitureWidgetsView.tsx | 7 +- .../furniture/FurnitureWidgetsView.types.ts | 6 - .../context-menu/FurnitureContextMenuView.tsx | 137 +++++++++++++----- .../MonsterPlantSeedConfirmView.tsx | 83 +++++++++++ .../MonsterPlantSeedConfirmView.types.ts | 5 + .../PurchasableClothingConfirmView.tsx | 102 +++++++++++++ .../PurchasableClothingConfirmView.types.ts | 5 + .../furniture/dimmer/FurnitureDimmerView.tsx | 3 +- .../dimmer/FurnitureDimmerView.types.ts | 4 - .../FurnitureEngravingLockView.types.ts | 4 - .../FurnitureExchangeCreditView.tsx | 3 +- .../FurnitureExchangeCreditView.types.ts | 4 - .../FriendFurniLockData.ts} | 0 .../FurnitureFriendFurniView.scss} | 0 .../FurnitureFriendFurniView.tsx} | 5 +- .../high-score/FurnitureHighScoreView.tsx | 3 +- .../FurnitureHighScoreView.types.ts | 6 - .../FurnitureManipulationMenuView.tsx | 3 +- .../FurnitureManipulationMenuView.types.ts | 6 - .../mannequin/FurnitureMannequinView.tsx | 26 ++-- .../MannequinViewMode.ts} | 7 +- .../present/FurniturePresentView.tsx | 3 +- .../present/FurniturePresentView.types.ts | 6 - .../stickie/FurnitureStickieView.tsx | 3 +- .../stickie/FurnitureStickieView.types.ts | 6 - .../furniture/trophy/FurnitureTrophyView.tsx | 3 +- .../trophy/FurnitureTrophyView.types.ts | 4 - .../views/furni/InfoStandWidgetFurniView.tsx | 5 + 55 files changed, 499 insertions(+), 213 deletions(-) rename src/assets/images/room-widgets/{avatar-info => furni-context-menu}/monsterplant-preview.png (100%) create mode 100644 src/views/room/handlers/FurnitureContextMenuWidgetHandler.ts delete mode 100644 src/views/room/widgets/avatar-info/AvatarInfoWidgetView.types.ts delete mode 100644 src/views/room/widgets/camera/CameraWidgetView.types.ts delete mode 100644 src/views/room/widgets/chat-input/ChatInputView.types.ts delete mode 100644 src/views/room/widgets/chat/ChatWidgetView.types.ts delete mode 100644 src/views/room/widgets/furniture/FurnitureWidget.types.ts delete mode 100644 src/views/room/widgets/furniture/FurnitureWidgetsView.types.ts create mode 100644 src/views/room/widgets/furniture/context-menu/views/monsterplant-seed/MonsterPlantSeedConfirmView.tsx create mode 100644 src/views/room/widgets/furniture/context-menu/views/monsterplant-seed/MonsterPlantSeedConfirmView.types.ts create mode 100644 src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.tsx create mode 100644 src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.types.ts delete mode 100644 src/views/room/widgets/furniture/dimmer/FurnitureDimmerView.types.ts delete mode 100644 src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockView.types.ts delete mode 100644 src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.types.ts rename src/views/room/widgets/furniture/{engraving-lock/FurnitureEngravingLockData.ts => friend-furni/FriendFurniLockData.ts} (100%) rename src/views/room/widgets/furniture/{engraving-lock/FurnitureEngravingLockView.scss => friend-furni/FurnitureFriendFurniView.scss} (100%) rename src/views/room/widgets/furniture/{engraving-lock/FurnitureEngravingLockView.tsx => friend-furni/FurnitureFriendFurniView.tsx} (96%) delete mode 100644 src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.types.ts delete mode 100644 src/views/room/widgets/furniture/manipulation-menu/FurnitureManipulationMenuView.types.ts rename src/views/room/widgets/furniture/mannequin/{FurnitureMannequinView.types.tsx => common/MannequinViewMode.ts} (61%) delete mode 100644 src/views/room/widgets/furniture/present/FurniturePresentView.types.ts delete mode 100644 src/views/room/widgets/furniture/stickie/FurnitureStickieView.types.ts delete mode 100644 src/views/room/widgets/furniture/trophy/FurnitureTrophyView.types.ts diff --git a/src/assets/images/room-widgets/avatar-info/monsterplant-preview.png b/src/assets/images/room-widgets/furni-context-menu/monsterplant-preview.png similarity index 100% rename from src/assets/images/room-widgets/avatar-info/monsterplant-preview.png rename to src/assets/images/room-widgets/furni-context-menu/monsterplant-preview.png diff --git a/src/assets/styles/utils.scss b/src/assets/styles/utils.scss index c2a43bac..51b4bcab 100644 --- a/src/assets/styles/utils.scss +++ b/src/assets/styles/utils.scss @@ -62,3 +62,7 @@ ul { .filter-none { filter: unset !important; } + +.w-unset { + width: unset; +} diff --git a/src/views/room/RoomView.tsx b/src/views/room/RoomView.tsx index fe7d0145..2bc5e352 100644 --- a/src/views/room/RoomView.tsx +++ b/src/views/room/RoomView.tsx @@ -9,7 +9,7 @@ import { GetRoomEngine } from '../../api/nitro/room/GetRoomEngine'; import { useRoomEngineEvent } from '../../hooks/events'; import { RoomContextProvider } from './context/RoomContext'; import { RoomWidgetRoomEngineUpdateEvent, RoomWidgetRoomObjectUpdateEvent } from './events'; -import { IRoomWidgetHandlerManager, RoomWidgetAvatarInfoHandler, RoomWidgetChatHandler, RoomWidgetChatInputHandler, RoomWidgetHandlerManager, RoomWidgetInfostandHandler } from './handlers'; +import { FurnitureContextMenuWidgetHandler, IRoomWidgetHandlerManager, RoomWidgetAvatarInfoHandler, RoomWidgetChatHandler, RoomWidgetChatInputHandler, RoomWidgetHandlerManager, RoomWidgetInfostandHandler } from './handlers'; import { RoomViewProps } from './RoomView.types'; import { RoomWidgetsView } from './widgets/RoomWidgetsView'; @@ -37,6 +37,7 @@ export const RoomView: FC = props => widgetHandlerManager.registerHandler(new RoomWidgetInfostandHandler()); widgetHandlerManager.registerHandler(new RoomWidgetChatInputHandler()); widgetHandlerManager.registerHandler(new RoomWidgetChatHandler()); + widgetHandlerManager.registerHandler(new FurnitureContextMenuWidgetHandler()); setWidgetHandler(widgetHandlerManager); diff --git a/src/views/room/handlers/FurnitureContextMenuWidgetHandler.ts b/src/views/room/handlers/FurnitureContextMenuWidgetHandler.ts new file mode 100644 index 00000000..11080342 --- /dev/null +++ b/src/views/room/handlers/FurnitureContextMenuWidgetHandler.ts @@ -0,0 +1,40 @@ +import { NitroEvent, RoomEngineTriggerWidgetEvent } from 'nitro-renderer'; +import { RoomWidgetUpdateEvent } from '../events'; +import { RoomWidgetMessage, RoomWidgetUseProductMessage } from '../messages'; +import { RoomWidgetHandler } from './RoomWidgetHandler'; + +export class FurnitureContextMenuWidgetHandler extends RoomWidgetHandler +{ + public processEvent(event: NitroEvent): void + { + } + + public processWidgetMessage(message: RoomWidgetMessage): RoomWidgetUpdateEvent + { + switch(message.type) + { + case RoomWidgetUseProductMessage.MONSTERPLANT_SEED: + const productMessage = (message as RoomWidgetUseProductMessage); + + this.container.roomSession.useMultistateItem(productMessage.objectId); + break; + } + + return null; + } + + public get eventTypes(): string[] + { + return [ + RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU, + RoomEngineTriggerWidgetEvent.CLOSE_FURNI_CONTEXT_MENU + ]; + } + + public get messageTypes(): string[] + { + return [ + RoomWidgetUseProductMessage.MONSTERPLANT_SEED + ]; + } +} diff --git a/src/views/room/handlers/RoomWidgetAvatarInfoHandler.ts b/src/views/room/handlers/RoomWidgetAvatarInfoHandler.ts index 5b7f5538..6324a380 100644 --- a/src/views/room/handlers/RoomWidgetAvatarInfoHandler.ts +++ b/src/views/room/handlers/RoomWidgetAvatarInfoHandler.ts @@ -168,8 +168,7 @@ export class RoomWidgetAvatarInfoHandler extends RoomWidgetHandler RoomWidgetDanceMessage.DANCE, RoomWidgetAvatarExpressionMessage.AVATAR_EXPRESSION, RoomWidgetChangePostureMessage.CHANGE_POSTURE, - RoomWidgetUseProductMessage.PET_PRODUCT, - RoomWidgetUseProductMessage.MONSTERPLANT_SEED + RoomWidgetUseProductMessage.PET_PRODUCT ]; } } diff --git a/src/views/room/handlers/index.ts b/src/views/room/handlers/index.ts index 64596a0f..5c6464e2 100644 --- a/src/views/room/handlers/index.ts +++ b/src/views/room/handlers/index.ts @@ -1,3 +1,4 @@ +export * from './FurnitureContextMenuWidgetHandler'; export * from './IRoomWidgetHandler'; export * from './IRoomWidgetHandlerManager'; export * from './RoomWidgetAvatarInfoHandler'; diff --git a/src/views/room/widgets/RoomWidgets.types.ts b/src/views/room/widgets/RoomWidgets.types.ts index 199fc363..ea28fdd6 100644 --- a/src/views/room/widgets/RoomWidgets.types.ts +++ b/src/views/room/widgets/RoomWidgets.types.ts @@ -1,5 +1,2 @@ export interface RoomWidgetViewProps {} - -export interface RoomWidgetProps -{} diff --git a/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.scss b/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.scss index dffb096d..df009b29 100644 --- a/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.scss +++ b/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.scss @@ -1,6 +1,10 @@ .nitro-use-product-confirmation { + width: 350px; .product-preview { + display: flex; + justify-content: center; + align-items: center; width: 122px; height: 130px; background: url('../../../../assets/images/room-widgets/avatar-info/preview-background.png') no-repeat center; @@ -9,5 +13,21 @@ width: 122px; height: 130px; } + + .monsterplant-image { + width: 122px; + height: 130px; + background: url('../../../../assets/images/room-widgets/furni-context-menu/monsterplant-preview.png') no-repeat center; + } + } + + .mannequin-preview { + display: flex; + justify-content: center; + align-items: center; + width: 83px; + height: 130px; + background-image: url('../../../../assets/images/room-widgets/mannequin-widget/mannequin-spritesheet.png'); + overflow: hidden; } } diff --git a/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx b/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx index 57ef9fdd..76af1582 100644 --- a/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx +++ b/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx @@ -7,7 +7,6 @@ import { CreateEventDispatcherHook } from '../../../../hooks/events/event-dispat import { useRoomContext } from '../../context/RoomContext'; import { RoomWidgetObjectNameEvent, RoomWidgetRoomEngineUpdateEvent, RoomWidgetRoomObjectUpdateEvent, RoomWidgetUpdateDanceStatusEvent, RoomWidgetUpdateInfostandEvent, RoomWidgetUpdateInfostandFurniEvent, RoomWidgetUpdateInfostandPetEvent, RoomWidgetUpdateInfostandRentableBotEvent, RoomWidgetUpdateInfostandUserEvent, RoomWidgetUpdateRentableBotChatEvent, RoomWidgetUseProductBubbleEvent, UseProductItem } from '../../events'; import { RoomWidgetRoomObjectMessage } from '../../messages'; -import { AvatarInfoWidgetViewProps } from './AvatarInfoWidgetView.types'; import { AvatarInfoWidgetAvatarView } from './views/avatar/AvatarInfoWidgetAvatarView'; import { AvatarInfoWidgetDecorateView } from './views/decorate/AvatarInfoWidgetDecorateView'; import { AvatarInfoWidgetNameView } from './views/name/AvatarInfoWidgetNameView'; @@ -19,7 +18,7 @@ import { AvatarInfoWidgetRentableBotView } from './views/rentable-bot/AvatarInfo import { AvatarInfoUseProductConfirmView } from './views/use-product-confirm/AvatarInfoUseProductConfirmView'; import { AvatarInfoUseProductView } from './views/use-product/AvatarInfoUseProductView'; -export const AvatarInfoWidgetView: FC = props => +export const AvatarInfoWidgetView: FC<{}> = props => { const { roomSession = null, eventDispatcher = null, widgetHandler = null } = useRoomContext(); const [ name, setName ] = useState(null); diff --git a/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.types.ts b/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.types.ts deleted file mode 100644 index 23622184..00000000 --- a/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.types.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { RoomWidgetProps } from '../RoomWidgets.types'; - -export interface AvatarInfoWidgetViewProps extends RoomWidgetProps -{} diff --git a/src/views/room/widgets/avatar-info/views/avatar/AvatarInfoWidgetAvatarView.tsx b/src/views/room/widgets/avatar-info/views/avatar/AvatarInfoWidgetAvatarView.tsx index 9f6d5415..a46ff0f4 100644 --- a/src/views/room/widgets/avatar-info/views/avatar/AvatarInfoWidgetAvatarView.tsx +++ b/src/views/room/widgets/avatar-info/views/avatar/AvatarInfoWidgetAvatarView.tsx @@ -194,7 +194,7 @@ export const AvatarInfoWidgetAvatarView: FC = p }, []); return ( - + { userData.name } diff --git a/src/views/room/widgets/avatar-info/views/name/AvatarInfoWidgetNameView.tsx b/src/views/room/widgets/avatar-info/views/name/AvatarInfoWidgetNameView.tsx index 786741dd..d30da446 100644 --- a/src/views/room/widgets/avatar-info/views/name/AvatarInfoWidgetNameView.tsx +++ b/src/views/room/widgets/avatar-info/views/name/AvatarInfoWidgetNameView.tsx @@ -13,7 +13,7 @@ export const AvatarInfoWidgetNameView: FC = props }, [ nameData ]); return ( - +
{ nameData.name }
diff --git a/src/views/room/widgets/avatar-info/views/own-avatar/AvatarInfoWidgetOwnAvatarView.tsx b/src/views/room/widgets/avatar-info/views/own-avatar/AvatarInfoWidgetOwnAvatarView.tsx index ebbf725e..58e851ef 100644 --- a/src/views/room/widgets/avatar-info/views/own-avatar/AvatarInfoWidgetOwnAvatarView.tsx +++ b/src/views/room/widgets/avatar-info/views/own-avatar/AvatarInfoWidgetOwnAvatarView.tsx @@ -105,7 +105,7 @@ export const AvatarInfoWidgetOwnAvatarView: FC + { userData.name } diff --git a/src/views/room/widgets/avatar-info/views/own-pet/AvatarInfoWidgetOwnPetView.tsx b/src/views/room/widgets/avatar-info/views/own-pet/AvatarInfoWidgetOwnPetView.tsx index a5b3a2ff..03ebc74a 100644 --- a/src/views/room/widgets/avatar-info/views/own-pet/AvatarInfoWidgetOwnPetView.tsx +++ b/src/views/room/widgets/avatar-info/views/own-pet/AvatarInfoWidgetOwnPetView.tsx @@ -1,4 +1,4 @@ -import { PetType, RoomObjectCategory, RoomObjectVariable } from 'nitro-renderer'; +import { PetType, RoomObjectCategory, RoomObjectType, RoomObjectVariable } from 'nitro-renderer'; import { FC, useCallback, useEffect, useMemo, useState } from 'react'; import { GetOwnRoomObject } from '../../../../../../api'; import { LocalizeText } from '../../../../../../utils/LocalizeText'; @@ -139,7 +139,7 @@ export const AvatarInfoWidgetOwnPetView: FC = p }, []); return ( - + { petData.name } diff --git a/src/views/room/widgets/avatar-info/views/rentable-bot/AvatarInfoWidgetRentableBotView.tsx b/src/views/room/widgets/avatar-info/views/rentable-bot/AvatarInfoWidgetRentableBotView.tsx index ab5522ba..6f91a26b 100644 --- a/src/views/room/widgets/avatar-info/views/rentable-bot/AvatarInfoWidgetRentableBotView.tsx +++ b/src/views/room/widgets/avatar-info/views/rentable-bot/AvatarInfoWidgetRentableBotView.tsx @@ -1,4 +1,4 @@ -import { BotCommandConfigurationEvent, BotRemoveComposer, BotSkillSaveComposer, Nitro, RequestBotCommandConfigurationComposer, RoomObjectCategory } from 'nitro-renderer'; +import { BotCommandConfigurationEvent, BotRemoveComposer, BotSkillSaveComposer, Nitro, RequestBotCommandConfigurationComposer, RoomObjectCategory, RoomObjectType } from 'nitro-renderer'; import { FC, useCallback, useEffect, useState } from 'react'; import { CreateMessageHook, SendMessageHook } from '../../../../../../hooks/messages'; import { LocalizeText } from '../../../../../../utils/LocalizeText'; @@ -136,7 +136,7 @@ export const AvatarInfoWidgetRentableBotView: FC + { rentableBotData.name } diff --git a/src/views/room/widgets/avatar-info/views/use-product-confirm/AvatarInfoUseProductConfirmView.tsx b/src/views/room/widgets/avatar-info/views/use-product-confirm/AvatarInfoUseProductConfirmView.tsx index 8a7b2bf9..4d781a25 100644 --- a/src/views/room/widgets/avatar-info/views/use-product-confirm/AvatarInfoUseProductConfirmView.tsx +++ b/src/views/room/widgets/avatar-info/views/use-product-confirm/AvatarInfoUseProductConfirmView.tsx @@ -26,6 +26,13 @@ export const AvatarInfoUseProductConfirmView: FC(null); const { roomSession = null, widgetHandler = null } = useRoomContext(); + const selectRoomObject = useCallback(() => + { + if(!petData) return; + + GetRoomEngine().selectRoomObject(roomSession.roomId, petData.roomIndex, RoomObjectCategory.UNIT); + }, [ roomSession, petData ]); + const useProduct = useCallback(() => { widgetHandler.processWidgetMessage(new RoomWidgetUseProductMessage(RoomWidgetUseProductMessage.PET_PRODUCT, item.requestRoomObjectId, petData.webID)); @@ -217,49 +224,51 @@ export const AvatarInfoUseProductConfirmView: FC -
-
- { getPetImage } +
+
+
+ { getPetImage } +
-
-
+
+
{ (mode === _Str_11906) && <> -
{ LocalizeText('useproduct.widget.text.shampoo', [ 'productName' ], [ furniData.name ] ) }
-
{ LocalizeText('useproduct.widget.info.shampoo') }
+
{ LocalizeText('useproduct.widget.text.shampoo', [ 'productName' ], [ furniData.name ] ) }
+
{ LocalizeText('useproduct.widget.info.shampoo') }
} { (mode === _Str_11214) && <> -
{ LocalizeText('useproduct.widget.text.custompart', [ 'productName' ], [ furniData.name ] ) }
-
{ LocalizeText('useproduct.widget.info.custompart') }
+
{ LocalizeText('useproduct.widget.text.custompart', [ 'productName' ], [ furniData.name ] ) }
+
{ LocalizeText('useproduct.widget.info.custompart') }
} { (mode === _Str_11733) && <> -
{ LocalizeText('useproduct.widget.text.custompartshampoo', [ 'productName' ], [ furniData.name ] ) }
-
{ LocalizeText('useproduct.widget.info.custompartshampoo') }
+
{ LocalizeText('useproduct.widget.text.custompartshampoo', [ 'productName' ], [ furniData.name ] ) }
+
{ LocalizeText('useproduct.widget.info.custompartshampoo') }
} { (mode === _Str_11369) && <> -
{ LocalizeText('useproduct.widget.text.saddle', [ 'productName' ], [ furniData.name ] ) }
-
{ LocalizeText('useproduct.widget.info.saddle') }
+
{ LocalizeText('useproduct.widget.text.saddle', [ 'productName' ], [ furniData.name ] ) }
+
{ LocalizeText('useproduct.widget.info.saddle') }
} { (mode === _Str_8759) && <> -
{ LocalizeText('useproduct.widget.text.revive_monsterplant', [ 'productName' ], [ furniData.name ] ) }
-
{ LocalizeText('useproduct.widget.info.revive_monsterplant') }
+
{ LocalizeText('useproduct.widget.text.revive_monsterplant', [ 'productName' ], [ furniData.name ] ) }
+
{ LocalizeText('useproduct.widget.info.revive_monsterplant') }
} { (mode === _Str_8432) && <> -
{ LocalizeText('useproduct.widget.text.rebreed_monsterplant', [ 'productName' ], [ furniData.name ] ) }
-
{ LocalizeText('useproduct.widget.info.rebreed_monsterplant') }
+
{ LocalizeText('useproduct.widget.text.rebreed_monsterplant', [ 'productName' ], [ furniData.name ] ) }
+
{ LocalizeText('useproduct.widget.info.rebreed_monsterplant') }
} { (mode === _Str_9653) && <> -
{ LocalizeText('useproduct.widget.text.fertilize_monsterplant', [ 'productName' ], [ furniData.name ] ) }
-
{ LocalizeText('useproduct.widget.info.fertilize_monsterplant') }
+
{ LocalizeText('useproduct.widget.text.fertilize_monsterplant', [ 'productName' ], [ furniData.name ] ) }
+
{ LocalizeText('useproduct.widget.info.fertilize_monsterplant') }
}
-
+
diff --git a/src/views/room/widgets/avatar-info/views/use-product/AvatarInfoUseProductView.tsx b/src/views/room/widgets/avatar-info/views/use-product/AvatarInfoUseProductView.tsx index aca532b0..1162b43e 100644 --- a/src/views/room/widgets/avatar-info/views/use-product/AvatarInfoUseProductView.tsx +++ b/src/views/room/widgets/avatar-info/views/use-product/AvatarInfoUseProductView.tsx @@ -1,4 +1,4 @@ -import { RoomObjectCategory } from 'nitro-renderer'; +import { RoomObjectCategory, RoomObjectType } from 'nitro-renderer'; import { FC, useCallback, useEffect, useState } from 'react'; import { GetFurnitureDataForRoomObject } from '../../../../../../api'; import { LocalizeText } from '../../../../../../utils/LocalizeText'; @@ -83,7 +83,7 @@ export const AvatarInfoUseProductView: FC = props }, [ item, updateConfirmingProduct ]); return ( - + { item.name } diff --git a/src/views/room/widgets/camera/CameraWidgetView.tsx b/src/views/room/widgets/camera/CameraWidgetView.tsx index 23d083a1..5b57cdcf 100644 --- a/src/views/room/widgets/camera/CameraWidgetView.tsx +++ b/src/views/room/widgets/camera/CameraWidgetView.tsx @@ -7,13 +7,12 @@ import { RoomWidgetCameraEvent } from '../../../../events/room-widgets/camera/Ro import { useCameraEvent } from '../../../../hooks/events/nitro/camera/camera-event'; import { useUiEvent } from '../../../../hooks/events/ui/ui-event'; import { CreateMessageHook, SendMessageHook } from '../../../../hooks/messages/message-event'; -import { CameraWidgetViewProps } from './CameraWidgetView.types'; import { CameraWidgetContextProvider } from './context/CameraWidgetContext'; import { CameraWidgetCaptureView } from './views/capture/CameraWidgetCaptureView'; import { CameraWidgetCheckoutView } from './views/checkout/CameraWidgetCheckoutView'; import { CameraWidgetEditorView } from './views/editor/CameraWidgetEditorView'; -export const CameraWidgetView: FC = props => +export const CameraWidgetView: FC<{}> = props => { const [ effectsReady, setEffectsReady ] = useState(false); diff --git a/src/views/room/widgets/camera/CameraWidgetView.types.ts b/src/views/room/widgets/camera/CameraWidgetView.types.ts deleted file mode 100644 index dc1096c2..00000000 --- a/src/views/room/widgets/camera/CameraWidgetView.types.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { RoomWidgetProps } from '../RoomWidgets.types'; - -export interface CameraWidgetViewProps extends RoomWidgetProps -{} diff --git a/src/views/room/widgets/chat-input/ChatInputView.tsx b/src/views/room/widgets/chat-input/ChatInputView.tsx index 471376ff..4fad3a92 100644 --- a/src/views/room/widgets/chat-input/ChatInputView.tsx +++ b/src/views/room/widgets/chat-input/ChatInputView.tsx @@ -6,10 +6,9 @@ import { LocalizeText } from '../../../../utils/LocalizeText'; import { useRoomContext } from '../../context/RoomContext'; import { RoomWidgetRoomObjectUpdateEvent, RoomWidgetUpdateChatInputContentEvent, RoomWidgetUpdateInfostandUserEvent } from '../../events'; import { RoomWidgetChatMessage, RoomWidgetChatTypingMessage } from '../../messages'; -import { ChatInputViewProps } from './ChatInputView.types'; import { ChatInputStyleSelectorView } from './style-selector/ChatInputStyleSelectorView'; -export const ChatInputView: FC = props => +export const ChatInputView: FC<{}> = props => { const [ chatValue, setChatValue ] = useState(''); const [ selectedUsername, setSelectedUsername ] = useState(''); diff --git a/src/views/room/widgets/chat-input/ChatInputView.types.ts b/src/views/room/widgets/chat-input/ChatInputView.types.ts deleted file mode 100644 index fe19aca1..00000000 --- a/src/views/room/widgets/chat-input/ChatInputView.types.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { RoomWidgetProps } from '../RoomWidgets.types'; - -export interface ChatInputViewProps extends RoomWidgetProps -{ - -} diff --git a/src/views/room/widgets/chat/ChatWidgetView.tsx b/src/views/room/widgets/chat/ChatWidgetView.tsx index 1612dc5f..18c5a781 100644 --- a/src/views/room/widgets/chat/ChatWidgetView.tsx +++ b/src/views/room/widgets/chat/ChatWidgetView.tsx @@ -3,11 +3,10 @@ import { FC, useCallback, useEffect, useRef, useState } from 'react'; import { CreateEventDispatcherHook, useRoomEngineEvent } from '../../../../hooks/events'; import { useRoomContext } from '../../context/RoomContext'; import { RoomWidgetUpdateChatEvent } from '../../events'; -import { ChatWidgetViewProps } from './ChatWidgetView.types'; import { ChatWidgetMessageView } from './message/ChatWidgetMessageView'; import { ChatBubbleMessage } from './utils/ChatBubbleMessage'; -export const ChatWidgetView: FC = props => +export const ChatWidgetView: FC<{}> = props => { const [ chatMessages, setChatMessages ] = useState([]); const { roomSession = null, eventDispatcher = null } = useRoomContext(); diff --git a/src/views/room/widgets/chat/ChatWidgetView.types.ts b/src/views/room/widgets/chat/ChatWidgetView.types.ts deleted file mode 100644 index 8f5535be..00000000 --- a/src/views/room/widgets/chat/ChatWidgetView.types.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { RoomWidgetProps } from '../RoomWidgets.types'; - -export interface ChatWidgetViewProps extends RoomWidgetProps -{ - -} diff --git a/src/views/room/widgets/context-menu/ContextMenuView.tsx b/src/views/room/widgets/context-menu/ContextMenuView.tsx index c99f48b4..09b568db 100644 --- a/src/views/room/widgets/context-menu/ContextMenuView.tsx +++ b/src/views/room/widgets/context-menu/ContextMenuView.tsx @@ -1,24 +1,43 @@ -import { FixedSizeStack, Nitro } from 'nitro-renderer'; +import { FixedSizeStack, Nitro, NitroPoint, NitroRectangle, RoomObjectType } from 'nitro-renderer'; import { FC, useCallback, useEffect, useRef, useState } from 'react'; -import { GetRoomObjectBounds, GetRoomSession, GetTicker } from '../../../../api'; +import { GetRoomEngine, GetRoomObjectBounds, GetRoomSession, GetTicker } from '../../../../api'; import { ContextMenuViewProps } from './ContextMenuView.types'; +const LOCATION_STACK_SIZE: number = 25; +const BUBBLE_DROP_SPEED: number = 3; const fadeDelay = 3000; const fadeLength = 75; const SPACE_AROUND_EDGES = 10; export const ContextMenuView: FC = props => { - const { objectId = -1, category = -1, fades = false, className = '', close = null, children = null } = props; + const { objectId = -1, category = -1, userType = -1, fades = false, className = '', close = null, children = null } = props; const [ pos, setPos ] = useState<{ x: number, y: number }>({ x: null, y: null }); - const [ stack, setStack ] = useState(null); + const [ deltaYStack, setDeltaYStack ] = useState(null); + const [ currentDeltaY, setCurrentDeltaY ] = useState(-1000000); const [ opacity, setOpacity ] = useState(1); const [ isFading, setIsFading ] = useState(false); const [ fadeTime, setFadeTime ] = useState(0); const [ frozen, setFrozen ] = useState(false); const elementRef = useRef(); - const update = useCallback((time: number) => + const getOffset = useCallback((bounds: NitroRectangle) => + { + let height = -(elementRef.current.offsetHeight); + + if((userType > -1) && ((userType === RoomObjectType.USER) || (userType === RoomObjectType.BOT) || (userType === RoomObjectType.RENTABLE_BOT))) + { + height = (height + ((bounds.height > 50) ? 15 : 0)); + } + else + { + height = (height - 14); + } + + return height; + }, [ userType ]); + + const updateFade = useCallback((time: number) => { let newFadeTime = time; let newOpacity = 1; @@ -38,37 +57,59 @@ export const ContextMenuView: FC = props => { close(); - return; + return false; } setOpacity(newOpacity); } - const bounds = GetRoomObjectBounds(GetRoomSession().roomId, objectId, category); + return true; + }, [ isFading, close ]); - if(!bounds || !elementRef.current) return; + const updatePosition = useCallback((bounds: NitroRectangle, location: NitroPoint) => + { + if(!bounds || !location || !deltaYStack) return; - let left = Math.round((bounds.left + (bounds.width / 2)) - (elementRef.current.offsetWidth / 2)); - let top = Math.round((bounds.top - elementRef.current.offsetHeight)); + const offset = getOffset(bounds); + + deltaYStack.addValue((location.y - bounds.top)); + + let maxStack = deltaYStack.getMax(); + + if(maxStack < (currentDeltaY - BUBBLE_DROP_SPEED)) maxStack = (currentDeltaY - BUBBLE_DROP_SPEED); + + const deltaY = (location.y - maxStack); + + let x = (location.x - (elementRef.current.offsetWidth / 2)); + let y = (deltaY + offset); const maxLeft = ((Nitro.instance.width - elementRef.current.offsetWidth) - SPACE_AROUND_EDGES); const maxTop = ((Nitro.instance.height - elementRef.current.offsetHeight) - SPACE_AROUND_EDGES); - if(left < SPACE_AROUND_EDGES) left = SPACE_AROUND_EDGES; - else if(left > maxLeft) left = maxLeft; + if(x < SPACE_AROUND_EDGES) x = SPACE_AROUND_EDGES; + else if(x > maxLeft) x = maxLeft; - if(top < SPACE_AROUND_EDGES) top = SPACE_AROUND_EDGES; - else if(top > maxTop) top = maxTop; + if(y < SPACE_AROUND_EDGES) y = SPACE_AROUND_EDGES; + else if(y > maxTop) y = maxTop; - setPos({ - x: left, - y: top - }); - }, [ objectId, category, isFading, close ]); + setCurrentDeltaY(maxStack); + setPos({ x, y }); + }, [ deltaYStack, currentDeltaY, getOffset ]); + + const update = useCallback((time: number) => + { + if(!elementRef.current || !updateFade(time)) return; + + const bounds = GetRoomObjectBounds(GetRoomSession().roomId, objectId, category); + const location = GetRoomEngine().getRoomObjectScreenLocation(GetRoomSession().roomId, objectId, category); + + updatePosition(bounds, location); + }, [ objectId, category, updateFade, updatePosition ]); useEffect(() => { - setStack(new FixedSizeStack(25)); + setDeltaYStack(new FixedSizeStack(LOCATION_STACK_SIZE)); + setCurrentDeltaY(-1000000); }, []); useEffect(() => @@ -101,7 +142,7 @@ export const ContextMenuView: FC = props => }, [ fades ]); return ( -
setFrozen(true) } onMouseLeave={ event => setFrozen(false) }> +
{ children }
); diff --git a/src/views/room/widgets/context-menu/ContextMenuView.types.ts b/src/views/room/widgets/context-menu/ContextMenuView.types.ts index e3650194..c1527ad9 100644 --- a/src/views/room/widgets/context-menu/ContextMenuView.types.ts +++ b/src/views/room/widgets/context-menu/ContextMenuView.types.ts @@ -2,6 +2,7 @@ export interface ContextMenuViewProps { objectId: number; category: number; + userType?: number; fades?: boolean; className?: string; close: () => void; diff --git a/src/views/room/widgets/furniture/FurnitureWidget.types.ts b/src/views/room/widgets/furniture/FurnitureWidget.types.ts deleted file mode 100644 index e147144f..00000000 --- a/src/views/room/widgets/furniture/FurnitureWidget.types.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { RoomWidgetProps } from '../RoomWidgets.types'; - -export interface FurnitureWidgetProps extends RoomWidgetProps -{} diff --git a/src/views/room/widgets/furniture/FurnitureWidgets.scss b/src/views/room/widgets/furniture/FurnitureWidgets.scss index 2bf505ba..1a56f4e1 100644 --- a/src/views/room/widgets/furniture/FurnitureWidgets.scss +++ b/src/views/room/widgets/furniture/FurnitureWidgets.scss @@ -1,6 +1,6 @@ -@import './engraving-lock/FurnitureEngravingLockView'; @import './dimmer/FurnitureDimmerView'; @import './exchange-credit/FurnitureExchangeCreditView'; +@import './friend-furni/FurnitureFriendFurniView'; @import './manipulation-menu/FurnitureManipulationMenuView'; @import './mannequin/FurnitureMannequinView'; @import './stickie/FurnitureStickieView'; diff --git a/src/views/room/widgets/furniture/FurnitureWidgetsView.tsx b/src/views/room/widgets/furniture/FurnitureWidgetsView.tsx index ce58b376..aac85a29 100644 --- a/src/views/room/widgets/furniture/FurnitureWidgetsView.tsx +++ b/src/views/room/widgets/furniture/FurnitureWidgetsView.tsx @@ -2,9 +2,8 @@ import { FC } from 'react'; import { FurnitureBackgroundColorView } from './background-color/FurnitureBackgroundColorView'; import { FurnitureContextMenuView } from './context-menu/FurnitureContextMenuView'; import { FurnitureDimmerView } from './dimmer/FurnitureDimmerView'; -import { FurnitureEngravingLockView } from './engraving-lock/FurnitureEngravingLockView'; import { FurnitureExchangeCreditView } from './exchange-credit/FurnitureExchangeCreditView'; -import { FurnitureWidgetsViewProps } from './FurnitureWidgetsView.types'; +import { FurnitureFriendFurniView } from './friend-furni/FurnitureFriendFurniView'; import { FurnitureHighScoreView } from './high-score/FurnitureHighScoreView'; import { FurnitureManipulationMenuView } from './manipulation-menu/FurnitureManipulationMenuView'; import { FurnitureMannequinView } from './mannequin/FurnitureMannequinView'; @@ -12,14 +11,14 @@ import { FurniturePresentView } from './present/FurniturePresentView'; import { FurnitureStickieView } from './stickie/FurnitureStickieView'; import { FurnitureTrophyView } from './trophy/FurnitureTrophyView'; -export const FurnitureWidgetsView: FC = props => +export const FurnitureWidgetsView: FC<{}> = props => { return (
- + diff --git a/src/views/room/widgets/furniture/FurnitureWidgetsView.types.ts b/src/views/room/widgets/furniture/FurnitureWidgetsView.types.ts deleted file mode 100644 index 618f7649..00000000 --- a/src/views/room/widgets/furniture/FurnitureWidgetsView.types.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { FurnitureWidgetProps } from './FurnitureWidget.types'; - -export interface FurnitureWidgetsViewProps extends FurnitureWidgetProps -{ - -} diff --git a/src/views/room/widgets/furniture/context-menu/FurnitureContextMenuView.tsx b/src/views/room/widgets/furniture/context-menu/FurnitureContextMenuView.tsx index 9409b00d..275b5d52 100644 --- a/src/views/room/widgets/furniture/context-menu/FurnitureContextMenuView.tsx +++ b/src/views/room/widgets/furniture/context-menu/FurnitureContextMenuView.tsx @@ -1,73 +1,91 @@ -import { ContextMenuEnum, IRoomObject, RoomEngineObjectEvent, RoomEngineTriggerWidgetEvent, RoomObjectCategory } from 'nitro-renderer'; +import { ContextMenuEnum, RoomEngineTriggerWidgetEvent, RoomObjectCategory } from 'nitro-renderer'; import { FC, useCallback, useState } from 'react'; import { GetRoomEngine, IsOwnerOfFurniture } from '../../../../../api'; import { useRoomEngineEvent } from '../../../../../hooks/events'; import { LocalizeText } from '../../../../../utils/LocalizeText'; import { useRoomContext } from '../../../context/RoomContext'; +import { RoomWidgetFurniActionMessage } from '../../../messages'; import { ContextMenuView } from '../../context-menu/ContextMenuView'; import { ContextMenuHeaderView } from '../../context-menu/views/header/ContextMenuHeaderView'; import { ContextMenuListItemView } from '../../context-menu/views/list-item/ContextMenuListItemView'; +import { MonsterPlantSeedConfirmView } from './views/monsterplant-seed/MonsterPlantSeedConfirmView'; +import { PurchasableClothingConfirmView } from './views/purchaseable-clothing/PurchasableClothingConfirmView'; const MONSTERPLANT_SEED_CONFIRMATION: string = 'MONSTERPLANT_SEED_CONFIRMATION'; +const PURCHASABLE_CLOTHING_CONFIRMATION: string = 'PURCHASABLE_CLOTHING_CONFIRMATION'; export const FurnitureContextMenuView: FC<{}> = props => { - const { roomSession = null, eventDispatcher = null, widgetHandler = null } = useRoomContext(); - const [ roomObject, setRoomObject ] = useState(null); - const [ contextMenu, setContextMenu ] = useState(null); + const [ objectId, setObjectId ] = useState(-1); + const [ mode, setMode ] = useState(null); + const [ confirmMode, setConfirmMode ] = useState(null); + const [ confirmingObjectId, setConfirmingObjectId ] = useState(-1); + const { roomSession = null, widgetHandler = null } = useRoomContext(); const close = useCallback(() => { - setRoomObject(null); - setContextMenu(null); + setObjectId(-1); + setMode(null); + }, []); + + const closeConfirm = useCallback(() => + { + setConfirmMode(null); + setConfirmingObjectId(-1); }, []); const onRoomEngineTriggerWidgetEvent = useCallback((event: RoomEngineTriggerWidgetEvent) => { - const roomObject = GetRoomEngine().getRoomObject(roomSession.roomId, event.objectId, event.category); + const object = GetRoomEngine().getRoomObject(roomSession.roomId, event.objectId, event.category); - if(!roomObject) return; + if(!object) return; switch(event.type) { + case RoomEngineTriggerWidgetEvent.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG: + setConfirmingObjectId(object.id); + setConfirmMode(MONSTERPLANT_SEED_CONFIRMATION); + + close(); + return; + case RoomEngineTriggerWidgetEvent.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG: + setConfirmingObjectId(object.id); + setConfirmMode(PURCHASABLE_CLOTHING_CONFIRMATION); + + close(); + return; case RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU: + setObjectId(object.id); + switch(event.contextMenu) { case ContextMenuEnum.FRIEND_FURNITURE: + setMode(ContextMenuEnum.FRIEND_FURNITURE); return; case ContextMenuEnum.MONSTERPLANT_SEED: - if(IsOwnerOfFurniture(roomObject)) - { - setRoomObject(roomObject); - setContextMenu(ContextMenuEnum.MONSTERPLANT_SEED); - } + if(IsOwnerOfFurniture(object)) setMode(ContextMenuEnum.MONSTERPLANT_SEED); return; case ContextMenuEnum.MYSTERY_BOX: return; case ContextMenuEnum.RANDOM_TELEPORT: + setMode(ContextMenuEnum.RANDOM_TELEPORT); return; case ContextMenuEnum.PURCHASABLE_CLOTHING: + if(IsOwnerOfFurniture(object)) setMode(ContextMenuEnum.PURCHASABLE_CLOTHING); return; } return; case RoomEngineTriggerWidgetEvent.CLOSE_FURNI_CONTEXT_MENU: - close(); + if(object.id === objectId) close(); return; } - }, [ roomSession, close ]); + }, [ roomSession, objectId, close ]); useRoomEngineEvent(RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU, onRoomEngineTriggerWidgetEvent); useRoomEngineEvent(RoomEngineTriggerWidgetEvent.CLOSE_FURNI_CONTEXT_MENU, onRoomEngineTriggerWidgetEvent); - - const onRoomEngineObjectEvent = useCallback((event: RoomEngineObjectEvent) => - { - if(!roomObject || (event.objectId !== roomObject.id)) return; - - close(); - }, [ roomObject, close ]); - - useRoomEngineEvent(RoomEngineObjectEvent.REMOVED, onRoomEngineObjectEvent); + useRoomEngineEvent(RoomEngineTriggerWidgetEvent.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG, onRoomEngineTriggerWidgetEvent); + useRoomEngineEvent(RoomEngineTriggerWidgetEvent.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG, onRoomEngineTriggerWidgetEvent); const processAction = useCallback((name: string) => { @@ -75,26 +93,69 @@ export const FurnitureContextMenuView: FC<{}> = props => { switch(name) { + case 'use_friend_furni': + roomSession.useMultistateItem(objectId); + break; case 'use_monsterplant_seed': - setContextMenu(MONSTERPLANT_SEED_CONFIRMATION); + setConfirmMode(MONSTERPLANT_SEED_CONFIRMATION); + setConfirmingObjectId(objectId); + break; + case 'use_random_teleport': + widgetHandler.processWidgetMessage(new RoomWidgetFurniActionMessage(RoomWidgetFurniActionMessage.USE, objectId, RoomObjectCategory.FLOOR)); + break; + case 'use_purchaseable_clothing': + setConfirmMode(PURCHASABLE_CLOTHING_CONFIRMATION); + setConfirmingObjectId(objectId); break; } } - }, [ ]); - if(!roomObject || !contextMenu) return null; + close(); + }, [ roomSession, widgetHandler, objectId, close ]); return ( - - { (contextMenu === ContextMenuEnum.MONSTERPLANT_SEED) && - <> - - { LocalizeText('furni.mnstr_seed.name') } - - processAction('use_monsterplant_seed') }> - { LocalizeText('widget.monsterplant_seed.button.use') } - - } - + <> + { (confirmMode === MONSTERPLANT_SEED_CONFIRMATION) && } + { (confirmMode === PURCHASABLE_CLOTHING_CONFIRMATION) && } + { (objectId >= 0) && mode && + + { (mode === ContextMenuEnum.FRIEND_FURNITURE) && + <> + + { LocalizeText('friendfurni.context.title') } + + processAction('use_friend_furni') }> + { LocalizeText('friendfurni.context.use') } + + } + { (mode === ContextMenuEnum.MONSTERPLANT_SEED) && + <> + + { LocalizeText('furni.mnstr_seed.name') } + + processAction('use_monsterplant_seed') }> + { LocalizeText('widget.monsterplant_seed.button.use') } + + } + { (mode === ContextMenuEnum.RANDOM_TELEPORT) && + <> + + { LocalizeText('furni.random_teleport.name') } + + processAction('use_random_teleport') }> + { LocalizeText('widget.random_teleport.button.use') } + + } + { (mode === ContextMenuEnum.PURCHASABLE_CLOTHING) && + <> + + { LocalizeText('furni.generic_usable.name') } + + processAction('use_purchaseable_clothing') }> + { LocalizeText('widget.generic_usable.button.use') } + + } + } + ) } diff --git a/src/views/room/widgets/furniture/context-menu/views/monsterplant-seed/MonsterPlantSeedConfirmView.tsx b/src/views/room/widgets/furniture/context-menu/views/monsterplant-seed/MonsterPlantSeedConfirmView.tsx new file mode 100644 index 00000000..acdeb4fa --- /dev/null +++ b/src/views/room/widgets/furniture/context-menu/views/monsterplant-seed/MonsterPlantSeedConfirmView.tsx @@ -0,0 +1,83 @@ +import { IFurnitureData, RoomObjectCategory } from 'nitro-renderer'; +import { FC, useCallback, useEffect, useState } from 'react'; +import { GetFurnitureDataForRoomObject } from '../../../../../../../api'; +import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../../../../layout'; +import { LocalizeText } from '../../../../../../../utils/LocalizeText'; +import { FurniCategory } from '../../../../../../inventory/common/FurniCategory'; +import { useRoomContext } from '../../../../../context/RoomContext'; +import { RoomWidgetUseProductMessage } from '../../../../../messages'; +import { MonsterPlantSeedConfirmViewProps } from './MonsterPlantSeedConfirmView.types'; + +const MODE_DEFAULT: number = -1; +const MODE_MONSTERPLANT_SEED: number = 0; + +export const MonsterPlantSeedConfirmView: FC = props => +{ + const { objectId = -1, close = null } = props; + const [ furniData, setFurniData ] = useState(null); + const [ mode, setMode ] = useState(MODE_DEFAULT); + const { roomSession = null, widgetHandler = null } = useRoomContext(); + + const useProduct = useCallback(() => + { + widgetHandler.processWidgetMessage(new RoomWidgetUseProductMessage(RoomWidgetUseProductMessage.MONSTERPLANT_SEED, objectId)); + + close(); + }, [ widgetHandler, objectId, close ]); + + useEffect(() => + { + if(!roomSession || (objectId === -1)) return; + + const furniData = GetFurnitureDataForRoomObject(roomSession.roomId, objectId, RoomObjectCategory.FLOOR); + + if(!furniData) return; + + setFurniData(furniData); + + let mode = MODE_DEFAULT; + + switch(furniData.specialType) + { + case FurniCategory.MONSTERPLANT_SEED: + mode = MODE_MONSTERPLANT_SEED; + break; + } + + if(mode === MODE_DEFAULT) + { + close(); + + return; + } + + setMode(mode); + }, [ roomSession, objectId, close ]); + + if(mode === MODE_DEFAULT) return null; + + return ( + + + +
+
+
+
+
+
+
+
+
{ LocalizeText('useproduct.widget.text.plant_seed', [ 'productName' ], [ furniData.name ] ) }
+
{ LocalizeText('useproduct.widget.info.plant_seed') }
+
+
+ + +
+
+
+ + + ); +} diff --git a/src/views/room/widgets/furniture/context-menu/views/monsterplant-seed/MonsterPlantSeedConfirmView.types.ts b/src/views/room/widgets/furniture/context-menu/views/monsterplant-seed/MonsterPlantSeedConfirmView.types.ts new file mode 100644 index 00000000..75fded04 --- /dev/null +++ b/src/views/room/widgets/furniture/context-menu/views/monsterplant-seed/MonsterPlantSeedConfirmView.types.ts @@ -0,0 +1,5 @@ +export interface MonsterPlantSeedConfirmViewProps +{ + objectId: number; + close: () => void; +} diff --git a/src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.tsx b/src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.tsx new file mode 100644 index 00000000..859a1f69 --- /dev/null +++ b/src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.tsx @@ -0,0 +1,102 @@ +import { FigureData, RedeemItemClothingComposer, RoomObjectCategory, UserFigureComposer } from 'nitro-renderer'; +import { FC, useCallback, useEffect, useState } from 'react'; +import { GetAvatarRenderManager, GetConnection, GetFurnitureDataForRoomObject, GetSessionDataManager } from '../../../../../../../api'; +import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../../../../layout'; +import { LocalizeText } from '../../../../../../../utils/LocalizeText'; +import { FurniCategory } from '../../../../../../inventory/common/FurniCategory'; +import { AvatarImageView } from '../../../../../../shared/avatar-image/AvatarImageView'; +import { useRoomContext } from '../../../../../context/RoomContext'; +import { PurchasableClothingConfirmViewProps } from './PurchasableClothingConfirmView.types'; + +const MODE_DEFAULT: number = -1; +const MODE_PURCHASABLE_CLOTHING: number = 0; + +export const PurchasableClothingConfirmView: FC = props => +{ + const { objectId = -1, close = null } = props; + const [ mode, setMode ] = useState(MODE_DEFAULT); + const [ gender, setGender ] = useState(FigureData.MALE); + const [ newFigure, setNewFigure ] = useState(null); + const { roomSession = null } = useRoomContext(); + + const useProduct = useCallback(() => + { + GetConnection().send(new RedeemItemClothingComposer(objectId)); + GetConnection().send(new UserFigureComposer(gender, newFigure)); + + close(); + }, [ objectId, gender, newFigure, close ]); + + useEffect(() => + { + let mode = MODE_DEFAULT; + + const figure = GetSessionDataManager().figure; + const gender = GetSessionDataManager().gender; + const validSets: number[] = []; + + if(roomSession && (objectId >= 0)) + { + const furniData = GetFurnitureDataForRoomObject(roomSession.roomId, objectId, RoomObjectCategory.FLOOR); + + if(furniData) + { + switch(furniData.specialType) + { + case FurniCategory._Str_12534: + mode = MODE_PURCHASABLE_CLOTHING; + + const setIds = furniData.customParams.split(',').map(part => parseInt(part)); + + for(const setId of setIds) + { + if(GetAvatarRenderManager().isValidFigureSetForGender(setId, gender)) validSets.push(setId); + } + + break; + } + } + } + + if(mode === MODE_DEFAULT) + { + close(); + + return; + } + + setGender(gender); + setNewFigure(GetAvatarRenderManager().getFigureStringWithFigureIds(figure, gender, validSets)); + + // if owns clothing, change to it + + setMode(mode); + }, [ roomSession, objectId, close ]); + + if(mode === MODE_DEFAULT) return null; + + return ( + + + +
+
+
+ +
+
+
+
+
{ LocalizeText('useproduct.widget.text.bind_clothing') }
+
{ LocalizeText('useproduct.widget.info.bind_clothing') }
+
+
+ + +
+
+
+
+
+ ); +} diff --git a/src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.types.ts b/src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.types.ts new file mode 100644 index 00000000..f6f04211 --- /dev/null +++ b/src/views/room/widgets/furniture/context-menu/views/purchaseable-clothing/PurchasableClothingConfirmView.types.ts @@ -0,0 +1,5 @@ +export interface PurchasableClothingConfirmViewProps +{ + objectId: number; + close: () => void; +} diff --git a/src/views/room/widgets/furniture/dimmer/FurnitureDimmerView.tsx b/src/views/room/widgets/furniture/dimmer/FurnitureDimmerView.tsx index 1d320b04..8c79722a 100644 --- a/src/views/room/widgets/furniture/dimmer/FurnitureDimmerView.tsx +++ b/src/views/room/widgets/furniture/dimmer/FurnitureDimmerView.tsx @@ -3,9 +3,8 @@ import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../ import { LocalizeText } from '../../../../../utils/LocalizeText'; import { useRoomContext } from '../../../context/RoomContext'; import { FurnitureDimmerData } from './FurnitureDimmerData'; -import { FurnitureDimmerViewProps } from './FurnitureDimmerView.types'; -export const FurnitureDimmerView: FC = props => +export const FurnitureDimmerView: FC<{}> = props => { const { eventDispatcher = null, widgetHandler = null } = useRoomContext(); const [ dimmerData, setDimmerData ] = useState(null); diff --git a/src/views/room/widgets/furniture/dimmer/FurnitureDimmerView.types.ts b/src/views/room/widgets/furniture/dimmer/FurnitureDimmerView.types.ts deleted file mode 100644 index 6c267da7..00000000 --- a/src/views/room/widgets/furniture/dimmer/FurnitureDimmerView.types.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { FurnitureWidgetProps } from '../FurnitureWidget.types'; - -export interface FurnitureDimmerViewProps extends FurnitureWidgetProps -{} diff --git a/src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockView.types.ts b/src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockView.types.ts deleted file mode 100644 index b5d92bae..00000000 --- a/src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockView.types.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { FurnitureWidgetProps } from '../FurnitureWidget.types'; - -export interface FurnitureEngravingLockViewProps extends FurnitureWidgetProps -{} diff --git a/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.tsx b/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.tsx index d113b585..1743713f 100644 --- a/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.tsx +++ b/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.tsx @@ -8,9 +8,8 @@ import { LocalizeText } from '../../../../../utils/LocalizeText'; import { useRoomContext } from '../../../context/RoomContext'; import { RoomWidgetRoomObjectUpdateEvent } from '../../../events'; import { FurnitureExchangeCreditData } from './FurnitureExchangeCreditData'; -import { FurnitureExchangeCreditProps } from './FurnitureExchangeCreditView.types'; -export const FurnitureExchangeCreditView: FC = props => +export const FurnitureExchangeCreditView: FC<{}> = props => { const { eventDispatcher = null, widgetHandler = null } = useRoomContext(); const [ exchangeCreditData, setExchangeCreditData ] = useState(null); diff --git a/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.types.ts b/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.types.ts deleted file mode 100644 index 32a48de0..00000000 --- a/src/views/room/widgets/furniture/exchange-credit/FurnitureExchangeCreditView.types.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { FurnitureWidgetProps } from '../FurnitureWidget.types'; - -export interface FurnitureExchangeCreditProps extends FurnitureWidgetProps -{} diff --git a/src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockData.ts b/src/views/room/widgets/furniture/friend-furni/FriendFurniLockData.ts similarity index 100% rename from src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockData.ts rename to src/views/room/widgets/furniture/friend-furni/FriendFurniLockData.ts diff --git a/src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockView.scss b/src/views/room/widgets/furniture/friend-furni/FurnitureFriendFurniView.scss similarity index 100% rename from src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockView.scss rename to src/views/room/widgets/furniture/friend-furni/FurnitureFriendFurniView.scss diff --git a/src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockView.tsx b/src/views/room/widgets/furniture/friend-furni/FurnitureFriendFurniView.tsx similarity index 96% rename from src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockView.tsx rename to src/views/room/widgets/furniture/friend-furni/FurnitureFriendFurniView.tsx index 80e87d07..2c6a6679 100644 --- a/src/views/room/widgets/furniture/engraving-lock/FurnitureEngravingLockView.tsx +++ b/src/views/room/widgets/furniture/friend-furni/FurnitureFriendFurniView.tsx @@ -10,10 +10,9 @@ import { LocalizeText } from '../../../../../utils/LocalizeText'; import { AvatarImageView } from '../../../../shared/avatar-image/AvatarImageView'; import { useRoomContext } from '../../../context/RoomContext'; import { RoomWidgetRoomObjectUpdateEvent } from '../../../events'; -import { FurnitureEngravingLockData } from './FurnitureEngravingLockData'; -import { FurnitureEngravingLockViewProps } from './FurnitureEngravingLockView.types'; +import { FurnitureEngravingLockData } from './FriendFurniLockData'; -export const FurnitureEngravingLockView: FC = props => +export const FurnitureFriendFurniView: FC<{}> = props => { const { eventDispatcher = null, widgetHandler = null } = useRoomContext(); const [ engravingLockData, setEngravingLockData ] = useState(null); diff --git a/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.tsx b/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.tsx index c8e715c0..2b02a2a1 100644 --- a/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.tsx +++ b/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.tsx @@ -2,9 +2,8 @@ import { NitroEvent, RoomEngineTriggerWidgetEvent } from 'nitro-renderer'; import { FC } from 'react'; import { useRoomEngineEvent } from '../../../../../hooks/events/nitro/room/room-engine-event'; import { useRoomContext } from '../../../context/RoomContext'; -import { FurnitureHighScoreViewProps } from './FurnitureHighScoreView.types'; -export const FurnitureHighScoreView: FC = props => +export const FurnitureHighScoreView: FC<{}> = props => { const { eventDispatcher = null, widgetHandler = null } = useRoomContext(); diff --git a/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.types.ts b/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.types.ts deleted file mode 100644 index b387dab6..00000000 --- a/src/views/room/widgets/furniture/high-score/FurnitureHighScoreView.types.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { FurnitureWidgetProps } from '../FurnitureWidget.types'; - -export interface FurnitureHighScoreViewProps extends FurnitureWidgetProps -{ - -} diff --git a/src/views/room/widgets/furniture/manipulation-menu/FurnitureManipulationMenuView.tsx b/src/views/room/widgets/furniture/manipulation-menu/FurnitureManipulationMenuView.tsx index cee946ec..a4439b5b 100644 --- a/src/views/room/widgets/furniture/manipulation-menu/FurnitureManipulationMenuView.tsx +++ b/src/views/room/widgets/furniture/manipulation-menu/FurnitureManipulationMenuView.tsx @@ -5,9 +5,8 @@ import { CreateEventDispatcherHook } from '../../../../../hooks/events/event-dis import { useRoomContext } from '../../../context/RoomContext'; import { RoomWidgetRoomObjectUpdateEvent } from '../../../events'; import { ObjectLocationView } from '../../object-location/ObjectLocationView'; -import { FurnitureManipulationMenuViewProps } from './FurnitureManipulationMenuView.types'; -export const FurnitureManipulationMenuView: FC = props => +export const FurnitureManipulationMenuView: FC<{}> = props => { const { eventDispatcher = null, widgetHandler = null } = useRoomContext(); const [ isVisible, setIsVisible ] = useState(false); diff --git a/src/views/room/widgets/furniture/manipulation-menu/FurnitureManipulationMenuView.types.ts b/src/views/room/widgets/furniture/manipulation-menu/FurnitureManipulationMenuView.types.ts deleted file mode 100644 index 8fb33820..00000000 --- a/src/views/room/widgets/furniture/manipulation-menu/FurnitureManipulationMenuView.types.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { FurnitureWidgetProps } from '../FurnitureWidget.types'; - -export interface FurnitureManipulationMenuViewProps extends FurnitureWidgetProps -{ - -} diff --git a/src/views/room/widgets/furniture/mannequin/FurnitureMannequinView.tsx b/src/views/room/widgets/furniture/mannequin/FurnitureMannequinView.tsx index a07a6cba..151e0a3e 100644 --- a/src/views/room/widgets/furniture/mannequin/FurnitureMannequinView.tsx +++ b/src/views/room/widgets/furniture/mannequin/FurnitureMannequinView.tsx @@ -10,8 +10,8 @@ import { LocalizeText } from '../../../../../utils/LocalizeText'; import { AvatarImageView } from '../../../../shared/avatar-image/AvatarImageView'; import { useRoomContext } from '../../../context/RoomContext'; import { RoomWidgetRoomObjectUpdateEvent } from '../../../events'; +import { MannequinViewMode } from './common/MannequinViewMode'; import { FurnitureMannequinData } from './FurnitureMannequinData'; -import { FurnitureMannequinViewMode, FurnitureMannequinViewProps } from './FurnitureMannequinView.types'; const parts = [ AvatarFigurePartType.CHEST_ACCESSORY, @@ -23,7 +23,7 @@ const parts = [ ]; const baseAvatar = ['hd', 99999, 99998]; -export const FurnitureMannequinView: FC = props => +export const FurnitureMannequinView: FC<{}> = props => { const { eventDispatcher = null } = useRoomContext(); @@ -64,7 +64,7 @@ export const FurnitureMannequinView: FC = props => if(userCanEdit) { - setViewMode(FurnitureMannequinViewMode.EDIT); + setViewMode(MannequinViewMode.EDIT); } else { @@ -72,15 +72,15 @@ export const FurnitureMannequinView: FC = props => if(userGender.toUpperCase() !== mannequinData.gender.toUpperCase()) { - setViewMode(FurnitureMannequinViewMode.INCOMPATIBLE_GENDER); + setViewMode(MannequinViewMode.INCOMPATIBLE_GENDER); } else if(userClubLevel < mannequinData.clubLevel) { - setViewMode(FurnitureMannequinViewMode.CLUB); + setViewMode(MannequinViewMode.CLUB); } else { - setViewMode(FurnitureMannequinViewMode.DEFAULT); + setViewMode(MannequinViewMode.DEFAULT); } } }, []); @@ -138,11 +138,11 @@ export const FurnitureMannequinView: FC = props => return; case 'load_figure': loadMannequinFigure(Nitro.instance.avatar.createFigureContainer(Nitro.instance.sessionDataManager.figure)); - setViewMode(FurnitureMannequinViewMode.SAVE); + setViewMode(MannequinViewMode.SAVE); return; case 'back': loadMannequinFigure(Nitro.instance.avatar.createFigureContainer(mannequinData.figure)); - setViewMode(FurnitureMannequinViewMode.EDIT); + setViewMode(MannequinViewMode.EDIT); return; case 'save_name': GetRoomSession().connection.send(new FurnitureMannequinSaveNameComposer(mannequinData.objectId, mannequinData.name)); @@ -179,7 +179,7 @@ export const FurnitureMannequinView: FC = props =>
- { viewMode === FurnitureMannequinViewMode.DEFAULT && + { viewMode === MannequinViewMode.DEFAULT && <>
{ mannequinData.name }
@@ -187,7 +187,7 @@ export const FurnitureMannequinView: FC = props =>
processAction('wear') }>{ LocalizeText('mannequin.widget.wear') }
} - { viewMode === FurnitureMannequinViewMode.EDIT && + { viewMode === MannequinViewMode.EDIT && <> processAction('set_name', event.target.value) } onKeyDown={ event => handleKeyDown(event) } />
@@ -195,7 +195,7 @@ export const FurnitureMannequinView: FC = props =>
processAction('wear') }>{ LocalizeText('mannequin.widget.wear') }
} - { viewMode === FurnitureMannequinViewMode.SAVE && + { viewMode === MannequinViewMode.SAVE && <>
{ mannequinData.name }
@@ -206,9 +206,9 @@ export const FurnitureMannequinView: FC = props =>
processAction('save_figure') }>{ LocalizeText('mannequin.widget.save') }
} - { viewMode === FurnitureMannequinViewMode.CLUB && + { viewMode === MannequinViewMode.CLUB &&
{ LocalizeText('mannequin.widget.clubnotification') }
} - { viewMode === FurnitureMannequinViewMode.INCOMPATIBLE_GENDER && + { viewMode === MannequinViewMode.INCOMPATIBLE_GENDER &&
{ LocalizeText('mannequin.widget.wronggender') }
}
diff --git a/src/views/room/widgets/furniture/mannequin/FurnitureMannequinView.types.tsx b/src/views/room/widgets/furniture/mannequin/common/MannequinViewMode.ts similarity index 61% rename from src/views/room/widgets/furniture/mannequin/FurnitureMannequinView.types.tsx rename to src/views/room/widgets/furniture/mannequin/common/MannequinViewMode.ts index eae1f80c..e588eea4 100644 --- a/src/views/room/widgets/furniture/mannequin/FurnitureMannequinView.types.tsx +++ b/src/views/room/widgets/furniture/mannequin/common/MannequinViewMode.ts @@ -1,9 +1,4 @@ -import { FurnitureWidgetProps } from '../FurnitureWidget.types'; - -export interface FurnitureMannequinViewProps extends FurnitureWidgetProps -{} - -export class FurnitureMannequinViewMode +export class MannequinViewMode { public static readonly EDIT: string = 'edit'; public static readonly SAVE: string = 'save'; diff --git a/src/views/room/widgets/furniture/present/FurniturePresentView.tsx b/src/views/room/widgets/furniture/present/FurniturePresentView.tsx index 7e5fedfc..f3f11d51 100644 --- a/src/views/room/widgets/furniture/present/FurniturePresentView.tsx +++ b/src/views/room/widgets/furniture/present/FurniturePresentView.tsx @@ -2,9 +2,8 @@ import { NitroEvent, RoomEngineTriggerWidgetEvent } from 'nitro-renderer'; import { FC } from 'react'; import { useRoomEngineEvent } from '../../../../../hooks/events/nitro/room/room-engine-event'; import { useRoomContext } from '../../../context/RoomContext'; -import { FurniturePresentViewProps } from './FurniturePresentView.types'; -export const FurniturePresentView: FC = props => +export const FurniturePresentView: FC<{}> = props => { const { eventDispatcher = null, widgetHandler = null } = useRoomContext(); diff --git a/src/views/room/widgets/furniture/present/FurniturePresentView.types.ts b/src/views/room/widgets/furniture/present/FurniturePresentView.types.ts deleted file mode 100644 index 81171e33..00000000 --- a/src/views/room/widgets/furniture/present/FurniturePresentView.types.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { FurnitureWidgetProps } from '../FurnitureWidget.types'; - -export interface FurniturePresentViewProps extends FurnitureWidgetProps -{ - -} diff --git a/src/views/room/widgets/furniture/stickie/FurnitureStickieView.tsx b/src/views/room/widgets/furniture/stickie/FurnitureStickieView.tsx index 3a34020b..d6174681 100644 --- a/src/views/room/widgets/furniture/stickie/FurnitureStickieView.tsx +++ b/src/views/room/widgets/furniture/stickie/FurnitureStickieView.tsx @@ -9,9 +9,8 @@ import { useRoomContext } from '../../../context/RoomContext'; import { RoomWidgetRoomObjectUpdateEvent } from '../../../events'; import { FurnitureStickieData } from './FurnitureStickieData'; import { getStickieColorName, STICKIE_COLORS } from './FurnitureStickieUtils'; -import { FurnitureStickieViewProps } from './FurnitureStickieView.types'; -export const FurnitureStickieView: FC = props => +export const FurnitureStickieView: FC<{}> = props => { const { eventDispatcher = null, widgetHandler = null } = useRoomContext(); const [ stickieData, setStickieData ] = useState(null); diff --git a/src/views/room/widgets/furniture/stickie/FurnitureStickieView.types.ts b/src/views/room/widgets/furniture/stickie/FurnitureStickieView.types.ts deleted file mode 100644 index b45c08f5..00000000 --- a/src/views/room/widgets/furniture/stickie/FurnitureStickieView.types.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { FurnitureWidgetProps } from '../FurnitureWidget.types'; - -export interface FurnitureStickieViewProps extends FurnitureWidgetProps -{ - -} diff --git a/src/views/room/widgets/furniture/trophy/FurnitureTrophyView.tsx b/src/views/room/widgets/furniture/trophy/FurnitureTrophyView.tsx index 5eba165f..9a1e6b45 100644 --- a/src/views/room/widgets/furniture/trophy/FurnitureTrophyView.tsx +++ b/src/views/room/widgets/furniture/trophy/FurnitureTrophyView.tsx @@ -8,9 +8,8 @@ import { LocalizeText } from '../../../../../utils/LocalizeText'; import { useRoomContext } from '../../../context/RoomContext'; import { RoomWidgetRoomObjectUpdateEvent } from '../../../events'; import { FurnitureTrophyData } from './FurnitureTrophyData'; -import { FurnitureTrophyViewProps } from './FurnitureTrophyView.types'; -export const FurnitureTrophyView: FC = props => +export const FurnitureTrophyView: FC<{}> = props => { const { eventDispatcher = null, widgetHandler = null } = useRoomContext(); const [ trophyData, setTrophyData ] = useState(null); diff --git a/src/views/room/widgets/furniture/trophy/FurnitureTrophyView.types.ts b/src/views/room/widgets/furniture/trophy/FurnitureTrophyView.types.ts deleted file mode 100644 index d6d43f31..00000000 --- a/src/views/room/widgets/furniture/trophy/FurnitureTrophyView.types.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { FurnitureWidgetProps } from '../FurnitureWidget.types'; - -export interface FurnitureTrophyViewProps extends FurnitureWidgetProps -{} diff --git a/src/views/room/widgets/infostand/views/furni/InfoStandWidgetFurniView.tsx b/src/views/room/widgets/infostand/views/furni/InfoStandWidgetFurniView.tsx index 0415db5f..ea6495d6 100644 --- a/src/views/room/widgets/infostand/views/furni/InfoStandWidgetFurniView.tsx +++ b/src/views/room/widgets/infostand/views/furni/InfoStandWidgetFurniView.tsx @@ -3,6 +3,7 @@ import { FC, useCallback, useEffect, useState } from 'react'; import { LocalizeText } from '../../../../../../utils/LocalizeText'; import { BadgeImageView } from '../../../../../shared/badge-image/BadgeImageView'; import { LimitedEditionCompactPlateView } from '../../../../../shared/limited-edition/compact-plate/LimitedEditionCompactPlateView'; +import { RarityLevelView } from '../../../../../shared/rarity-level/RarityLevelView'; import { useRoomContext } from '../../../../context/RoomContext'; import { RoomWidgetFurniActionMessage } from '../../../../messages'; import { InfoStandBaseView } from '../base/InfoStandBaseView'; @@ -183,6 +184,10 @@ export const InfoStandWidgetFurniView: FC = props
} + { (furniData.stuffData.rarityLevel > -1) && +
+ +
} { furniData.image.src.length && }