From 7aafbfba4cbfe5f6420a9d4d97946d59ce5e53ba Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 17 Nov 2021 03:48:41 -0500 Subject: [PATCH] Random updates --- src/App.scss | 14 ++++++++++---- .../views/navigation/CatalogNavigationView.tsx | 4 ++-- src/views/room/RoomView.tsx | 3 ++- src/views/room/widgets/RoomWidgets.types.ts | 2 -- src/views/room/widgets/RoomWidgetsView.tsx | 4 ++-- .../avatar-info/AvatarInfoWidgetView.tsx | 2 +- .../views/avatar/AvatarInfoWidgetAvatarView.tsx | 12 +++--------- .../AvatarInfoWidgetOwnAvatarView.tsx | 13 ++++--------- src/views/shared/Shared.scss | 17 +++++++++-------- src/views/user-profile/UserProfileView.tsx | 9 ++++++--- .../RelationshipsContainerView.tsx | 12 ++++++------ 11 files changed, 45 insertions(+), 47 deletions(-) delete mode 100644 src/views/room/widgets/RoomWidgets.types.ts diff --git a/src/App.scss b/src/App.scss index 3ab4f7fd..047843ef 100644 --- a/src/App.scss +++ b/src/App.scss @@ -10,9 +10,9 @@ $infostand-zindex: 30; $chat-zindex: 20; $highscore-zindex: 19; -$grid-bg-color: #CDD3D9; +$grid-bg-color: #cdd3d9; $grid-border-color: $muted; -$grid-active-bg-color: #ECECEC; +$grid-active-bg-color: #ececec; $grid-active-border-color: $white; $toolbar-height: 55px; @@ -44,10 +44,16 @@ $nitro-widget-custom-stack-height-height: 220px; $nitro-widget-exchange-credit-width: 375px; $nitro-widget-exchange-credit-height: 150px; +$chat-history-width: 300px; +$chat-history-height: 300px; + +$friends-list-width: 250px; +$friends-list-height: 300px; + .nitro-app { width: 100%; height: 100%; } -@import './layout/Layout'; -@import './views/Styles'; +@import "./layout/Layout"; +@import "./views/Styles"; diff --git a/src/views/catalog/views/navigation/CatalogNavigationView.tsx b/src/views/catalog/views/navigation/CatalogNavigationView.tsx index b7bf41ed..4ee356ec 100644 --- a/src/views/catalog/views/navigation/CatalogNavigationView.tsx +++ b/src/views/catalog/views/navigation/CatalogNavigationView.tsx @@ -24,9 +24,9 @@ export const CatalogNavigationView: FC = props => }, [ page ]); return ( - + - + diff --git a/src/views/room/RoomView.tsx b/src/views/room/RoomView.tsx index b885b48c..a4125e9f 100644 --- a/src/views/room/RoomView.tsx +++ b/src/views/room/RoomView.tsx @@ -1,6 +1,6 @@ import { EventDispatcher, NitroRectangle, RoomGeometry, RoomVariableEnum, Vector3d } from '@nitrots/nitro-renderer'; import { FC, useEffect, useRef, useState } from 'react'; -import { DispatchMouseEvent, DispatchTouchEvent, DoorbellWidgetHandler, FurniChooserWidgetHandler, FurnitureContextMenuWidgetHandler, FurnitureCreditWidgetHandler, FurnitureCustomStackHeightWidgetHandler, FurnitureDimmerWidgetHandler, FurnitureExternalImageWidgetHandler, FurnitureMannequinWidgetHandler, FurniturePresentWidgetHandler, GetNitroInstance, GetRoomEngine, InitializeRoomInstanceRenderingCanvas, IRoomWidgetHandlerManager, RoomWidgetAvatarInfoHandler, RoomWidgetChatHandler, RoomWidgetChatInputHandler, RoomWidgetHandlerManager, RoomWidgetInfostandHandler, RoomWidgetRoomToolsHandler, RoomWidgetUpdateRoomViewEvent, UserChooserWidgetHandler } from '../../api'; +import { DispatchMouseEvent, DispatchTouchEvent, DoorbellWidgetHandler, FriendRequestHandler, FurniChooserWidgetHandler, FurnitureContextMenuWidgetHandler, FurnitureCreditWidgetHandler, FurnitureCustomStackHeightWidgetHandler, FurnitureDimmerWidgetHandler, FurnitureExternalImageWidgetHandler, FurnitureMannequinWidgetHandler, FurniturePresentWidgetHandler, GetNitroInstance, GetRoomEngine, InitializeRoomInstanceRenderingCanvas, IRoomWidgetHandlerManager, RoomWidgetAvatarInfoHandler, RoomWidgetChatHandler, RoomWidgetChatInputHandler, RoomWidgetHandlerManager, RoomWidgetInfostandHandler, RoomWidgetRoomToolsHandler, RoomWidgetUpdateRoomViewEvent, UserChooserWidgetHandler } from '../../api'; import { FurnitureYoutubeDisplayWidgetHandler } from '../../api/nitro/room/widgets/handlers/FurnitureYoutubeDisplayWidgetHandler'; import { RoomContextProvider } from './context/RoomContext'; import { RoomColorView } from './RoomColorView'; @@ -37,6 +37,7 @@ export const RoomView: FC = props => widgetHandlerManager.registerHandler(new RoomWidgetChatHandler()); widgetHandlerManager.registerHandler(new UserChooserWidgetHandler()); widgetHandlerManager.registerHandler(new DoorbellWidgetHandler()); + widgetHandlerManager.registerHandler(new FriendRequestHandler()); widgetHandlerManager.registerHandler(new FurniChooserWidgetHandler()); widgetHandlerManager.registerHandler(new FurnitureContextMenuWidgetHandler()); diff --git a/src/views/room/widgets/RoomWidgets.types.ts b/src/views/room/widgets/RoomWidgets.types.ts deleted file mode 100644 index ea28fdd6..00000000 --- a/src/views/room/widgets/RoomWidgets.types.ts +++ /dev/null @@ -1,2 +0,0 @@ -export interface RoomWidgetViewProps -{} diff --git a/src/views/room/widgets/RoomWidgetsView.tsx b/src/views/room/widgets/RoomWidgetsView.tsx index 3fd67cdc..1b62c52e 100644 --- a/src/views/room/widgets/RoomWidgetsView.tsx +++ b/src/views/room/widgets/RoomWidgetsView.tsx @@ -15,8 +15,8 @@ import { FurnitureWidgetsView } from './furniture/FurnitureWidgetsView'; import { InfoStandWidgetView } from './infostand/InfoStandWidgetView'; import { RoomThumbnailWidgetView } from './room-thumbnail/RoomThumbnailWidgetView'; import { RoomToolsWidgetView } from './room-tools/RoomToolsWidgetView'; -import { RoomWidgetViewProps } from './RoomWidgets.types'; -export const RoomWidgetsView: FC = props => + +export const RoomWidgetsView: FC<{}> = props => { const { roomSession = null, eventDispatcher = null, widgetHandler = null } = useRoomContext(); diff --git a/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx b/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx index 7014b2f7..41b20557 100644 --- a/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx +++ b/src/views/room/widgets/avatar-info/AvatarInfoWidgetView.tsx @@ -16,7 +16,6 @@ import { AvatarInfoUseProductView } from './views/use-product/AvatarInfoUseProdu export const AvatarInfoWidgetView: FC<{}> = props => { - const { roomSession = null, eventDispatcher = null, widgetHandler = null } = useRoomContext(); const [ name, setName ] = useState(null); const [ nameBubbles, setNameBubbles ] = useState([]); const [ productBubbles, setProductBubbles ] = useState([]); @@ -26,6 +25,7 @@ export const AvatarInfoWidgetView: FC<{}> = props => const [ isDancing, setIsDancing ] = useState(false); const [ isDecorating, setIsDecorating ] = useState(false); const [ rentableBotChatEvent, setRentableBotChatEvent ] = useState(null); + const { roomSession = null, eventDispatcher = null, widgetHandler = null } = useRoomContext(); const removeNameBubble = useCallback((index: number) => { 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 8e88af87..b926a175 100644 --- a/src/views/room/widgets/avatar-info/views/avatar/AvatarInfoWidgetAvatarView.tsx +++ b/src/views/room/widgets/avatar-info/views/avatar/AvatarInfoWidgetAvatarView.tsx @@ -1,7 +1,6 @@ -import { RoomControllerLevel, RoomObjectCategory, RoomObjectVariable, UserProfileComposer } from '@nitrots/nitro-renderer'; +import { RoomControllerLevel, RoomObjectCategory, RoomObjectVariable } from '@nitrots/nitro-renderer'; import { FC, useCallback, useEffect, useMemo, useState } from 'react'; -import { GetOwnRoomObject, LocalizeText, RoomWidgetMessage, RoomWidgetUserActionMessage } from '../../../../../../api'; -import { SendMessageHook } from '../../../../../../hooks'; +import { GetOwnRoomObject, GetUserProfile, LocalizeText, RoomWidgetMessage, RoomWidgetUserActionMessage } from '../../../../../../api'; import { useRoomContext } from '../../../../context/RoomContext'; import { ContextMenuView } from '../../../context-menu/ContextMenuView'; import { ContextMenuHeaderView } from '../../../context-menu/views/header/ContextMenuHeaderView'; @@ -192,14 +191,9 @@ export const AvatarInfoWidgetAvatarView: FC = p return flag; }, []); - const openProfile = useCallback(() => - { - SendMessageHook(new UserProfileComposer(userData.webID)); - }, [ userData ]); - return ( - openProfile() }> + GetUserProfile(userData.webID) }> { userData.name } { (mode === MODE_NORMAL) && 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 e20da225..8d1d9c46 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 @@ -1,8 +1,8 @@ -import { AvatarAction, AvatarExpressionEnum, RoomControllerLevel, RoomObjectCategory, UserProfileComposer } from '@nitrots/nitro-renderer'; +import { AvatarAction, AvatarExpressionEnum, RoomControllerLevel, RoomObjectCategory } from '@nitrots/nitro-renderer'; import { FC, useCallback, useMemo, useState } from 'react'; -import { GetCanStandUp, GetCanUseExpression, GetOwnPosture, HasHabboClub, HasHabboVip, IsRidingHorse, LocalizeText, RoomWidgetAvatarExpressionMessage, RoomWidgetChangePostureMessage, RoomWidgetDanceMessage, RoomWidgetMessage, RoomWidgetUpdateDecorateModeEvent, RoomWidgetUserActionMessage } from '../../../../../../api'; +import { GetCanStandUp, GetCanUseExpression, GetOwnPosture, GetUserProfile, HasHabboClub, HasHabboVip, IsRidingHorse, LocalizeText, RoomWidgetAvatarExpressionMessage, RoomWidgetChangePostureMessage, RoomWidgetDanceMessage, RoomWidgetMessage, RoomWidgetUpdateDecorateModeEvent, RoomWidgetUserActionMessage } from '../../../../../../api'; import { AvatarEditorEvent } from '../../../../../../events'; -import { dispatchUiEvent, SendMessageHook } from '../../../../../../hooks'; +import { dispatchUiEvent } from '../../../../../../hooks'; import { CurrencyIcon } from '../../../../../shared/currency-icon/CurrencyIcon'; import { useRoomContext } from '../../../../context/RoomContext'; import { ContextMenuView } from '../../../context-menu/ContextMenuView'; @@ -103,11 +103,6 @@ export const AvatarInfoWidgetOwnAvatarView: FC - { - SendMessageHook(new UserProfileComposer(userData.webID)); - }, [ userData ]); - const isShowDecorate = useMemo(() => { return (userData.amIOwner || userData.amIAnyRoomController || (userData.roomControllerLevel > RoomControllerLevel.GUEST)); @@ -117,7 +112,7 @@ export const AvatarInfoWidgetOwnAvatarView: FC - openProfile() }> + GetUserProfile(userData.webID) }> { userData.name } { (mode === MODE_NORMAL) && diff --git a/src/views/shared/Shared.scss b/src/views/shared/Shared.scss index 3fcc657f..542564b8 100644 --- a/src/views/shared/Shared.scss +++ b/src/views/shared/Shared.scss @@ -1,8 +1,9 @@ -@import './avatar-image/AvatarImage'; -@import './badge-image/BadgeImage'; -@import './currency-icon/CurrencyIcon'; -@import './furni-image/FurniImageView'; -@import './limited-edition/LimitedEdition'; -@import './pet-image/PetImage'; -@import './rarity-level/RarityLevelView'; -@import './room-previewer/RoomPreviewerView'; +@import "./avatar-image/AvatarImage"; +@import "./badge-image/BadgeImage"; +@import "./currency-icon/CurrencyIcon"; +@import "./furni-image/FurniImageView"; +@import "./limited-edition/LimitedEdition"; +@import "./pet-image/PetImage"; +@import "./rarity-level/RarityLevelView"; +@import "./room-previewer/RoomPreviewerView"; +@import "./item-count/ItemCountView"; diff --git a/src/views/user-profile/UserProfileView.tsx b/src/views/user-profile/UserProfileView.tsx index 14a579f0..33cfb22e 100644 --- a/src/views/user-profile/UserProfileView.tsx +++ b/src/views/user-profile/UserProfileView.tsx @@ -1,6 +1,6 @@ -import { RelationshipStatusInfoEvent, RelationshipStatusInfoMessageParser, UserCurrentBadgesComposer, UserCurrentBadgesEvent, UserProfileComposer, UserProfileEvent, UserProfileParser, UserRelationshipsComposer } from '@nitrots/nitro-renderer'; +import { RelationshipStatusInfoEvent, RelationshipStatusInfoMessageParser, UserCurrentBadgesComposer, UserCurrentBadgesEvent, UserProfileEvent, UserProfileParser, UserRelationshipsComposer } from '@nitrots/nitro-renderer'; import { FC, useCallback, useState } from 'react'; -import { GetSessionDataManager, LocalizeText } from '../../api'; +import { GetSessionDataManager, GetUserProfile, LocalizeText } from '../../api'; import { CreateMessageHook, SendMessageHook } from '../../hooks'; import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../layout'; import { BadgesContainerView } from './views/badges-container/BadgesContainerView'; @@ -23,7 +23,10 @@ export const UserProfileView: FC = props => const onLeaveGroup = useCallback(() => { - if(userProfile && userProfile.id === GetSessionDataManager().userId) SendMessageHook(new UserProfileComposer(userProfile.id)); + if(userProfile && userProfile.id === GetSessionDataManager().userId) + { + GetUserProfile(userProfile.id); + } }, [ userProfile ]); const OnUserCurrentBadgesEvent = useCallback((event: UserCurrentBadgesEvent) => diff --git a/src/views/user-profile/views/relationships-container/RelationshipsContainerView.tsx b/src/views/user-profile/views/relationships-container/RelationshipsContainerView.tsx index 51fe425d..e1bb648c 100644 --- a/src/views/user-profile/views/relationships-container/RelationshipsContainerView.tsx +++ b/src/views/user-profile/views/relationships-container/RelationshipsContainerView.tsx @@ -1,7 +1,6 @@ -import { RelationshipStatusEnum, RelationshipStatusInfo, UserProfileComposer } from '@nitrots/nitro-renderer'; +import { RelationshipStatusEnum, RelationshipStatusInfo } from '@nitrots/nitro-renderer'; import { FC, useCallback } from 'react'; -import { LocalizeText } from '../../../../api'; -import { SendMessageHook } from '../../../../hooks'; +import { GetUserProfile, LocalizeText } from '../../../../api'; import { AvatarImageView } from '../../../shared/avatar-image/AvatarImageView'; import { RelationshipsContainerViewProps } from './RelationshipsContainerView.types'; @@ -11,8 +10,9 @@ export const RelationshipsContainerView: FC = p const OnUserClick = useCallback((user: RelationshipStatusInfo) => { - if(user) - SendMessageHook(new UserProfileComposer(user.randomFriendId)); + if(!user) return; + + GetUserProfile(user.randomFriendId); }, []); const RelationshipComponent = useCallback(({ type }) => @@ -28,7 +28,7 @@ export const RelationshipsContainerView: FC = p
- OnUserClick(relationshipInfo)}> + OnUserClick(relationshipInfo)}> { (relationshipInfo && relationshipInfo.friendCount > 0) ? relationshipInfo.randomFriendName : LocalizeText('extendedprofile.add.friends') }