mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-18 21:36:27 +01:00
Update events & hooks
This commit is contained in:
parent
53b57d72c9
commit
eb8ba913b8
29
src/App.tsx
29
src/App.tsx
@ -4,10 +4,7 @@ import { GetCommunication, GetConfiguration, GetNitroInstance } from './api';
|
||||
import { Base, TransitionAnimation, TransitionAnimationTypes } from './common';
|
||||
import { LoadingView } from './components/loading/LoadingView';
|
||||
import { MainView } from './components/main/MainView';
|
||||
import { useConfigurationEvent } from './hooks/events/core/configuration/configuration-event';
|
||||
import { useLocalizationEvent } from './hooks/events/nitro/localization/localization-event';
|
||||
import { dispatchMainEvent, useMainEvent } from './hooks/events/nitro/main-event';
|
||||
import { useRoomEngineEvent } from './hooks/events/nitro/room/room-engine-event';
|
||||
import { DispatchUiEvent, UseConfigurationEvent, UseLocalizationEvent, UseMainEvent, UseRoomEngineEvent } from './hooks';
|
||||
|
||||
export const App: FC<{}> = props =>
|
||||
{
|
||||
@ -105,21 +102,21 @@ export const App: FC<{}> = props =>
|
||||
}
|
||||
}, [ getPreloadAssetUrls ]);
|
||||
|
||||
useMainEvent(Nitro.WEBGL_UNAVAILABLE, handler);
|
||||
useMainEvent(Nitro.WEBGL_CONTEXT_LOST, handler);
|
||||
useMainEvent(NitroCommunicationDemoEvent.CONNECTION_HANDSHAKING, handler);
|
||||
useMainEvent(NitroCommunicationDemoEvent.CONNECTION_HANDSHAKE_FAILED, handler);
|
||||
useMainEvent(NitroCommunicationDemoEvent.CONNECTION_AUTHENTICATED, handler);
|
||||
useMainEvent(NitroCommunicationDemoEvent.CONNECTION_ERROR, handler);
|
||||
useMainEvent(NitroCommunicationDemoEvent.CONNECTION_CLOSED, handler);
|
||||
useRoomEngineEvent(RoomEngineEvent.ENGINE_INITIALIZED, handler);
|
||||
useLocalizationEvent(NitroLocalizationEvent.LOADED, handler);
|
||||
useConfigurationEvent(ConfigurationEvent.LOADED, handler);
|
||||
useConfigurationEvent(ConfigurationEvent.FAILED, handler);
|
||||
UseMainEvent(Nitro.WEBGL_UNAVAILABLE, handler);
|
||||
UseMainEvent(Nitro.WEBGL_CONTEXT_LOST, handler);
|
||||
UseMainEvent(NitroCommunicationDemoEvent.CONNECTION_HANDSHAKING, handler);
|
||||
UseMainEvent(NitroCommunicationDemoEvent.CONNECTION_HANDSHAKE_FAILED, handler);
|
||||
UseMainEvent(NitroCommunicationDemoEvent.CONNECTION_AUTHENTICATED, handler);
|
||||
UseMainEvent(NitroCommunicationDemoEvent.CONNECTION_ERROR, handler);
|
||||
UseMainEvent(NitroCommunicationDemoEvent.CONNECTION_CLOSED, handler);
|
||||
UseRoomEngineEvent(RoomEngineEvent.ENGINE_INITIALIZED, handler);
|
||||
UseLocalizationEvent(NitroLocalizationEvent.LOADED, handler);
|
||||
UseConfigurationEvent(ConfigurationEvent.LOADED, handler);
|
||||
UseConfigurationEvent(ConfigurationEvent.FAILED, handler);
|
||||
|
||||
if(!WebGL.isWebGLAvailable())
|
||||
{
|
||||
dispatchMainEvent(new NitroEvent(Nitro.WEBGL_UNAVAILABLE));
|
||||
DispatchUiEvent(new NitroEvent(Nitro.WEBGL_UNAVAILABLE));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { GroupInformationComposer } from '@nitrots/nitro-renderer';
|
||||
import { SendMessageHook } from '../../hooks';
|
||||
import { SendMessageComposer } from '..';
|
||||
|
||||
export function GetGroupInformation(groupId: number): void
|
||||
{
|
||||
SendMessageHook(new GroupInformationComposer(groupId, true));
|
||||
SendMessageComposer(new GroupInformationComposer(groupId, true));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { GroupJoinComposer } from '@nitrots/nitro-renderer';
|
||||
import { SendMessageHook } from '../../hooks';
|
||||
import { SendMessageComposer } from '..';
|
||||
|
||||
export const TryJoinGroup = (groupId: number) => SendMessageHook(new GroupJoinComposer(groupId));
|
||||
export const TryJoinGroup = (groupId: number) => SendMessageComposer(new GroupJoinComposer(groupId));
|
||||
|
@ -1,2 +1,4 @@
|
||||
export * from './GetGroupInformation';
|
||||
export * from './GetGroupManager';
|
||||
export * from './GetGroupMembers';
|
||||
export * from './TryJoinGroup';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { RoomInfoComposer } from '@nitrots/nitro-renderer';
|
||||
import { SendMessageHook } from '../../hooks/messages/message-event';
|
||||
import { SendMessageComposer } from '../nitro';
|
||||
|
||||
export function TryVisitRoom(roomId: number): void
|
||||
{
|
||||
SendMessageHook(new RoomInfoComposer(roomId, false, true));
|
||||
SendMessageComposer(new RoomInfoComposer(roomId, false, true));
|
||||
}
|
||||
|
4
src/api/nitro/SendMessageComposer.ts
Normal file
4
src/api/nitro/SendMessageComposer.ts
Normal file
@ -0,0 +1,4 @@
|
||||
import { IMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { GetConnection } from './GetConnection';
|
||||
|
||||
export const SendMessageComposer = (event: IMessageComposer<unknown[]>) => GetConnection().send(event);
|
@ -10,4 +10,9 @@ export * from './GetNitroInstance';
|
||||
export * from './GetTicker';
|
||||
export * from './RemoveLinkEventTracker';
|
||||
export * from './room';
|
||||
export * from './room/widgets';
|
||||
export * from './room/widgets/events';
|
||||
export * from './room/widgets/handlers';
|
||||
export * from './room/widgets/messages';
|
||||
export * from './SendMessageComposer';
|
||||
export * from './session';
|
||||
|
@ -6,6 +6,7 @@ export * from './RoomWidgetChooserContentEvent';
|
||||
export * from './RoomWidgetDoorbellEvent';
|
||||
export * from './RoomWidgetFloodControlEvent';
|
||||
export * from './RoomWidgetObjectNameEvent';
|
||||
export * from './RoomWidgetPollUpdateEvent';
|
||||
export * from './RoomWidgetUpdateBackgroundColorPreviewEvent';
|
||||
export * from './RoomWidgetUpdateChatEvent';
|
||||
export * from './RoomWidgetUpdateChatInputContentEvent';
|
||||
@ -34,4 +35,5 @@ export * from './RoomWidgetUpdateTrophyEvent';
|
||||
export * from './RoomWidgetUpdateUserDataEvent';
|
||||
export * from './RoomWidgetUpdateYoutubeDisplayEvent';
|
||||
export * from './RoomWidgetUseProductBubbleEvent';
|
||||
export * from './RoomWidgetWordQuizUpdateEvent';
|
||||
export * from './UseProductItem';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { NitroEvent, RoomSessionFriendRequestEvent, RoomWidgetEnum } from '@nitrots/nitro-renderer';
|
||||
import { FriendRequestEvent, FriendsAcceptFriendRequestEvent, FriendsDeclineFriendRequestEvent } from '../../../../../events';
|
||||
import { dispatchUiEvent } from '../../../../../hooks';
|
||||
import { DispatchUiEvent } from '../../../../../hooks';
|
||||
import { RoomWidgetUpdateEvent, RoomWidgetUpdateFriendRequestEvent } from '../events';
|
||||
import { RoomWidgetFriendRequestMessage, RoomWidgetMessage } from '../messages';
|
||||
import { RoomWidgetHandler } from './RoomWidgetHandler';
|
||||
@ -30,10 +30,10 @@ export class FriendRequestHandler extends RoomWidgetHandler
|
||||
switch(message.type)
|
||||
{
|
||||
case RoomWidgetFriendRequestMessage.ACCEPT:
|
||||
dispatchUiEvent(new FriendsAcceptFriendRequestEvent(friendMessage.requestId));
|
||||
DispatchUiEvent(new FriendsAcceptFriendRequestEvent(friendMessage.requestId));
|
||||
break;
|
||||
case RoomWidgetFriendRequestMessage.DECLINE:
|
||||
dispatchUiEvent(new FriendsDeclineFriendRequestEvent(friendMessage.requestId));
|
||||
DispatchUiEvent(new FriendsDeclineFriendRequestEvent(friendMessage.requestId));
|
||||
break;
|
||||
|
||||
}
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { NitroEvent, RoomControllerLevel, RoomEngineDimmerStateEvent, RoomEngineTriggerWidgetEvent, RoomSessionDimmerPresetsEvent, RoomWidgetEnum } from '@nitrots/nitro-renderer';
|
||||
import { GetRoomEngine } from '../..';
|
||||
import { GetSessionDataManager } from '../../..';
|
||||
import { RoomWidgetUpdateDimmerEvent, RoomWidgetUpdateEvent } from '../events';
|
||||
import { RoomWidgetUpdateDimmerStateEvent } from '../events/RoomWidgetUpdateDimmerStateEvent';
|
||||
import { RoomWidgetDimmerChangeStateMessage, RoomWidgetDimmerPreviewMessage, RoomWidgetFurniToWidgetMessage, RoomWidgetMessage } from '../messages';
|
||||
import { RoomWidgetDimmerSavePresetMessage } from '../messages/RoomWidgetDimmerSavePresetMessage';
|
||||
import { RoomWidgetUpdateDimmerEvent, RoomWidgetUpdateDimmerStateEvent, RoomWidgetUpdateEvent } from '../events';
|
||||
import { RoomWidgetDimmerChangeStateMessage, RoomWidgetDimmerPreviewMessage, RoomWidgetDimmerSavePresetMessage, RoomWidgetFurniToWidgetMessage, RoomWidgetMessage } from '../messages';
|
||||
import { RoomWidgetHandler } from './RoomWidgetHandler';
|
||||
|
||||
export class FurnitureDimmerWidgetHandler extends RoomWidgetHandler
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { NitroEvent, RoomEngineTriggerWidgetEvent, RoomObjectVariable, RoomWidgetEnum } from '@nitrots/nitro-renderer';
|
||||
import { GetRoomEngine } from '../../../..';
|
||||
import { IPhotoData } from '../events';
|
||||
import { RoomWidgetUpdateEvent } from '../events/RoomWidgetUpdateEvent';
|
||||
import { RoomWidgetUpdateExternalImageEvent } from '../events/RoomWidgetUpdateExternalImageEvent';
|
||||
import { IPhotoData, RoomWidgetUpdateEvent, RoomWidgetUpdateExternalImageEvent } from '../events';
|
||||
import { RoomWidgetMessage } from '../messages/RoomWidgetMessage';
|
||||
import { RoomWidgetHandler } from './RoomWidgetHandler';
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { NitroEvent, RoomEngineTriggerWidgetEvent, RoomObjectVariable, RoomWidgetEnum } from '@nitrots/nitro-renderer';
|
||||
import { RoomWidgetUpdateMannequinEvent } from '..';
|
||||
import { GetRoomEngine } from '../../GetRoomEngine';
|
||||
import { RoomWidgetUpdateEvent } from '../events/RoomWidgetUpdateEvent';
|
||||
import { RoomWidgetMessage } from '../messages/RoomWidgetMessage';
|
||||
import { RoomWidgetUpdateEvent } from '../events';
|
||||
import { RoomWidgetMessage } from '../messages';
|
||||
import { RoomWidgetHandler } from './RoomWidgetHandler';
|
||||
|
||||
export class FurnitureMannequinWidgetHandler extends RoomWidgetHandler
|
||||
|
@ -1,13 +1,9 @@
|
||||
import { SecurityLevel } from '@nitrots/nitro-renderer';
|
||||
import { NitroEvent } from '@nitrots/nitro-renderer/src/core/events/NitroEvent';
|
||||
import { GetYoutubeDisplayStatusMessageComposer } from '@nitrots/nitro-renderer/src/nitro/communication/messages/outgoing/room/furniture/youtube';
|
||||
import { RoomEngineTriggerWidgetEvent } from '@nitrots/nitro-renderer/src/nitro/room/events/RoomEngineTriggerWidgetEvent';
|
||||
import { RoomWidgetEnum } from '@nitrots/nitro-renderer/src/nitro/ui/widget/enums/RoomWidgetEnum';
|
||||
import { GetYoutubeDisplayStatusMessageComposer, NitroEvent, RoomWidgetEnum, SecurityLevel } from '@nitrots/nitro-renderer';
|
||||
import { RoomEngineTriggerWidgetEvent } from '@nitrots/nitro-renderer/';
|
||||
import { RoomWidgetMessage, RoomWidgetUpdateEvent } from '..';
|
||||
import { GetSessionDataManager, IsOwnerOfFurniture } from '../../..';
|
||||
import { SendMessageHook } from '../../../../../hooks';
|
||||
import { GetSessionDataManager, IsOwnerOfFurniture, SendMessageComposer } from '../../..';
|
||||
import { GetRoomEngine } from '../../GetRoomEngine';
|
||||
import { RoomWidgetUpdateYoutubeDisplayEvent } from '../events/RoomWidgetUpdateYoutubeDisplayEvent';
|
||||
import { RoomWidgetUpdateYoutubeDisplayEvent } from '../events';
|
||||
import { RoomWidgetHandler } from './RoomWidgetHandler';
|
||||
|
||||
export class FurnitureYoutubeDisplayWidgetHandler extends RoomWidgetHandler
|
||||
@ -34,7 +30,7 @@ export class FurnitureYoutubeDisplayWidgetHandler extends RoomWidgetHandler
|
||||
|
||||
const hasControl = GetSessionDataManager().hasSecurity(SecurityLevel.EMPLOYEE) || IsOwnerOfFurniture(roomObject);
|
||||
this.container.eventDispatcher.dispatchEvent(new RoomWidgetUpdateYoutubeDisplayEvent(roomObject.id, hasControl));
|
||||
SendMessageHook(new GetYoutubeDisplayStatusMessageComposer(this._lastFurniId));
|
||||
SendMessageComposer(new GetYoutubeDisplayStatusMessageComposer(this._lastFurniId));
|
||||
return;
|
||||
}
|
||||
case RoomEngineTriggerWidgetEvent.CLOSE_WIDGET: {
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { NitroEvent, RoomSessionPollEvent, RoomWidgetEnum } from '@nitrots/nitro-renderer';
|
||||
import { RoomWidgetPollUpdateEvent } from '../events/RoomWidgetPollUpdateEvent';
|
||||
import { RoomWidgetUpdateEvent } from '../events/RoomWidgetUpdateEvent';
|
||||
import { RoomWidgetMessage } from '../messages/RoomWidgetMessage';
|
||||
import { RoomWidgetPollMessage } from '../messages/RoomWidgetPollMessage';
|
||||
import { RoomWidgetPollUpdateEvent, RoomWidgetUpdateEvent } from '../events';
|
||||
import { RoomWidgetMessage, RoomWidgetPollMessage } from '../messages';
|
||||
import { RoomWidgetHandler } from './RoomWidgetHandler';
|
||||
|
||||
export class PollWidgetHandler extends RoomWidgetHandler
|
||||
|
@ -1,9 +1,8 @@
|
||||
import { AvatarExpressionEnum, HabboClubLevelEnum, NitroEvent, RoomControllerLevel, RoomRotatingEffect, RoomSessionChatEvent, RoomSettingsComposer, RoomShakingEffect, RoomWidgetEnum, RoomZoomEvent, TextureUtils } from '@nitrots/nitro-renderer';
|
||||
import { GetConfiguration, GetNitroInstance } from '../../..';
|
||||
import { GetConfiguration, GetNitroInstance, SendMessageComposer } from '../../..';
|
||||
import { GetRoomEngine, GetSessionDataManager, LocalizeText } from '../../../..';
|
||||
import { FloorplanEditorEvent } from '../../../../../events/floorplan-editor/FloorplanEditorEvent';
|
||||
import { dispatchUiEvent } from '../../../../../hooks';
|
||||
import { SendMessageHook } from '../../../../../hooks/messages';
|
||||
import { DispatchUiEvent } from '../../../../../hooks';
|
||||
import { NotificationUtilities } from '../../../../../views/notification-center/common/NotificationUtilities';
|
||||
import { RoomWidgetFloodControlEvent, RoomWidgetUpdateEvent } from '../events';
|
||||
import { RoomWidgetChatMessage, RoomWidgetChatSelectAvatarMessage, RoomWidgetChatTypingMessage, RoomWidgetMessage, RoomWidgetRequestWidgetMessage } from '../messages';
|
||||
@ -160,7 +159,7 @@ export class RoomWidgetChatInputHandler extends RoomWidgetHandler
|
||||
if(this.container.roomSession.controllerLevel >= RoomControllerLevel.ROOM_OWNER)
|
||||
{
|
||||
//this.container.processWidgetMessage(new RoomWidgetRequestWidgetMessage(RoomWidgetRequestWidgetMessage.FLOOR_EDITOR));
|
||||
dispatchUiEvent(new FloorplanEditorEvent(FloorplanEditorEvent.SHOW_FLOORPLAN_EDITOR));
|
||||
DispatchUiEvent(new FloorplanEditorEvent(FloorplanEditorEvent.SHOW_FLOORPLAN_EDITOR));
|
||||
}
|
||||
|
||||
return null;
|
||||
@ -179,7 +178,7 @@ export class RoomWidgetChatInputHandler extends RoomWidgetHandler
|
||||
case ':settings':
|
||||
if(this.container.roomSession.isRoomOwner || GetSessionDataManager().isModerator)
|
||||
{
|
||||
SendMessageHook(new RoomSettingsComposer(this.container.roomSession.roomId));
|
||||
SendMessageComposer(new RoomSettingsComposer(this.container.roomSession.roomId));
|
||||
}
|
||||
|
||||
return null;
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { IFurnitureData, NitroEvent, ObjectDataFactory, PetFigureData, PetRespectComposer, PetSupplementComposer, PetType, RoomControllerLevel, RoomModerationSettings, RoomObjectCategory, RoomObjectOperationType, RoomObjectType, RoomObjectVariable, RoomSessionPetInfoUpdateEvent, RoomSessionUserBadgesEvent, RoomSessionUserFigureUpdateEvent, RoomTradingLevelEnum, RoomUnitDropHandItemComposer, RoomUnitGiveHandItemComposer, RoomUnitGiveHandItemPetComposer, RoomUserData, RoomWidgetEnum, RoomWidgetEnumItemExtradataParameter, Vector3d } from '@nitrots/nitro-renderer';
|
||||
import { SendMessageComposer } from '../../..';
|
||||
import { GetNitroInstance, GetRoomEngine, GetSessionDataManager, IsOwnerOfFurniture } from '../../../..';
|
||||
import { InventoryTradeRequestEvent, WiredSelectObjectEvent } from '../../../../../events';
|
||||
import { FriendsSendFriendRequestEvent } from '../../../../../events/friends/FriendsSendFriendRequestEvent';
|
||||
import { HelpReportUserEvent } from '../../../../../events/help/HelpReportUserEvent';
|
||||
import { dispatchUiEvent } from '../../../../../hooks/events';
|
||||
import { SendMessageHook } from '../../../../../hooks/messages';
|
||||
import { FriendsSendFriendRequestEvent, HelpReportUserEvent, InventoryTradeRequestEvent, WiredSelectObjectEvent } from '../../../../../events';
|
||||
import { DispatchUiEvent } from '../../../../../hooks';
|
||||
import { FriendsHelper } from '../../../../../views/friends/common/FriendsHelper';
|
||||
import { PetSupplementEnum } from '../../../../../views/room/widgets/avatar-info/common/PetSupplementEnum';
|
||||
import { LocalizeText } from '../../../../utils/LocalizeText';
|
||||
@ -81,7 +79,7 @@ export class RoomWidgetInfostandHandler extends RoomWidgetHandler
|
||||
case RoomWidgetRoomObjectMessage.GET_OBJECT_INFO:
|
||||
return this.processObjectInfoMessage((message as RoomWidgetRoomObjectMessage));
|
||||
case RoomWidgetUserActionMessage.SEND_FRIEND_REQUEST:
|
||||
dispatchUiEvent(new FriendsSendFriendRequestEvent(userData.webID, userData.name));
|
||||
DispatchUiEvent(new FriendsSendFriendRequestEvent(userData.webID, userData.name));
|
||||
break;
|
||||
case RoomWidgetUserActionMessage.RESPECT_USER:
|
||||
GetSessionDataManager().giveRespect(userId);
|
||||
@ -122,7 +120,7 @@ export class RoomWidgetInfostandHandler extends RoomWidgetHandler
|
||||
this.container.roomSession.sendTakeRightsMessage((message as RoomWidgetUserActionMessage).userId);
|
||||
break;
|
||||
case RoomWidgetUserActionMessage.START_TRADING:
|
||||
dispatchUiEvent(new InventoryTradeRequestEvent(userData.roomIndex, userData.name));
|
||||
DispatchUiEvent(new InventoryTradeRequestEvent(userData.roomIndex, userData.name));
|
||||
break;
|
||||
// case RoomWidgetUserActionMessage.RWUAM_OPEN_HOME_PAGE:
|
||||
// this._container.sessionDataManager._Str_21275((message as RoomWidgetUserActionMessage).userId, _local_3.name);
|
||||
@ -146,22 +144,22 @@ export class RoomWidgetInfostandHandler extends RoomWidgetHandler
|
||||
this.container.roomSession.removePetSaddle(userId);
|
||||
break;
|
||||
case RoomWidgetUserActionMessage.PASS_CARRY_ITEM:
|
||||
SendMessageHook(new RoomUnitGiveHandItemComposer(userId));
|
||||
SendMessageComposer(new RoomUnitGiveHandItemComposer(userId));
|
||||
break;
|
||||
case RoomWidgetUserActionMessage.GIVE_CARRY_ITEM_TO_PET:
|
||||
SendMessageHook(new RoomUnitGiveHandItemPetComposer(userId));
|
||||
SendMessageComposer(new RoomUnitGiveHandItemPetComposer(userId));
|
||||
break;
|
||||
case RoomWidgetUserActionMessage.GIVE_WATER_TO_PET:
|
||||
SendMessageHook(new PetSupplementComposer(userId, PetSupplementEnum.WATER));
|
||||
SendMessageComposer(new PetSupplementComposer(userId, PetSupplementEnum.WATER));
|
||||
break;
|
||||
case RoomWidgetUserActionMessage.GIVE_LIGHT_TO_PET:
|
||||
SendMessageHook(new PetSupplementComposer(userId, PetSupplementEnum.LIGHT));
|
||||
SendMessageComposer(new PetSupplementComposer(userId, PetSupplementEnum.LIGHT));
|
||||
break;
|
||||
case RoomWidgetUserActionMessage.TREAT_PET:
|
||||
SendMessageHook(new PetRespectComposer(userId));
|
||||
SendMessageComposer(new PetRespectComposer(userId));
|
||||
break;
|
||||
case RoomWidgetUserActionMessage.DROP_CARRY_ITEM:
|
||||
SendMessageHook(new RoomUnitDropHandItemComposer());
|
||||
SendMessageComposer(new RoomUnitDropHandItemComposer());
|
||||
break;
|
||||
case RoomWidgetUserActionMessage.REQUEST_PET_UPDATE:
|
||||
this.container.roomSession.userDataManager.requestPetInfo(userId);
|
||||
@ -169,7 +167,7 @@ export class RoomWidgetInfostandHandler extends RoomWidgetHandler
|
||||
case RoomWidgetUserActionMessage.REPORT:
|
||||
return;
|
||||
case RoomWidgetUserActionMessage.REPORT_CFH_OTHER:
|
||||
dispatchUiEvent(new HelpReportUserEvent(userId));
|
||||
DispatchUiEvent(new HelpReportUserEvent(userId));
|
||||
return;
|
||||
case RoomWidgetUserActionMessage.AMBASSADOR_ALERT_USER:
|
||||
this.container.roomSession.sendAmbassadorAlertMessage(userId);
|
||||
@ -391,7 +389,7 @@ export class RoomWidgetInfostandHandler extends RoomWidgetHandler
|
||||
event.tileSizeX = furnitureData.tileSizeX;
|
||||
event.tileSizeY = furnitureData.tileSizeY;
|
||||
|
||||
dispatchUiEvent(new WiredSelectObjectEvent(event.id, event.category));
|
||||
DispatchUiEvent(new WiredSelectObjectEvent(event.id, event.category));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,7 @@ export * from './RoomWidgetFurniActionMessage';
|
||||
export * from './RoomWidgetFurniToWidgetMessage';
|
||||
export * from './RoomWidgetLetUserInMessage';
|
||||
export * from './RoomWidgetMessage';
|
||||
export * from './RoomWidgetPollMessage';
|
||||
export * from './RoomWidgetPresentOpenMessage';
|
||||
export * from './RoomWidgetRequestWidgetMessage';
|
||||
export * from './RoomWidgetRoomObjectMessage';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { DesktopViewComposer } from '@nitrots/nitro-renderer';
|
||||
import { SendMessageHook } from '../../../hooks';
|
||||
import { SendMessageComposer } from '..';
|
||||
|
||||
export function GoToDesktop(): void
|
||||
{
|
||||
SendMessageHook(new DesktopViewComposer());
|
||||
SendMessageComposer(new DesktopViewComposer());
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { UserProfileComposer } from '@nitrots/nitro-renderer';
|
||||
import { SendMessageHook } from '../../hooks';
|
||||
import { SendMessageComposer } from '..';
|
||||
|
||||
export function GetUserProfile(userId: number): void
|
||||
{
|
||||
SendMessageHook(new UserProfileComposer(userId));
|
||||
SendMessageComposer(new UserProfileComposer(userId));
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { NitroSoundEvent } from '@nitrots/nitro-renderer/src/nitro/events/NitroSoundEvent';
|
||||
import { dispatchMainEvent } from '../../hooks';
|
||||
import { DispatchMainEvent } from '../../hooks';
|
||||
|
||||
export function PlaySound(sampleCode: string): void
|
||||
{
|
||||
dispatchMainEvent(new NitroSoundEvent(NitroSoundEvent.PLAY_SOUND, sampleCode));
|
||||
DispatchMainEvent(new NitroSoundEvent(NitroSoundEvent.PLAY_SOUND, sampleCode));
|
||||
}
|
||||
|
||||
export const CAMERA_SHUTTER = 'camera_shutter';
|
||||
|
@ -1,14 +1,9 @@
|
||||
import { AchievementData, AchievementEvent, AchievementsEvent, AchievementsScoreEvent, RequestAchievementsMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { GetConfiguration, LocalizeText } from '../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardSubHeaderView, NitroCardView } from '../../common';
|
||||
import { Base } from '../../common/Base';
|
||||
import { Column } from '../../common/Column';
|
||||
import { Flex } from '../../common/Flex';
|
||||
import { Text } from '../../common/Text';
|
||||
import { AchievementsUIEvent, AchievementsUIUnseenCountEvent } from '../../events/achievements';
|
||||
import { BatchUpdates, CreateMessageHook, dispatchUiEvent, SendMessageHook } from '../../hooks';
|
||||
import { useUiEvent } from '../../hooks/events';
|
||||
import { GetConfiguration, LocalizeText, SendMessageComposer } from '../../api';
|
||||
import { Base, Column, Flex, NitroCardContentView, NitroCardHeaderView, NitroCardSubHeaderView, NitroCardView, Text } from '../../common';
|
||||
import { AchievementsUIEvent, AchievementsUIUnseenCountEvent } from '../../events';
|
||||
import { BatchUpdates, DispatchUiEvent, UseMessageEventHook, UseUiEvent } from '../../hooks';
|
||||
import { AchievementCategory } from './common/AchievementCategory';
|
||||
import { AchievementUtilities } from './common/AchievementUtilities';
|
||||
import { AchievementsCategoryListView } from './views/category-list/AchievementsCategoryListView';
|
||||
@ -38,9 +33,9 @@ export const AchievementsView: FC<{}> = props =>
|
||||
}
|
||||
}, []);
|
||||
|
||||
useUiEvent(AchievementsUIEvent.SHOW_ACHIEVEMENTS, onAchievementsUIEvent);
|
||||
useUiEvent(AchievementsUIEvent.HIDE_ACHIEVEMENTS, onAchievementsUIEvent);
|
||||
useUiEvent(AchievementsUIEvent.TOGGLE_ACHIEVEMENTS, onAchievementsUIEvent);
|
||||
UseUiEvent(AchievementsUIEvent.SHOW_ACHIEVEMENTS, onAchievementsUIEvent);
|
||||
UseUiEvent(AchievementsUIEvent.HIDE_ACHIEVEMENTS, onAchievementsUIEvent);
|
||||
UseUiEvent(AchievementsUIEvent.TOGGLE_ACHIEVEMENTS, onAchievementsUIEvent);
|
||||
|
||||
const onAchievementEvent = useCallback((event: AchievementEvent) =>
|
||||
{
|
||||
@ -89,7 +84,7 @@ export const AchievementsView: FC<{}> = props =>
|
||||
setAchievementCategories(newCategories);
|
||||
}, [ achievementCategories ]);
|
||||
|
||||
CreateMessageHook(AchievementEvent, onAchievementEvent);
|
||||
UseMessageEventHook(AchievementEvent, onAchievementEvent);
|
||||
|
||||
const onAchievementsEvent = useCallback((event: AchievementsEvent) =>
|
||||
{
|
||||
@ -119,7 +114,7 @@ export const AchievementsView: FC<{}> = props =>
|
||||
});
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(AchievementsEvent, onAchievementsEvent);
|
||||
UseMessageEventHook(AchievementsEvent, onAchievementsEvent);
|
||||
|
||||
const onAchievementsScoreEvent = useCallback((event: AchievementsScoreEvent) =>
|
||||
{
|
||||
@ -128,7 +123,7 @@ export const AchievementsView: FC<{}> = props =>
|
||||
setAchievementScore(parser.score);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(AchievementsScoreEvent, onAchievementsScoreEvent);
|
||||
UseMessageEventHook(AchievementsScoreEvent, onAchievementsScoreEvent);
|
||||
|
||||
const getTotalUnseen = useMemo(() =>
|
||||
{
|
||||
@ -204,12 +199,12 @@ export const AchievementsView: FC<{}> = props =>
|
||||
{
|
||||
if(!isVisible || !isInitalized) return;
|
||||
|
||||
SendMessageHook(new RequestAchievementsMessageComposer());
|
||||
SendMessageComposer(new RequestAchievementsMessageComposer());
|
||||
}, [ isVisible, isInitalized ]);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
dispatchUiEvent(new AchievementsUIUnseenCountEvent(getTotalUnseen));
|
||||
DispatchUiEvent(new AchievementsUIUnseenCountEvent(getTotalUnseen));
|
||||
}, [ getTotalUnseen ]);
|
||||
|
||||
if(!isVisible || !isInitalized) return null;
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { AvatarEditorFigureCategory, FigureSetIdsMessageEvent, GetWardrobeMessageComposer, IAvatarFigureContainer, ILinkEventTracker, UserFigureComposer, UserWardrobePageEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { AddEventLinkTracker, GetAvatarRenderManager, GetClubMemberLevel, GetConfiguration, GetSessionDataManager, LocalizeText, RemoveLinkEventTracker } from '../../api';
|
||||
import { AddEventLinkTracker, GetAvatarRenderManager, GetClubMemberLevel, GetConfiguration, GetSessionDataManager, LocalizeText, RemoveLinkEventTracker, SendMessageComposer } from '../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView } from '../../common';
|
||||
import { Button } from '../../common/Button';
|
||||
import { ButtonGroup } from '../../common/ButtonGroup';
|
||||
import { Column } from '../../common/Column';
|
||||
import { Grid } from '../../common/Grid';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../hooks';
|
||||
import { UseMessageEventHook } from '../../hooks';
|
||||
import { AvatarEditorAction } from './common/AvatarEditorAction';
|
||||
import { AvatarEditorUtilities } from './common/AvatarEditorUtilities';
|
||||
import { BodyModel } from './common/BodyModel';
|
||||
@ -50,7 +50,7 @@ export const AvatarEditorView: FC<{}> = props =>
|
||||
setBoundFurnitureNames(parser.boundsFurnitureNames);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(FigureSetIdsMessageEvent, onFigureSetIdsMessageEvent);
|
||||
UseMessageEventHook(FigureSetIdsMessageEvent, onFigureSetIdsMessageEvent);
|
||||
|
||||
const onUserWardrobePageEvent = useCallback((event: UserWardrobePageEvent) =>
|
||||
{
|
||||
@ -76,7 +76,7 @@ export const AvatarEditorView: FC<{}> = props =>
|
||||
setSavedFigures(savedFigures)
|
||||
}, [ maxWardrobeSlots ]);
|
||||
|
||||
CreateMessageHook(UserWardrobePageEvent, onUserWardrobePageEvent);
|
||||
UseMessageEventHook(UserWardrobePageEvent, onUserWardrobePageEvent);
|
||||
|
||||
const selectCategory = useCallback((name: string) =>
|
||||
{
|
||||
@ -152,7 +152,7 @@ export const AvatarEditorView: FC<{}> = props =>
|
||||
resetCategories();
|
||||
return;
|
||||
case AvatarEditorAction.ACTION_SAVE:
|
||||
SendMessageHook(new UserFigureComposer(figureData.gender, figureData.getFigureString()));
|
||||
SendMessageComposer(new UserFigureComposer(figureData.gender, figureData.getFigureString()));
|
||||
setIsVisible(false);
|
||||
return;
|
||||
}
|
||||
@ -214,7 +214,7 @@ export const AvatarEditorView: FC<{}> = props =>
|
||||
if(!isWardrobeVisible) return;
|
||||
|
||||
setActiveCategory(null);
|
||||
SendMessageHook(new GetWardrobeMessageComposer());
|
||||
SendMessageComposer(new GetWardrobeMessageComposer());
|
||||
}, [ isWardrobeVisible ]);
|
||||
|
||||
useEffect(() =>
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { IAvatarFigureContainer, SaveWardrobeOutfitMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { Dispatch, FC, SetStateAction, useCallback, useMemo } from 'react';
|
||||
import { GetAvatarRenderManager, GetSessionDataManager } from '../../../../api';
|
||||
import { GetAvatarRenderManager, GetSessionDataManager, SendMessageComposer } from '../../../../api';
|
||||
import { AutoGrid, Base, Button, Flex, LayoutGridItem } from '../../../../common';
|
||||
import { SendMessageHook } from '../../../../hooks';
|
||||
import { AvatarImageView } from '../../../../views/shared/avatar-image/AvatarImageView';
|
||||
import { CurrencyIcon } from '../../../../views/shared/currency-icon/CurrencyIcon';
|
||||
import { FigureData } from '../../common/FigureData';
|
||||
@ -40,7 +39,7 @@ export const AvatarEditorWardrobeView: FC<AvatarEditorWardrobeViewProps> = props
|
||||
newFigures[index] = [ GetAvatarRenderManager().createFigureContainer(figure), gender ];
|
||||
|
||||
setSavedFigures(newFigures);
|
||||
SendMessageHook(new SaveWardrobeOutfitMessageComposer((index + 1), figure, gender));
|
||||
SendMessageComposer(new SaveWardrobeOutfitMessageComposer((index + 1), figure, gender));
|
||||
}, [ figureData, savedFigures, setSavedFigures ]);
|
||||
|
||||
const figures = useMemo(() =>
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { ILinkEventTracker, InitCameraMessageEvent, IRoomCameraWidgetEffect, RequestCameraConfigurationComposer, RoomCameraWidgetManagerEvent, RoomSessionEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { AddEventLinkTracker, GetRoomCameraWidgetManager, RemoveLinkEventTracker } from '../../api';
|
||||
import { useRoomSessionManagerEvent } from '../../hooks';
|
||||
import { useCameraEvent } from '../../hooks/events/nitro/camera/camera-event';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../hooks/messages/message-event';
|
||||
import { AddEventLinkTracker, GetRoomCameraWidgetManager, RemoveLinkEventTracker, SendMessageComposer } from '../../api';
|
||||
import { UseCameraEvent, UseMessageEventHook, UseRoomSessionManagerEvent } from '../../hooks';
|
||||
import { CameraWidgetContextProvider } from './CameraWidgetContext';
|
||||
import { CameraPicture } from './common/CameraPicture';
|
||||
import { CameraWidgetCaptureView } from './views/capture/CameraWidgetCaptureView';
|
||||
@ -30,7 +28,7 @@ export const CameraWidgetView: FC<{}> = props =>
|
||||
setAvailableEffects(Array.from(GetRoomCameraWidgetManager().effects.values()))
|
||||
}, []);
|
||||
|
||||
useCameraEvent(RoomCameraWidgetManagerEvent.INITIALIZED, onRoomCameraWidgetManagerEvent);
|
||||
UseCameraEvent(RoomCameraWidgetManagerEvent.INITIALIZED, onRoomCameraWidgetManagerEvent);
|
||||
|
||||
const onCameraConfigurationEvent = useCallback((event: InitCameraMessageEvent) =>
|
||||
{
|
||||
@ -39,14 +37,14 @@ export const CameraWidgetView: FC<{}> = props =>
|
||||
setPrice({ credits: parser.creditPrice, duckets: parser.ducketPrice, publishDucketPrice: parser.publishDucketPrice });
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(InitCameraMessageEvent, onCameraConfigurationEvent);
|
||||
UseMessageEventHook(InitCameraMessageEvent, onCameraConfigurationEvent);
|
||||
|
||||
const onRoomSessionEvent = useCallback((event: RoomSessionEvent) =>
|
||||
{
|
||||
setMode(MODE_NONE);
|
||||
}, []);
|
||||
|
||||
useRoomSessionManagerEvent(RoomSessionEvent.ENDED, onRoomSessionEvent);
|
||||
UseRoomSessionManagerEvent(RoomSessionEvent.ENDED, onRoomSessionEvent);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
@ -54,7 +52,7 @@ export const CameraWidgetView: FC<{}> = props =>
|
||||
{
|
||||
GetRoomCameraWidgetManager().init();
|
||||
|
||||
SendMessageHook(new RequestCameraConfigurationComposer());
|
||||
SendMessageComposer(new RequestCameraConfigurationComposer());
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { CameraPublishStatusMessageEvent, CameraPurchaseOKMessageEvent, CameraStorageUrlMessageEvent, PublishPhotoMessageComposer, PurchasePhotoMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { GetConfiguration, GetRoomEngine, LocalizeText } from '../../../../api';
|
||||
import { GetConfiguration, GetRoomEngine, LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { Button, Column, Flex, LayoutImage, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common';
|
||||
import { InventoryEvent } from '../../../../events';
|
||||
import { BatchUpdates, CreateMessageHook, dispatchUiEvent, SendMessageHook } from '../../../../hooks';
|
||||
import { BatchUpdates, DispatchUiEvent, UseMessageEventHook } from '../../../../hooks';
|
||||
import { CurrencyIcon } from '../../../../views/shared/currency-icon/CurrencyIcon';
|
||||
|
||||
export interface CameraWidgetCheckoutViewProps
|
||||
@ -33,7 +33,7 @@ export const CameraWidgetCheckoutView: FC<CameraWidgetCheckoutViewProps> = props
|
||||
});
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(CameraPurchaseOKMessageEvent, onCameraPurchaseOKMessageEvent);
|
||||
UseMessageEventHook(CameraPurchaseOKMessageEvent, onCameraPurchaseOKMessageEvent);
|
||||
|
||||
const onCameraPublishStatusMessageEvent = useCallback((event: CameraPublishStatusMessageEvent) =>
|
||||
{
|
||||
@ -48,7 +48,7 @@ export const CameraWidgetCheckoutView: FC<CameraWidgetCheckoutViewProps> = props
|
||||
});
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(CameraPublishStatusMessageEvent, onCameraPublishStatusMessageEvent);
|
||||
UseMessageEventHook(CameraPublishStatusMessageEvent, onCameraPublishStatusMessageEvent);
|
||||
|
||||
const onCameraStorageUrlMessageEvent = useCallback((event: CameraStorageUrlMessageEvent) =>
|
||||
{
|
||||
@ -57,7 +57,7 @@ export const CameraWidgetCheckoutView: FC<CameraWidgetCheckoutViewProps> = props
|
||||
setPictureUrl(GetConfiguration<string>('camera.url') + '/' + parser.url);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(CameraStorageUrlMessageEvent, onCameraStorageUrlMessageEvent);
|
||||
UseMessageEventHook(CameraStorageUrlMessageEvent, onCameraStorageUrlMessageEvent);
|
||||
|
||||
const processAction = (type: string, value: string | number = null) =>
|
||||
{
|
||||
@ -70,13 +70,13 @@ export const CameraWidgetCheckoutView: FC<CameraWidgetCheckoutViewProps> = props
|
||||
if(isWaiting) return;
|
||||
|
||||
setIsWaiting(true);
|
||||
SendMessageHook(new PurchasePhotoMessageComposer(''));
|
||||
SendMessageComposer(new PurchasePhotoMessageComposer(''));
|
||||
return;
|
||||
case 'publish':
|
||||
if(isWaiting) return;
|
||||
|
||||
setIsWaiting(true);
|
||||
SendMessageHook(new PublishPhotoMessageComposer());
|
||||
SendMessageComposer(new PublishPhotoMessageComposer());
|
||||
return;
|
||||
case 'cancel':
|
||||
onCancelClick();
|
||||
@ -127,7 +127,7 @@ export const CameraWidgetCheckoutView: FC<CameraWidgetCheckoutViewProps> = props
|
||||
{ (picturesBought > 0) &&
|
||||
<Text>
|
||||
<Text bold>{ LocalizeText('camera.purchase.count.info') }</Text> { picturesBought }
|
||||
<u className="ms-1 cursor-pointer" onClick={ () => dispatchUiEvent(new InventoryEvent(InventoryEvent.SHOW_INVENTORY)) }>{ LocalizeText('camera.open.inventory') }</u>
|
||||
<u className="ms-1 cursor-pointer" onClick={ () => DispatchUiEvent(new InventoryEvent(InventoryEvent.SHOW_INVENTORY)) }>{ LocalizeText('camera.open.inventory') }</u>
|
||||
</Text> }
|
||||
</Column>
|
||||
<Flex alignItems="center">
|
||||
|
@ -2,13 +2,8 @@ import { ApproveNameMessageEvent, CatalogPageMessageEvent, CatalogPagesListEvent
|
||||
import { GuildMembershipsMessageEvent } from '@nitrots/nitro-renderer/src/nitro/communication/messages/incoming/user/GuildMembershipsMessageEvent';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { GetFurnitureData, GetProductDataForLocalization, LocalizeText } from '../../api';
|
||||
import { CatalogNameResultEvent, CatalogPurchaseFailureEvent, CatalogPurchaseNotAllowedEvent, CatalogSetExtraPurchaseParameterEvent } from '../../events';
|
||||
import { CatalogGiftReceiverNotFoundEvent } from '../../events/catalog/CatalogGiftReceiverNotFoundEvent';
|
||||
import { CatalogPurchasedEvent } from '../../events/catalog/CatalogPurchasedEvent';
|
||||
import { CatalogPurchaseSoldOutEvent } from '../../events/catalog/CatalogPurchaseSoldOutEvent';
|
||||
import { BatchUpdates } from '../../hooks';
|
||||
import { dispatchUiEvent } from '../../hooks/events/ui/ui-event';
|
||||
import { CreateMessageHook } from '../../hooks/messages/message-event';
|
||||
import { CatalogGiftReceiverNotFoundEvent, CatalogNameResultEvent, CatalogPurchasedEvent, CatalogPurchaseFailureEvent, CatalogPurchaseNotAllowedEvent, CatalogPurchaseSoldOutEvent, CatalogSetExtraPurchaseParameterEvent } from '../../events';
|
||||
import { BatchUpdates, DispatchUiEvent, UseMessageEventHook } from '../../hooks';
|
||||
import { NotificationAlertType } from '../../views/notification-center/common/NotificationAlertType';
|
||||
import { NotificationUtilities } from '../../views/notification-center/common/NotificationUtilities';
|
||||
import { useCatalogContext } from './CatalogContext';
|
||||
@ -102,28 +97,28 @@ export const CatalogMessageHandler: FC<{}> = props =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
dispatchUiEvent(new CatalogPurchasedEvent(parser.offer));
|
||||
DispatchUiEvent(new CatalogPurchasedEvent(parser.offer));
|
||||
}, []);
|
||||
|
||||
const onPurchaseErrorMessageEvent = useCallback((event: PurchaseErrorMessageEvent) =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
dispatchUiEvent(new CatalogPurchaseFailureEvent(parser.code));
|
||||
DispatchUiEvent(new CatalogPurchaseFailureEvent(parser.code));
|
||||
}, []);
|
||||
|
||||
const onPurchaseNotAllowedMessageEvent = useCallback((event: PurchaseNotAllowedMessageEvent) =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
dispatchUiEvent(new CatalogPurchaseNotAllowedEvent(parser.code));
|
||||
DispatchUiEvent(new CatalogPurchaseNotAllowedEvent(parser.code));
|
||||
}, []);
|
||||
|
||||
const onLimitedEditionSoldOutEvent = useCallback((event: LimitedEditionSoldOutEvent) =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
dispatchUiEvent(new CatalogPurchaseSoldOutEvent());
|
||||
DispatchUiEvent(new CatalogPurchaseSoldOutEvent());
|
||||
}, []);
|
||||
|
||||
const onProductOfferEvent = useCallback((event: ProductOfferEvent) =>
|
||||
@ -160,7 +155,7 @@ export const CatalogMessageHandler: FC<{}> = props =>
|
||||
|
||||
if(offer.product && (offer.product.productType === ProductTypeEnum.WALL))
|
||||
{
|
||||
dispatchUiEvent(new CatalogSetExtraPurchaseParameterEvent(offer.product.extraParam));
|
||||
DispatchUiEvent(new CatalogSetExtraPurchaseParameterEvent(offer.product.extraParam));
|
||||
}
|
||||
|
||||
// (this._isObjectMoverRequested) && (this._purchasableOffer)
|
||||
@ -199,12 +194,12 @@ export const CatalogMessageHandler: FC<{}> = props =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
dispatchUiEvent(new CatalogNameResultEvent(parser.result, parser.validationInfo));
|
||||
DispatchUiEvent(new CatalogNameResultEvent(parser.result, parser.validationInfo));
|
||||
}, []);
|
||||
|
||||
const onGiftReceiverNotFoundEvent = useCallback(() =>
|
||||
{
|
||||
dispatchUiEvent(new CatalogGiftReceiverNotFoundEvent());
|
||||
DispatchUiEvent(new CatalogGiftReceiverNotFoundEvent());
|
||||
}, []);
|
||||
|
||||
const onHabboClubOffersMessageEvent = useCallback((event: HabboClubOffersMessageEvent) =>
|
||||
@ -310,24 +305,24 @@ export const CatalogMessageHandler: FC<{}> = props =>
|
||||
});
|
||||
}, [ setCatalogOptions ]);
|
||||
|
||||
CreateMessageHook(CatalogPagesListEvent, onCatalogPagesListEvent);
|
||||
CreateMessageHook(CatalogPageMessageEvent, onCatalogPageMessageEvent);
|
||||
CreateMessageHook(PurchaseOKMessageEvent, onPurchaseOKMessageEvent);
|
||||
CreateMessageHook(PurchaseErrorMessageEvent, onPurchaseErrorMessageEvent);
|
||||
CreateMessageHook(PurchaseNotAllowedMessageEvent, onPurchaseNotAllowedMessageEvent);
|
||||
CreateMessageHook(LimitedEditionSoldOutEvent, onLimitedEditionSoldOutEvent);
|
||||
CreateMessageHook(ProductOfferEvent, onProductOfferEvent);
|
||||
CreateMessageHook(GuildMembershipsMessageEvent, onGuildMembershipsMessageEvent);
|
||||
CreateMessageHook(SellablePetPalettesMessageEvent, onSellablePetPalettesMessageEvent);
|
||||
CreateMessageHook(ApproveNameMessageEvent, onApproveNameMessageEvent);
|
||||
CreateMessageHook(GiftReceiverNotFoundEvent, onGiftReceiverNotFoundEvent);
|
||||
CreateMessageHook(HabboClubOffersMessageEvent, onHabboClubOffersMessageEvent);
|
||||
CreateMessageHook(UserSubscriptionEvent, onUserSubscriptionEvent);
|
||||
CreateMessageHook(CatalogPublishedMessageEvent, onCatalogPublishedMessageEvent);
|
||||
CreateMessageHook(GiftWrappingConfigurationEvent, onGiftWrappingConfigurationEvent);
|
||||
CreateMessageHook(ClubGiftInfoEvent, onClubGiftInfoEvent);
|
||||
CreateMessageHook(MarketplaceMakeOfferResult, onMarketplaceMakeOfferResult);
|
||||
CreateMessageHook(MarketplaceConfigurationEvent, onMarketplaceConfigurationEvent);
|
||||
UseMessageEventHook(CatalogPagesListEvent, onCatalogPagesListEvent);
|
||||
UseMessageEventHook(CatalogPageMessageEvent, onCatalogPageMessageEvent);
|
||||
UseMessageEventHook(PurchaseOKMessageEvent, onPurchaseOKMessageEvent);
|
||||
UseMessageEventHook(PurchaseErrorMessageEvent, onPurchaseErrorMessageEvent);
|
||||
UseMessageEventHook(PurchaseNotAllowedMessageEvent, onPurchaseNotAllowedMessageEvent);
|
||||
UseMessageEventHook(LimitedEditionSoldOutEvent, onLimitedEditionSoldOutEvent);
|
||||
UseMessageEventHook(ProductOfferEvent, onProductOfferEvent);
|
||||
UseMessageEventHook(GuildMembershipsMessageEvent, onGuildMembershipsMessageEvent);
|
||||
UseMessageEventHook(SellablePetPalettesMessageEvent, onSellablePetPalettesMessageEvent);
|
||||
UseMessageEventHook(ApproveNameMessageEvent, onApproveNameMessageEvent);
|
||||
UseMessageEventHook(GiftReceiverNotFoundEvent, onGiftReceiverNotFoundEvent);
|
||||
UseMessageEventHook(HabboClubOffersMessageEvent, onHabboClubOffersMessageEvent);
|
||||
UseMessageEventHook(UserSubscriptionEvent, onUserSubscriptionEvent);
|
||||
UseMessageEventHook(CatalogPublishedMessageEvent, onCatalogPublishedMessageEvent);
|
||||
UseMessageEventHook(GiftWrappingConfigurationEvent, onGiftWrappingConfigurationEvent);
|
||||
UseMessageEventHook(ClubGiftInfoEvent, onClubGiftInfoEvent);
|
||||
UseMessageEventHook(MarketplaceMakeOfferResult, onMarketplaceMakeOfferResult);
|
||||
UseMessageEventHook(MarketplaceConfigurationEvent, onMarketplaceConfigurationEvent);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -1,14 +1,9 @@
|
||||
import { FrontPageItem, GetCatalogIndexComposer, GetCatalogPageComposer, GetClubGiftInfo, GetGiftWrappingConfigurationComposer, GetMarketplaceConfigurationMessageComposer, ILinkEventTracker, RoomPreviewer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { AddEventLinkTracker, GetRoomEngine, LocalizeText, RemoveLinkEventTracker } from '../../api';
|
||||
import { CREDITS, PlaySound } from '../../api/utils/PlaySound';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView } from '../../common';
|
||||
import { Column } from '../../common/Column';
|
||||
import { Grid } from '../../common/Grid';
|
||||
import { AddEventLinkTracker, CREDITS, GetRoomEngine, LocalizeText, PlaySound, RemoveLinkEventTracker, SendMessageComposer } from '../../api';
|
||||
import { Column, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView } from '../../common';
|
||||
import { CatalogPurchasedEvent } from '../../events';
|
||||
import { BatchUpdates } from '../../hooks';
|
||||
import { useUiEvent } from '../../hooks/events/ui/ui-event';
|
||||
import { SendMessageHook } from '../../hooks/messages/message-event';
|
||||
import { BatchUpdates, UseUiEvent } from '../../hooks';
|
||||
import { CatalogContextProvider } from './CatalogContext';
|
||||
import { CatalogMessageHandler } from './CatalogMessageHandler';
|
||||
import { CatalogPage } from './common/CatalogPage';
|
||||
@ -119,7 +114,7 @@ export const CatalogView: FC<{}> = props =>
|
||||
setPageId(pageId);
|
||||
});
|
||||
|
||||
if(pageId > -1) SendMessageHook(new GetCatalogPageComposer(pageId, offerId, currentType));
|
||||
if(pageId > -1) SendMessageComposer(new GetCatalogPageComposer(pageId, offerId, currentType));
|
||||
}, [ currentType ]);
|
||||
|
||||
const showCatalogPage = useCallback((pageId: number, layoutCode: string, localization: IPageLocalization, offers: IPurchasableOffer[], offerId: number, acceptSeasonCurrencyAsCredits: boolean) =>
|
||||
@ -276,7 +271,7 @@ export const CatalogView: FC<{}> = props =>
|
||||
PlaySound(CREDITS);
|
||||
}, []);
|
||||
|
||||
useUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogPurchasedEvent);
|
||||
UseUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogPurchasedEvent);
|
||||
|
||||
const linkReceived = useCallback((url: string) =>
|
||||
{
|
||||
@ -352,10 +347,10 @@ export const CatalogView: FC<{}> = props =>
|
||||
{
|
||||
if(!isVisible || rootNode) return;
|
||||
|
||||
SendMessageHook(new GetMarketplaceConfigurationMessageComposer());
|
||||
SendMessageHook(new GetGiftWrappingConfigurationComposer());
|
||||
SendMessageHook(new GetClubGiftInfo());
|
||||
SendMessageHook(new GetCatalogIndexComposer(currentType));
|
||||
SendMessageComposer(new GetMarketplaceConfigurationMessageComposer());
|
||||
SendMessageComposer(new GetGiftWrappingConfigurationComposer());
|
||||
SendMessageComposer(new GetClubGiftInfo());
|
||||
SendMessageComposer(new GetCatalogIndexComposer(currentType));
|
||||
}, [ isVisible, rootNode, currentType ]);
|
||||
|
||||
useEffect(() =>
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { GetProductOfferComposer, IFurnitureData } from '@nitrots/nitro-renderer';
|
||||
import { GetProductDataForLocalization } from '../../../api';
|
||||
import { SendMessageHook } from '../../../hooks';
|
||||
import { GetProductDataForLocalization, SendMessageComposer } from '../../../api';
|
||||
import { ICatalogPage } from './ICatalogPage';
|
||||
import { IProduct } from './IProduct';
|
||||
import { IPurchasableOffer } from './IPurchasableOffer';
|
||||
@ -21,7 +20,7 @@ export class FurnitureOffer implements IPurchasableOffer
|
||||
|
||||
public activate(): void
|
||||
{
|
||||
SendMessageHook(new GetProductOfferComposer((this._furniData.rentOfferId > -1) ? this._furniData.rentOfferId : this._furniData.purchaseOfferId));
|
||||
SendMessageComposer(new GetProductOfferComposer((this._furniData.rentOfferId > -1) ? this._furniData.rentOfferId : this._furniData.purchaseOfferId));
|
||||
}
|
||||
|
||||
public get offerId(): number
|
||||
|
@ -2,7 +2,7 @@ import { NitroToolbarAnimateIconEvent, TextureUtils, ToolbarIconEnum } from '@ni
|
||||
import { FC, useCallback, useRef } from 'react';
|
||||
import { GetRoomEngine } from '../../../../api';
|
||||
import { CatalogPurchasedEvent } from '../../../../events';
|
||||
import { useUiEvent } from '../../../../hooks';
|
||||
import { UseUiEvent } from '../../../../hooks';
|
||||
import { RoomPreviewerView, RoomPreviewerViewProps } from '../../../../views/shared/room-previewer/RoomPreviewerView';
|
||||
|
||||
export const CatalogRoomPreviewerView: FC<RoomPreviewerViewProps> = props =>
|
||||
@ -39,7 +39,7 @@ export const CatalogRoomPreviewerView: FC<RoomPreviewerViewProps> = props =>
|
||||
animatePurchase();
|
||||
}, [ animatePurchase ]);
|
||||
|
||||
useUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogPurchasedEvent);
|
||||
UseUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogPurchasedEvent);
|
||||
|
||||
return (
|
||||
<div ref={ elementRef }>
|
||||
|
@ -2,11 +2,11 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { PurchaseFromCatalogAsGiftComposer } from '@nitrots/nitro-renderer';
|
||||
import classNames from 'classnames';
|
||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { GetSessionDataManager, LocalizeText } from '../../../../api';
|
||||
import { GetSessionDataManager, LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { Base, Button, ButtonGroup, Column, Flex, FormGroup, LayoutGiftTagView, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common';
|
||||
import { CatalogEvent, CatalogPurchasedEvent } from '../../../../events';
|
||||
import { CatalogInitGiftEvent } from '../../../../events/catalog/CatalogInitGiftEvent';
|
||||
import { BatchUpdates, SendMessageHook, useUiEvent } from '../../../../hooks';
|
||||
import { BatchUpdates, UseUiEvent } from '../../../../hooks';
|
||||
import { CurrencyIcon } from '../../../../views/shared/currency-icon/CurrencyIcon';
|
||||
import { FurniImageView } from '../../../../views/shared/furni-image/FurniImageView';
|
||||
import { useCatalogContext } from '../../CatalogContext';
|
||||
@ -75,9 +75,9 @@ export const CatalogGiftView: FC<{}> = props =>
|
||||
}
|
||||
}, [ close ]);
|
||||
|
||||
useUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogEvent);
|
||||
useUiEvent(CatalogEvent.INIT_GIFT, onCatalogEvent);
|
||||
useUiEvent(CatalogEvent.GIFT_RECEIVER_NOT_FOUND, onCatalogEvent);
|
||||
UseUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogEvent);
|
||||
UseUiEvent(CatalogEvent.INIT_GIFT, onCatalogEvent);
|
||||
UseUiEvent(CatalogEvent.GIFT_RECEIVER_NOT_FOUND, onCatalogEvent);
|
||||
|
||||
const isBoxDefault = useMemo(() =>
|
||||
{
|
||||
@ -123,7 +123,7 @@ export const CatalogGiftView: FC<{}> = props =>
|
||||
return;
|
||||
}
|
||||
|
||||
SendMessageHook(new PurchaseFromCatalogAsGiftComposer(pageId, offerId, extraData, receiverName, message, selectedColorId, selectedBoxIndex, selectedRibbonIndex, showMyFace));
|
||||
SendMessageComposer(new PurchaseFromCatalogAsGiftComposer(pageId, offerId, extraData, receiverName, message, selectedColorId, selectedBoxIndex, selectedRibbonIndex, showMyFace));
|
||||
return;
|
||||
}
|
||||
}, [ extraData, maxBoxIndex, maxRibbonIndex, message, offerId, pageId, receiverName, selectedBoxIndex, selectedColorId, selectedRibbonIndex, showMyFace ]);
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { RedeemVoucherMessageComposer, VoucherRedeemErrorMessageEvent, VoucherRedeemOkMessageEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../../api';
|
||||
import { Button } from '../../../../../common/Button';
|
||||
import { Flex } from '../../../../../common/Flex';
|
||||
import { BatchUpdates, CreateMessageHook, SendMessageHook } from '../../../../../hooks';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../../api';
|
||||
import { Button, Flex } from '../../../../../common';
|
||||
import { BatchUpdates, UseMessageEventHook } from '../../../../../hooks';
|
||||
import { NotificationUtilities } from '../../../../../views/notification-center/common/NotificationUtilities';
|
||||
|
||||
export interface CatalogRedeemVoucherViewProps
|
||||
@ -22,7 +21,7 @@ export const CatalogRedeemVoucherView: FC<CatalogRedeemVoucherViewProps> = props
|
||||
{
|
||||
if(!voucher || !voucher.length || isWaiting) return;
|
||||
|
||||
SendMessageHook(new RedeemVoucherMessageComposer(voucher));
|
||||
SendMessageComposer(new RedeemVoucherMessageComposer(voucher));
|
||||
|
||||
setIsWaiting(true);
|
||||
}
|
||||
@ -44,7 +43,7 @@ export const CatalogRedeemVoucherView: FC<CatalogRedeemVoucherViewProps> = props
|
||||
});
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(VoucherRedeemOkMessageEvent, onVoucherRedeemOkMessageEvent);
|
||||
UseMessageEventHook(VoucherRedeemOkMessageEvent, onVoucherRedeemOkMessageEvent);
|
||||
|
||||
const onVoucherRedeemErrorMessageEvent = useCallback((event: VoucherRedeemErrorMessageEvent) =>
|
||||
{
|
||||
@ -55,7 +54,7 @@ export const CatalogRedeemVoucherView: FC<CatalogRedeemVoucherViewProps> = props
|
||||
setIsWaiting(false);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(VoucherRedeemErrorMessageEvent, onVoucherRedeemErrorMessageEvent);
|
||||
UseMessageEventHook(VoucherRedeemErrorMessageEvent, onVoucherRedeemErrorMessageEvent);
|
||||
|
||||
return (
|
||||
<Flex gap={ 1 }>
|
||||
|
@ -1,11 +1,7 @@
|
||||
import { CatalogGroupsComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useEffect, useState } from 'react';
|
||||
import { Base } from '../../../../../common/Base';
|
||||
import { Column } from '../../../../../common/Column';
|
||||
import { Flex } from '../../../../../common/Flex';
|
||||
import { Grid } from '../../../../../common/Grid';
|
||||
import { Text } from '../../../../../common/Text';
|
||||
import { SendMessageHook } from '../../../../../hooks/messages';
|
||||
import { SendMessageComposer } from '../../../../../api';
|
||||
import { Base, Column, Flex, Grid, Text } from '../../../../../common';
|
||||
import { useCatalogContext } from '../../../CatalogContext';
|
||||
import { CatalogFirstProductSelectorWidgetView } from '../widgets/CatalogFirstProductSelectorWidgetView';
|
||||
import { CatalogGuildSelectorWidgetView } from '../widgets/CatalogGuildSelectorWidgetView';
|
||||
@ -22,7 +18,7 @@ export const CatalogLayouGuildForumView: FC<CatalogLayoutProps> = props =>
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
SendMessageHook(new CatalogGroupsComposer());
|
||||
SendMessageComposer(new CatalogGroupsComposer());
|
||||
}, [ page ]);
|
||||
|
||||
return (
|
||||
|
@ -1,18 +1,9 @@
|
||||
import { ClubOfferData, GetClubOffersMessageComposer, PurchaseFromCatalogComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../../api';
|
||||
import { AutoGrid } from '../../../../../common/AutoGrid';
|
||||
import { Button } from '../../../../../common/Button';
|
||||
import { Column } from '../../../../../common/Column';
|
||||
import { Flex } from '../../../../../common/Flex';
|
||||
import { Grid } from '../../../../../common/Grid';
|
||||
import { LayoutGridItem } from '../../../../../common/layout/LayoutGridItem';
|
||||
import { LayoutLoadingSpinnerView } from '../../../../../common/layout/LayoutLoadingSpinnerView';
|
||||
import { Text } from '../../../../../common/Text';
|
||||
import { CatalogPurchasedEvent, CatalogPurchaseFailureEvent } from '../../../../../events';
|
||||
import { CatalogEvent } from '../../../../../events/catalog/CatalogEvent';
|
||||
import { useUiEvent } from '../../../../../hooks';
|
||||
import { SendMessageHook } from '../../../../../hooks/messages/message-event';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../../api';
|
||||
import { AutoGrid, Button, Column, Flex, Grid, LayoutGridItem, LayoutLoadingSpinnerView, Text } from '../../../../../common';
|
||||
import { CatalogEvent, CatalogPurchasedEvent, CatalogPurchaseFailureEvent } from '../../../../../events';
|
||||
import { UseUiEvent } from '../../../../../hooks';
|
||||
import { CurrencyIcon } from '../../../../../views/shared/currency-icon/CurrencyIcon';
|
||||
import { GetCurrencyAmount } from '../../../../purse/common/CurrencyHelper';
|
||||
import { GLOBAL_PURSE } from '../../../../purse/PurseView';
|
||||
@ -40,8 +31,8 @@ export const CatalogLayoutVipBuyView: FC<CatalogLayoutProps> = props =>
|
||||
}
|
||||
}, []);
|
||||
|
||||
useUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogEvent);
|
||||
useUiEvent(CatalogPurchaseFailureEvent.PURCHASE_FAILED, onCatalogEvent);
|
||||
UseUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogEvent);
|
||||
UseUiEvent(CatalogPurchaseFailureEvent.PURCHASE_FAILED, onCatalogEvent);
|
||||
|
||||
const getOfferText = useCallback((offer: ClubOfferData) =>
|
||||
{
|
||||
@ -103,7 +94,7 @@ export const CatalogLayoutVipBuyView: FC<CatalogLayoutProps> = props =>
|
||||
if(!pendingOffer) return;
|
||||
|
||||
setPurchaseState(CatalogPurchaseState.PURCHASE);
|
||||
SendMessageHook(new PurchaseFromCatalogComposer(currentPage.pageId, pendingOffer.offerId, null, 1));
|
||||
SendMessageComposer(new PurchaseFromCatalogComposer(currentPage.pageId, pendingOffer.offerId, null, 1));
|
||||
}, [ pendingOffer, currentPage ]);
|
||||
|
||||
const setOffer = useCallback((offer: ClubOfferData) =>
|
||||
@ -142,7 +133,7 @@ export const CatalogLayoutVipBuyView: FC<CatalogLayoutProps> = props =>
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
if(!clubOffers) SendMessageHook(new GetClubOffersMessageComposer(1));
|
||||
if(!clubOffers) SendMessageComposer(new GetClubOffersMessageComposer(1));
|
||||
}, [ clubOffers ]);
|
||||
|
||||
return (
|
||||
|
@ -1,11 +1,8 @@
|
||||
import { CancelMarketplaceOfferMessageComposer, GetMarketplaceOwnOffersMessageComposer, MarketplaceCancelOfferResultEvent, MarketplaceOwnOffersEvent, RedeemMarketplaceOfferCreditsMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useMemo, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../../../api';
|
||||
import { Button } from '../../../../../../common/Button';
|
||||
import { Column } from '../../../../../../common/Column';
|
||||
import { Grid } from '../../../../../../common/Grid';
|
||||
import { Text } from '../../../../../../common/Text';
|
||||
import { BatchUpdates, CreateMessageHook, SendMessageHook, UseMountEffect } from '../../../../../../hooks';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../../../api';
|
||||
import { Button, Column, Grid, Text } from '../../../../../../common';
|
||||
import { BatchUpdates, UseMessageEventHook, UseMountEffect } from '../../../../../../hooks';
|
||||
import { NotificationAlertType } from '../../../../../../views/notification-center/common/NotificationAlertType';
|
||||
import { NotificationUtilities } from '../../../../../../views/notification-center/common/NotificationUtilities';
|
||||
import { CatalogLayoutProps } from '../CatalogLayout.types';
|
||||
@ -40,7 +37,7 @@ export const CatalogLayoutMarketplaceOwnItemsView: FC<CatalogLayoutProps> = prop
|
||||
});
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(MarketplaceOwnOffersEvent, onMarketPlaceOwnOffersEvent);
|
||||
UseMessageEventHook(MarketplaceOwnOffersEvent, onMarketPlaceOwnOffersEvent);
|
||||
|
||||
const onMarketplaceCancelOfferResultEvent = useCallback((event:MarketplaceCancelOfferResultEvent) =>
|
||||
{
|
||||
@ -58,7 +55,7 @@ export const CatalogLayoutMarketplaceOwnItemsView: FC<CatalogLayoutProps> = prop
|
||||
setOffers(prevValue => prevValue.filter(value => (value.offerId !== parser.offerId)));
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(MarketplaceCancelOfferResultEvent, onMarketplaceCancelOfferResultEvent);
|
||||
UseMessageEventHook(MarketplaceCancelOfferResultEvent, onMarketplaceCancelOfferResultEvent);
|
||||
|
||||
const soldOffers = useMemo(() =>
|
||||
{
|
||||
@ -74,17 +71,17 @@ export const CatalogLayoutMarketplaceOwnItemsView: FC<CatalogLayoutProps> = prop
|
||||
return prevValue.filter(value => (idsToDelete.indexOf(value.offerId) === -1));
|
||||
})
|
||||
|
||||
SendMessageHook(new RedeemMarketplaceOfferCreditsMessageComposer());
|
||||
SendMessageComposer(new RedeemMarketplaceOfferCreditsMessageComposer());
|
||||
}, [ soldOffers ]);
|
||||
|
||||
const takeItemBack = (offerData: MarketplaceOfferData) =>
|
||||
{
|
||||
SendMessageHook(new CancelMarketplaceOfferMessageComposer(offerData.offerId));
|
||||
SendMessageComposer(new CancelMarketplaceOfferMessageComposer(offerData.offerId));
|
||||
};
|
||||
|
||||
UseMountEffect(() =>
|
||||
{
|
||||
SendMessageHook(new GetMarketplaceOwnOffersMessageComposer());
|
||||
SendMessageComposer(new GetMarketplaceOwnOffersMessageComposer());
|
||||
});
|
||||
|
||||
return (
|
||||
|
@ -1,12 +1,8 @@
|
||||
import { BuyMarketplaceOfferMessageComposer, GetMarketplaceOffersMessageComposer, MarketplaceBuyOfferResultEvent, MarketPlaceOffersEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useMemo, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../../../api';
|
||||
import { Button } from '../../../../../../common/Button';
|
||||
import { ButtonGroup } from '../../../../../../common/ButtonGroup';
|
||||
import { Column } from '../../../../../../common/Column';
|
||||
import { Grid } from '../../../../../../common/Grid';
|
||||
import { Text } from '../../../../../../common/Text';
|
||||
import { BatchUpdates, CreateMessageHook, SendMessageHook } from '../../../../../../hooks';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../../../api';
|
||||
import { Button, ButtonGroup, Column, Grid, Text } from '../../../../../../common';
|
||||
import { BatchUpdates, UseMessageEventHook } from '../../../../../../hooks';
|
||||
import { NotificationAlertType } from '../../../../../../views/notification-center/common/NotificationAlertType';
|
||||
import { NotificationUtilities } from '../../../../../../views/notification-center/common/NotificationUtilities';
|
||||
import { GetCurrencyAmount } from '../../../../../purse/common/CurrencyHelper';
|
||||
@ -35,7 +31,7 @@ export const CatalogLayoutMarketplacePublicItemsView: FC<CatalogLayoutMarketplac
|
||||
const requestOffers = useCallback((options: IMarketplaceSearchOptions) =>
|
||||
{
|
||||
setLastSearch(options);
|
||||
SendMessageHook(new GetMarketplaceOffersMessageComposer(options.minPrice, options.maxPrice, options.query, options.type))
|
||||
SendMessageComposer(new GetMarketplaceOffersMessageComposer(options.minPrice, options.maxPrice, options.query, options.type))
|
||||
}, []);
|
||||
|
||||
const getSortTypes = useMemo( () =>
|
||||
@ -62,7 +58,7 @@ export const CatalogLayoutMarketplacePublicItemsView: FC<CatalogLayoutMarketplac
|
||||
const offerId = offerData.offerId;
|
||||
NotificationUtilities.confirm(LocalizeText('catalog.marketplace.confirm_header'), () =>
|
||||
{
|
||||
SendMessageHook(new BuyMarketplaceOfferMessageComposer(offerId));
|
||||
SendMessageComposer(new BuyMarketplaceOfferMessageComposer(offerId));
|
||||
},
|
||||
null, null, null, LocalizeText('catalog.marketplace.confirm_title'));
|
||||
},[]);
|
||||
@ -132,7 +128,7 @@ export const CatalogLayoutMarketplacePublicItemsView: FC<CatalogLayoutMarketplac
|
||||
NotificationUtilities.confirm(LocalizeText('catalog.marketplace.confirm_higher_header') +
|
||||
'\n' + LocalizeText('catalog.marketplace.confirm_price', ['price'], [parser.newPrice.toString()]), () =>
|
||||
{
|
||||
SendMessageHook(new BuyMarketplaceOfferMessageComposer(parser.offerId));
|
||||
SendMessageComposer(new BuyMarketplaceOfferMessageComposer(parser.offerId));
|
||||
},
|
||||
null, null, null, LocalizeText('catalog.marketplace.confirm_higher_title'));
|
||||
break;
|
||||
@ -142,8 +138,8 @@ export const CatalogLayoutMarketplacePublicItemsView: FC<CatalogLayoutMarketplac
|
||||
}
|
||||
}, [lastSearch, requestOffers]);
|
||||
|
||||
CreateMessageHook(MarketPlaceOffersEvent, onMarketPlaceOffersEvent);
|
||||
CreateMessageHook(MarketplaceBuyOfferResultEvent, onMarketplaceBuyOfferResultEvent);
|
||||
UseMessageEventHook(MarketPlaceOffersEvent, onMarketPlaceOffersEvent);
|
||||
UseMessageEventHook(MarketplaceBuyOfferResultEvent, onMarketplaceBuyOfferResultEvent);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { ImageResult, MakeOfferMessageComposer, Vector3d } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { GetRoomEngine, LocalizeText } from '../../../../../../api';
|
||||
import { GetRoomEngine, LocalizeText, SendMessageComposer } from '../../../../../../api';
|
||||
import { Base, Button, Column, Grid, LayoutImage, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../../../common';
|
||||
import { CatalogPostMarketplaceOfferEvent } from '../../../../../../events';
|
||||
import { BatchUpdates, SendMessageHook, useUiEvent } from '../../../../../../hooks';
|
||||
import { BatchUpdates, UseUiEvent } from '../../../../../../hooks';
|
||||
import { NotificationUtilities } from '../../../../../../views/notification-center/common/NotificationUtilities';
|
||||
import { FurnitureItem } from '../../../../../inventory/common/FurnitureItem';
|
||||
import { useCatalogContext } from '../../../../CatalogContext';
|
||||
@ -29,7 +29,7 @@ export const MarketplacePostOfferView : FC<{}> = props =>
|
||||
setItem(event.item);
|
||||
}, []);
|
||||
|
||||
useUiEvent(CatalogPostMarketplaceOfferEvent.POST_MARKETPLACE, onCatalogPostMarketplaceOfferEvent);
|
||||
UseUiEvent(CatalogPostMarketplaceOfferEvent.POST_MARKETPLACE, onCatalogPostMarketplaceOfferEvent);
|
||||
|
||||
const getItemImage = useCallback( () =>
|
||||
{
|
||||
@ -79,7 +79,7 @@ export const MarketplacePostOfferView : FC<{}> = props =>
|
||||
|
||||
NotificationUtilities.confirm(LocalizeText('inventory.marketplace.confirm_offer.info', ['furniname', 'price'], [getFurniTitle(), askingPrice.toString()]), () =>
|
||||
{
|
||||
SendMessageHook(new MakeOfferMessageComposer(askingPrice, item.isWallItem ? 2 : 1, item.id));
|
||||
SendMessageComposer(new MakeOfferMessageComposer(askingPrice, item.isWallItem ? 2 : 1, item.id));
|
||||
setItem(null);
|
||||
},
|
||||
() => { setItem(null)}, null, null, LocalizeText('inventory.marketplace.confirm_offer.title'));
|
||||
|
@ -1,12 +1,9 @@
|
||||
import { ApproveNameMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../../../api';
|
||||
import { Column } from '../../../../../../common/Column';
|
||||
import { Flex } from '../../../../../../common/Flex';
|
||||
import { Text } from '../../../../../../common/Text';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../../../api';
|
||||
import { Column, Flex, Text } from '../../../../../../common';
|
||||
import { CatalogPurchasedEvent } from '../../../../../../events';
|
||||
import { useUiEvent } from '../../../../../../hooks/events/ui/ui-event';
|
||||
import { SendMessageHook } from '../../../../../../hooks/messages/message-event';
|
||||
import { UseUiEvent } from '../../../../../../hooks';
|
||||
import { CurrencyIcon } from '../../../../../../views/shared/currency-icon/CurrencyIcon';
|
||||
import { IPurchasableOffer } from '../../../../common/IPurchasableOffer';
|
||||
import { Offer } from '../../../../common/Offer';
|
||||
@ -31,11 +28,11 @@ export const CatalogLayoutPetPurchaseView: FC<CatalogLayoutPetPurchaseViewProps>
|
||||
setNameApproved(false);
|
||||
}, []);
|
||||
|
||||
useUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogPurchasedEvent);
|
||||
UseUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogPurchasedEvent);
|
||||
|
||||
const beforePurchase = useCallback(() =>
|
||||
{
|
||||
SendMessageHook(new ApproveNameMessageComposer(petNameValue, 1));
|
||||
SendMessageComposer(new ApproveNameMessageComposer(petNameValue, 1));
|
||||
}, [ petNameValue ]);
|
||||
|
||||
const extraData = `${ petNameValue }\n${ extra }`;
|
||||
|
@ -1,19 +1,10 @@
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { ApproveNameMessageComposer, ColorConverter, GetSellablePetPalettesComposer, PurchaseFromCatalogComposer, SellablePetPaletteData } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../../../api';
|
||||
import { AutoGrid } from '../../../../../../common/AutoGrid';
|
||||
import { Base } from '../../../../../../common/Base';
|
||||
import { Button } from '../../../../../../common/Button';
|
||||
import { Column } from '../../../../../../common/Column';
|
||||
import { Flex } from '../../../../../../common/Flex';
|
||||
import { Grid } from '../../../../../../common/Grid';
|
||||
import { LayoutGridItem } from '../../../../../../common/layout/LayoutGridItem';
|
||||
import { Text } from '../../../../../../common/Text';
|
||||
import { CatalogNameResultEvent, CatalogPurchaseFailureEvent } from '../../../../../../events';
|
||||
import { CatalogWidgetEvent } from '../../../../../../events/catalog/CatalogWidgetEvent';
|
||||
import { BatchUpdates, dispatchUiEvent, useUiEvent } from '../../../../../../hooks';
|
||||
import { SendMessageHook } from '../../../../../../hooks/messages/message-event';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../../../api';
|
||||
import { AutoGrid, Base, Button, Column, Flex, Grid, LayoutGridItem, Text } from '../../../../../../common';
|
||||
import { CatalogNameResultEvent, CatalogPurchaseFailureEvent, CatalogWidgetEvent } from '../../../../../../events';
|
||||
import { BatchUpdates, DispatchUiEvent, UseUiEvent } from '../../../../../../hooks';
|
||||
import { PetImageView } from '../../../../../../views/shared/pet-image/PetImageView';
|
||||
import { useCatalogContext } from '../../../../CatalogContext';
|
||||
import { GetPetAvailableColors, GetPetIndexFromLocalization } from '../../../../common/CatalogUtilities';
|
||||
@ -103,14 +94,14 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
|
||||
{
|
||||
if(approvalResult === -1)
|
||||
{
|
||||
SendMessageHook(new ApproveNameMessageComposer(petName, 1));
|
||||
SendMessageComposer(new ApproveNameMessageComposer(petName, 1));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(approvalResult === 0)
|
||||
{
|
||||
SendMessageHook(new PurchaseFromCatalogComposer(page.pageId, currentOffer.offerId, `${ petName }\n${ petPurchaseString }`, 1));
|
||||
SendMessageComposer(new PurchaseFromCatalogComposer(page.pageId, currentOffer.offerId, `${ petName }\n${ petPurchaseString }`, 1));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -121,10 +112,10 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
|
||||
setApprovalResult(event.result);
|
||||
|
||||
if(event.result === 0) purchasePet();
|
||||
else dispatchUiEvent(new CatalogPurchaseFailureEvent(-1));
|
||||
else DispatchUiEvent(new CatalogPurchaseFailureEvent(-1));
|
||||
}, [ purchasePet ]);
|
||||
|
||||
useUiEvent(CatalogWidgetEvent.APPROVE_RESULT, onCatalogNameResultEvent);
|
||||
UseUiEvent(CatalogWidgetEvent.APPROVE_RESULT, onCatalogNameResultEvent);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
@ -176,7 +167,7 @@ export const CatalogLayoutPetView: FC<CatalogLayoutProps> = props =>
|
||||
setSellablePalettes([]);
|
||||
});
|
||||
|
||||
SendMessageHook(new GetSellablePetPalettesComposer(productData.type));
|
||||
SendMessageComposer(new GetSellablePetPalettesComposer(productData.type));
|
||||
}, [ currentOffer, petPalettes ]);
|
||||
|
||||
useEffect(() =>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Dispatch, FC, SetStateAction, useCallback, useEffect, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../../../api';
|
||||
import { CatalogEvent, CatalogNameResultEvent } from '../../../../../../events';
|
||||
import { useUiEvent } from '../../../../../../hooks/events/ui/ui-event';
|
||||
import { UseUiEvent } from '../../../../../../hooks';
|
||||
|
||||
export interface CatalogPetNameApprovalViewProps
|
||||
{
|
||||
@ -28,7 +28,7 @@ export const CatalogPetNameApprovalView: FC<CatalogPetNameApprovalViewProps> = p
|
||||
setValidationResult(event.result);
|
||||
}, [ setNameApproved ]);
|
||||
|
||||
useUiEvent(CatalogEvent.APPROVE_NAME_RESULT, onCatalogNameResultEvent);
|
||||
UseUiEvent(CatalogEvent.APPROVE_NAME_RESULT, onCatalogNameResultEvent);
|
||||
|
||||
const validationErrorMessage = () =>
|
||||
{
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { SelectClubGiftComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { LocalizeText } from '../../../../../../api';
|
||||
import { AutoGrid } from '../../../../../../common/AutoGrid';
|
||||
import { Text } from '../../../../../../common/Text';
|
||||
import { SendMessageHook } from '../../../../../../hooks';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../../../api';
|
||||
import { AutoGrid, Text } from '../../../../../../common';
|
||||
import { NotificationUtilities } from '../../../../../../views/notification-center/common/NotificationUtilities';
|
||||
import { useCatalogContext } from '../../../../CatalogContext';
|
||||
import { CatalogLayoutProps } from '../CatalogLayout.types';
|
||||
@ -31,7 +29,7 @@ export const CatalogLayoutVipGiftsView: FC<CatalogLayoutProps> = props =>
|
||||
{
|
||||
NotificationUtilities.confirm(LocalizeText('catalog.club_gift.confirm'), () =>
|
||||
{
|
||||
SendMessageHook(new SelectClubGiftComposer(localizationId));
|
||||
SendMessageComposer(new SelectClubGiftComposer(localizationId));
|
||||
|
||||
setCatalogOptions(prevValue =>
|
||||
{
|
||||
|
@ -1,10 +1,8 @@
|
||||
import { StringDataType } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { AutoGrid, AutoGridProps } from '../../../../../common/AutoGrid';
|
||||
import { LayoutGridItem } from '../../../../../common/layout/LayoutGridItem';
|
||||
import { InventoryBadgesUpdatedEvent } from '../../../../../events';
|
||||
import { InventoryBadgesRequestEvent } from '../../../../../events/inventory/InventoryBadgesRequestEvent';
|
||||
import { dispatchUiEvent, useUiEvent } from '../../../../../hooks';
|
||||
import { AutoGrid, AutoGridProps, LayoutGridItem } from '../../../../../common';
|
||||
import { InventoryBadgesRequestEvent, InventoryBadgesUpdatedEvent } from '../../../../../events';
|
||||
import { DispatchUiEvent, UseUiEvent } from '../../../../../hooks';
|
||||
import { BadgeImageView } from '../../../../../views/shared/badge-image/BadgeImageView';
|
||||
import { useCatalogContext } from '../../../CatalogContext';
|
||||
|
||||
@ -27,7 +25,7 @@ export const CatalogBadgeSelectorWidgetView: FC<CatalogBadgeSelectorWidgetViewPr
|
||||
setBadges(event.badges);
|
||||
}, []);
|
||||
|
||||
useUiEvent(InventoryBadgesUpdatedEvent.BADGES_UPDATED, onInventoryBadgesUpdatedEvent);
|
||||
UseUiEvent(InventoryBadgesUpdatedEvent.BADGES_UPDATED, onInventoryBadgesUpdatedEvent);
|
||||
|
||||
const previewStuffData = useMemo(() =>
|
||||
{
|
||||
@ -55,7 +53,7 @@ export const CatalogBadgeSelectorWidgetView: FC<CatalogBadgeSelectorWidgetViewPr
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
dispatchUiEvent(new InventoryBadgesRequestEvent(InventoryBadgesRequestEvent.REQUEST_BADGES));
|
||||
DispatchUiEvent(new InventoryBadgesRequestEvent(InventoryBadgesRequestEvent.REQUEST_BADGES));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { StringDataType } from '@nitrots/nitro-renderer';
|
||||
import { FC, useMemo } from 'react';
|
||||
import { BaseProps } from '../../../../../common/Base';
|
||||
import { BaseProps } from '../../../../../common';
|
||||
import { BadgeImageView } from '../../../../../views/shared/badge-image/BadgeImageView';
|
||||
import { useCatalogContext } from '../../../CatalogContext';
|
||||
|
||||
|
@ -1,10 +1,7 @@
|
||||
import { CatalogGroupsComposer, StringDataType } from '@nitrots/nitro-renderer';
|
||||
import { FC, useEffect, useMemo, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../../api';
|
||||
import { Base } from '../../../../../common/Base';
|
||||
import { Button } from '../../../../../common/Button';
|
||||
import { Flex } from '../../../../../common/Flex';
|
||||
import { SendMessageHook } from '../../../../../hooks';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../../api';
|
||||
import { Base, Button, Flex } from '../../../../../common';
|
||||
import { useCatalogContext } from '../../../CatalogContext';
|
||||
|
||||
export const CatalogGuildSelectorWidgetView: FC<{}> = props =>
|
||||
@ -43,7 +40,7 @@ export const CatalogGuildSelectorWidgetView: FC<{}> = props =>
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
SendMessageHook(new CatalogGroupsComposer());
|
||||
SendMessageComposer(new CatalogGroupsComposer());
|
||||
}, []);
|
||||
|
||||
if(!groups || !groups.length)
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { FC } from 'react';
|
||||
import { AutoGrid, AutoGridProps } from '../../../../../common/AutoGrid';
|
||||
import { CatalogSetExtraPurchaseParameterEvent } from '../../../../../events';
|
||||
import { dispatchUiEvent } from '../../../../../hooks';
|
||||
import { DispatchUiEvent } from '../../../../../hooks';
|
||||
import { useCatalogContext } from '../../../CatalogContext';
|
||||
import { IPurchasableOffer } from '../../../common/IPurchasableOffer';
|
||||
import { ProductTypeEnum } from '../../../common/ProductTypeEnum';
|
||||
@ -29,7 +29,7 @@ export const CatalogItemGridWidgetView: FC<CatalogItemGridWidgetViewProps> = pro
|
||||
|
||||
if(offer.product && (offer.product.productType === ProductTypeEnum.WALL))
|
||||
{
|
||||
dispatchUiEvent(new CatalogSetExtraPurchaseParameterEvent(offer.product.extraParam));
|
||||
DispatchUiEvent(new CatalogSetExtraPurchaseParameterEvent(offer.product.extraParam));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { PurchaseFromCatalogComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { CreateLinkEvent, GetClubMemberLevel, LocalizeText } from '../../../../../api';
|
||||
import { CreateLinkEvent, GetClubMemberLevel, LocalizeText, SendMessageComposer } from '../../../../../api';
|
||||
import { Button, LayoutLoadingSpinnerView } from '../../../../../common';
|
||||
import { CatalogEvent, CatalogInitGiftEvent, CatalogInitPurchaseEvent, CatalogPurchasedEvent, CatalogPurchaseFailureEvent, CatalogPurchaseNotAllowedEvent, CatalogPurchaseSoldOutEvent, CatalogWidgetEvent } from '../../../../../events';
|
||||
import { dispatchUiEvent, SendMessageHook, useUiEvent } from '../../../../../hooks';
|
||||
import { DispatchUiEvent, UseUiEvent } from '../../../../../hooks';
|
||||
import { GetCurrencyAmount } from '../../../../purse/common/CurrencyHelper';
|
||||
import { useCatalogContext } from '../../../CatalogContext';
|
||||
import { CatalogPurchaseState } from '../../../common/CatalogPurchaseState';
|
||||
@ -31,7 +31,7 @@ export const CatalogPurchaseWidgetView: FC<CatalogPurchaseWidgetViewProps> = pro
|
||||
// offer, page.pageId, extraData, quantity, previewStuffData, null, true, null
|
||||
}, [ currentOffer ]);
|
||||
|
||||
useUiEvent(CatalogWidgetEvent.INIT_PURCHASE, onCatalogInitPurchaseEvent);
|
||||
UseUiEvent(CatalogWidgetEvent.INIT_PURCHASE, onCatalogInitPurchaseEvent);
|
||||
|
||||
const onCatalogEvent = useCallback((event: CatalogEvent) =>
|
||||
{
|
||||
@ -52,10 +52,10 @@ export const CatalogPurchaseWidgetView: FC<CatalogPurchaseWidgetViewProps> = pro
|
||||
}
|
||||
}, []);
|
||||
|
||||
useUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogEvent);
|
||||
useUiEvent(CatalogPurchaseFailureEvent.PURCHASE_FAILED, onCatalogEvent);
|
||||
useUiEvent(CatalogPurchaseNotAllowedEvent.NOT_ALLOWED, onCatalogEvent);
|
||||
useUiEvent(CatalogPurchaseSoldOutEvent.SOLD_OUT, onCatalogEvent);
|
||||
UseUiEvent(CatalogPurchasedEvent.PURCHASE_SUCCESS, onCatalogEvent);
|
||||
UseUiEvent(CatalogPurchaseFailureEvent.PURCHASE_FAILED, onCatalogEvent);
|
||||
UseUiEvent(CatalogPurchaseNotAllowedEvent.NOT_ALLOWED, onCatalogEvent);
|
||||
UseUiEvent(CatalogPurchaseSoldOutEvent.SOLD_OUT, onCatalogEvent);
|
||||
|
||||
const isLimitedSoldOut = useMemo(() =>
|
||||
{
|
||||
@ -86,7 +86,7 @@ export const CatalogPurchaseWidgetView: FC<CatalogPurchaseWidgetViewProps> = pro
|
||||
|
||||
if(isGift)
|
||||
{
|
||||
dispatchUiEvent(new CatalogInitGiftEvent(currentOffer.page.pageId, currentOffer.offerId, extraData));
|
||||
DispatchUiEvent(new CatalogInitGiftEvent(currentOffer.page.pageId, currentOffer.offerId, extraData));
|
||||
|
||||
return;
|
||||
}
|
||||
@ -109,7 +109,7 @@ export const CatalogPurchaseWidgetView: FC<CatalogPurchaseWidgetViewProps> = pro
|
||||
// if(nodes) pageId = nodes[0].pageId;
|
||||
// }
|
||||
|
||||
SendMessageHook(new PurchaseFromCatalogComposer(pageId, currentOffer.offerId, extraData, quantity));
|
||||
SendMessageComposer(new PurchaseFromCatalogComposer(pageId, currentOffer.offerId, extraData, quantity));
|
||||
}, [ currentOffer, purchaseCallback, extraData, quantity ]);
|
||||
|
||||
useEffect(() =>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { GetGuestRoomResultEvent, RoomSessionChatEvent, RoomSessionEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { GetRoomSession } from '../../api';
|
||||
import { CreateMessageHook, useRoomSessionManagerEvent } from '../../hooks';
|
||||
import { UseMessageEventHook, UseRoomSessionManagerEvent } from '../../hooks';
|
||||
import { useChatHistoryContext } from './ChatHistoryContext';
|
||||
import { ChatEntryType } from './common/ChatEntryType';
|
||||
import { IChatEntry } from './common/IChatEntry';
|
||||
@ -64,7 +64,7 @@ export const ChatHistoryMessageHandler: FC<{}> = props =>
|
||||
addChatEntry(entry);
|
||||
}, [addChatEntry]);
|
||||
|
||||
useRoomSessionManagerEvent(RoomSessionChatEvent.CHAT_EVENT, onChatEvent);
|
||||
UseRoomSessionManagerEvent(RoomSessionChatEvent.CHAT_EVENT, onChatEvent);
|
||||
|
||||
const onRoomSessionEvent = useCallback((event: RoomSessionEvent) =>
|
||||
{
|
||||
@ -79,8 +79,8 @@ export const ChatHistoryMessageHandler: FC<{}> = props =>
|
||||
}
|
||||
}, []);
|
||||
|
||||
useRoomSessionManagerEvent(RoomSessionEvent.ENDED, onRoomSessionEvent);
|
||||
useRoomSessionManagerEvent(RoomSessionEvent.STARTED, onRoomSessionEvent);
|
||||
UseRoomSessionManagerEvent(RoomSessionEvent.ENDED, onRoomSessionEvent);
|
||||
UseRoomSessionManagerEvent(RoomSessionEvent.STARTED, onRoomSessionEvent);
|
||||
|
||||
const onGetGuestRoomResultEvent = useCallback((event: GetGuestRoomResultEvent) =>
|
||||
{
|
||||
@ -106,7 +106,7 @@ export const ChatHistoryMessageHandler: FC<{}> = props =>
|
||||
}
|
||||
}, [addChatEntry, addRoomHistoryEntry, needsRoomInsert]);
|
||||
|
||||
CreateMessageHook(GetGuestRoomResultEvent, onGetGuestRoomResultEvent);
|
||||
UseMessageEventHook(GetGuestRoomResultEvent, onGetGuestRoomResultEvent);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { GroupBadgePartsComposer, GroupBadgePartsEvent, GroupPurchasedEvent, GroupSettingsComposer, ILinkEventTracker } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { AddEventLinkTracker, RemoveLinkEventTracker, TryVisitRoom } from '../../api';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../hooks';
|
||||
import { AddEventLinkTracker, RemoveLinkEventTracker, SendMessageComposer, TryVisitRoom } from '../../api';
|
||||
import { UseMessageEventHook } from '../../hooks';
|
||||
import { CompareId } from './common/CompareId';
|
||||
import { IGroupCustomize } from './common/IGroupCustomize';
|
||||
import { GroupsContextProvider } from './GroupsContext';
|
||||
@ -23,7 +23,7 @@ export const GroupsView: FC<{}> = props =>
|
||||
TryVisitRoom(parser.roomId);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(GroupPurchasedEvent, onGroupPurchasedEvent);
|
||||
UseMessageEventHook(GroupPurchasedEvent, onGroupPurchasedEvent);
|
||||
|
||||
const onGroupBadgePartsEvent = useCallback((event: GroupBadgePartsEvent) =>
|
||||
{
|
||||
@ -52,7 +52,7 @@ export const GroupsView: FC<{}> = props =>
|
||||
setGroupCustomize(customize);
|
||||
}, [ setGroupCustomize ]);
|
||||
|
||||
CreateMessageHook(GroupBadgePartsEvent, onGroupBadgePartsEvent);
|
||||
UseMessageEventHook(GroupBadgePartsEvent, onGroupBadgePartsEvent);
|
||||
|
||||
const linkReceived = useCallback((url: string) =>
|
||||
{
|
||||
@ -69,7 +69,7 @@ export const GroupsView: FC<{}> = props =>
|
||||
if(!parts[2]) return;
|
||||
|
||||
setCreatorVisible(false);
|
||||
SendMessageHook(new GroupSettingsComposer(Number(parts[2])));
|
||||
SendMessageComposer(new GroupSettingsComposer(Number(parts[2])));
|
||||
return;
|
||||
}
|
||||
}, []);
|
||||
@ -88,7 +88,7 @@ export const GroupsView: FC<{}> = props =>
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
SendMessageHook(new GroupBadgePartsComposer());
|
||||
SendMessageComposer(new GroupBadgePartsComposer());
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { GroupBuyComposer, GroupBuyDataComposer, GroupBuyDataEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { HasHabboClub, LocalizeText } from '../../../api';
|
||||
import { HasHabboClub, LocalizeText, SendMessageComposer } from '../../../api';
|
||||
import { Base, Button, Column, Flex, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../common';
|
||||
import { BatchUpdates, CreateMessageHook, SendMessageHook } from '../../../hooks';
|
||||
import { BatchUpdates, UseMessageEventHook } from '../../../hooks';
|
||||
import { IGroupData } from '../common/IGroupData';
|
||||
import { GroupTabBadgeView } from './tabs/GroupTabBadgeView';
|
||||
import { GroupTabColorsView } from './tabs/GroupTabColorsView';
|
||||
@ -49,7 +49,7 @@ export const GroupCreatorView: FC<GroupCreatorViewProps> = props =>
|
||||
}
|
||||
});
|
||||
|
||||
SendMessageHook(new GroupBuyComposer(groupData.groupName, groupData.groupDescription, groupData.groupHomeroomId, groupData.groupColors[0], groupData.groupColors[1], badge));
|
||||
SendMessageComposer(new GroupBuyComposer(groupData.groupName, groupData.groupDescription, groupData.groupHomeroomId, groupData.groupColors[0], groupData.groupColors[1], badge));
|
||||
}
|
||||
|
||||
const previousStep = () =>
|
||||
@ -101,7 +101,7 @@ export const GroupCreatorView: FC<GroupCreatorViewProps> = props =>
|
||||
});
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(GroupBuyDataEvent, onGroupBuyDataEvent);
|
||||
UseMessageEventHook(GroupBuyDataEvent, onGroupBuyDataEvent);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
@ -121,7 +121,7 @@ export const GroupCreatorView: FC<GroupCreatorViewProps> = props =>
|
||||
});
|
||||
});
|
||||
|
||||
SendMessageHook(new GroupBuyDataComposer());
|
||||
SendMessageComposer(new GroupBuyDataComposer());
|
||||
}, [ setGroupData ]);
|
||||
|
||||
if(!groupData) return null;
|
||||
|
@ -2,7 +2,7 @@ import { GroupInformationEvent, GroupInformationParser } from '@nitrots/nitro-re
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { LocalizeText } from '../../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../common';
|
||||
import { CreateMessageHook } from '../../../hooks';
|
||||
import { UseMessageEventHook } from '../../../hooks';
|
||||
import { GroupInformationView } from './GroupInformationView';
|
||||
|
||||
export const GroupInformationStandaloneView: FC<{}> = props =>
|
||||
@ -16,7 +16,7 @@ export const GroupInformationStandaloneView: FC<{}> = props =>
|
||||
if((groupInformation && (groupInformation.id === parser.id)) || parser.flag) setGroupInformation(parser);
|
||||
}, [ groupInformation ]);
|
||||
|
||||
CreateMessageHook(GroupInformationEvent, onGroupInformationEvent);
|
||||
UseMessageEventHook(GroupInformationEvent, onGroupInformationEvent);
|
||||
|
||||
if(!groupInformation) return null;
|
||||
|
||||
|
@ -1,11 +1,7 @@
|
||||
import { GroupInformationParser, GroupRemoveMemberComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { CreateLinkEvent, GetSessionDataManager, LocalizeText, TryVisitRoom } from '../../../api';
|
||||
import { GetGroupManager } from '../../../api/groups/GetGroupManager';
|
||||
import { GetGroupMembers } from '../../../api/groups/GetGroupMembers';
|
||||
import { TryJoinGroup } from '../../../api/groups/TryJoinGroup';
|
||||
import { CreateLinkEvent, GetGroupManager, GetGroupMembers, GetSessionDataManager, LocalizeText, SendMessageComposer, TryJoinGroup, TryVisitRoom } from '../../../api';
|
||||
import { Button, Column, Flex, Grid, Text } from '../../../common';
|
||||
import { SendMessageHook } from '../../../hooks';
|
||||
import { NotificationUtilities } from '../../../views/notification-center/common/NotificationUtilities';
|
||||
import { BadgeImageView } from '../../../views/shared/badge-image/BadgeImageView';
|
||||
import { CatalogPageName } from '../../catalog/common/CatalogPageName';
|
||||
@ -33,7 +29,7 @@ export const GroupInformationView: FC<GroupInformationViewProps> = props =>
|
||||
{
|
||||
NotificationUtilities.confirm(LocalizeText('group.leaveconfirm.desc'), () =>
|
||||
{
|
||||
SendMessageHook(new GroupRemoveMemberComposer(groupInformation.id, GetSessionDataManager().userId));
|
||||
SendMessageComposer(new GroupRemoveMemberComposer(groupInformation.id, GetSessionDataManager().userId));
|
||||
|
||||
if(onClose) onClose();
|
||||
}, null);
|
||||
|
@ -2,7 +2,7 @@ import { GroupBadgePart, GroupInformationEvent, GroupSettingsEvent } from '@nitr
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { LocalizeText } from '../../../api';
|
||||
import { Base, Column, Flex, NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView, Text } from '../../../common';
|
||||
import { CreateMessageHook } from '../../../hooks';
|
||||
import { UseMessageEventHook } from '../../../hooks';
|
||||
import { IGroupData } from '../common/IGroupData';
|
||||
import { GroupTabBadgeView } from './tabs/GroupTabBadgeView';
|
||||
import { GroupTabColorsView } from './tabs/GroupTabColorsView';
|
||||
@ -55,7 +55,7 @@ export const GroupManagerView: FC<{}> = props =>
|
||||
});
|
||||
}, [ groupData ]);
|
||||
|
||||
CreateMessageHook(GroupInformationEvent, onGroupInformationEvent);
|
||||
UseMessageEventHook(GroupInformationEvent, onGroupInformationEvent);
|
||||
|
||||
const onGroupSettingsEvent = useCallback((event: GroupSettingsEvent) =>
|
||||
{
|
||||
@ -85,7 +85,7 @@ export const GroupManagerView: FC<{}> = props =>
|
||||
});
|
||||
}, [ setGroupData ]);
|
||||
|
||||
CreateMessageHook(GroupSettingsEvent, onGroupSettingsEvent);
|
||||
UseMessageEventHook(GroupSettingsEvent, onGroupSettingsEvent);
|
||||
|
||||
if(!groupData || (groupData.groupId <= 0)) return null;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { GroupAdminGiveComposer, GroupAdminTakeComposer, GroupConfirmMemberRemoveEvent, GroupConfirmRemoveMemberComposer, GroupMemberParser, GroupMembersComposer, GroupMembersEvent, GroupMembershipAcceptComposer, GroupMembershipDeclineComposer, GroupMembersParser, GroupRank, GroupRemoveMemberComposer, ILinkEventTracker } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { AddEventLinkTracker, GetSessionDataManager, GetUserProfile, LocalizeText, RemoveLinkEventTracker } from '../../../api';
|
||||
import { AddEventLinkTracker, GetSessionDataManager, GetUserProfile, LocalizeText, RemoveLinkEventTracker, SendMessageComposer } from '../../../api';
|
||||
import { Base, Button, Column, Flex, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../common';
|
||||
import { BatchUpdates, CreateMessageHook, SendMessageHook } from '../../../hooks';
|
||||
import { BatchUpdates, UseMessageEventHook } from '../../../hooks';
|
||||
import { NotificationUtilities } from '../../../views/notification-center/common/NotificationUtilities';
|
||||
import { AvatarImageView } from '../../../views/shared/avatar-image/AvatarImageView';
|
||||
import { BadgeImageView } from '../../../views/shared/badge-image/BadgeImageView';
|
||||
@ -36,15 +36,15 @@ export const GroupMembersView: FC<{}> = props =>
|
||||
{
|
||||
if((groupId === -1) || (levelId === -1) || (pageId === -1)) return;
|
||||
|
||||
SendMessageHook(new GroupMembersComposer(groupId, pageId, searchQuery, levelId));
|
||||
SendMessageComposer(new GroupMembersComposer(groupId, pageId, searchQuery, levelId));
|
||||
}, [ groupId, levelId, pageId, searchQuery ]);
|
||||
|
||||
const toggleAdmin = (member: GroupMemberParser) =>
|
||||
{
|
||||
if(!membersData.admin || (member.rank === GroupRank.OWNER)) return;
|
||||
|
||||
if(member.rank !== GroupRank.ADMIN) SendMessageHook(new GroupAdminGiveComposer(membersData.groupId, member.id));
|
||||
else SendMessageHook(new GroupAdminTakeComposer(membersData.groupId, member.id));
|
||||
if(member.rank !== GroupRank.ADMIN) SendMessageComposer(new GroupAdminGiveComposer(membersData.groupId, member.id));
|
||||
else SendMessageComposer(new GroupAdminTakeComposer(membersData.groupId, member.id));
|
||||
|
||||
refreshMembers();
|
||||
}
|
||||
@ -53,7 +53,7 @@ export const GroupMembersView: FC<{}> = props =>
|
||||
{
|
||||
if(!membersData.admin || (member.rank !== GroupRank.REQUESTED)) return;
|
||||
|
||||
SendMessageHook(new GroupMembershipAcceptComposer(membersData.groupId, member.id));
|
||||
SendMessageComposer(new GroupMembershipAcceptComposer(membersData.groupId, member.id));
|
||||
|
||||
refreshMembers();
|
||||
}
|
||||
@ -64,7 +64,7 @@ export const GroupMembersView: FC<{}> = props =>
|
||||
|
||||
if(member.rank === GroupRank.REQUESTED)
|
||||
{
|
||||
SendMessageHook(new GroupMembershipDeclineComposer(membersData.groupId, member.id));
|
||||
SendMessageComposer(new GroupMembershipDeclineComposer(membersData.groupId, member.id));
|
||||
|
||||
refreshMembers();
|
||||
|
||||
@ -72,7 +72,7 @@ export const GroupMembersView: FC<{}> = props =>
|
||||
}
|
||||
|
||||
setRemovingMemberName(member.name);
|
||||
SendMessageHook(new GroupConfirmRemoveMemberComposer(membersData.groupId, member.id));
|
||||
SendMessageComposer(new GroupConfirmRemoveMemberComposer(membersData.groupId, member.id));
|
||||
}
|
||||
|
||||
const onGroupMembersEvent = useCallback((event: GroupMembersEvent) =>
|
||||
@ -87,7 +87,7 @@ export const GroupMembersView: FC<{}> = props =>
|
||||
});
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(GroupMembersEvent, onGroupMembersEvent);
|
||||
UseMessageEventHook(GroupMembersEvent, onGroupMembersEvent);
|
||||
|
||||
const onGroupConfirmMemberRemoveEvent = useCallback((event: GroupConfirmMemberRemoveEvent) =>
|
||||
{
|
||||
@ -95,7 +95,7 @@ export const GroupMembersView: FC<{}> = props =>
|
||||
|
||||
NotificationUtilities.confirm(LocalizeText(((parser.furnitureCount > 0) ? 'group.kickconfirm.desc' : 'group.kickconfirm_nofurni.desc'), [ 'user', 'amount' ], [ removingMemberName, parser.furnitureCount.toString() ]), () =>
|
||||
{
|
||||
SendMessageHook(new GroupRemoveMemberComposer(membersData.groupId, parser.userId));
|
||||
SendMessageComposer(new GroupRemoveMemberComposer(membersData.groupId, parser.userId));
|
||||
|
||||
refreshMembers();
|
||||
}, null);
|
||||
@ -103,7 +103,7 @@ export const GroupMembersView: FC<{}> = props =>
|
||||
setRemovingMemberName(null);
|
||||
}, [ membersData, removingMemberName, refreshMembers ]);
|
||||
|
||||
CreateMessageHook(GroupConfirmMemberRemoveEvent, onGroupConfirmMemberRemoveEvent);
|
||||
UseMessageEventHook(GroupConfirmMemberRemoveEvent, onGroupConfirmMemberRemoveEvent);
|
||||
|
||||
const linkReceived = useCallback((url: string) =>
|
||||
{
|
||||
@ -142,7 +142,7 @@ export const GroupMembersView: FC<{}> = props =>
|
||||
{
|
||||
if((groupId === -1) || (levelId === -1) || (pageId === -1)) return;
|
||||
|
||||
SendMessageHook(new GroupMembersComposer(groupId, pageId, searchQuery, levelId));
|
||||
SendMessageComposer(new GroupMembersComposer(groupId, pageId, searchQuery, levelId));
|
||||
}, [ groupId, levelId, pageId, searchQuery ]);
|
||||
|
||||
useEffect(() =>
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { DesktopViewEvent, GetGuestRoomResultEvent, GroupInformationComposer, GroupInformationEvent, GroupInformationParser, GroupRemoveMemberComposer, HabboGroupDeactivatedMessageEvent, RoomEntryInfoMessageEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { GetGroupInformation, GetSessionDataManager, LocalizeText, TryJoinGroup } from '../../../api';
|
||||
import { GetGroupManager } from '../../../api/groups/GetGroupManager';
|
||||
import { GetGroupInformation, GetGroupManager, GetSessionDataManager, LocalizeText, SendMessageComposer, TryJoinGroup } from '../../../api';
|
||||
import { Base, Button, Column, Flex, Text } from '../../../common';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../../hooks';
|
||||
import { UseMessageEventHook } from '../../../hooks';
|
||||
import { NotificationUtilities } from '../../../views/notification-center/common/NotificationUtilities';
|
||||
import { BadgeImageView } from '../../../views/shared/badge-image/BadgeImageView';
|
||||
import { GroupMembershipType } from '../common/GroupMembershipType';
|
||||
@ -22,7 +21,7 @@ export const GroupRoomInformationView: FC<{}> = props =>
|
||||
setGroupInformation(null);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(DesktopViewEvent, onDesktopViewEvent);
|
||||
UseMessageEventHook(DesktopViewEvent, onDesktopViewEvent);
|
||||
|
||||
const onRoomEntryInfoMessageEvent = useCallback((event: RoomEntryInfoMessageEvent) =>
|
||||
{
|
||||
@ -30,7 +29,7 @@ export const GroupRoomInformationView: FC<{}> = props =>
|
||||
setGroupInformation(null);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(RoomEntryInfoMessageEvent, onRoomEntryInfoMessageEvent);
|
||||
UseMessageEventHook(RoomEntryInfoMessageEvent, onRoomEntryInfoMessageEvent);
|
||||
|
||||
const onGetGuestRoomResultEvent = useCallback((event: GetGuestRoomResultEvent) =>
|
||||
{
|
||||
@ -41,7 +40,7 @@ export const GroupRoomInformationView: FC<{}> = props =>
|
||||
if(parser.data.habboGroupId > 0)
|
||||
{
|
||||
setExpectedGroupId(parser.data.habboGroupId);
|
||||
SendMessageHook(new GroupInformationComposer(parser.data.habboGroupId, false));
|
||||
SendMessageComposer(new GroupInformationComposer(parser.data.habboGroupId, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -50,7 +49,7 @@ export const GroupRoomInformationView: FC<{}> = props =>
|
||||
}
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(GetGuestRoomResultEvent, onGetGuestRoomResultEvent);
|
||||
UseMessageEventHook(GetGuestRoomResultEvent, onGetGuestRoomResultEvent);
|
||||
|
||||
const onHabboGroupDeactivatedMessageEvent = useCallback((event: HabboGroupDeactivatedMessageEvent) =>
|
||||
{
|
||||
@ -62,7 +61,7 @@ export const GroupRoomInformationView: FC<{}> = props =>
|
||||
setGroupInformation(null);
|
||||
}, [ expectedGroupId, groupInformation ]);
|
||||
|
||||
CreateMessageHook(HabboGroupDeactivatedMessageEvent, onHabboGroupDeactivatedMessageEvent);
|
||||
UseMessageEventHook(HabboGroupDeactivatedMessageEvent, onHabboGroupDeactivatedMessageEvent);
|
||||
|
||||
const onGroupInformationEvent = useCallback((event: GroupInformationEvent) =>
|
||||
{
|
||||
@ -73,13 +72,13 @@ export const GroupRoomInformationView: FC<{}> = props =>
|
||||
setGroupInformation(parser);
|
||||
}, [ expectedGroupId ]);
|
||||
|
||||
CreateMessageHook(GroupInformationEvent, onGroupInformationEvent);
|
||||
UseMessageEventHook(GroupInformationEvent, onGroupInformationEvent);
|
||||
|
||||
const leaveGroup = () =>
|
||||
{
|
||||
NotificationUtilities.confirm(LocalizeText('group.leaveconfirm.desc'), () =>
|
||||
{
|
||||
SendMessageHook(new GroupRemoveMemberComposer(groupInformation.id, GetSessionDataManager().userId));
|
||||
SendMessageComposer(new GroupRemoveMemberComposer(groupInformation.id, GetSessionDataManager().userId));
|
||||
}, null);
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { GroupSaveBadgeComposer } from '@nitrots/nitro-renderer';
|
||||
import { Dispatch, FC, SetStateAction, useCallback, useEffect, useState } from 'react';
|
||||
import { SendMessageComposer } from '../../../../api';
|
||||
import { Column, Flex, Grid } from '../../../../common';
|
||||
import { SendMessageHook } from '../../../../hooks';
|
||||
import { BadgeImageView } from '../../../../views/shared/badge-image/BadgeImageView';
|
||||
import { GroupBadgePart } from '../../common/GroupBadgePart';
|
||||
import { IGroupData } from '../../common/IGroupData';
|
||||
@ -64,7 +64,7 @@ export const GroupTabBadgeView: FC<GroupTabBadgeViewProps> = props =>
|
||||
badge.push(part.position);
|
||||
});
|
||||
|
||||
SendMessageHook(new GroupSaveBadgeComposer(groupData.groupId, badge));
|
||||
SendMessageComposer(new GroupSaveBadgeComposer(groupData.groupId, badge));
|
||||
|
||||
return true;
|
||||
}, [ groupData, badgeParts, setGroupData ]);
|
||||
|
@ -1,9 +1,8 @@
|
||||
import { GroupSaveColorsComposer } from '@nitrots/nitro-renderer';
|
||||
import classNames from 'classnames';
|
||||
import { Dispatch, FC, SetStateAction, useCallback, useEffect, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../api';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { AutoGrid, Base, Column, Flex, Grid, Text } from '../../../../common';
|
||||
import { SendMessageHook } from '../../../../hooks';
|
||||
import { IGroupData } from '../../common/IGroupData';
|
||||
import { useGroupsContext } from '../../GroupsContext';
|
||||
|
||||
@ -59,7 +58,7 @@ export const GroupTabColorsView: FC<GroupTabColorsViewProps> = props =>
|
||||
return true;
|
||||
}
|
||||
|
||||
SendMessageHook(new GroupSaveColorsComposer(groupData.groupId, colors[0], colors[1]));
|
||||
SendMessageComposer(new GroupSaveColorsComposer(groupData.groupId, colors[0], colors[1]));
|
||||
|
||||
return true;
|
||||
}, [ groupData, colors, setGroupData ]);
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { GroupDeleteComposer, GroupSaveInformationComposer } from '@nitrots/nitro-renderer';
|
||||
import { Dispatch, FC, SetStateAction, useCallback, useEffect, useState } from 'react';
|
||||
import { CreateLinkEvent, LocalizeText } from '../../../../api';
|
||||
import { CreateLinkEvent, LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { Base, Button, Column, Flex, Text } from '../../../../common';
|
||||
import { BatchUpdates, SendMessageHook } from '../../../../hooks';
|
||||
import { BatchUpdates } from '../../../../hooks';
|
||||
import { NotificationUtilities } from '../../../../views/notification-center/common/NotificationUtilities';
|
||||
import { IGroupData } from '../../common/IGroupData';
|
||||
|
||||
@ -28,7 +28,7 @@ export const GroupTabIdentityView: FC<GroupTabIdentityViewProps> = props =>
|
||||
|
||||
NotificationUtilities.confirm(LocalizeText('group.deleteconfirm.desc'), () =>
|
||||
{
|
||||
SendMessageHook(new GroupDeleteComposer(groupData.groupId));
|
||||
SendMessageComposer(new GroupDeleteComposer(groupData.groupId));
|
||||
}, null, null, null, LocalizeText('group.deleteconfirm.title'));
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ export const GroupTabIdentityView: FC<GroupTabIdentityViewProps> = props =>
|
||||
return true;
|
||||
}
|
||||
|
||||
SendMessageHook(new GroupSaveInformationComposer(groupData.groupId, groupName, (groupDescription || '')));
|
||||
SendMessageComposer(new GroupSaveInformationComposer(groupData.groupId, groupName, (groupDescription || '')));
|
||||
|
||||
return true;
|
||||
}, [ groupData, groupName, groupDescription, groupHomeroomId, setGroupData ]);
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { GroupSavePreferencesComposer } from '@nitrots/nitro-renderer';
|
||||
import { Dispatch, FC, SetStateAction, useCallback, useEffect, useState } from 'react';
|
||||
import { SendMessageComposer } from '../../../../api';
|
||||
import { LocalizeText } from '../../../../api/utils/LocalizeText';
|
||||
import { Column, Flex, HorizontalRule, Text } from '../../../../common';
|
||||
import { BatchUpdates, SendMessageHook } from '../../../../hooks';
|
||||
import { BatchUpdates } from '../../../../hooks';
|
||||
import { IGroupData } from '../../common/IGroupData';
|
||||
|
||||
const STATES: string[] = [ 'regular', 'exclusive', 'private' ];
|
||||
@ -41,7 +42,7 @@ export const GroupTabSettingsView: FC<GroupTabSettingsViewProps> = props =>
|
||||
return true;
|
||||
}
|
||||
|
||||
SendMessageHook(new GroupSavePreferencesComposer(groupData.groupId, groupState, groupDecorate ? 0 : 1));
|
||||
SendMessageComposer(new GroupSavePreferencesComposer(groupData.groupId, groupState, groupDecorate ? 0 : 1));
|
||||
|
||||
return true;
|
||||
}, [ groupData, groupState, groupDecorate, setGroupData ]);
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { GuideOnDutyStatusMessageEvent, GuideSessionAttachedMessageEvent, GuideSessionDetachedMessageEvent, GuideSessionEndedMessageEvent, GuideSessionInvitedToGuideRoomMessageEvent, GuideSessionMessageMessageEvent, GuideSessionOnDutyUpdateMessageComposer, GuideSessionPartnerIsTypingMessageEvent, GuideSessionStartedMessageEvent, ILinkEventTracker, PerkAllowancesMessageEvent, PerkEnum } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { AddEventLinkTracker, GetConfiguration, GetSessionDataManager, LocalizeText, RemoveLinkEventTracker } from '../../api';
|
||||
import { AddEventLinkTracker, GetConfiguration, GetSessionDataManager, LocalizeText, RemoveLinkEventTracker, SendMessageComposer } from '../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../common';
|
||||
import { GuideToolEvent, NotificationAlertEvent } from '../../events';
|
||||
import { CreateMessageHook, dispatchUiEvent, SendMessageHook, useUiEvent } from '../../hooks';
|
||||
import { DispatchUiEvent, UseMessageEventHook, UseUiEvent } from '../../hooks';
|
||||
import { GuideSessionState } from './common/GuideSessionState';
|
||||
import { GuideToolMessage } from './common/GuideToolMessage';
|
||||
import { GuideToolMessageGroup } from './common/GuideToolMessageGroup';
|
||||
@ -103,10 +103,10 @@ export const GuideToolView: FC<{}> = props =>
|
||||
}
|
||||
}, [ updateSessionState ]);
|
||||
|
||||
useUiEvent(GuideToolEvent.SHOW_GUIDE_TOOL, onGuideToolEvent);
|
||||
useUiEvent(GuideToolEvent.HIDE_GUIDE_TOOL, onGuideToolEvent);
|
||||
useUiEvent(GuideToolEvent.TOGGLE_GUIDE_TOOL, onGuideToolEvent);
|
||||
useUiEvent(GuideToolEvent.CREATE_HELP_REQUEST, onGuideToolEvent);
|
||||
UseUiEvent(GuideToolEvent.SHOW_GUIDE_TOOL, onGuideToolEvent);
|
||||
UseUiEvent(GuideToolEvent.HIDE_GUIDE_TOOL, onGuideToolEvent);
|
||||
UseUiEvent(GuideToolEvent.TOGGLE_GUIDE_TOOL, onGuideToolEvent);
|
||||
UseUiEvent(GuideToolEvent.CREATE_HELP_REQUEST, onGuideToolEvent);
|
||||
|
||||
const onPerkAllowancesMessageEvent = useCallback((event: PerkAllowancesMessageEvent) =>
|
||||
{
|
||||
@ -115,11 +115,11 @@ export const GuideToolView: FC<{}> = props =>
|
||||
if(!parser.isAllowed(PerkEnum.USE_GUIDE_TOOL) && isOnDuty)
|
||||
{
|
||||
setIsOnDuty(false);
|
||||
SendMessageHook(new GuideSessionOnDutyUpdateMessageComposer(false, false, false, false));
|
||||
SendMessageComposer(new GuideSessionOnDutyUpdateMessageComposer(false, false, false, false));
|
||||
}
|
||||
}, [ isOnDuty, setIsOnDuty ]);
|
||||
|
||||
CreateMessageHook(PerkAllowancesMessageEvent, onPerkAllowancesMessageEvent);
|
||||
UseMessageEventHook(PerkAllowancesMessageEvent, onPerkAllowancesMessageEvent);
|
||||
|
||||
const onGuideOnDutyStatusMessageEvent = useCallback((event: GuideOnDutyStatusMessageEvent) =>
|
||||
{
|
||||
@ -131,7 +131,7 @@ export const GuideToolView: FC<{}> = props =>
|
||||
setGuardiansOnDuty(parser.guardiansOnDuty);
|
||||
}, [ setIsOnDuty, setHelpersOnDuty, setGuidesOnDuty, setGuardiansOnDuty ]);
|
||||
|
||||
CreateMessageHook(GuideOnDutyStatusMessageEvent, onGuideOnDutyStatusMessageEvent);
|
||||
UseMessageEventHook(GuideOnDutyStatusMessageEvent, onGuideOnDutyStatusMessageEvent);
|
||||
|
||||
const onGuideSessionAttachedMessageEvent = useCallback((event: GuideSessionAttachedMessageEvent) =>
|
||||
{
|
||||
@ -146,7 +146,7 @@ export const GuideToolView: FC<{}> = props =>
|
||||
|
||||
}, [ isOnDuty, updateSessionState ]);
|
||||
|
||||
CreateMessageHook(GuideSessionAttachedMessageEvent, onGuideSessionAttachedMessageEvent);
|
||||
UseMessageEventHook(GuideSessionAttachedMessageEvent, onGuideSessionAttachedMessageEvent);
|
||||
|
||||
const onGuideSessionStartedMessageEvent = useCallback((event: GuideSessionStartedMessageEvent) =>
|
||||
{
|
||||
@ -168,7 +168,7 @@ export const GuideToolView: FC<{}> = props =>
|
||||
}
|
||||
}, [ isOnDuty, updateSessionState ]);
|
||||
|
||||
CreateMessageHook(GuideSessionStartedMessageEvent, onGuideSessionStartedMessageEvent);
|
||||
UseMessageEventHook(GuideSessionStartedMessageEvent, onGuideSessionStartedMessageEvent);
|
||||
|
||||
const onGuideSessionPartnerIsTypingMessageEvent = useCallback((event: GuideSessionPartnerIsTypingMessageEvent) =>
|
||||
{
|
||||
@ -177,7 +177,7 @@ export const GuideToolView: FC<{}> = props =>
|
||||
setOngoingIsTyping(parser.isTyping);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(GuideSessionPartnerIsTypingMessageEvent, onGuideSessionPartnerIsTypingMessageEvent);
|
||||
UseMessageEventHook(GuideSessionPartnerIsTypingMessageEvent, onGuideSessionPartnerIsTypingMessageEvent);
|
||||
|
||||
const onGuideSessionMessageMessageEvent = useCallback((event: GuideSessionMessageMessageEvent) =>
|
||||
{
|
||||
@ -197,7 +197,7 @@ export const GuideToolView: FC<{}> = props =>
|
||||
setOngoingMessageGroups(messageGroups);
|
||||
}, [ ongoingMessageGroups ]);
|
||||
|
||||
CreateMessageHook(GuideSessionMessageMessageEvent, onGuideSessionMessageMessageEvent);
|
||||
UseMessageEventHook(GuideSessionMessageMessageEvent, onGuideSessionMessageMessageEvent);
|
||||
|
||||
const onGuideSessionInvitedToGuideRoomMessageEvent = useCallback((event: GuideSessionInvitedToGuideRoomMessageEvent) =>
|
||||
{
|
||||
@ -219,7 +219,7 @@ export const GuideToolView: FC<{}> = props =>
|
||||
setOngoingMessageGroups(messageGroups);
|
||||
}, [isOnDuty, ongoingMessageGroups, ongoingUserId]);
|
||||
|
||||
CreateMessageHook(GuideSessionInvitedToGuideRoomMessageEvent, onGuideSessionInvitedToGuideRoomMessageEvent);
|
||||
UseMessageEventHook(GuideSessionInvitedToGuideRoomMessageEvent, onGuideSessionInvitedToGuideRoomMessageEvent);
|
||||
|
||||
const onGuideSessionEndedMessageEvent = useCallback((event: GuideSessionEndedMessageEvent) =>
|
||||
{
|
||||
@ -238,7 +238,7 @@ export const GuideToolView: FC<{}> = props =>
|
||||
}
|
||||
}, [ isOnDuty, updateSessionState ]);
|
||||
|
||||
CreateMessageHook(GuideSessionEndedMessageEvent, onGuideSessionEndedMessageEvent);
|
||||
UseMessageEventHook(GuideSessionEndedMessageEvent, onGuideSessionEndedMessageEvent);
|
||||
|
||||
const onGuideSessionDetachedMessageEvent = useCallback((event: GuideSessionDetachedMessageEvent) =>
|
||||
{
|
||||
@ -259,7 +259,7 @@ export const GuideToolView: FC<{}> = props =>
|
||||
}
|
||||
}, [ isOnDuty, updateSessionState ]);
|
||||
|
||||
CreateMessageHook(GuideSessionDetachedMessageEvent, onGuideSessionDetachedMessageEvent);
|
||||
UseMessageEventHook(GuideSessionDetachedMessageEvent, onGuideSessionDetachedMessageEvent);
|
||||
|
||||
const linkReceived = useCallback((url: string) =>
|
||||
{
|
||||
@ -299,13 +299,13 @@ export const GuideToolView: FC<{}> = props =>
|
||||
case 'toggle_duty':
|
||||
if(!isHandlingBullyReports && !isHandlingGuideRequests && !isHandlingHelpRequests)
|
||||
{
|
||||
dispatchUiEvent(new NotificationAlertEvent([LocalizeText('guide.help.guide.tool.noqueueselected.message')], null, null, null, LocalizeText('guide.help.guide.tool.noqueueselected.caption'), null));
|
||||
DispatchUiEvent(new NotificationAlertEvent([LocalizeText('guide.help.guide.tool.noqueueselected.message')], null, null, null, LocalizeText('guide.help.guide.tool.noqueueselected.caption'), null));
|
||||
return;
|
||||
}
|
||||
|
||||
setIsOnDuty(v =>
|
||||
{
|
||||
SendMessageHook(new GuideSessionOnDutyUpdateMessageComposer(!v, v ? false : isHandlingGuideRequests, v ? false : isHandlingHelpRequests, v ? false : isHandlingBullyReports));
|
||||
SendMessageComposer(new GuideSessionOnDutyUpdateMessageComposer(!v, v ? false : isHandlingGuideRequests, v ? false : isHandlingHelpRequests, v ? false : isHandlingBullyReports));
|
||||
return !v;
|
||||
});
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { GuideSessionGuideDecidesMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC } from 'react';
|
||||
import { LocalizeText } from '../../../api';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../api';
|
||||
import { Button, Column, Text } from '../../../common';
|
||||
import { SendMessageHook } from '../../../hooks';
|
||||
|
||||
interface GuideToolAcceptViewProps
|
||||
{
|
||||
@ -14,7 +13,7 @@ export const GuideToolAcceptView: FC<GuideToolAcceptViewProps> = props =>
|
||||
{
|
||||
const { helpRequestDescription = null, helpRequestAverageTime = 0 } = props;
|
||||
|
||||
const answerRequest = (response: boolean) => SendMessageHook(new GuideSessionGuideDecidesMessageComposer(response));
|
||||
const answerRequest = (response: boolean) => SendMessageComposer(new GuideSessionGuideDecidesMessageComposer(response));
|
||||
|
||||
return (
|
||||
<Column>
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { GuideSessionGetRequesterRoomMessageComposer, GuideSessionInviteRequesterMessageComposer, GuideSessionRequesterRoomMessageEvent, GuideSessionResolvedMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { GuideSessionMessageMessageComposer } from '@nitrots/nitro-renderer/src';
|
||||
import { FC, KeyboardEvent, useCallback, useState } from 'react';
|
||||
import { GetSessionDataManager, LocalizeText, TryVisitRoom } from '../../../api';
|
||||
import { GetSessionDataManager, LocalizeText, SendMessageComposer, TryVisitRoom } from '../../../api';
|
||||
import { Base, Button, ButtonGroup, Column, Flex, Text } from '../../../common';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../../hooks';
|
||||
import { UseMessageEventHook } from '../../../hooks';
|
||||
import { AvatarImageView } from '../../../views/shared/avatar-image/AvatarImageView';
|
||||
import { GuideToolMessageGroup } from '../common/GuideToolMessageGroup';
|
||||
|
||||
@ -25,17 +25,17 @@ export const GuideToolOngoingView: FC<GuideToolOngoingViewProps> = props =>
|
||||
|
||||
const visit = useCallback(() =>
|
||||
{
|
||||
SendMessageHook(new GuideSessionGetRequesterRoomMessageComposer());
|
||||
SendMessageComposer(new GuideSessionGetRequesterRoomMessageComposer());
|
||||
}, []);
|
||||
|
||||
const invite = useCallback(() =>
|
||||
{
|
||||
SendMessageHook(new GuideSessionInviteRequesterMessageComposer());
|
||||
SendMessageComposer(new GuideSessionInviteRequesterMessageComposer());
|
||||
}, []);
|
||||
|
||||
const resolve = useCallback(() =>
|
||||
{
|
||||
SendMessageHook(new GuideSessionResolvedMessageComposer());
|
||||
SendMessageComposer(new GuideSessionResolvedMessageComposer());
|
||||
}, []);
|
||||
|
||||
const onGuideSessionRequesterRoomMessageEvent = useCallback((event: GuideSessionRequesterRoomMessageEvent) =>
|
||||
@ -45,13 +45,13 @@ export const GuideToolOngoingView: FC<GuideToolOngoingViewProps> = props =>
|
||||
TryVisitRoom(parser.requesterRoomId);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(GuideSessionRequesterRoomMessageEvent, onGuideSessionRequesterRoomMessageEvent);
|
||||
UseMessageEventHook(GuideSessionRequesterRoomMessageEvent, onGuideSessionRequesterRoomMessageEvent);
|
||||
|
||||
const sendMessage = useCallback(() =>
|
||||
{
|
||||
if(!messageText || !messageText.length) return;
|
||||
|
||||
SendMessageHook(new GuideSessionMessageMessageComposer(messageText));
|
||||
SendMessageComposer(new GuideSessionMessageMessageComposer(messageText));
|
||||
setMessageText('');
|
||||
}, [ messageText ]);
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { GuideSessionCreateMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useState } from 'react';
|
||||
import { LocalizeText } from '../../../api';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../api';
|
||||
import { Button, Column, Text } from '../../../common';
|
||||
import { SendMessageHook } from '../../../hooks';
|
||||
|
||||
interface GuideToolUserCreateRequestViewProps
|
||||
{
|
||||
@ -20,7 +19,7 @@ export const GuideToolUserCreateRequestView: FC<GuideToolUserCreateRequestViewPr
|
||||
const sendRequest = () =>
|
||||
{
|
||||
setIsPending(true);
|
||||
SendMessageHook(new GuideSessionCreateMessageComposer(1, userRequest));
|
||||
SendMessageComposer(new GuideSessionCreateMessageComposer(1, userRequest));
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { GuideSessionFeedbackMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { LocalizeText } from '../../../api';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../api';
|
||||
import { Button, Column, Flex, Text } from '../../../common';
|
||||
import { SendMessageHook } from '../../../hooks';
|
||||
|
||||
interface GuideToolUserFeedbackViewProps
|
||||
{
|
||||
@ -15,7 +14,7 @@ export const GuideToolUserFeedbackView: FC<GuideToolUserFeedbackViewProps> = pro
|
||||
|
||||
const giveFeedback = useCallback((recommend: boolean) =>
|
||||
{
|
||||
SendMessageHook(new GuideSessionFeedbackMessageComposer(recommend));
|
||||
SendMessageComposer(new GuideSessionFeedbackMessageComposer(recommend));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { GuideSessionRequesterCancelsMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC } from 'react';
|
||||
import { LocalizeText } from '../../../api';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../api';
|
||||
import { Button, Column, Text } from '../../../common';
|
||||
import { SendMessageHook } from '../../../hooks';
|
||||
|
||||
interface GuideToolUserPendingViewProps
|
||||
{
|
||||
@ -14,7 +13,7 @@ export const GuideToolUserPendingView: FC<GuideToolUserPendingViewProps> = props
|
||||
{
|
||||
const { helpRequestDescription = null, helpRequestAverageTime = 0 } = props;
|
||||
|
||||
const cancelRequest = () => SendMessageHook(new GuideSessionRequesterCancelsMessageComposer());
|
||||
const cancelRequest = () => SendMessageComposer(new GuideSessionRequesterCancelsMessageComposer());
|
||||
|
||||
return (
|
||||
<Column>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { CallForHelpResultMessageEvent, GetPendingCallsForHelpMessageComposer, IssueCloseNotificationMessageEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { LocalizeText } from '../../api';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../hooks/messages/message-event';
|
||||
import { LocalizeText, SendMessageComposer } from '../../api';
|
||||
import { UseMessageEventHook } from '../../hooks';
|
||||
import { NotificationAlertType } from '../../views/notification-center/common/NotificationAlertType';
|
||||
import { NotificationUtilities } from '../../views/notification-center/common/NotificationUtilities';
|
||||
import { CallForHelpResult } from './common/CallForHelpResult';
|
||||
@ -18,7 +18,7 @@ export const HelpMessageHandler: FC<{}> = props =>
|
||||
switch(parser.resultType)
|
||||
{
|
||||
case CallForHelpResult.TOO_MANY_PENDING_CALLS_CODE:
|
||||
SendMessageHook(new GetPendingCallsForHelpMessageComposer());
|
||||
SendMessageComposer(new GetPendingCallsForHelpMessageComposer());
|
||||
NotificationUtilities.simpleAlert(LocalizeText('help.cfh.error.pending'), NotificationAlertType.MODERATION, null, null, LocalizeText('help.cfh.error.title'));
|
||||
break;
|
||||
case CallForHelpResult.HAS_ABUSIVE_CALL_CODE:
|
||||
@ -33,7 +33,7 @@ export const HelpMessageHandler: FC<{}> = props =>
|
||||
}
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(CallForHelpResultMessageEvent, onCallForHelpResultMessageEvent);
|
||||
UseMessageEventHook(CallForHelpResultMessageEvent, onCallForHelpResultMessageEvent);
|
||||
|
||||
const onIssueCloseNotificationMessageEvent = useCallback((event: IssueCloseNotificationMessageEvent) =>
|
||||
{
|
||||
@ -44,7 +44,7 @@ export const HelpMessageHandler: FC<{}> = props =>
|
||||
NotificationUtilities.simpleAlert(message, NotificationAlertType.MODERATION, null, null, LocalizeText('mod.alert.title'));
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(IssueCloseNotificationMessageEvent, onIssueCloseNotificationMessageEvent);
|
||||
UseMessageEventHook(IssueCloseNotificationMessageEvent, onIssueCloseNotificationMessageEvent);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -3,7 +3,7 @@ import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { AddEventLinkTracker, LocalizeText, RemoveLinkEventTracker } from '../../api';
|
||||
import { Base, Column, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../common';
|
||||
import { HelpReportUserEvent } from '../../events/help/HelpReportUserEvent';
|
||||
import { useUiEvent } from '../../hooks';
|
||||
import { UseUiEvent } from '../../hooks';
|
||||
import { IHelpReportState } from './common/IHelpReportState';
|
||||
import { HelpContextProvider } from './HelpContext';
|
||||
import { HelpMessageHandler } from './HelpMessageHandler';
|
||||
@ -63,7 +63,7 @@ export const HelpView: FC<{}> = props =>
|
||||
setIsVisible(true);
|
||||
}, []);
|
||||
|
||||
useUiEvent(HelpReportUserEvent.REPORT_USER, onHelpReportUserEvent);
|
||||
UseUiEvent(HelpReportUserEvent.REPORT_USER, onHelpReportUserEvent);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { CallForHelpMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useState } from 'react';
|
||||
import { CreateLinkEvent, LocalizeText } from '../../../api';
|
||||
import { CreateLinkEvent, LocalizeText, SendMessageComposer } from '../../../api';
|
||||
import { Button, Column, Text } from '../../../common';
|
||||
import { SendMessageHook } from '../../../hooks';
|
||||
import { useHelpContext } from '../HelpContext';
|
||||
|
||||
export const DescribeReportView: FC<{}> = props =>
|
||||
@ -24,7 +23,7 @@ export const DescribeReportView: FC<{}> = props =>
|
||||
chats.push(entry.message);
|
||||
});
|
||||
|
||||
SendMessageHook(new CallForHelpMessageComposer(message, cfhTopic, reportedUserId, roomId, chats));
|
||||
SendMessageComposer(new CallForHelpMessageComposer(message, cfhTopic, reportedUserId, roomId, chats));
|
||||
|
||||
CreateLinkEvent('help/hide');
|
||||
}
|
||||
|
@ -1,11 +1,9 @@
|
||||
import { GetCfhStatusMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { LocalizeText } from '../../../api';
|
||||
import { Button } from '../../../common/Button';
|
||||
import { Column } from '../../../common/Column';
|
||||
import { Text } from '../../../common/Text';
|
||||
import { GuideToolEvent } from '../../../events/guide-tool/GuideToolEvent';
|
||||
import { dispatchUiEvent, SendMessageHook } from '../../../hooks';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../api';
|
||||
import { Button, Column, Text } from '../../../common';
|
||||
import { GuideToolEvent } from '../../../events';
|
||||
import { DispatchUiEvent } from '../../../hooks';
|
||||
import { useHelpContext } from '../HelpContext';
|
||||
|
||||
export const HelpIndexView: FC<{}> = props =>
|
||||
@ -21,12 +19,12 @@ export const HelpIndexView: FC<{}> = props =>
|
||||
|
||||
const onRequestMySanctionStatusClick = useCallback(() =>
|
||||
{
|
||||
SendMessageHook(new GetCfhStatusMessageComposer(false));
|
||||
SendMessageComposer(new GetCfhStatusMessageComposer(false));
|
||||
}, []);
|
||||
|
||||
const onNewHelpRequestClick = useCallback(() =>
|
||||
{
|
||||
dispatchUiEvent(new GuideToolEvent(GuideToolEvent.CREATE_HELP_REQUEST));
|
||||
DispatchUiEvent(new GuideToolEvent(GuideToolEvent.CREATE_HELP_REQUEST));
|
||||
}, []);
|
||||
|
||||
return (
|
||||
|
@ -2,7 +2,7 @@ import { SanctionStatusEvent, SanctionStatusMessageParser } from '@nitrots/nitro
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { LocalizeText } from '../../../api';
|
||||
import { Base, Button, Column, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../common';
|
||||
import { CreateMessageHook } from '../../../hooks';
|
||||
import { UseMessageEventHook } from '../../../hooks';
|
||||
|
||||
export const SanctionSatusView:FC<{}> = props =>
|
||||
{
|
||||
@ -17,7 +17,7 @@ export const SanctionSatusView:FC<{}> = props =>
|
||||
setSanctionInfo(parser);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(SanctionStatusEvent, onSanctionStatusEvent);
|
||||
UseMessageEventHook(SanctionStatusEvent, onSanctionStatusEvent);
|
||||
|
||||
const sanctionLocalization = useCallback((param: string, sanctionName: string, length?: number) =>
|
||||
{
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { ChangeUserNameMessageComposer, UserNameChangeMessageEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { GetSessionDataManager, LocalizeText } from '../../../../api';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../../../hooks';
|
||||
import { GetSessionDataManager, LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { UseMessageEventHook } from '../../../../hooks';
|
||||
import { NameChangeLayoutViewProps } from './NameChangeView.types';
|
||||
|
||||
export const NameChangeConfirmationView:FC<NameChangeLayoutViewProps> = props =>
|
||||
@ -21,14 +21,14 @@ export const NameChangeConfirmationView:FC<NameChangeLayoutViewProps> = props =>
|
||||
onAction('close');
|
||||
}, [ onAction ]);
|
||||
|
||||
CreateMessageHook(UserNameChangeMessageEvent, onUserNameChangeMessageEvent);
|
||||
UseMessageEventHook(UserNameChangeMessageEvent, onUserNameChangeMessageEvent);
|
||||
|
||||
const confirm = useCallback(() =>
|
||||
{
|
||||
if(isConfirming) return;
|
||||
|
||||
setIsConfirming(true);
|
||||
SendMessageHook(new ChangeUserNameMessageComposer(username));
|
||||
SendMessageComposer(new ChangeUserNameMessageComposer(username));
|
||||
}, [ isConfirming, username ]);
|
||||
|
||||
return (
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { CheckUserNameMessageComposer, CheckUserNameResultMessageEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../api';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../../../hooks';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { UseMessageEventHook } from '../../../../hooks';
|
||||
import { NameChangeLayoutViewProps } from './NameChangeView.types';
|
||||
|
||||
const AVAILABLE: number = 0;
|
||||
@ -52,7 +52,7 @@ export const NameChangeInputView:FC<NameChangeLayoutViewProps> = props =>
|
||||
}
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(CheckUserNameResultMessageEvent, onCheckUserNameResultMessageEvent);
|
||||
UseMessageEventHook(CheckUserNameResultMessageEvent, onCheckUserNameResultMessageEvent);
|
||||
|
||||
const check = useCallback(() =>
|
||||
{
|
||||
@ -63,7 +63,7 @@ export const NameChangeInputView:FC<NameChangeLayoutViewProps> = props =>
|
||||
setErrorCode(null);
|
||||
|
||||
setIsChecking(true);
|
||||
SendMessageHook(new CheckUserNameMessageComposer(newUsername));
|
||||
SendMessageComposer(new CheckUserNameMessageComposer(newUsername));
|
||||
}, [ newUsername ]);
|
||||
|
||||
const handleUsernameChange = useCallback((username: string) =>
|
||||
|
@ -2,7 +2,7 @@ import { FC, useCallback, useMemo, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../common';
|
||||
import { HelpNameChangeEvent } from '../../../../events';
|
||||
import { useUiEvent } from '../../../../hooks';
|
||||
import { UseUiEvent } from '../../../../hooks';
|
||||
import { NameChangeConfirmationView } from './NameChangeConfirmationView';
|
||||
import { NameChangeInitView } from './NameChangeInitView';
|
||||
import { NameChangeInputView } from './NameChangeInputView';
|
||||
@ -23,7 +23,7 @@ export const NameChangeView:FC<{}> = props =>
|
||||
setIsVisible(true);
|
||||
}, []);
|
||||
|
||||
useUiEvent(HelpNameChangeEvent.INIT, onHelpNameChangeEvent);
|
||||
UseUiEvent(HelpNameChangeEvent.INIT, onHelpNameChangeEvent);
|
||||
|
||||
const onAction = useCallback((action: string, value?: string) =>
|
||||
{
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { AdvancedMap, BadgePointLimitsEvent, BadgeReceivedEvent, BadgesEvent, BotAddedToInventoryEvent, BotInventoryMessageEvent, BotRemovedFromInventoryEvent, FurnitureListAddOrUpdateEvent, FurnitureListEvent, FurnitureListInvalidateEvent, FurnitureListItemParser, FurnitureListRemovedEvent, FurniturePostItPlacedEvent, PetAddedToInventoryEvent, PetData, PetInventoryEvent, PetRemovedFromInventory, RequestBadgesComposer, TradingAcceptEvent, TradingCloseEvent, TradingCompletedEvent, TradingConfirmationEvent, TradingListItemEvent, TradingNotOpenEvent, TradingOpenEvent, TradingOpenFailedEvent, TradingOtherNotAllowedEvent, TradingYouAreNotAllowedEvent, UnseenItemsEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { GetLocalization, GetRoomSession, GetSessionDataManager, LocalizeText } from '../../api';
|
||||
import { GetLocalization, GetRoomSession, GetSessionDataManager, LocalizeText, SendMessageComposer } from '../../api';
|
||||
import { InventoryBadgesUpdatedEvent } from '../../events';
|
||||
import { InventoryBadgesRequestEvent } from '../../events/inventory/InventoryBadgesRequestEvent';
|
||||
import { dispatchUiEvent, useUiEvent } from '../../hooks';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../hooks/messages/message-event';
|
||||
import { DispatchUiEvent, UseUiEvent } from '../../hooks';
|
||||
import { UseMessageEventHook } from '../../hooks/messages/UseMessageEventHook';
|
||||
import { NotificationUtilities } from '../../views/notification-center/common/NotificationUtilities';
|
||||
import { mergeFurniFragments } from './common/FurnitureUtilities';
|
||||
import { mergePetFragments } from './common/PetUtilities';
|
||||
@ -326,45 +326,45 @@ export const InventoryMessageHandler: FC<{}> = props =>
|
||||
for(const data of parser.data) GetLocalization().setBadgePointLimit(data.badgeId, data.limit);
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(FurnitureListAddOrUpdateEvent, onFurnitureListAddOrUpdateEvent);
|
||||
CreateMessageHook(FurnitureListEvent, onFurnitureListEvent);
|
||||
CreateMessageHook(FurnitureListInvalidateEvent, onFurnitureListInvalidateEvent);
|
||||
CreateMessageHook(FurnitureListRemovedEvent, onFurnitureListRemovedEvent);
|
||||
CreateMessageHook(FurniturePostItPlacedEvent, onFurniturePostItPlacedEvent);
|
||||
CreateMessageHook(BotInventoryMessageEvent, onBotInventoryMessageEvent);
|
||||
CreateMessageHook(BotRemovedFromInventoryEvent, onBotRemovedFromInventoryEvent);
|
||||
CreateMessageHook(BotAddedToInventoryEvent, onBotAddedToInventoryEvent);
|
||||
CreateMessageHook(PetInventoryEvent, onPetInventoryEvent);
|
||||
CreateMessageHook(PetRemovedFromInventory, onPetRemovedFromInventory);
|
||||
CreateMessageHook(PetAddedToInventoryEvent, onPetAddedToInventoryEvent);
|
||||
CreateMessageHook(BadgesEvent, onBadgesEvent);
|
||||
CreateMessageHook(BadgeReceivedEvent, onBadgeReceivedEvent);
|
||||
CreateMessageHook(TradingAcceptEvent, onTradingAcceptEvent);
|
||||
CreateMessageHook(TradingCloseEvent, onTradingCloseEvent);
|
||||
CreateMessageHook(TradingCompletedEvent, onTradingCompletedEvent);
|
||||
CreateMessageHook(TradingConfirmationEvent, onTradingConfirmationEvent);
|
||||
CreateMessageHook(TradingListItemEvent, onTradingListItemEvent);
|
||||
CreateMessageHook(TradingNotOpenEvent, onTradingNotOpenEvent);
|
||||
CreateMessageHook(TradingOpenEvent, onTradingOpenEvent);
|
||||
CreateMessageHook(TradingOpenFailedEvent, onTradingOpenFailedEvent);
|
||||
CreateMessageHook(TradingOtherNotAllowedEvent, onTradingOtherNotAllowedEvent);
|
||||
CreateMessageHook(TradingYouAreNotAllowedEvent, onTradingYouAreNotAllowedEvent);
|
||||
CreateMessageHook(UnseenItemsEvent, onUnseenItemsEvent);
|
||||
CreateMessageHook(BadgePointLimitsEvent, onBadgePointLimitsEvent);
|
||||
UseMessageEventHook(FurnitureListAddOrUpdateEvent, onFurnitureListAddOrUpdateEvent);
|
||||
UseMessageEventHook(FurnitureListEvent, onFurnitureListEvent);
|
||||
UseMessageEventHook(FurnitureListInvalidateEvent, onFurnitureListInvalidateEvent);
|
||||
UseMessageEventHook(FurnitureListRemovedEvent, onFurnitureListRemovedEvent);
|
||||
UseMessageEventHook(FurniturePostItPlacedEvent, onFurniturePostItPlacedEvent);
|
||||
UseMessageEventHook(BotInventoryMessageEvent, onBotInventoryMessageEvent);
|
||||
UseMessageEventHook(BotRemovedFromInventoryEvent, onBotRemovedFromInventoryEvent);
|
||||
UseMessageEventHook(BotAddedToInventoryEvent, onBotAddedToInventoryEvent);
|
||||
UseMessageEventHook(PetInventoryEvent, onPetInventoryEvent);
|
||||
UseMessageEventHook(PetRemovedFromInventory, onPetRemovedFromInventory);
|
||||
UseMessageEventHook(PetAddedToInventoryEvent, onPetAddedToInventoryEvent);
|
||||
UseMessageEventHook(BadgesEvent, onBadgesEvent);
|
||||
UseMessageEventHook(BadgeReceivedEvent, onBadgeReceivedEvent);
|
||||
UseMessageEventHook(TradingAcceptEvent, onTradingAcceptEvent);
|
||||
UseMessageEventHook(TradingCloseEvent, onTradingCloseEvent);
|
||||
UseMessageEventHook(TradingCompletedEvent, onTradingCompletedEvent);
|
||||
UseMessageEventHook(TradingConfirmationEvent, onTradingConfirmationEvent);
|
||||
UseMessageEventHook(TradingListItemEvent, onTradingListItemEvent);
|
||||
UseMessageEventHook(TradingNotOpenEvent, onTradingNotOpenEvent);
|
||||
UseMessageEventHook(TradingOpenEvent, onTradingOpenEvent);
|
||||
UseMessageEventHook(TradingOpenFailedEvent, onTradingOpenFailedEvent);
|
||||
UseMessageEventHook(TradingOtherNotAllowedEvent, onTradingOtherNotAllowedEvent);
|
||||
UseMessageEventHook(TradingYouAreNotAllowedEvent, onTradingYouAreNotAllowedEvent);
|
||||
UseMessageEventHook(UnseenItemsEvent, onUnseenItemsEvent);
|
||||
UseMessageEventHook(BadgePointLimitsEvent, onBadgePointLimitsEvent);
|
||||
|
||||
const onInventoryBadgesRequestEvent = useCallback((event: InventoryBadgesRequestEvent) =>
|
||||
{
|
||||
if(badgeState.needsBadgeUpdate)
|
||||
{
|
||||
SendMessageHook(new RequestBadgesComposer());
|
||||
SendMessageComposer(new RequestBadgesComposer());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
dispatchUiEvent(new InventoryBadgesUpdatedEvent(InventoryBadgesUpdatedEvent.BADGES_UPDATED, badgeState.badges));
|
||||
DispatchUiEvent(new InventoryBadgesUpdatedEvent(InventoryBadgesUpdatedEvent.BADGES_UPDATED, badgeState.badges));
|
||||
}, [ badgeState ])
|
||||
|
||||
useUiEvent(InventoryBadgesRequestEvent.REQUEST_BADGES, onInventoryBadgesRequestEvent);
|
||||
UseUiEvent(InventoryBadgesRequestEvent.REQUEST_BADGES, onInventoryBadgesRequestEvent);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -1,12 +1,9 @@
|
||||
import { IRoomSession, RoomEngineObjectEvent, RoomEngineObjectPlacedEvent, RoomPreviewer, RoomSessionEvent, TradingCancelComposer, TradingCloseComposer, TradingOpenComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useReducer, useState } from 'react';
|
||||
import { GetRoomEngine, LocalizeText } from '../../api';
|
||||
import { GetRoomEngine, LocalizeText, SendMessageComposer } from '../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView } from '../../common';
|
||||
import { InventoryBadgesUpdatedEvent, InventoryEvent, InventoryTradeRequestEvent } from '../../events';
|
||||
import { useRoomEngineEvent } from '../../hooks/events/nitro/room/room-engine-event';
|
||||
import { useRoomSessionManagerEvent } from '../../hooks/events/nitro/session/room-session-manager-event';
|
||||
import { dispatchUiEvent, useUiEvent } from '../../hooks/events/ui/ui-event';
|
||||
import { SendMessageHook } from '../../hooks/messages';
|
||||
import { DispatchUiEvent, UseRoomEngineEvent, UseRoomSessionManagerEvent, UseUiEvent } from '../../hooks';
|
||||
import { isObjectMoverRequested, setObjectMoverRequested } from './common/InventoryUtilities';
|
||||
import { TradeState } from './common/TradeState';
|
||||
import { IUnseenItemTracker } from './common/unseen/IUnseenItemTracker';
|
||||
@ -50,10 +47,10 @@ export const InventoryView: FC<{}> = props =>
|
||||
switch(furnitureState.tradeData.state)
|
||||
{
|
||||
case TradeState.TRADING_STATE_RUNNING:
|
||||
SendMessageHook(new TradingCloseComposer());
|
||||
SendMessageComposer(new TradingCloseComposer());
|
||||
return;
|
||||
default:
|
||||
SendMessageHook(new TradingCancelComposer());
|
||||
SendMessageComposer(new TradingCancelComposer());
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -88,15 +85,15 @@ export const InventoryView: FC<{}> = props =>
|
||||
case InventoryTradeRequestEvent.REQUEST_TRADE: {
|
||||
const tradeEvent = (event as InventoryTradeRequestEvent);
|
||||
|
||||
SendMessageHook(new TradingOpenComposer(tradeEvent.objectId));
|
||||
SendMessageComposer(new TradingOpenComposer(tradeEvent.objectId));
|
||||
}
|
||||
}
|
||||
}, [ isVisible, close ]);
|
||||
|
||||
useUiEvent(InventoryEvent.SHOW_INVENTORY, onInventoryEvent);
|
||||
useUiEvent(InventoryEvent.HIDE_INVENTORY, onInventoryEvent);
|
||||
useUiEvent(InventoryEvent.TOGGLE_INVENTORY, onInventoryEvent);
|
||||
useUiEvent(InventoryTradeRequestEvent.REQUEST_TRADE, onInventoryEvent);
|
||||
UseUiEvent(InventoryEvent.SHOW_INVENTORY, onInventoryEvent);
|
||||
UseUiEvent(InventoryEvent.HIDE_INVENTORY, onInventoryEvent);
|
||||
UseUiEvent(InventoryEvent.TOGGLE_INVENTORY, onInventoryEvent);
|
||||
UseUiEvent(InventoryTradeRequestEvent.REQUEST_TRADE, onInventoryEvent);
|
||||
|
||||
const onRoomEngineObjectPlacedEvent = useCallback((event: RoomEngineObjectPlacedEvent) =>
|
||||
{
|
||||
@ -107,7 +104,7 @@ export const InventoryView: FC<{}> = props =>
|
||||
if(!event.placedInRoom) setIsVisible(true);
|
||||
}, []);
|
||||
|
||||
useRoomEngineEvent(RoomEngineObjectEvent.PLACED, onRoomEngineObjectPlacedEvent);
|
||||
UseRoomEngineEvent(RoomEngineObjectEvent.PLACED, onRoomEngineObjectPlacedEvent);
|
||||
|
||||
const onRoomSessionEvent = useCallback((event: RoomSessionEvent) =>
|
||||
{
|
||||
@ -123,8 +120,8 @@ export const InventoryView: FC<{}> = props =>
|
||||
}
|
||||
}, []);
|
||||
|
||||
useRoomSessionManagerEvent(RoomSessionEvent.CREATED, onRoomSessionEvent);
|
||||
useRoomSessionManagerEvent(RoomSessionEvent.ENDED, onRoomSessionEvent);
|
||||
UseRoomSessionManagerEvent(RoomSessionEvent.CREATED, onRoomSessionEvent);
|
||||
UseRoomSessionManagerEvent(RoomSessionEvent.ENDED, onRoomSessionEvent);
|
||||
|
||||
const resetTrackerForTab = useCallback((name: string) =>
|
||||
{
|
||||
@ -192,7 +189,7 @@ export const InventoryView: FC<{}> = props =>
|
||||
{
|
||||
if(!badgeState.badges) return;
|
||||
|
||||
dispatchUiEvent(new InventoryBadgesUpdatedEvent(InventoryBadgesUpdatedEvent.BADGES_UPDATED, badgeState.badges));
|
||||
DispatchUiEvent(new InventoryBadgesUpdatedEvent(InventoryBadgesUpdatedEvent.BADGES_UPDATED, badgeState.badges));
|
||||
}, [ badgeState.badges ]);
|
||||
|
||||
return (
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { BotData, RoomObjectCategory, RoomObjectPlacementSource, RoomObjectType } from '@nitrots/nitro-renderer';
|
||||
import { GetRoomEngine, GetRoomSessionManager } from '../../../api';
|
||||
import { InventoryEvent } from '../../../events';
|
||||
import { dispatchUiEvent } from '../../../hooks/events/ui/ui-event';
|
||||
import { DispatchUiEvent } from '../../../hooks';
|
||||
import { BotItem } from './BotItem';
|
||||
import { getPlacingItemId, setObjectMoverRequested, setPlacingItemId } from './InventoryUtilities';
|
||||
import { IUnseenItemTracker } from './unseen/IUnseenItemTracker';
|
||||
@ -27,7 +27,7 @@ export function attemptBotPlacement(botItem: BotItem, flag: boolean = false): bo
|
||||
|
||||
if(!session || !session.isRoomOwner) return false;
|
||||
|
||||
dispatchUiEvent(new InventoryEvent(InventoryEvent.HIDE_INVENTORY));
|
||||
DispatchUiEvent(new InventoryEvent(InventoryEvent.HIDE_INVENTORY));
|
||||
|
||||
if(GetRoomEngine().processRoomObjectPlacement(RoomObjectPlacementSource.INVENTORY, -(botData.id), RoomObjectCategory.UNIT, RoomObjectType.RENTABLE_BOT, botData.figure))
|
||||
{
|
||||
@ -98,7 +98,7 @@ export function removeBotItemById(id: number, set: BotItem[]): BotItem
|
||||
{
|
||||
cancelRoomObjectPlacement();
|
||||
|
||||
setTimeout(() => dispatchUiEvent(new InventoryEvent(InventoryEvent.SHOW_INVENTORY)), 1);
|
||||
setTimeout(() => DispatchUiEvent(new InventoryEvent(InventoryEvent.SHOW_INVENTORY)), 1);
|
||||
}
|
||||
|
||||
set.splice(index, 1);
|
||||
|
@ -1,9 +1,7 @@
|
||||
import { FurnitureListItemParser, FurniturePlacePaintComposer, IObjectData, RoomObjectCategory, RoomObjectPlacementSource } from '@nitrots/nitro-renderer';
|
||||
import { GetRoomEngine } from '../../../api';
|
||||
import { InventoryEvent } from '../../../events';
|
||||
import { CatalogPostMarketplaceOfferEvent } from '../../../events/catalog/CatalogPostMarketplaceOfferEvent';
|
||||
import { dispatchUiEvent } from '../../../hooks/events/ui/ui-event';
|
||||
import { SendMessageHook } from '../../../hooks/messages/message-event';
|
||||
import { GetRoomEngine, SendMessageComposer } from '../../../api';
|
||||
import { CatalogPostMarketplaceOfferEvent, InventoryEvent } from '../../../events';
|
||||
import { DispatchUiEvent } from '../../../hooks';
|
||||
import { FurniCategory } from './FurniCategory';
|
||||
import { FurnitureItem } from './FurnitureItem';
|
||||
import { GroupItem } from './GroupItem';
|
||||
@ -23,13 +21,13 @@ export function attemptItemPlacement(groupItem: GroupItem, flag: boolean = false
|
||||
{
|
||||
if(flag) return false;
|
||||
|
||||
SendMessageHook(new FurniturePlacePaintComposer(item.id));
|
||||
SendMessageComposer(new FurniturePlacePaintComposer(item.id));
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatchUiEvent(new InventoryEvent(InventoryEvent.HIDE_INVENTORY));
|
||||
DispatchUiEvent(new InventoryEvent(InventoryEvent.HIDE_INVENTORY));
|
||||
|
||||
let category = 0;
|
||||
let isMoving = false;
|
||||
@ -64,7 +62,7 @@ export function attemptPlaceMarketplaceOffer(groupItem: GroupItem): boolean
|
||||
|
||||
if(!item.sellable) return false;
|
||||
|
||||
dispatchUiEvent(new CatalogPostMarketplaceOfferEvent(item));
|
||||
DispatchUiEvent(new CatalogPostMarketplaceOfferEvent(item));
|
||||
}
|
||||
|
||||
function cancelRoomObjectPlacement(): void
|
||||
@ -180,7 +178,7 @@ export function removeFurniItemById(id: number, set: GroupItem[]): GroupItem
|
||||
|
||||
if(!attemptItemPlacement(group))
|
||||
{
|
||||
setTimeout(() => dispatchUiEvent(new InventoryEvent(InventoryEvent.SHOW_INVENTORY)), 1);
|
||||
setTimeout(() => DispatchUiEvent(new InventoryEvent(InventoryEvent.SHOW_INVENTORY)), 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { PetData, RoomObjectCategory, RoomObjectPlacementSource, RoomObjectType } from '@nitrots/nitro-renderer';
|
||||
import { GetRoomEngine, GetRoomSessionManager } from '../../../api';
|
||||
import { InventoryEvent } from '../../../events';
|
||||
import { dispatchUiEvent } from '../../../hooks/events/ui/ui-event';
|
||||
import { DispatchUiEvent } from '../../../hooks';
|
||||
import { getPlacingItemId, setObjectMoverRequested, setPlacingItemId } from './InventoryUtilities';
|
||||
import { PetItem } from './PetItem';
|
||||
import { IUnseenItemTracker } from './unseen/IUnseenItemTracker';
|
||||
@ -32,7 +32,7 @@ export function attemptPetPlacement(petItem: PetItem, flag: boolean = false): bo
|
||||
if(!session.allowPets) return false;
|
||||
}
|
||||
|
||||
dispatchUiEvent(new InventoryEvent(InventoryEvent.HIDE_INVENTORY));
|
||||
DispatchUiEvent(new InventoryEvent(InventoryEvent.HIDE_INVENTORY));
|
||||
|
||||
if(GetRoomEngine().processRoomObjectPlacement(RoomObjectPlacementSource.INVENTORY, -(petData.id), RoomObjectCategory.UNIT, RoomObjectType.PET, petData.figureData.figuredata))
|
||||
{
|
||||
@ -117,7 +117,7 @@ export function removePetItemById(id: number, set: PetItem[]): PetItem
|
||||
{
|
||||
cancelRoomObjectPlacement();
|
||||
|
||||
setTimeout(() => dispatchUiEvent(new InventoryEvent(InventoryEvent.SHOW_INVENTORY)), 1);
|
||||
setTimeout(() => DispatchUiEvent(new InventoryEvent(InventoryEvent.SHOW_INVENTORY)), 1);
|
||||
}
|
||||
|
||||
set.splice(index, 1);
|
||||
|
@ -1,6 +1,7 @@
|
||||
import { UnseenResetCategoryComposer, UnseenResetItemsComposer } from '@nitrots/nitro-renderer';
|
||||
import { SendMessageComposer } from '../../../../api';
|
||||
import { UnseenItemTrackerUpdateEvent } from '../../../../events';
|
||||
import { dispatchUiEvent, SendMessageHook } from '../../../../hooks';
|
||||
import { DispatchUiEvent } from '../../../../hooks';
|
||||
import { IUnseenItemTracker } from './IUnseenItemTracker';
|
||||
|
||||
export class UnseenItemTracker implements IUnseenItemTracker
|
||||
@ -130,16 +131,16 @@ export class UnseenItemTracker implements IUnseenItemTracker
|
||||
|
||||
private dispatchUpdateEvent(): void
|
||||
{
|
||||
dispatchUiEvent(new UnseenItemTrackerUpdateEvent(this.getFullCount()));
|
||||
DispatchUiEvent(new UnseenItemTrackerUpdateEvent(this.getFullCount()));
|
||||
}
|
||||
|
||||
private sendResetCategoryMessage(category: number): void
|
||||
{
|
||||
SendMessageHook(new UnseenResetCategoryComposer(category));
|
||||
SendMessageComposer(new UnseenResetCategoryComposer(category));
|
||||
}
|
||||
|
||||
private sendResetItemsMessage(category: number, itemIds: number[]): void
|
||||
{
|
||||
SendMessageHook(new UnseenResetItemsComposer(category, ...itemIds));
|
||||
SendMessageComposer(new UnseenResetItemsComposer(category, ...itemIds));
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { SetActivatedBadgesComposer } from '@nitrots/nitro-renderer';
|
||||
import { Reducer } from 'react';
|
||||
import { SendMessageHook } from '../../../hooks/messages/message-event';
|
||||
import { SendMessageComposer } from '../../../api';
|
||||
|
||||
export interface IInventoryBadgeState
|
||||
{
|
||||
@ -102,7 +102,7 @@ export const InventoryBadgeReducer: Reducer<IInventoryBadgeState, IInventoryBadg
|
||||
composer.addActivatedBadge(badgeCode);
|
||||
}
|
||||
|
||||
SendMessageHook(composer);
|
||||
SendMessageComposer(composer);
|
||||
|
||||
return { ...state, activeBadges };
|
||||
}
|
||||
@ -124,7 +124,7 @@ export const InventoryBadgeReducer: Reducer<IInventoryBadgeState, IInventoryBadg
|
||||
composer.addActivatedBadge(badgeCode);
|
||||
}
|
||||
|
||||
SendMessageHook(composer);
|
||||
SendMessageComposer(composer);
|
||||
|
||||
return { ...state, activeBadges };
|
||||
}
|
||||
|
@ -1,13 +1,7 @@
|
||||
import { RequestBadgesComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useEffect } from 'react';
|
||||
import { GetConfiguration, LocalizeBadgeName, LocalizeText } from '../../../../api';
|
||||
import { AutoGrid } from '../../../../common/AutoGrid';
|
||||
import { Button } from '../../../../common/Button';
|
||||
import { Column } from '../../../../common/Column';
|
||||
import { Flex } from '../../../../common/Flex';
|
||||
import { Grid } from '../../../../common/Grid';
|
||||
import { Text } from '../../../../common/Text';
|
||||
import { SendMessageHook } from '../../../../hooks/messages/message-event';
|
||||
import { GetConfiguration, LocalizeBadgeName, LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { AutoGrid, Button, Column, Flex, Grid, Text } from '../../../../common';
|
||||
import { BadgeImageView } from '../../../../views/shared/badge-image/BadgeImageView';
|
||||
import { useInventoryContext } from '../../InventoryContext';
|
||||
import { InventoryBadgeActions } from '../../reducers/InventoryBadgeReducer';
|
||||
@ -62,7 +56,7 @@ export const InventoryBadgeView: FC<InventoryBadgeViewProps> = props =>
|
||||
}
|
||||
});
|
||||
|
||||
SendMessageHook(new RequestBadgesComposer());
|
||||
SendMessageComposer(new RequestBadgesComposer());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { MouseEventType } from '@nitrots/nitro-renderer';
|
||||
import { FC, MouseEvent, useEffect, useState } from 'react';
|
||||
import { LayoutGridItem } from '../../../../common/layout/LayoutGridItem';
|
||||
import { LayoutGridItem } from '../../../../common';
|
||||
import { AvatarImageView } from '../../../../views/shared/avatar-image/AvatarImageView';
|
||||
import { BotItem } from '../../common/BotItem';
|
||||
import { attemptBotPlacement } from '../../common/BotUtilities';
|
||||
|
@ -1,12 +1,7 @@
|
||||
import { GetBotInventoryComposer, IRoomSession, RoomObjectVariable, RoomPreviewer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useEffect } from 'react';
|
||||
import { GetRoomEngine, LocalizeText } from '../../../../api';
|
||||
import { AutoGrid } from '../../../../common/AutoGrid';
|
||||
import { Button } from '../../../../common/Button';
|
||||
import { Column } from '../../../../common/Column';
|
||||
import { Grid } from '../../../../common/Grid';
|
||||
import { Text } from '../../../../common/Text';
|
||||
import { SendMessageHook } from '../../../../hooks/messages/message-event';
|
||||
import { GetRoomEngine, LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { AutoGrid, Button, Column, Grid, Text } from '../../../../common';
|
||||
import { RoomPreviewerView } from '../../../../views/shared/room-previewer/RoomPreviewerView';
|
||||
import { attemptBotPlacement } from '../../common/BotUtilities';
|
||||
import { useInventoryContext } from '../../InventoryContext';
|
||||
@ -37,7 +32,7 @@ export const InventoryBotView: FC<InventoryBotViewProps> = props =>
|
||||
}
|
||||
});
|
||||
|
||||
SendMessageHook(new GetBotInventoryComposer());
|
||||
SendMessageComposer(new GetBotInventoryComposer());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,12 +1,7 @@
|
||||
import { FurnitureListComposer, IRoomSession, RoomObjectVariable, RoomPreviewer, Vector3d } from '@nitrots/nitro-renderer';
|
||||
import { FC, useEffect, useState } from 'react';
|
||||
import { GetRoomEngine, GetSessionDataManager, LocalizeText } from '../../../../api';
|
||||
import { AutoGrid } from '../../../../common/AutoGrid';
|
||||
import { Button } from '../../../../common/Button';
|
||||
import { Column } from '../../../../common/Column';
|
||||
import { Grid } from '../../../../common/Grid';
|
||||
import { Text } from '../../../../common/Text';
|
||||
import { SendMessageHook } from '../../../../hooks/messages';
|
||||
import { GetRoomEngine, GetSessionDataManager, LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { AutoGrid, Button, Column, Grid, Text } from '../../../../common';
|
||||
import { LimitedEditionCompactPlateView } from '../../../../views/shared/limited-edition/LimitedEditionCompactPlateView';
|
||||
import { RarityLevelView } from '../../../../views/shared/rarity-level/RarityLevelView';
|
||||
import { RoomPreviewerView } from '../../../../views/shared/room-previewer/RoomPreviewerView';
|
||||
@ -43,7 +38,7 @@ export const InventoryFurnitureView: FC<InventoryFurnitureViewProps> = props =>
|
||||
}
|
||||
});
|
||||
|
||||
SendMessageHook(new FurnitureListComposer());
|
||||
SendMessageComposer(new FurnitureListComposer());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { MouseEventType } from '@nitrots/nitro-renderer';
|
||||
import { FC, MouseEvent, useEffect, useState } from 'react';
|
||||
import { LayoutGridItem } from '../../../../common/layout/LayoutGridItem';
|
||||
import { LayoutGridItem } from '../../../../common';
|
||||
import { PetImageView } from '../../../../views/shared/pet-image/PetImageView';
|
||||
import { PetItem } from '../../common/PetItem';
|
||||
import { attemptPetPlacement } from '../../common/PetUtilities';
|
||||
|
@ -1,12 +1,7 @@
|
||||
import { IRoomSession, RequestPetsComposer, RoomObjectVariable, RoomPreviewer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useEffect } from 'react';
|
||||
import { GetRoomEngine, LocalizeText } from '../../../../api';
|
||||
import { AutoGrid } from '../../../../common/AutoGrid';
|
||||
import { Button } from '../../../../common/Button';
|
||||
import { Column } from '../../../../common/Column';
|
||||
import { Grid } from '../../../../common/Grid';
|
||||
import { Text } from '../../../../common/Text';
|
||||
import { SendMessageHook } from '../../../../hooks/messages/message-event';
|
||||
import { GetRoomEngine, LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { AutoGrid, Button, Column, Grid, Text } from '../../../../common';
|
||||
import { RoomPreviewerView } from '../../../../views/shared/room-previewer/RoomPreviewerView';
|
||||
import { attemptPetPlacement } from '../../common/PetUtilities';
|
||||
import { useInventoryContext } from '../../InventoryContext';
|
||||
@ -37,7 +32,7 @@ export const InventoryPetView: FC<InventoryPetViewProps> = props =>
|
||||
}
|
||||
});
|
||||
|
||||
SendMessageHook(new RequestPetsComposer());
|
||||
SendMessageComposer(new RequestPetsComposer());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1,16 +1,8 @@
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { FurnitureListComposer, IObjectData, TradingAcceptComposer, TradingConfirmationComposer, TradingListAddItemComposer, TradingListAddItemsComposer, TradingListItemRemoveComposer, TradingUnacceptComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useEffect, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../api';
|
||||
import { AutoGrid } from '../../../../common/AutoGrid';
|
||||
import { Base } from '../../../../common/Base';
|
||||
import { Button } from '../../../../common/Button';
|
||||
import { Column } from '../../../../common/Column';
|
||||
import { Flex } from '../../../../common/Flex';
|
||||
import { Grid } from '../../../../common/Grid';
|
||||
import { LayoutGridItem } from '../../../../common/layout/LayoutGridItem';
|
||||
import { Text } from '../../../../common/Text';
|
||||
import { SendMessageHook } from '../../../../hooks/messages';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { AutoGrid, Base, Button, Column, Flex, Grid, LayoutGridItem, Text } from '../../../../common';
|
||||
import { NotificationAlertType } from '../../../../views/notification-center/common/NotificationAlertType';
|
||||
import { NotificationUtilities } from '../../../../views/notification-center/common/NotificationUtilities';
|
||||
import { FurniCategory } from '../../common/FurniCategory';
|
||||
@ -93,7 +85,7 @@ export const InventoryTradeView: FC<InventoryTradeViewProps> = props =>
|
||||
{
|
||||
if(!coreItem.isGroupable && (itemIds.length))
|
||||
{
|
||||
SendMessageHook(new TradingListAddItemComposer(itemIds.pop()));
|
||||
SendMessageComposer(new TradingListAddItemComposer(itemIds.pop()));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -111,11 +103,11 @@ export const InventoryTradeView: FC<InventoryTradeViewProps> = props =>
|
||||
{
|
||||
if(tradeIds.length === 1)
|
||||
{
|
||||
SendMessageHook(new TradingListAddItemComposer(tradeIds.pop()));
|
||||
SendMessageComposer(new TradingListAddItemComposer(tradeIds.pop()));
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageHook(new TradingListAddItemsComposer(...tradeIds));
|
||||
SendMessageComposer(new TradingListAddItemsComposer(...tradeIds));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -132,7 +124,7 @@ export const InventoryTradeView: FC<InventoryTradeViewProps> = props =>
|
||||
|
||||
if(!item) return;
|
||||
|
||||
SendMessageHook(new TradingListItemRemoveComposer(item.id));
|
||||
SendMessageComposer(new TradingListItemRemoveComposer(item.id));
|
||||
}
|
||||
|
||||
const progressTrade = () =>
|
||||
@ -147,15 +139,15 @@ export const InventoryTradeView: FC<InventoryTradeViewProps> = props =>
|
||||
|
||||
if(tradeData.ownUser.accepts)
|
||||
{
|
||||
SendMessageHook(new TradingUnacceptComposer());
|
||||
SendMessageComposer(new TradingUnacceptComposer());
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageHook(new TradingAcceptComposer());
|
||||
SendMessageComposer(new TradingAcceptComposer());
|
||||
}
|
||||
return;
|
||||
case TradeState.TRADING_STATE_CONFIRMING:
|
||||
SendMessageHook(new TradingConfirmationComposer());
|
||||
SendMessageComposer(new TradingConfirmationComposer());
|
||||
|
||||
dispatchFurnitureState({
|
||||
type: InventoryFurnitureActions.SET_TRADE_STATE,
|
||||
@ -186,7 +178,7 @@ export const InventoryTradeView: FC<InventoryTradeViewProps> = props =>
|
||||
}
|
||||
});
|
||||
|
||||
SendMessageHook(new FurnitureListComposer());
|
||||
SendMessageComposer(new FurnitureListComposer());
|
||||
}
|
||||
|
||||
}, [ needsFurniUpdate, groupItems, dispatchFurnitureState ]);
|
||||
|
@ -2,7 +2,7 @@ import { HabboWebTools, RoomSessionEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { AddEventLinkTracker, GetCommunication, RemoveLinkEventTracker } from '../../api';
|
||||
import { Base, TransitionAnimation, TransitionAnimationTypes } from '../../common';
|
||||
import { useRoomSessionManagerEvent } from '../../hooks/events/nitro/session/room-session-manager-event';
|
||||
import { UseRoomSessionManagerEvent } from '../../hooks';
|
||||
import { CampaignView } from '../../views/campaign/CampaignView';
|
||||
import { FloorplanEditorView } from '../../views/floorplan-editor/FloorplanEditorView';
|
||||
import { FriendsView } from '../../views/friends/FriendsView';
|
||||
@ -45,8 +45,8 @@ export const MainView: FC<{}> = props =>
|
||||
}
|
||||
}, []);
|
||||
|
||||
useRoomSessionManagerEvent(RoomSessionEvent.CREATED, onRoomSessionEvent);
|
||||
useRoomSessionManagerEvent(RoomSessionEvent.ENDED, onRoomSessionEvent);
|
||||
UseRoomSessionManagerEvent(RoomSessionEvent.CREATED, onRoomSessionEvent);
|
||||
UseRoomSessionManagerEvent(RoomSessionEvent.ENDED, onRoomSessionEvent);
|
||||
|
||||
const onLinkReceived = useCallback((link: string) =>
|
||||
{
|
||||
|
@ -1,12 +1,8 @@
|
||||
import { CfhSanctionMessageEvent, CfhTopicsInitEvent, IssueDeletedMessageEvent, IssueInfoMessageEvent, IssuePickFailedMessageEvent, ModeratorActionResultMessageEvent, ModeratorInitMessageEvent, ModeratorToolPreferencesEvent, RoomEngineEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback } from 'react';
|
||||
import { MODTOOLS_NEW_TICKET, PlaySound } from '../../api/utils/PlaySound';
|
||||
import { ModToolsEvent } from '../../events/mod-tools/ModToolsEvent';
|
||||
import { ModToolsOpenRoomChatlogEvent } from '../../events/mod-tools/ModToolsOpenRoomChatlogEvent';
|
||||
import { ModToolsOpenRoomInfoEvent } from '../../events/mod-tools/ModToolsOpenRoomInfoEvent';
|
||||
import { ModToolsOpenUserChatlogEvent } from '../../events/mod-tools/ModToolsOpenUserChatlogEvent';
|
||||
import { ModToolsOpenUserInfoEvent } from '../../events/mod-tools/ModToolsOpenUserInfoEvent';
|
||||
import { CreateMessageHook, useRoomEngineEvent, useUiEvent } from '../../hooks';
|
||||
import { MODTOOLS_NEW_TICKET, PlaySound } from '../../api';
|
||||
import { ModToolsEvent, ModToolsOpenRoomChatlogEvent, ModToolsOpenRoomInfoEvent, ModToolsOpenUserChatlogEvent, ModToolsOpenUserInfoEvent } from '../../events';
|
||||
import { UseMessageEventHook, UseRoomEngineEvent, UseUiEvent } from '../../hooks';
|
||||
import { NotificationAlertType } from '../../views/notification-center/common/NotificationAlertType';
|
||||
import { NotificationUtilities } from '../../views/notification-center/common/NotificationUtilities';
|
||||
import { SetCfhCategories } from './common/GetCFHCategories';
|
||||
@ -152,14 +148,14 @@ export const ModToolsMessageHandler: FC<{}> = props =>
|
||||
// todo: update sanction data
|
||||
}, []);
|
||||
|
||||
CreateMessageHook(ModeratorInitMessageEvent, onModeratorInitMessageEvent);
|
||||
CreateMessageHook(IssueInfoMessageEvent, onIssueInfoMessageEvent);
|
||||
CreateMessageHook(ModeratorToolPreferencesEvent, onModeratorToolPreferencesEvent);
|
||||
CreateMessageHook(IssuePickFailedMessageEvent, onIssuePickFailedMessageEvent);
|
||||
CreateMessageHook(IssueDeletedMessageEvent, onIssueDeletedMessageEvent);
|
||||
CreateMessageHook(ModeratorActionResultMessageEvent, onModeratorActionResultMessageEvent);
|
||||
CreateMessageHook(CfhTopicsInitEvent, onCfhTopicsInitEvent);
|
||||
CreateMessageHook(CfhSanctionMessageEvent, onCfhSanctionMessageEvent);
|
||||
UseMessageEventHook(ModeratorInitMessageEvent, onModeratorInitMessageEvent);
|
||||
UseMessageEventHook(IssueInfoMessageEvent, onIssueInfoMessageEvent);
|
||||
UseMessageEventHook(ModeratorToolPreferencesEvent, onModeratorToolPreferencesEvent);
|
||||
UseMessageEventHook(IssuePickFailedMessageEvent, onIssuePickFailedMessageEvent);
|
||||
UseMessageEventHook(IssueDeletedMessageEvent, onIssueDeletedMessageEvent);
|
||||
UseMessageEventHook(ModeratorActionResultMessageEvent, onModeratorActionResultMessageEvent);
|
||||
UseMessageEventHook(CfhTopicsInitEvent, onCfhTopicsInitEvent);
|
||||
UseMessageEventHook(CfhSanctionMessageEvent, onCfhSanctionMessageEvent);
|
||||
|
||||
const onRoomEngineEvent = useCallback((event: RoomEngineEvent) =>
|
||||
{
|
||||
@ -184,8 +180,8 @@ export const ModToolsMessageHandler: FC<{}> = props =>
|
||||
}
|
||||
}, [ dispatchModToolsState ]);
|
||||
|
||||
useRoomEngineEvent(RoomEngineEvent.INITIALIZED, onRoomEngineEvent);
|
||||
useRoomEngineEvent(RoomEngineEvent.DISPOSED, onRoomEngineEvent);
|
||||
UseRoomEngineEvent(RoomEngineEvent.INITIALIZED, onRoomEngineEvent);
|
||||
UseRoomEngineEvent(RoomEngineEvent.DISPOSED, onRoomEngineEvent);
|
||||
|
||||
const onModToolsEvent = useCallback((event: ModToolsEvent) =>
|
||||
{
|
||||
@ -254,10 +250,10 @@ export const ModToolsMessageHandler: FC<{}> = props =>
|
||||
}
|
||||
}, [openRooms, dispatchModToolsState, openRoomChatlogs, openUserInfo, openUserChatlogs]);
|
||||
|
||||
useUiEvent(ModToolsEvent.OPEN_ROOM_INFO, onModToolsEvent);
|
||||
useUiEvent(ModToolsEvent.OPEN_ROOM_CHATLOG, onModToolsEvent);
|
||||
useUiEvent(ModToolsEvent.OPEN_USER_INFO, onModToolsEvent);
|
||||
useUiEvent(ModToolsEvent.OPEN_USER_CHATLOG, onModToolsEvent);
|
||||
UseUiEvent(ModToolsEvent.OPEN_ROOM_INFO, onModToolsEvent);
|
||||
UseUiEvent(ModToolsEvent.OPEN_ROOM_CHATLOG, onModToolsEvent);
|
||||
UseUiEvent(ModToolsEvent.OPEN_USER_INFO, onModToolsEvent);
|
||||
UseUiEvent(ModToolsEvent.OPEN_USER_CHATLOG, onModToolsEvent);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
@ -3,12 +3,8 @@ import { RoomEngineObjectEvent, RoomObjectCategory } from '@nitrots/nitro-render
|
||||
import { FC, useCallback, useReducer, useState } from 'react';
|
||||
import { GetRoomSession } from '../../api';
|
||||
import { Button, NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../common';
|
||||
import { ModToolsEvent } from '../../events/mod-tools/ModToolsEvent';
|
||||
import { ModToolsOpenRoomChatlogEvent } from '../../events/mod-tools/ModToolsOpenRoomChatlogEvent';
|
||||
import { ModToolsOpenRoomInfoEvent } from '../../events/mod-tools/ModToolsOpenRoomInfoEvent';
|
||||
import { ModToolsOpenUserInfoEvent } from '../../events/mod-tools/ModToolsOpenUserInfoEvent';
|
||||
import { useRoomEngineEvent } from '../../hooks/events';
|
||||
import { dispatchUiEvent, useUiEvent } from '../../hooks/events/ui/ui-event';
|
||||
import { ModToolsEvent, ModToolsOpenRoomChatlogEvent, ModToolsOpenRoomInfoEvent, ModToolsOpenUserInfoEvent } from '../../events';
|
||||
import { DispatchUiEvent, UseRoomEngineEvent, UseUiEvent } from '../../hooks';
|
||||
import { ModToolsContextProvider } from './ModToolsContext';
|
||||
import { ModToolsMessageHandler } from './ModToolsMessageHandler';
|
||||
import { initialModTools, ModToolsActions, ModToolsReducer } from './reducers/ModToolsReducer';
|
||||
@ -43,9 +39,9 @@ export const ModToolsView: FC<{}> = props =>
|
||||
}
|
||||
}, []);
|
||||
|
||||
useUiEvent(ModToolsEvent.SHOW_MOD_TOOLS, onModToolsEvent);
|
||||
useUiEvent(ModToolsEvent.HIDE_MOD_TOOLS, onModToolsEvent);
|
||||
useUiEvent(ModToolsEvent.TOGGLE_MOD_TOOLS, onModToolsEvent);
|
||||
UseUiEvent(ModToolsEvent.SHOW_MOD_TOOLS, onModToolsEvent);
|
||||
UseUiEvent(ModToolsEvent.HIDE_MOD_TOOLS, onModToolsEvent);
|
||||
UseUiEvent(ModToolsEvent.TOGGLE_MOD_TOOLS, onModToolsEvent);
|
||||
|
||||
const onRoomEngineObjectEvent = useCallback((event: RoomEngineObjectEvent) =>
|
||||
{
|
||||
@ -62,7 +58,7 @@ export const ModToolsView: FC<{}> = props =>
|
||||
setSelectedUser({ userId: userData.webID, username: userData.name });
|
||||
}, []);
|
||||
|
||||
useRoomEngineEvent(RoomEngineObjectEvent.SELECTED, onRoomEngineObjectEvent);
|
||||
UseRoomEngineEvent(RoomEngineObjectEvent.SELECTED, onRoomEngineObjectEvent);
|
||||
|
||||
const handleClick = useCallback((action: string, value?: string) =>
|
||||
{
|
||||
@ -73,7 +69,7 @@ export const ModToolsView: FC<{}> = props =>
|
||||
case 'toggle_room': {
|
||||
if(!openRooms)
|
||||
{
|
||||
dispatchUiEvent(new ModToolsOpenRoomInfoEvent(currentRoomId));
|
||||
DispatchUiEvent(new ModToolsOpenRoomInfoEvent(currentRoomId));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -83,7 +79,7 @@ export const ModToolsView: FC<{}> = props =>
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatchUiEvent(new ModToolsOpenRoomInfoEvent(currentRoomId));
|
||||
DispatchUiEvent(new ModToolsOpenRoomInfoEvent(currentRoomId));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -104,7 +100,7 @@ export const ModToolsView: FC<{}> = props =>
|
||||
case 'toggle_room_chatlog': {
|
||||
if(!openRoomChatlogs)
|
||||
{
|
||||
dispatchUiEvent(new ModToolsOpenRoomChatlogEvent(currentRoomId));
|
||||
DispatchUiEvent(new ModToolsOpenRoomChatlogEvent(currentRoomId));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -114,7 +110,7 @@ export const ModToolsView: FC<{}> = props =>
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatchUiEvent(new ModToolsOpenRoomChatlogEvent(currentRoomId));
|
||||
DispatchUiEvent(new ModToolsOpenRoomChatlogEvent(currentRoomId));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@ -140,7 +136,7 @@ export const ModToolsView: FC<{}> = props =>
|
||||
|
||||
if(!openUserInfo)
|
||||
{
|
||||
dispatchUiEvent(new ModToolsOpenUserInfoEvent(userId));
|
||||
DispatchUiEvent(new ModToolsOpenUserInfoEvent(userId));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -150,7 +146,7 @@ export const ModToolsView: FC<{}> = props =>
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatchUiEvent(new ModToolsOpenUserInfoEvent(userId));
|
||||
DispatchUiEvent(new ModToolsOpenUserInfoEvent(userId));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { ChatRecordData, UserProfileComposer } from '@nitrots/nitro-renderer';
|
||||
import { CSSProperties, FC, Key, useCallback } from 'react';
|
||||
import { AutoSizer, CellMeasurer, CellMeasurerCache, List, ListRowProps } from 'react-virtualized';
|
||||
import { TryVisitRoom } from '../../../../api';
|
||||
import { SendMessageComposer, TryVisitRoom } from '../../../../api';
|
||||
import { Base, Button, Column, Flex, Grid, Text } from '../../../../common';
|
||||
import { ModToolsOpenRoomInfoEvent } from '../../../../events/mod-tools/ModToolsOpenRoomInfoEvent';
|
||||
import { dispatchUiEvent, SendMessageHook } from '../../../../hooks';
|
||||
import { DispatchUiEvent } from '../../../../hooks';
|
||||
|
||||
interface ChatlogViewProps
|
||||
{
|
||||
@ -29,7 +29,7 @@ export const ChatlogView: FC<ChatlogViewProps> = props =>
|
||||
>
|
||||
<Grid key={ props.key } fullHeight={ false } style={ props.style } gap={ 1 } alignItems="center" className="log-entry py-1 border-bottom">
|
||||
<Text className="g-col-2">{ chatlogEntry.timestamp }</Text>
|
||||
<Text className="g-col-3" bold underline pointer onClick={ event => SendMessageHook(new UserProfileComposer(chatlogEntry.userId)) }>{ chatlogEntry.userName }</Text>
|
||||
<Text className="g-col-3" bold underline pointer onClick={ event => SendMessageComposer(new UserProfileComposer(chatlogEntry.userId)) }>{ chatlogEntry.userName }</Text>
|
||||
<Text textBreak wrap className="g-col-7">{ chatlogEntry.message }</Text>
|
||||
</Grid>
|
||||
</CellMeasurer>
|
||||
@ -79,7 +79,7 @@ export const ChatlogView: FC<ChatlogViewProps> = props =>
|
||||
{ !isRoomInfo &&
|
||||
<Grid key={ props.key } style={ props.style } gap={ 1 } alignItems="center" className="log-entry py-1 border-bottom">
|
||||
<Text className="g-col-2">{ chatlogEntry.timestamp }</Text>
|
||||
<Text className="g-col-3" bold underline pointer onClick={ event => SendMessageHook(new UserProfileComposer(chatlogEntry.userId)) }>{ chatlogEntry.userName }</Text>
|
||||
<Text className="g-col-3" bold underline pointer onClick={ event => SendMessageComposer(new UserProfileComposer(chatlogEntry.userId)) }>{ chatlogEntry.userName }</Text>
|
||||
<Text textBreak wrap className="g-col-7">{ chatlogEntry.message }</Text>
|
||||
</Grid> }
|
||||
</CellMeasurer>
|
||||
@ -109,7 +109,7 @@ export const ChatlogView: FC<ChatlogViewProps> = props =>
|
||||
</Flex>
|
||||
<Flex gap={ 1 }>
|
||||
<Button onClick={ event => TryVisitRoom(props.roomId) }>Visit Room</Button>
|
||||
<Button onClick={ event => dispatchUiEvent(new ModToolsOpenRoomInfoEvent(props.roomId)) }>Room Tools</Button>
|
||||
<Button onClick={ event => DispatchUiEvent(new ModToolsOpenRoomInfoEvent(props.roomId)) }>Room Tools</Button>
|
||||
</Flex>
|
||||
</Flex>
|
||||
);
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { ChatRecordData, GetRoomChatlogMessageComposer, RoomChatlogEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { SendMessageComposer } from '../../../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../common';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../../../hooks/messages';
|
||||
import { UseMessageEventHook } from '../../../../hooks';
|
||||
import { ChatlogView } from '../chatlog/ChatlogView';
|
||||
|
||||
interface ModToolsChatlogViewProps
|
||||
@ -24,11 +25,11 @@ export const ModToolsChatlogView: FC<ModToolsChatlogViewProps> = props =>
|
||||
setRoomChatlog(parser.data);
|
||||
}, [ roomId ]);
|
||||
|
||||
CreateMessageHook(RoomChatlogEvent, onModtoolRoomChatlogEvent);
|
||||
UseMessageEventHook(RoomChatlogEvent, onModtoolRoomChatlogEvent);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
SendMessageHook(new GetRoomChatlogMessageComposer(roomId));
|
||||
SendMessageComposer(new GetRoomChatlogMessageComposer(roomId));
|
||||
}, [ roomId ]);
|
||||
|
||||
if(!roomChatlog) return null;
|
||||
|
@ -1,10 +1,9 @@
|
||||
import { GetModeratorRoomInfoMessageComposer, ModerateRoomMessageComposer, ModeratorActionMessageComposer, ModeratorRoomInfoEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { TryVisitRoom } from '../../../../api';
|
||||
import { SendMessageComposer, TryVisitRoom } from '../../../../api';
|
||||
import { Button, Column, Flex, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common';
|
||||
import { ModToolsOpenRoomChatlogEvent } from '../../../../events/mod-tools/ModToolsOpenRoomChatlogEvent';
|
||||
import { BatchUpdates, dispatchUiEvent } from '../../../../hooks';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../../../hooks/messages';
|
||||
import { BatchUpdates, DispatchUiEvent, UseMessageEventHook } from '../../../../hooks';
|
||||
|
||||
interface ModToolsRoomViewProps
|
||||
{
|
||||
@ -48,7 +47,7 @@ export const ModToolsRoomView: FC<ModToolsRoomViewProps> = props =>
|
||||
});
|
||||
}, [ roomId ]);
|
||||
|
||||
CreateMessageHook(ModeratorRoomInfoEvent, onModtoolRoomInfoEvent);
|
||||
UseMessageEventHook(ModeratorRoomInfoEvent, onModtoolRoomInfoEvent);
|
||||
|
||||
const handleClick = useCallback((action: string, value?: string) =>
|
||||
{
|
||||
@ -59,13 +58,13 @@ export const ModToolsRoomView: FC<ModToolsRoomViewProps> = props =>
|
||||
case 'alert_only':
|
||||
if(message.trim().length === 0) return;
|
||||
|
||||
SendMessageHook(new ModeratorActionMessageComposer(ModeratorActionMessageComposer.ACTION_ALERT, message, ''));
|
||||
SendMessageComposer(new ModeratorActionMessageComposer(ModeratorActionMessageComposer.ACTION_ALERT, message, ''));
|
||||
return;
|
||||
case 'send_message':
|
||||
if(message.trim().length === 0) return;
|
||||
|
||||
SendMessageHook(new ModeratorActionMessageComposer(ModeratorActionMessageComposer.ACTION_MESSAGE, message, ''));
|
||||
SendMessageHook(new ModerateRoomMessageComposer(roomId, lockRoom ? 1 : 0, changeRoomName ? 1 : 0, kickUsers ? 1 : 0))
|
||||
SendMessageComposer(new ModeratorActionMessageComposer(ModeratorActionMessageComposer.ACTION_MESSAGE, message, ''));
|
||||
SendMessageComposer(new ModerateRoomMessageComposer(roomId, lockRoom ? 1 : 0, changeRoomName ? 1 : 0, kickUsers ? 1 : 0))
|
||||
return;
|
||||
}
|
||||
}, [ changeRoomName, kickUsers, lockRoom, message, roomId ]);
|
||||
@ -74,7 +73,7 @@ export const ModToolsRoomView: FC<ModToolsRoomViewProps> = props =>
|
||||
{
|
||||
if(infoRequested) return;
|
||||
|
||||
SendMessageHook(new GetModeratorRoomInfoMessageComposer(roomId));
|
||||
SendMessageComposer(new GetModeratorRoomInfoMessageComposer(roomId));
|
||||
setInfoRequested(true);
|
||||
}, [ roomId, infoRequested, setInfoRequested ]);
|
||||
|
||||
@ -99,7 +98,7 @@ export const ModToolsRoomView: FC<ModToolsRoomViewProps> = props =>
|
||||
</Column>
|
||||
<Column gap={ 1 }>
|
||||
<Button onClick={ event => TryVisitRoom(roomId) }>Visit Room</Button>
|
||||
<Button onClick={ event => dispatchUiEvent(new ModToolsOpenRoomChatlogEvent(roomId)) }>Chatlog</Button>
|
||||
<Button onClick={ event => DispatchUiEvent(new ModToolsOpenRoomChatlogEvent(roomId)) }>Chatlog</Button>
|
||||
</Column>
|
||||
</Flex>
|
||||
<Column className="bg-muted rounded p-2" gap={ 1 }>
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { CfhChatlogData, CfhChatlogEvent, GetCfhChatlogMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { SendMessageComposer } from '../../../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../common';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../../../hooks';
|
||||
import { UseMessageEventHook } from '../../../../hooks';
|
||||
import { ChatlogView } from '../chatlog/ChatlogView';
|
||||
|
||||
interface CfhChatlogViewProps
|
||||
@ -17,7 +18,7 @@ export const CfhChatlogView: FC<CfhChatlogViewProps> = props =>
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
SendMessageHook(new GetCfhChatlogMessageComposer(issueId));
|
||||
SendMessageComposer(new GetCfhChatlogMessageComposer(issueId));
|
||||
}, [issueId]);
|
||||
|
||||
const onCfhChatlogEvent = useCallback((event: CfhChatlogEvent) =>
|
||||
@ -29,7 +30,7 @@ export const CfhChatlogView: FC<CfhChatlogViewProps> = props =>
|
||||
setChatlogData(parser.data);
|
||||
}, [issueId]);
|
||||
|
||||
CreateMessageHook(CfhChatlogEvent, onCfhChatlogEvent);
|
||||
UseMessageEventHook(CfhChatlogEvent, onCfhChatlogEvent);
|
||||
|
||||
return (
|
||||
<NitroCardView className="nitro-mod-tools-cfh-chatlog" simple={true}>
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { CloseIssuesMessageComposer, ReleaseIssuesMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useMemo, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../api';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { Button, Column, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common';
|
||||
import { ModToolsOpenUserInfoEvent } from '../../../../events/mod-tools/ModToolsOpenUserInfoEvent';
|
||||
import { dispatchUiEvent, SendMessageHook } from '../../../../hooks';
|
||||
import { ModToolsOpenUserInfoEvent } from '../../../../events';
|
||||
import { DispatchUiEvent } from '../../../../hooks';
|
||||
import { getSourceName } from '../../common/IssueCategoryNames';
|
||||
import { useModToolsContext } from '../../ModToolsContext';
|
||||
import { CfhChatlogView } from './CfhChatlogView';
|
||||
@ -30,19 +30,19 @@ export const ModToolsIssueInfoView: FC<IssueInfoViewProps> = props =>
|
||||
|
||||
const releaseIssue = (issueId: number) =>
|
||||
{
|
||||
SendMessageHook(new ReleaseIssuesMessageComposer([ issueId ]));
|
||||
SendMessageComposer(new ReleaseIssuesMessageComposer([ issueId ]));
|
||||
|
||||
onIssueInfoClosed(issueId);
|
||||
}
|
||||
|
||||
const closeIssue = (resolutionType: number) =>
|
||||
{
|
||||
SendMessageHook(new CloseIssuesMessageComposer([ issueId ], resolutionType));
|
||||
SendMessageComposer(new CloseIssuesMessageComposer([ issueId ], resolutionType));
|
||||
|
||||
onIssueInfoClosed(issueId)
|
||||
}
|
||||
|
||||
const openUserInfo = (userId: number) => dispatchUiEvent(new ModToolsOpenUserInfoEvent(userId));
|
||||
const openUserInfo = (userId: number) => DispatchUiEvent(new ModToolsOpenUserInfoEvent(userId));
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { IssueMessageData, ReleaseIssuesMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC } from 'react';
|
||||
import { SendMessageComposer } from '../../../../api';
|
||||
import { Base, Button, Column, Grid } from '../../../../common';
|
||||
import { SendMessageHook } from '../../../../hooks';
|
||||
|
||||
interface ModToolsMyIssuesTabViewProps
|
||||
{
|
||||
@ -13,7 +13,7 @@ export const ModToolsMyIssuesTabView: FC<ModToolsMyIssuesTabViewProps> = props =
|
||||
{
|
||||
const { myIssues = null, onIssueHandleClick = null } = props;
|
||||
|
||||
const onReleaseIssue = (issueId: number) => SendMessageHook(new ReleaseIssuesMessageComposer([issueId]));
|
||||
const onReleaseIssue = (issueId: number) => SendMessageComposer(new ReleaseIssuesMessageComposer([issueId]));
|
||||
|
||||
return (
|
||||
<Column gap={ 0 } overflow="hidden">
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { IssueMessageData, PickIssuesMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC } from 'react';
|
||||
import { SendMessageComposer } from '../../../../api';
|
||||
import { Base, Button, Column, Grid } from '../../../../common';
|
||||
import { SendMessageHook } from '../../../../hooks';
|
||||
|
||||
interface ModToolsOpenIssuesTabViewProps
|
||||
{
|
||||
@ -12,7 +12,7 @@ export const ModToolsOpenIssuesTabView: FC<ModToolsOpenIssuesTabViewProps> = pro
|
||||
{
|
||||
const { openIssues = null } = props;
|
||||
|
||||
const onPickIssue = (issueId: number) => SendMessageHook(new PickIssuesMessageComposer([issueId], false, 0, 'pick issue button'));
|
||||
const onPickIssue = (issueId: number) => SendMessageComposer(new PickIssuesMessageComposer([issueId], false, 0, 'pick issue button'));
|
||||
|
||||
return (
|
||||
<Column gap={ 0 } overflow="hidden">
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { ChatRecordData, GetUserChatlogMessageComposer, UserChatlogEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { SendMessageComposer } from '../../../../api';
|
||||
import { NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../common';
|
||||
import { BatchUpdates, CreateMessageHook, SendMessageHook } from '../../../../hooks';
|
||||
import { BatchUpdates, UseMessageEventHook } from '../../../../hooks';
|
||||
import { ChatlogView } from '../chatlog/ChatlogView';
|
||||
|
||||
interface ModToolsUserChatlogViewProps
|
||||
@ -29,11 +30,11 @@ export const ModToolsUserChatlogView: FC<ModToolsUserChatlogViewProps> = props =
|
||||
});
|
||||
}, [ userId ]);
|
||||
|
||||
CreateMessageHook(UserChatlogEvent, onModtoolUserChatlogEvent);
|
||||
UseMessageEventHook(UserChatlogEvent, onModtoolUserChatlogEvent);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
SendMessageHook(new GetUserChatlogMessageComposer(userId));
|
||||
SendMessageComposer(new GetUserChatlogMessageComposer(userId));
|
||||
}, [ userId ]);
|
||||
|
||||
return (
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { CallForHelpTopicData, DefaultSanctionMessageComposer, ModAlertMessageComposer, ModBanMessageComposer, ModKickMessageComposer, ModMessageMessageComposer, ModMuteMessageComposer, ModTradingLockMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useMemo, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../api';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { Button, Column, Flex, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common';
|
||||
import { SendMessageHook } from '../../../../hooks';
|
||||
import { NotificationAlertType } from '../../../../views/notification-center/common/NotificationAlertType';
|
||||
import { NotificationUtilities } from '../../../../views/notification-center/common/NotificationUtilities';
|
||||
import { useModToolsContext } from '../../ModToolsContext';
|
||||
@ -61,7 +60,7 @@ export const ModToolsUserModActionView: FC<ModToolsUserModActionViewProps> = pro
|
||||
|
||||
const sendDefaultSanction = () =>
|
||||
{
|
||||
SendMessageHook(new DefaultSanctionMessageComposer(user.userId, selectedTopic, message));
|
||||
SendMessageComposer(new DefaultSanctionMessageComposer(user.userId, selectedTopic, message));
|
||||
|
||||
onCloseClick();
|
||||
}
|
||||
@ -104,11 +103,11 @@ export const ModToolsUserModActionView: FC<ModToolsUserModActionViewProps> = pro
|
||||
return;
|
||||
}
|
||||
|
||||
SendMessageHook(new ModAlertMessageComposer(user.userId, message, category.id));
|
||||
SendMessageComposer(new ModAlertMessageComposer(user.userId, message, category.id));
|
||||
break;
|
||||
}
|
||||
case ModActionDefinition.MUTE:
|
||||
SendMessageHook(new ModMuteMessageComposer(user.userId, messageOrDefault, category.id));
|
||||
SendMessageComposer(new ModMuteMessageComposer(user.userId, messageOrDefault, category.id));
|
||||
break;
|
||||
case ModActionDefinition.BAN: {
|
||||
if(!settings.banPermission)
|
||||
@ -118,7 +117,7 @@ export const ModToolsUserModActionView: FC<ModToolsUserModActionViewProps> = pro
|
||||
return;
|
||||
}
|
||||
|
||||
SendMessageHook(new ModBanMessageComposer(user.userId, messageOrDefault, category.id, selectedAction, (sanction.actionId === 106)));
|
||||
SendMessageComposer(new ModBanMessageComposer(user.userId, messageOrDefault, category.id, selectedAction, (sanction.actionId === 106)));
|
||||
break;
|
||||
}
|
||||
case ModActionDefinition.KICK: {
|
||||
@ -128,13 +127,13 @@ export const ModToolsUserModActionView: FC<ModToolsUserModActionViewProps> = pro
|
||||
return;
|
||||
}
|
||||
|
||||
SendMessageHook(new ModKickMessageComposer(user.userId, messageOrDefault, category.id));
|
||||
SendMessageComposer(new ModKickMessageComposer(user.userId, messageOrDefault, category.id));
|
||||
break;
|
||||
}
|
||||
case ModActionDefinition.TRADE_LOCK: {
|
||||
const numSeconds = (sanction.actionLengthHours * 60);
|
||||
|
||||
SendMessageHook(new ModTradingLockMessageComposer(user.userId, messageOrDefault, numSeconds, category.id));
|
||||
SendMessageComposer(new ModTradingLockMessageComposer(user.userId, messageOrDefault, numSeconds, category.id));
|
||||
break;
|
||||
}
|
||||
case ModActionDefinition.MESSAGE: {
|
||||
@ -145,7 +144,7 @@ export const ModToolsUserModActionView: FC<ModToolsUserModActionViewProps> = pro
|
||||
return;
|
||||
}
|
||||
|
||||
SendMessageHook(new ModMessageMessageComposer(user.userId, message, category.id));
|
||||
SendMessageComposer(new ModMessageMessageComposer(user.userId, message, category.id));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { GetRoomVisitsMessageComposer, RoomVisitsData, RoomVisitsEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useState } from 'react';
|
||||
import { AutoSizer, List, ListRowProps } from 'react-virtualized';
|
||||
import { TryVisitRoom } from '../../../../api';
|
||||
import { SendMessageComposer, TryVisitRoom } from '../../../../api';
|
||||
import { Base, Column, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common';
|
||||
import { CreateMessageHook, SendMessageHook } from '../../../../hooks';
|
||||
import { UseMessageEventHook } from '../../../../hooks';
|
||||
|
||||
interface ModToolsUserRoomVisitsViewProps
|
||||
{
|
||||
@ -25,7 +25,7 @@ export const ModToolsUserRoomVisitsView: FC<ModToolsUserRoomVisitsViewProps> = p
|
||||
setRoomVisitData(parser.data);
|
||||
}, [ userId ]);
|
||||
|
||||
CreateMessageHook(RoomVisitsEvent, onModtoolReceivedRoomsUserEvent);
|
||||
UseMessageEventHook(RoomVisitsEvent, onModtoolReceivedRoomsUserEvent);
|
||||
|
||||
const RowRenderer = (props: ListRowProps) =>
|
||||
{
|
||||
@ -42,7 +42,7 @@ export const ModToolsUserRoomVisitsView: FC<ModToolsUserRoomVisitsViewProps> = p
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
SendMessageHook(new GetRoomVisitsMessageComposer(userId));
|
||||
SendMessageComposer(new GetRoomVisitsMessageComposer(userId));
|
||||
}, [userId]);
|
||||
|
||||
if(!userId) return null;
|
||||
|
@ -1,8 +1,9 @@
|
||||
import { ModMessageMessageComposer } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useState } from 'react';
|
||||
import { SendMessageComposer } from '../../../../api';
|
||||
import { Button, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../../../common';
|
||||
import { NotificationAlertEvent } from '../../../../events';
|
||||
import { dispatchUiEvent, SendMessageHook } from '../../../../hooks';
|
||||
import { DispatchUiEvent } from '../../../../hooks';
|
||||
import { ISelectedUser } from '../../utils/ISelectedUser';
|
||||
|
||||
interface ModToolsUserSendMessageViewProps
|
||||
@ -20,12 +21,12 @@ export const ModToolsUserSendMessageView: FC<ModToolsUserSendMessageViewProps> =
|
||||
{
|
||||
if(message.trim().length === 0)
|
||||
{
|
||||
dispatchUiEvent(new NotificationAlertEvent([ 'Please write a message to user.' ], null, null, null, 'Error', null));
|
||||
DispatchUiEvent(new NotificationAlertEvent([ 'Please write a message to user.' ], null, null, null, 'Error', null));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SendMessageHook(new ModMessageMessageComposer(user.userId, message, -999));
|
||||
SendMessageComposer(new ModMessageMessageComposer(user.userId, message, -999));
|
||||
|
||||
onCloseClick();
|
||||
}, [ message, user, onCloseClick ]);
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { FriendlyTime, GetModeratorUserInfoMessageComposer, ModeratorUserInfoData, ModeratorUserInfoEvent } from '@nitrots/nitro-renderer';
|
||||
import { FC, useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import { LocalizeText } from '../../../../api';
|
||||
import { LocalizeText, SendMessageComposer } from '../../../../api';
|
||||
import { Button, Column, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../../../common';
|
||||
import { ModToolsOpenUserChatlogEvent } from '../../../../events/mod-tools/ModToolsOpenUserChatlogEvent';
|
||||
import { CreateMessageHook, dispatchUiEvent, SendMessageHook } from '../../../../hooks';
|
||||
import { ModToolsOpenUserChatlogEvent } from '../../../../events';
|
||||
import { DispatchUiEvent, UseMessageEventHook } from '../../../../hooks';
|
||||
import { ModToolsUserModActionView } from './ModToolsUserModActionView';
|
||||
import { ModToolsUserRoomVisitsView } from './ModToolsUserRoomVisitsView';
|
||||
import { ModToolsUserSendMessageView } from './ModToolsUserSendMessageView';
|
||||
@ -31,7 +31,7 @@ export const ModToolsUserView: FC<ModToolsUserViewProps> = props =>
|
||||
setUserInfo(parser.data);
|
||||
}, [ userId ]);
|
||||
|
||||
CreateMessageHook(ModeratorUserInfoEvent, onModtoolUserInfoEvent);
|
||||
UseMessageEventHook(ModeratorUserInfoEvent, onModtoolUserInfoEvent);
|
||||
|
||||
const userProperties = useMemo(() =>
|
||||
{
|
||||
@ -100,7 +100,7 @@ export const ModToolsUserView: FC<ModToolsUserViewProps> = props =>
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
SendMessageHook(new GetModeratorUserInfoMessageComposer(userId));
|
||||
SendMessageComposer(new GetModeratorUserInfoMessageComposer(userId));
|
||||
}, [ userId ]);
|
||||
|
||||
if(!userInfo) return null;
|
||||
@ -132,7 +132,7 @@ export const ModToolsUserView: FC<ModToolsUserViewProps> = props =>
|
||||
</table>
|
||||
</Column>
|
||||
<Column size={ 4 } gap={ 1 }>
|
||||
<Button onClick={ event => dispatchUiEvent(new ModToolsOpenUserChatlogEvent(userId)) }>
|
||||
<Button onClick={ event => DispatchUiEvent(new ModToolsOpenUserChatlogEvent(userId)) }>
|
||||
Room Chat
|
||||
</Button>
|
||||
<Button onClick={ event => setSendMessageVisible(!sendMessageVisible) }>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user