Merge branch 'async-booting' into dev

This commit is contained in:
Bill 2023-07-20 20:05:36 -04:00
commit 1d151a4f06
98 changed files with 830 additions and 1022 deletions

View File

@ -10,7 +10,6 @@
"eslint": "eslint src --ext .ts,.tsx"
},
"dependencies": {
"@nitrots/nitro-renderer": "^1.6.6",
"@tanstack/react-virtual": "^3.0.0-alpha.0",
"react": "^18.2.0",
"react-bootstrap": "^2.2.2",

View File

@ -1,120 +1,41 @@
import { ConfigurationEvent, GetAssetManager, HabboWebTools, LegacyExternalInterface, Nitro, NitroCommunicationDemoEvent, NitroConfiguration, NitroEvent, NitroLocalizationEvent, NitroVersion, RoomEngineEvent } from '@nitrots/nitro-renderer';
import { FC, useCallback, useEffect, useState } from 'react';
import { GetCommunication, GetConfiguration, GetNitroInstance, GetUIVersion } from './api';
import { Base, TransitionAnimation, TransitionAnimationTypes } from './common';
import { Nitro, NitroLogger, NitroVersion } from '@nitrots/nitro-renderer';
import { FC, useEffect, useState } from 'react';
import { GetNitroInstance, GetUIVersion } from './api';
import { Base } from './common';
import { LoadingView } from './components/loading/LoadingView';
import { MainView } from './components/main/MainView';
import { useConfigurationEvent, useLocalizationEvent, useMainEvent, useRoomEngineEvent } from './hooks';
NitroVersion.UI_VERSION = GetUIVersion();
export const App: FC<{}> = props =>
{
const [ isReady, setIsReady ] = useState(false);
const [ isError, setIsError ] = useState(false);
const [ message, setMessage ] = useState('Getting Ready');
const [ percent, setPercent ] = useState(0);
const [ imageRendering, setImageRendering ] = useState<boolean>(true);
if(!GetNitroInstance())
useEffect(() =>
{
(async () =>
{
try
{
//@ts-ignore
if(!NitroConfig) throw new Error('NitroConfig is not defined!');
Nitro.bootstrap();
await GetNitroInstance().init();
setIsReady(true);
// handle socket close
//canvas.addEventListener('webglcontextlost', () => instance.events.dispatchEvent(new NitroEvent(Nitro.WEBGL_CONTEXT_LOST)));
}
const handler = useCallback(async (event: NitroEvent) =>
catch(err)
{
switch(event.type)
{
case ConfigurationEvent.LOADED:
GetNitroInstance().localization.init();
setPercent(prevValue => (prevValue + 20));
return;
case ConfigurationEvent.FAILED:
setIsError(true);
setMessage('Configuration Failed');
return;
case Nitro.WEBGL_UNAVAILABLE:
setIsError(true);
setMessage('WebGL Required');
return;
case Nitro.WEBGL_CONTEXT_LOST:
setIsError(true);
setMessage('WebGL Context Lost - Reloading');
setTimeout(() => window.location.reload(), 1500);
return;
case NitroCommunicationDemoEvent.CONNECTION_HANDSHAKING:
setPercent(prevValue => (prevValue + 20));
return;
case NitroCommunicationDemoEvent.CONNECTION_HANDSHAKE_FAILED:
setIsError(true);
setMessage('Handshake Failed');
return;
case NitroCommunicationDemoEvent.CONNECTION_AUTHENTICATED:
setPercent(prevValue => (prevValue + 20));
GetNitroInstance().init();
if(LegacyExternalInterface.available) LegacyExternalInterface.call('legacyTrack', 'authentication', 'authok', []);
return;
case NitroCommunicationDemoEvent.CONNECTION_ERROR:
setIsError(true);
setMessage('Connection Error');
return;
case NitroCommunicationDemoEvent.CONNECTION_CLOSED:
//if(GetNitroInstance().roomEngine) GetNitroInstance().roomEngine.dispose();
//setIsError(true);
setMessage('Connection Error');
HabboWebTools.send(-1, 'client.init.handshake.fail');
return;
case RoomEngineEvent.ENGINE_INITIALIZED:
setPercent(prevValue => (prevValue + 20));
setTimeout(() => setIsReady(true), 300);
return;
case NitroLocalizationEvent.LOADED: {
const assetUrls = GetConfiguration<string[]>('preload.assets.urls');
const urls: string[] = [];
if(assetUrls && assetUrls.length) for(const url of assetUrls) urls.push(NitroConfiguration.interpolate(url));
const status = await GetAssetManager().downloadAssets(urls);
if(status)
{
GetCommunication().init();
setPercent(prevValue => (prevValue + 20))
NitroLogger.error(err);
}
else
{
setIsError(true);
setMessage('Assets Failed');
}
return;
}
}
}, []);
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);
useEffect(() =>
{
GetNitroInstance().core.configuration.init();
})();
const resize = (event: UIEvent) => setImageRendering(!(window.devicePixelRatio % 1));
@ -130,11 +51,9 @@ export const App: FC<{}> = props =>
return (
<Base fit overflow="hidden" className={ imageRendering && 'image-rendering-pixelated' }>
{ (!isReady || isError) &&
<LoadingView isError={ isError } message={ message } percent={ percent } /> }
<TransitionAnimation type={ TransitionAnimationTypes.FADE_IN } inProp={ (isReady) }>
<MainView />
</TransitionAnimation>
{ !isReady &&
<LoadingView isError={ false } message={ message } percent={ 0 } showPercent={ false } /> }
{ isReady && <MainView /> }
<Base id="draggable-windows-container" />
</Base>
);

View File

@ -189,7 +189,7 @@ export class AvatarEditorGridPartItem implements IAvatarImageListener
return container;
}
private updateThumbVisualization(): void
private async updateThumbVisualization(): Promise<void>
{
if(!this._isInitalized) return;
@ -212,7 +212,7 @@ export class AvatarEditorGridPartItem implements IAvatarImageListener
if(this._isDisabled) this.setAlpha(container, 0.2);
this._imageUrl = TextureUtils.generateImageUrl(container);
this._imageUrl = await TextureUtils.generateImageUrl(container);
if(this.notify) this.notify();
}

View File

@ -1,3 +1,5 @@
export * from './GetRendererVersion';
export * from './GetUIVersion';
export * from './achievements';
export * from './avatar';
export * from './camera';
@ -6,8 +8,6 @@ export * from './catalog';
export * from './chat-history';
export * from './events';
export * from './friends';
export * from './GetRendererVersion';
export * from './GetUIVersion';
export * from './groups';
export * from './guide-tool';
export * from './hc-center';
@ -18,7 +18,6 @@ export * from './navigator';
export * from './nitro';
export * from './nitro/avatar';
export * from './nitro/camera';
export * from './nitro/core';
export * from './nitro/room';
export * from './nitro/session';
export * from './notification';

View File

@ -1,7 +1,7 @@
import { IConfigurationManager } from '@nitrots/nitro-renderer';
import { GetNitroCore } from './GetNitroCore';
import { GetNitroInstance } from './GetNitroInstance';
export function GetConfigurationManager(): IConfigurationManager
{
return GetNitroCore().configuration;
return GetNitroInstance().configuration;
}

View File

@ -1,7 +0,0 @@
import { INitroCore } from '@nitrots/nitro-renderer';
import { GetNitroInstance } from '..';
export function GetNitroCore(): INitroCore
{
return GetNitroInstance().core;
}

View File

@ -1,2 +0,0 @@
export * from './GetConfigurationManager';
export * from './GetNitroCore';

View File

@ -1,15 +1,15 @@
export * from './AddLinkEventTracker';
export * from './avatar';
export * from './camera';
export * from './core';
export * from './CreateLinkEvent';
export * from './GetCommunication';
export * from './GetConfiguration';
export * from './GetConfigurationManager';
export * from './GetConnection';
export * from './GetLocalization';
export * from './GetNitroInstance';
export * from './OpenUrl';
export * from './RemoveLinkEventTracker';
export * from './room';
export * from './SendMessageComposer';
export * from './avatar';
export * from './camera';
export * from './room';
export * from './session';

View File

@ -1,7 +1,7 @@
import { IRoomSessionManager } from '@nitrots/nitro-renderer';
import { GetNitroInstance } from '../GetNitroInstance';
import { GetRoomEngine } from '../room';
export function GetRoomSessionManager(): IRoomSessionManager
{
return GetNitroInstance().roomSessionManager;
return GetRoomEngine().roomSessionManager;
}

View File

@ -9,7 +9,6 @@ export class AvatarInfoFurni implements IAvatarInfo
public category: number = 0;
public name: string = '';
public description: string = '';
public image: HTMLImageElement = null;
public isWallItem: boolean = false;
public isStickie: boolean = false;
public isRoomOwner: boolean = false;

View File

@ -1,4 +1,4 @@
import { GetTickerTime, IFurnitureData, IRoomModerationSettings, IRoomPetData, IRoomUserData, ObjectDataFactory, PetFigureData, PetType, RoomControllerLevel, RoomModerationSettings, RoomObjectCategory, RoomObjectType, RoomObjectVariable, RoomTradingLevelEnum, RoomWidgetEnumItemExtradataParameter, Vector3d } from '@nitrots/nitro-renderer';
import { GetTickerTime, IFurnitureData, IRoomModerationSettings, IRoomPetData, IRoomUserData, ObjectDataFactory, PetFigureData, PetType, RoomControllerLevel, RoomModerationSettings, RoomObjectCategory, RoomObjectType, RoomObjectVariable, RoomTradingLevelEnum, RoomWidgetEnumItemExtradataParameter } from '@nitrots/nitro-renderer';
import { GetRoomEngine, GetRoomSession, GetSessionDataManager, IsOwnerOfFurniture } from '../../nitro';
import { LocalizeText } from '../../utils';
import { AvatarInfoFurni } from './AvatarInfoFurni';
@ -72,24 +72,20 @@ export class AvatarInfoUtilities
public static getFurniInfo(objectId: number, category: number): AvatarInfoFurni
{
const roomSession = GetRoomSession();
const roomObject = GetRoomEngine().getRoomObject(roomSession.roomId, objectId, category);
if(!roomObject) return null;
const furniInfo = new AvatarInfoFurni(AvatarInfoFurni.FURNI);
furniInfo.id = objectId;
furniInfo.category = category;
const roomObject = GetRoomEngine().getRoomObject(roomSession.roomId, objectId, category);
if(!roomObject) return;
const model = roomObject.model;
if(model.getValue<string>(RoomWidgetEnumItemExtradataParameter.INFOSTAND_EXTRA_PARAM))
{
furniInfo.extraParam = model.getValue<string>(RoomWidgetEnumItemExtradataParameter.INFOSTAND_EXTRA_PARAM);
}
if(model.getValue<string>(RoomWidgetEnumItemExtradataParameter.INFOSTAND_EXTRA_PARAM)) furniInfo.extraParam = model.getValue<string>(RoomWidgetEnumItemExtradataParameter.INFOSTAND_EXTRA_PARAM);
const dataFormat = model.getValue<number>(RoomObjectVariable.FURNITURE_DATA_FORMAT);
const objectData = ObjectDataFactory.getData(dataFormat);
const objectData = ObjectDataFactory.getData(model.getValue<number>(RoomObjectVariable.FURNITURE_DATA_FORMAT));
objectData.initializeFromRoomObjectModel(model);
@ -141,14 +137,14 @@ export class AvatarInfoUtilities
furniInfo.expiration = ((expiryTime < 0) ? expiryTime : Math.max(0, (expiryTime - ((GetTickerTime() - expiryTimestamp) / 1000))));
let roomObjectImage = GetRoomEngine().getRoomObjectImage(roomSession.roomId, objectId, category, new Vector3d(180), 64, null);
/* let roomObjectImage = GetRoomEngine().getRoomObjectImage(roomSession.roomId, objectId, category, new Vector3d(180), 64, null);
if(!roomObjectImage.data || (roomObjectImage.data.width > 140) || (roomObjectImage.data.height > 200))
{
roomObjectImage = GetRoomEngine().getRoomObjectImage(roomSession.roomId, objectId, category, new Vector3d(180), 1, null);
}
furniInfo.image = roomObjectImage.getImage();
furniInfo.image = roomObjectImage.getImage(); */
furniInfo.isWallItem = (category === RoomObjectCategory.WALL);
furniInfo.isRoomOwner = roomSession.isRoomOwner;
furniInfo.roomControllerLevel = roomSession.controllerLevel;
@ -159,11 +155,7 @@ export class AvatarInfoUtilities
const guildId = model.getValue<number>(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_GUILD_ID);
if(guildId !== 0)
{
furniInfo.groupId = guildId;
//this.container.connection.send(new GroupInformationComposer(guildId, false));
}
if(guildId !== 0) furniInfo.groupId = guildId;
if(IsOwnerOfFurniture(roomObject)) furniInfo.isOwner = true;
@ -174,11 +166,7 @@ export class AvatarInfoUtilities
{
const roomSession = GetRoomSession();
let userInfoType = AvatarInfoUser.OWN_USER;
if(userData.webID !== GetSessionDataManager().userId) userInfoType = AvatarInfoUser.PEER;
const userInfo = new AvatarInfoUser(userInfoType);
const userInfo = new AvatarInfoUser((userData.webID === GetSessionDataManager().userId) ? AvatarInfoUser.OWN_USER : AvatarInfoUser.PEER);
userInfo.isSpectatorMode = roomSession.isSpectator;
userInfo.name = userData.name;
@ -192,7 +180,7 @@ export class AvatarInfoUtilities
if(roomObject) userInfo.carryItem = (roomObject.model.getValue<number>(RoomObjectVariable.FIGURE_CARRY_OBJECT) || 0);
if(userInfoType === AvatarInfoUser.OWN_USER) userInfo.allowNameChange = GetSessionDataManager().canChangeName;
if(userInfo.type === AvatarInfoUser.OWN_USER) userInfo.allowNameChange = GetSessionDataManager().canChangeName;
userInfo.amIOwner = roomSession.isRoomOwner;
userInfo.isGuildRoom = roomSession.isGuildRoom;
@ -200,14 +188,11 @@ export class AvatarInfoUtilities
userInfo.amIAnyRoomController = GetSessionDataManager().isModerator;
userInfo.isAmbassador = GetSessionDataManager().isAmbassador;
if(userInfoType === AvatarInfoUser.PEER)
if(userInfo.type === AvatarInfoUser.PEER)
{
if(roomObject)
{
const flatControl = roomObject.model.getValue<number>(RoomObjectVariable.FIGURE_FLAT_CONTROL);
if(flatControl !== null) userInfo.targetRoomControllerLevel = flatControl;
userInfo.targetRoomControllerLevel = roomObject.model.getValue<number>(RoomObjectVariable.FIGURE_FLAT_CONTROL);
userInfo.canBeMuted = this.canBeMuted(userInfo);
userInfo.canBeKicked = this.canBeKicked(userInfo);
userInfo.canBeBanned = this.canBeBanned(userInfo);
@ -234,7 +219,7 @@ export class AvatarInfoUtilities
userInfo.canTrade = (roomController || targetController);
break;
}
case RoomTradingLevelEnum.NO_TRADING:
case RoomTradingLevelEnum.FREE_TRADING:
userInfo.canTrade = true;
break;
default:

View File

@ -0,0 +1,70 @@
import { AvatarFigurePartType, AvatarScaleType, AvatarSetType, PetFigureData, TextureUtils, Vector3d } from '@nitrots/nitro-renderer';
import { GetAvatarRenderManager, GetRoomEngine } from '../../nitro';
export class ChatBubbleUtilities
{
public static AVATAR_COLOR_CACHE: Map<string, number> = new Map();
public static AVATAR_IMAGE_CACHE: Map<string, string> = new Map();
public static PET_IMAGE_CACHE: Map<string, string> = new Map();
private static placeHolderImageUrl: string = '';
public static async setFigureImage(figure: string): Promise<string>
{
const avatarImage = GetAvatarRenderManager().createAvatarImage(figure, AvatarScaleType.LARGE, null, {
resetFigure: figure => this.setFigureImage(figure),
dispose: () =>
{},
disposed: false
});
if(!avatarImage) return null;
const isPlaceholder = avatarImage.isPlaceholder();
if(isPlaceholder && this.placeHolderImageUrl?.length) return this.placeHolderImageUrl;
figure = avatarImage.getFigure().getFigureString();
const image = await avatarImage.getCroppedImage(AvatarSetType.HEAD);
const color = avatarImage.getPartColor(AvatarFigurePartType.CHEST);
if(isPlaceholder) this.placeHolderImageUrl = image.src;
this.AVATAR_COLOR_CACHE.set(figure, ((color && color.rgb) || 16777215));
this.AVATAR_IMAGE_CACHE.set(figure, image.src);
avatarImage.dispose();
return image.src;
}
public static async getUserImage(figure: string): Promise<string>
{
let existing = this.AVATAR_IMAGE_CACHE.get(figure);
if(!existing) existing = await this.setFigureImage(figure);
return existing;
}
public static async getPetImage(figure: string, direction: number, _arg_3: boolean, scale: number = 64, posture: string = null)
{
let existing = this.PET_IMAGE_CACHE.get((figure + posture));
if(existing) return existing;
const figureData = new PetFigureData(figure);
const typeId = figureData.typeId;
const image = GetRoomEngine().getRoomObjectPetImage(typeId, figureData.paletteId, figureData.color, new Vector3d((direction * 45)), scale, null, false, 0, figureData.customParts, posture);
if(image)
{
existing = await TextureUtils.generateImageUrl(image.data);
this.PET_IMAGE_CACHE.set((figure + posture), existing);
}
return existing;
}
}

View File

@ -6,6 +6,7 @@ export * from './AvatarInfoUser';
export * from './AvatarInfoUtilities';
export * from './BotSkillsEnum';
export * from './ChatBubbleMessage';
export * from './ChatBubbleUtilities';
export * from './ChatMessageTypeEnum';
export * from './DimmerFurnitureWidgetPresetItem';
export * from './DoChatsOverlap';

View File

@ -24,36 +24,6 @@ export const NitroCardView: FC<NitroCardViewProps> = props =>
return newClassNames;
}, [ theme, classNames ]);
/* useEffect(() =>
{
if(!uniqueKey || !elementRef || !elementRef.current) return;
const localStorage = GetLocalStorage<WindowSaveOptions>(`nitro.windows.${ uniqueKey }`);
const element = elementRef.current;
if(localStorage && localStorage.size)
{
//element.style.width = `${ localStorage.size.width }px`;
//element.style.height = `${ localStorage.size.height }px`;
}
const observer = new ResizeObserver(event =>
{
const newStorage = { ...GetLocalStorage<Partial<WindowSaveOptions>>(`nitro.windows.${ uniqueKey }`) } as WindowSaveOptions;
newStorage.size = { width: element.offsetWidth, height: element.offsetHeight };
SetLocalStorage<WindowSaveOptions>(`nitro.windows.${ uniqueKey }`, newStorage);
});
observer.observe(element);
return () =>
{
observer.disconnect();
}
}, [ uniqueKey ]); */
return (
<NitroCardContextProvider value={ { theme } }>
<DraggableWindow uniqueKey={ uniqueKey } handleSelector={ handleSelector } windowPosition={ windowPosition } disableDrag={ disableDrag }>

View File

@ -280,7 +280,8 @@
}
}
.furni-image {
.furni-image,
.room-object-image {
position: relative;
width: 100%;
height: 100%;

View File

@ -68,11 +68,14 @@ export const LayoutAvatarImageView: FC<LayoutAvatarImageViewProps> = props =>
avatarImage.setDirection(setType, direction);
const image = avatarImage.getCroppedImage(setType);
(async () =>
{
const image = await avatarImage.getCroppedImage(setType);
if(image) setAvatarUrl(image.src);
avatarImage.dispose();
})();
}, [ figure, gender, direction, headOnly, randomValue ]);
useEffect(() =>

View File

@ -1,4 +1,4 @@
import { BadgeImageReadyEvent, NitroSprite, TextureUtils } from '@nitrots/nitro-renderer';
import { BadgeImageReadyEvent, NitroEventDispatcher, NitroSprite, TextureUtils } from '@nitrots/nitro-renderer';
import { CSSProperties, FC, useEffect, useMemo, useState } from 'react';
import { GetConfiguration, GetSessionDataManager, LocalizeBadgeDescription, LocalizeBadgeName, LocalizeText } from '../../api';
import { Base, BaseProps } from '../Base';
@ -37,7 +37,7 @@ export const LayoutBadgeImageView: FC<LayoutBadgeImageViewProps> = props =>
if(imageElement)
{
newStyle.backgroundImage = `url(${ (isGroup) ? imageElement.src : GetConfiguration<string>('badge.asset.url').replace('%badgename%', badgeCode.toString())})`;
newStyle.backgroundImage = `url(${ (isGroup) ? imageElement.src : GetConfiguration<string>('badge.asset.url').replace('%badgename%', badgeCode.toString()) })`;
newStyle.width = imageElement.width;
newStyle.height = imageElement.height;
@ -55,7 +55,7 @@ export const LayoutBadgeImageView: FC<LayoutBadgeImageViewProps> = props =>
if(Object.keys(style).length) newStyle = { ...newStyle, ...style };
return newStyle;
}, [ imageElement, scale, style ]);
}, [ badgeCode, isGroup, imageElement, scale, style ]);
useEffect(() =>
{
@ -63,31 +63,34 @@ export const LayoutBadgeImageView: FC<LayoutBadgeImageViewProps> = props =>
let didSetBadge = false;
const onBadgeImageReadyEvent = (event: BadgeImageReadyEvent) =>
const onBadgeImageReadyEvent = async (event: BadgeImageReadyEvent) =>
{
if(event.badgeId !== badgeCode) return;
const element = TextureUtils.generateImage(new NitroSprite(event.image));
const element = await TextureUtils.generateImage(new NitroSprite(event.image));
element.onload = () => setImageElement(element);
didSetBadge = true;
GetSessionDataManager().events.removeEventListener(BadgeImageReadyEvent.IMAGE_READY, onBadgeImageReadyEvent);
NitroEventDispatcher.removeEventListener(BadgeImageReadyEvent.IMAGE_READY, onBadgeImageReadyEvent);
}
GetSessionDataManager().events.addEventListener(BadgeImageReadyEvent.IMAGE_READY, onBadgeImageReadyEvent);
NitroEventDispatcher.addEventListener(BadgeImageReadyEvent.IMAGE_READY, onBadgeImageReadyEvent);
const texture = isGroup ? GetSessionDataManager().getGroupBadgeImage(badgeCode) : GetSessionDataManager().getBadgeImage(badgeCode);
if(texture && !didSetBadge)
{
const element = TextureUtils.generateImage(new NitroSprite(texture));
(async () =>
{
const element = await TextureUtils.generateImage(new NitroSprite(texture));
element.onload = () => setImageElement(element);
})();
}
return () => GetSessionDataManager().events.removeEventListener(BadgeImageReadyEvent.IMAGE_READY, onBadgeImageReadyEvent);
return () => NitroEventDispatcher.removeEventListener(BadgeImageReadyEvent.IMAGE_READY, onBadgeImageReadyEvent);
}, [ badgeCode, isGroup ]);
return (

View File

@ -46,15 +46,7 @@ export const LayoutFurniImageView: FC<LayoutFurniImageViewProps> = props =>
let imageResult: ImageResult = null;
const listener: IGetImageListener = {
imageReady: (id, texture, image) =>
{
if(!image && texture)
{
image = TextureUtils.generateImage(texture);
}
image.onload = () => setImageElement(image);
},
imageReady: async (id, texture, image) => setImageElement(await TextureUtils.generateImage(texture)),
imageFailed: null
};
@ -68,12 +60,9 @@ export const LayoutFurniImageView: FC<LayoutFurniImageViewProps> = props =>
break;
}
if(imageResult)
{
const image = imageResult.getImage();
if(!imageResult) return;
image.onload = () => setImageElement(image);
}
(async () => setImageElement(await TextureUtils.generateImage(imageResult.data)))();
}, [ productType, productClassId, direction, extraData ]);
if(!imageElement) return null;

View File

@ -6,7 +6,7 @@ import { DraggableWindow } from '../draggable-window';
interface LayoutMiniCameraViewProps
{
roomId: number;
textureReceiver: (texture: NitroRenderTexture) => void;
textureReceiver: (texture: NitroRenderTexture) => Promise<void>;
onClose: () => void;
}

View File

@ -68,7 +68,7 @@ export const LayoutPetImageView: FC<LayoutPetImageViewProps> = props =>
if(petTypeId === 16) petHeadOnly = false;
const imageResult = GetRoomEngine().getRoomObjectPetImage(petTypeId, petPaletteId, petColor1, new Vector3d((direction * 45)), 64, {
imageReady: (id, texture, image) =>
imageReady: async (id, texture, image) =>
{
if(isDisposed.current) return;
@ -81,7 +81,7 @@ export const LayoutPetImageView: FC<LayoutPetImageViewProps> = props =>
else if(texture)
{
setPetUrl(TextureUtils.generateImageUrl(texture));
setPetUrl(await TextureUtils.generateImageUrl(texture));
setWidth(texture.width);
setHeight(texture.height);
}
@ -94,7 +94,9 @@ export const LayoutPetImageView: FC<LayoutPetImageViewProps> = props =>
if(imageResult)
{
const image = imageResult.getImage();
(async () =>
{
const image = await imageResult.getImage();
if(image)
{
@ -102,6 +104,7 @@ export const LayoutPetImageView: FC<LayoutPetImageViewProps> = props =>
setWidth(image.width);
setHeight(image.height);
}
})();
}
}, [ figure, typeId, paletteId, petColor, customParts, posture, headOnly, direction ]);

View File

@ -0,0 +1,61 @@
import { TextureUtils, Vector3d } from '@nitrots/nitro-renderer';
import { CSSProperties, FC, useEffect, useMemo, useState } from 'react';
import { BaseProps } from '..';
import { GetRoomEngine } from '../../api';
import { Base } from '../Base';
interface LayoutRoomObjectImageViewProps extends BaseProps<HTMLDivElement>
{
roomId: number;
objectId: number;
category: number;
direction?: number;
scale?: number;
}
export const LayoutRoomObjectImageView: FC<LayoutRoomObjectImageViewProps> = props =>
{
const { roomId = -1, objectId = 1, category = -1, direction = 2, scale = 1, style = {}, ...rest } = props;
const [ imageElement, setImageElement ] = useState<HTMLImageElement>(null);
const getStyle = useMemo(() =>
{
let newStyle: CSSProperties = {};
if(imageElement?.src?.length)
{
newStyle.backgroundImage = `url('${ imageElement.src }')`;
newStyle.width = imageElement.width;
newStyle.height = imageElement.height;
}
if(scale !== 1)
{
newStyle.transform = `scale(${ scale })`;
if(!(scale % 1)) newStyle.imageRendering = 'pixelated';
}
if(Object.keys(style).length) newStyle = { ...newStyle, ...style };
return newStyle;
}, [ imageElement, scale, style ]);
useEffect(() =>
{
const imageResult = GetRoomEngine().getRoomObjectImage(roomId, objectId, category, new Vector3d(direction * 45), 64, {
imageReady: async (id, texture, image) => setImageElement(await TextureUtils.generateImage(texture)),
imageFailed: null
});
// needs (roomObjectImage.data.width > 140) || (roomObjectImage.data.height > 200) scale 1
if(!imageResult) return;
(async () => setImageElement(await TextureUtils.generateImage(imageResult.data)))();
}, [ roomId, objectId, category, direction, scale ]);
if(!imageElement) return null;
return <Base classNames={ [ 'furni-image' ] } style={ getStyle } { ...rest } />;
}

View File

@ -26,7 +26,7 @@ export const LayoutRoomPreviewerView: FC<LayoutRoomPreviewerViewProps> = props =
{
if(!roomPreviewer) return;
const update = (time: number) =>
const update = async (time: number) =>
{
if(!roomPreviewer || !renderingCanvas || !elementRef.current) return;
@ -34,7 +34,7 @@ export const LayoutRoomPreviewerView: FC<LayoutRoomPreviewerViewProps> = props =
if(!renderingCanvas.canvasUpdated) return;
elementRef.current.style.backgroundImage = `url(${ TextureUtils.generateImageUrl(renderingCanvas.master) })`;
elementRef.current.style.backgroundImage = `url(${ await TextureUtils.generateImageUrl(renderingCanvas.master) })`;
}
if(!renderingCanvas)

View File

@ -16,8 +16,9 @@ export * from './LayoutNotificationBubbleView';
export * from './LayoutPetImageView';
export * from './LayoutProgressBar';
export * from './LayoutRarityLevelView';
export * from './LayoutRoomObjectImageView';
export * from './LayoutRoomPreviewerView';
export * from './LayoutRoomThumbnailView';
export * from './LayoutTrophyView';
export * from './limited-edition';
export * from './UserProfileIconView';
export * from './limited-edition';

View File

@ -1,5 +1,4 @@
import { NitroToolbarAnimateIconEvent } from '@nitrots/nitro-renderer';
import { GetRoomEngine } from '../../api';
import { NitroEventDispatcher, NitroToolbarAnimateIconEvent } from '@nitrots/nitro-renderer';
export const CreateTransitionToIcon = (image: HTMLImageElement, fromElement: HTMLElement, icon: string) =>
{
@ -10,5 +9,5 @@ export const CreateTransitionToIcon = (image: HTMLImageElement, fromElement: HTM
event.iconName = icon;
GetRoomEngine().events.dispatchEvent(event);
NitroEventDispatcher.dispatchEvent(event);
}

View File

@ -62,7 +62,7 @@ export const AvatarEditorWardrobeView: FC<AvatarEditorWardrobeViewProps> = props
<Flex gap={ 1 } className="button-container">
<Button variant="link" fullWidth onClick={ event => saveFigureAtWardrobeIndex(index) }>{ LocalizeText('avatareditor.wardrobe.save') }</Button>
{ figureContainer &&
<Button variant="link" fullWidth onClick={ event => wearFigureAtIndex(index) } disabled={ (clubLevel > GetClubMemberLevel()) }>{ LocalizeText('generic_usable.button.use') }</Button> }
<Button variant="link" fullWidth onClick={ event => wearFigureAtIndex(index) } disabled={ (clubLevel > GetClubMemberLevel()) }>{ LocalizeText('widget.generic_usable.button.use') }</Button> }
</Flex>
</LayoutGridItem>
);

View File

@ -1,7 +1,7 @@
import { ILinkEventTracker, RoomSessionEvent } from '@nitrots/nitro-renderer';
import { FC, useEffect, useState } from 'react';
import { AddEventLinkTracker, RemoveLinkEventTracker } from '../../api';
import { useCamera, useRoomSessionManagerEvent } from '../../hooks';
import { useCamera, useNitroEvent } from '../../hooks';
import { CameraWidgetCaptureView } from './views/CameraWidgetCaptureView';
import { CameraWidgetCheckoutView } from './views/CameraWidgetCheckoutView';
import { CameraWidgetEditorView } from './views/editor/CameraWidgetEditorView';
@ -49,7 +49,7 @@ export const CameraWidgetView: FC<{}> = props =>
setMode(MODE_CHECKOUT);
}
useRoomSessionManagerEvent<RoomSessionEvent>(RoomSessionEvent.ENDED, event => setMode(MODE_NONE));
useNitroEvent<RoomSessionEvent>(RoomSessionEvent.ENDED, event => setMode(MODE_NONE));
useEffect(() =>
{

View File

@ -32,7 +32,7 @@ export const CameraWidgetCaptureView: FC<CameraWidgetCaptureViewProps> = props =
return new NitroRectangle(Math.floor(frameBounds.x), Math.floor(frameBounds.y), Math.floor(frameBounds.width), Math.floor(frameBounds.height));
}
const takePicture = () =>
const takePicture = async () =>
{
if(selectedPictureIndex > -1)
{
@ -52,7 +52,7 @@ export const CameraWidgetCaptureView: FC<CameraWidgetCaptureViewProps> = props =
}
PlaySound(SoundNames.CAMERA_SHUTTER);
clone.push(new CameraPicture(texture, TextureUtils.generateImageUrl(texture)));
clone.push(new CameraPicture(texture, await TextureUtils.generateImageUrl(texture)));
setCameraRoll(clone);
}

View File

@ -26,6 +26,7 @@ export const CameraWidgetEditorView: FC<CameraWidgetEditorViewProps> = props =>
const [ selectedEffects, setSelectedEffects ] = useState<IRoomCameraWidgetSelectedEffect[]>([]);
const [ effectsThumbnails, setEffectsThumbnails ] = useState<CameraPictureThumbnail[]>([]);
const [ isZoomed, setIsZoomed ] = useState(false);
const [ currentPictureUrl, setCurrentPictureUrl ] = useState<string>('');
const getColorMatrixEffects = useMemo(() =>
{
@ -83,11 +84,6 @@ export const CameraWidgetEditorView: FC<CameraWidgetEditorViewProps> = props =>
});
}, [ getCurrentEffectIndex, setSelectedEffects ]);
const getCurrentPictureUrl = useMemo(() =>
{
return GetRoomCameraWidgetManager().applyEffects(picture.texture, selectedEffects, isZoomed).src;
}, [ picture, selectedEffects, isZoomed ]);
const processAction = useCallback((type: string, effectName: string = null) =>
{
switch(type)
@ -99,7 +95,7 @@ export const CameraWidgetEditorView: FC<CameraWidgetEditorViewProps> = props =>
onCancel();
return;
case 'checkout':
onCheckout(getCurrentPictureUrl);
onCheckout(currentPictureUrl);
return;
case 'change_tab':
setCurrentTab(String(effectName));
@ -143,32 +139,50 @@ export const CameraWidgetEditorView: FC<CameraWidgetEditorViewProps> = props =>
setSelectedEffects([]);
return;
case 'download': {
(async () =>
{
const image = new Image();
image.src = getCurrentPictureUrl
image.src = currentPictureUrl
const newWindow = window.open('');
newWindow.document.write(image.outerHTML);
})();
return;
}
case 'zoom':
setIsZoomed(!isZoomed);
return;
}
}, [ isZoomed, availableEffects, selectedEffectName, getCurrentPictureUrl, getSelectedEffectIndex, onCancel, onCheckout, onClose, setIsZoomed, setSelectedEffects ]);
}, [ isZoomed, availableEffects, selectedEffectName, currentPictureUrl, getSelectedEffectIndex, onCancel, onCheckout, onClose, setIsZoomed, setSelectedEffects ]);
useEffect(() =>
{
(async () =>
{
const thumbnails: CameraPictureThumbnail[] = [];
for(const effect of availableEffects)
for await (const effect of availableEffects)
{
thumbnails.push(new CameraPictureThumbnail(effect.name, GetRoomCameraWidgetManager().applyEffects(picture.texture, [ new RoomCameraWidgetSelectedEffect(effect, 1) ], false).src));
const image = await GetRoomCameraWidgetManager().applyEffects(picture.texture, [ new RoomCameraWidgetSelectedEffect(effect, 1) ], false);
thumbnails.push(new CameraPictureThumbnail(effect.name, image.src));
}
setEffectsThumbnails(thumbnails);
})();
}, [ picture, availableEffects ]);
useEffect(() =>
{
(async () =>
{
const imageUrl = await GetRoomCameraWidgetManager().applyEffects(picture.texture, selectedEffects, isZoomed);
setCurrentPictureUrl(imageUrl.src);
})();
}, [ picture, selectedEffects, isZoomed ]);
return (
<NitroCardView className="nitro-camera-editor">
<NitroCardHeaderView headerText={ LocalizeText('camera.editor.button.text') } onCloseClick={ event => processAction('close') } />
@ -185,7 +199,7 @@ export const CameraWidgetEditorView: FC<CameraWidgetEditorViewProps> = props =>
</Column>
<Column size={ 7 } justifyContent="between" overflow="hidden">
<Column center>
<LayoutImage imageUrl={ getCurrentPictureUrl } className="picture-preview" />
<LayoutImage imageUrl={ currentPictureUrl } className="picture-preview" />
{ selectedEffectName &&
<Column center fullWidth gap={ 1 }>
<Text>{ LocalizeText('camera.effect.name.' + selectedEffectName) }</Text>

View File

@ -1,6 +1,5 @@
import { NitroToolbarAnimateIconEvent, TextureUtils, ToolbarIconEnum } from '@nitrots/nitro-renderer';
import { NitroEventDispatcher, NitroToolbarAnimateIconEvent, TextureUtils, ToolbarIconEnum } from '@nitrots/nitro-renderer';
import { FC, useRef } from 'react';
import { GetRoomEngine } from '../../../../api';
import { LayoutRoomPreviewerView, LayoutRoomPreviewerViewProps } from '../../../../common';
import { CatalogPurchasedEvent } from '../../../../events';
import { useUiEvent } from '../../../../hooks';
@ -18,7 +17,9 @@ export const CatalogRoomPreviewerView: FC<LayoutRoomPreviewerViewProps> = props
if(!renderTexture) return;
const image = TextureUtils.generateImage(renderTexture);
(async () =>
{
const image = await TextureUtils.generateImage(renderTexture);
if(!image) return;
@ -31,7 +32,8 @@ export const CatalogRoomPreviewerView: FC<LayoutRoomPreviewerViewProps> = props
animateEvent.iconName = ToolbarIconEnum.INVENTORY;
GetRoomEngine().events.dispatchEvent(animateEvent);
NitroEventDispatcher.dispatchEvent(animateEvent);
})();
});
return (

View File

@ -23,9 +23,7 @@ export const CatalogSearchView: FC<{}> = props =>
const timeout = setTimeout(() =>
{
const furnitureDatas = GetSessionDataManager().getAllFurnitureData({
loadFurnitureData: null
});
const furnitureDatas = GetSessionDataManager().getAllFurnitureData();
if(!furnitureDatas || !furnitureDatas.length) return;

View File

@ -2,12 +2,12 @@ import { FloorHeightMapEvent, ILinkEventTracker, NitroPoint, RoomEngineEvent, Ro
import { FC, useEffect, useState } from 'react';
import { AddEventLinkTracker, LocalizeText, RemoveLinkEventTracker, SendMessageComposer } from '../../api';
import { Button, ButtonGroup, Flex, NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../common';
import { useMessageEvent, useRoomEngineEvent } from '../../hooks';
import { useMessageEvent, useNitroEvent } from '../../hooks';
import { FloorplanEditorContextProvider } from './FloorplanEditorContext';
import { FloorplanEditor } from './common/FloorplanEditor';
import { IFloorplanSettings } from './common/IFloorplanSettings';
import { IVisualizationSettings } from './common/IVisualizationSettings';
import { convertNumbersForSaving, convertSettingToNumber } from './common/Utils';
import { FloorplanEditorContextProvider } from './FloorplanEditorContext';
import { FloorplanCanvasView } from './views/FloorplanCanvasView';
import { FloorplanImportExportView } from './views/FloorplanImportExportView';
import { FloorplanOptionsView } from './views/FloorplanOptionsView';
@ -54,7 +54,7 @@ export const FloorplanEditorView: FC<{}> = props =>
FloorplanEditor.instance.renderTiles();
}
useRoomEngineEvent<RoomEngineEvent>(RoomEngineEvent.DISPOSED, event => setIsVisible(false));
useNitroEvent<RoomEngineEvent>(RoomEngineEvent.DISPOSED, event => setIsVisible(false));
useMessageEvent<FloorHeightMapEvent>(FloorHeightMapEvent, event =>
{
@ -135,11 +135,6 @@ export const FloorplanEditorView: FC<{}> = props =>
return () => RemoveLinkEventTracker(linkTracker);
}, []);
useEffect(() =>
{
FloorplanEditor.instance.initialize();
}, []);
return (
<FloorplanEditorContextProvider value={ { originalFloorplanSettings: originalFloorplanSettings, setOriginalFloorplanSettings: setOriginalFloorplanSettings, visualizationSettings: visualizationSettings, setVisualizationSettings: setVisualizationSettings } }>
{ isVisible &&

View File

@ -1,10 +1,11 @@
import { GetAssetManager, IGraphicAssetCollection, NitroPoint, NitroTilemap, PixiApplicationProxy, PixiInteractionEventProxy, POINT_STRUCT_SIZE } from '@nitrots/nitro-renderer';
import { NitroPoint } from '@nitrots/nitro-renderer';
import { ActionSettings } from './ActionSettings';
import { FloorAction, HEIGHT_SCHEME, MAX_NUM_TILE_PER_AXIS, TILE_SIZE } from './Constants';
import { imageBase64, spritesheet } from './FloorplanResource';
import { Tile } from './Tile';
import { getScreenPositionForTile, getTileFromScreenPosition } from './Utils';
import { getScreenPositionForTile } from './Utils';
export class FloorplanEditor extends PixiApplicationProxy
export class FloorplanEditor
{
private static _INSTANCE: FloorplanEditor = null;
@ -14,130 +15,76 @@ export class FloorplanEditor extends PixiApplicationProxy
private _tilemap: Tile[][];
private _width: number;
private _height: number;
private _isHolding: boolean;
private _isPointerDown: boolean;
private _doorLocation: NitroPoint;
private _lastUsedTile: NitroPoint;
private _tilemapRenderer: NitroTilemap;
private _renderer: CanvasRenderingContext2D;
private _actionSettings: ActionSettings;
private _isInitialized: boolean;
private _assetCollection: IGraphicAssetCollection;
private _image: HTMLImageElement;
constructor()
{
const width = TILE_SIZE * MAX_NUM_TILE_PER_AXIS + 20;
const height = (TILE_SIZE * MAX_NUM_TILE_PER_AXIS) / 2 + 100;
super({
width: width,
height: height,
backgroundColor: 0x000000,
antialias: true,
autoDensity: true,
resolution: 1,
sharedLoader: true,
sharedTicker: true
});
const canvas = document.createElement('canvas');
canvas.height = height;
canvas.width = width;
this._renderer = canvas.getContext('2d');
this._image = new Image();
this._image.src = imageBase64;
this._tilemap = [];
this._doorLocation = new NitroPoint(0, 0);
this._width = 0;
this._height = 0;
this._isHolding = false;
this._isPointerDown = false;
this._lastUsedTile = new NitroPoint(-1, -1);
this._actionSettings = new ActionSettings();
}
public initialize(): void
public onPointerRelease(): void
{
if(this._isInitialized) return;
const collection = GetAssetManager().getCollection('floor_editor');
if(!collection) return;
this._assetCollection = collection;
this._tilemapRenderer = new NitroTilemap(collection.baseTexture);
this.registerEventListeners();
this.stage.addChild(this._tilemapRenderer);
this._isInitialized = true;
this._isPointerDown = false;
}
private registerEventListeners(): void
public onPointerDown(event: PointerEvent): void
{
//this._tilemapRenderer.interactive = true;
if(event.button === 2) return;
const tempPoint = new NitroPoint();
// @ts-ignore
this._tilemapRenderer.containsPoint = (position) =>
{
this._tilemapRenderer.worldTransform.applyInverse(position, tempPoint);
return this.tileHitDetection(tempPoint, false);
};
const location = new NitroPoint(event.offsetX, event.offsetY);
this._tilemapRenderer.on('pointerup', () =>
{
this._isHolding = false;
});
this._isPointerDown = true;
this._tilemapRenderer.on('pointerout', () =>
{
this._isHolding = false;
});
this._tilemapRenderer.on('pointerdown', (event: PixiInteractionEventProxy) =>
{
if(!(event.data.originalEvent instanceof PointerEvent) && !(event.data.originalEvent instanceof TouchEvent)) return;
const pointerEvent = event.data.originalEvent;
if((pointerEvent instanceof MouseEvent) && pointerEvent.button === 2) return;
const location = event.data.global;
this.tileHitDetection(location, true);
});
this._tilemapRenderer.on('click', (event: PixiInteractionEventProxy) =>
{
if(!(event.data.originalEvent instanceof PointerEvent)) return;
const pointerEvent = event.data.originalEvent;
if(pointerEvent.button === 2) return;
const location = event.data.global;
this.tileHitDetection(location, true, true);
});
}
private tileHitDetection(tempPoint: NitroPoint, setHolding: boolean, isClick: boolean = false): boolean
public onPointerMove(event: PointerEvent): void
{
// @ts-ignore
const buffer = this._tilemapRenderer.pointsBuf;
const bufSize = POINT_STRUCT_SIZE;
if(!this._isPointerDown) return;
const len = buffer.length;
if(setHolding)
{
this._isHolding = true;
const location = new NitroPoint(event.offsetX, event.offsetY);
this.tileHitDetection(location, false);
}
for(let j = 0; j < len; j += bufSize)
private tileHitDetection(tempPoint: NitroPoint, isClick: boolean = false): boolean
{
const bufIndex = j + bufSize;
const data = buffer.slice(j, bufIndex);
const mousePositionX = Math.floor(tempPoint.x);
const mousePositionY = Math.floor(tempPoint.y);
const width = TILE_SIZE;
const height = TILE_SIZE / 2;
const mousePositionX = Math.floor(tempPoint.x);
const mousePositionY = Math.floor(tempPoint.y);
const tileStartX = data[2];
const tileStartY = data[3];
for(let y = 0; y < this._tilemap.length; y++)
{
for(let x = 0; x < this.tilemap[y].length; x++)
{
const [ tileStartX, tileStartY ] = getScreenPositionForTile(x, y);
const centreX = tileStartX + (width / 2);
const centreY = tileStartY + (height / 2);
@ -146,28 +93,27 @@ export class FloorplanEditor extends PixiApplicationProxy
const dy = Math.abs(mousePositionY - centreY);
const solution = (dx / (width * 0.5) + dy / (height * 0.5) <= 1);//todo: improve this
if(solution)
{
if(this._isHolding)
if(this._isPointerDown)
{
const [ realX, realY ] = getTileFromScreenPosition(tileStartX, tileStartY);
if(isClick)
{
this.onClick(realX, realY);
this.onClick(x, y);
}
else if(this._lastUsedTile.x !== realX || this._lastUsedTile.y !== realY)
else if(this._lastUsedTile.x !== x || this._lastUsedTile.y !== y)
{
this._lastUsedTile.x = realX;
this._lastUsedTile.y = realY;
this.onClick(realX, realY);
this._lastUsedTile.x = x;
this._lastUsedTile.y = y;
this.onClick(x, y);
}
}
return true;
}
}
}
return false;
}
@ -230,7 +176,7 @@ export class FloorplanEditor extends PixiApplicationProxy
public renderTiles(): void
{
this.tilemapRenderer.clear();
this.clearCanvas();
for(let y = 0; y < this._tilemap.length; y++)
{
@ -247,7 +193,9 @@ export class FloorplanEditor extends PixiApplicationProxy
//if((tile.height === 'x') || tile.height === 'X') continue;
const [ positionX, positionY ] = getScreenPositionForTile(x, y);
this._tilemapRenderer.tile(this._assetCollection.getTexture(`floor_editor_${ assetName }`), positionX, positionY);
const asset = spritesheet.frames[assetName];
this.renderer.drawImage(this._image, asset.frame.x, asset.frame.y, asset.frame.w, asset.frame.h, positionX, positionY, asset.frame.w, asset.frame.h);
}
}
}
@ -372,20 +320,24 @@ export class FloorplanEditor extends PixiApplicationProxy
public clear(): void
{
this._tilemapRenderer.interactive = false;
this._tilemap = [];
this._doorLocation.set(-1, -1);
this._width = 0;
this._height = 0;
this._isHolding = false;
this._isPointerDown = false;
this._lastUsedTile.set(-1, -1);
this._actionSettings.clear();
this._tilemapRenderer.clear();
this.clearCanvas();
}
public get tilemapRenderer(): NitroTilemap
public clearCanvas(): void
{
return this._tilemapRenderer;
this.renderer.clearRect(0, 0, this._renderer.canvas.width, this._renderer.canvas.height);
}
public get renderer(): CanvasRenderingContext2D
{
return this._renderer;
}
public get tilemap(): Tile[][]

View File

@ -0,0 +1,227 @@
export const imageBase64 =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAC+CAMAAADnThrbAAAAYFBMVEUAAAAiIiIAZf8A6P8A/5MZ/wCb/wD/tQD/MgD/AHr/APxDXocAkf8A/+oA/2hE/wDy/wD/iQD/BwD/AKXWAP////8AvP8A/78A/z1w/wD/4AD/XgD/ACP/ANGqAP8QEBBSz3qJAAAAAXRSTlMAQObYZgAAAAlwSFlzAAALEwAACxMBAJqcGAAABJxJREFUeNrt1tuOszoMBeDpD7QFBloKDGf6/m+51UTj1PUhN1uWOup3vSQLkSzn6+vV4fAV9X9lLIcdDv/+xWKHw/d3PPPzE8k8Rj1osceoBz3z4yiZ31HauN9R2rjfUcq451HSuOdR0rjnUcK411HcuNdR3LjXUcw4btTrOG7U6zhu1Ms4adTzOGnU8zhpVBh30Eb5cQ/fKp/5UR1+51l9mfU/Mz6NxvfMuEGMu9G49f/y8vzLz4Ikif/8qopnhiF6FhNHP9aVo2cGR71lCZAvbAXkzADE/kgQvooqhM8MCNuMCUFLtiJoZiBI5ycsvD4qFs4MLLTNElFYjJUoZAYRPAsSlV/5lcpnBhU8C6y+zPqfGZ9G43tm3CDG3Wjc+p9N/Z7PgjSN//y6jmfGMXoWU0c/1rWjZ0ZHvWUpkC9sDeTMCMT+SBG+imqEz4wI24wpQUu2JmhmJEjnpyy8PmoWzowstM1SUViMtShkRhE8C1KVX/m1ymdGFTwLrL7M+p8Zn0bje2bcIMbdaNz6n039ns+CLIv//Mslnpmm6FnMHP1YXxw9MznqLcuAfGEvQM5MQOyPDOGr6ILwmQlhmzEjaMleCJqZCNL5GQuvjwsLZyYW2maZKCzGiyhkJhE8CzKVX/kXlc9MKngWWH2Z9T8zPo3G98y4QYy70bj1P5v6PZ8Fx2P851+v8cw8R8/i0dGP9dXRM7Oj3rIjkC/sFciZGYj9cUT4KroifGZG2GY8ErRkrwTNzATp/CMLr48rC2dmFtpmR1FYjFdRyMwieBYcVX7lX1U+M6vgWWD1Zdb/zPg0Gt8z4wYx7kbj1v9s6vd8FpxO8Z/fNPHMskTP4snRj3Xj6JnFUW/ZCcgXtgFyZgFif5wQvooahM8sCNuMJ4KWbEPQzEKQzj+x8PpoWDizsNA2O4nCYmxEIbOI4FlwUvmV36h8ZlHBs8Dqy6z/mfFpNL5nxg1i3I3Grf/Z1O/5LDif4z//dotn1jV6Fs+Ofqxvjp5ZHfWWnYF8YW9AzqxA7I8zwlfRDeEzK8I245mgJXsjaGYlSOefWXh93Fg4s7LQNjuLwmK8iUJmFcGz4KzyK/+m8plVBc8Cqy+z/mfGp9H4nhk3iHE3Grf+Z1O/57Mgz+M/v23jmW2LnsXc0Y916+iZzVFvWQ7kC9sCObMBsT9yhK+iFuEzG8I2Y07Qkm0JmtkI0vk5C6+PloUzGwtts1wUFmMrCplNBM+CXOVXfqvymU0FzwKrL7P+Z8an0fieGTeIcTcat/5nU7/ns6Ao4j+/6+KZfY+excLRj3Xn6JndUW9ZAeQL2wE5swOxPwqEr6IO4TM7wjZjQdCS7Qia2QnS+QULr4+OhTM7C22zQhQWYycKmV0Ez4JC5Vd+p/KZXQXPAqsvs/5nxqfR+J4ZN4hxNxq3/mdTv+ezoCzjP7/v45n7PXoWS0c/1r2jZ+6OestKIF/YHsiZOxD7o0T4KuoRPnNH2GYsCVqyPUEzd4J0fsnC66Nn4cydhbZZKQqLsReFzF0Ez4JS5Vd+r/KZuwqeBVZfZv3PjE+j8T0zbhDjbjRu/b+0PP8DZwi9QurvbfwAAAAASUVORK5CYII=';
export const spritesheet = {
frames: {
'0': {
frame: { x: 1, y: 1, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'1': {
frame: { x: 37, y: 1, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'2': {
frame: { x: 73, y: 1, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'3': {
frame: { x: 1, y: 20, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'4': {
frame: { x: 37, y: 20, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'5': {
frame: { x: 73, y: 20, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'6': {
frame: { x: 1, y: 39, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'7': {
frame: { x: 37, y: 39, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'8': {
frame: { x: 73, y: 39, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'9': {
frame: { x: 1, y: 58, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'a': {
frame: { x: 37, y: 58, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'b': {
frame: { x: 73, y: 58, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'c': {
frame: { x: 1, y: 77, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'd': {
frame: { x: 37, y: 77, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'e': {
frame: { x: 73, y: 77, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'f': {
frame: { x: 1, y: 96, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'g': {
frame: { x: 37, y: 96, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'h': {
frame: { x: 73, y: 96, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'i': {
frame: { x: 1, y: 115, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'j': {
frame: { x: 37, y: 115, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'k': {
frame: { x: 73, y: 115, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'l': {
frame: { x: 1, y: 134, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'm': {
frame: { x: 37, y: 134, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'n': {
frame: { x: 73, y: 134, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'o': {
frame: { x: 1, y: 153, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'p': {
frame: { x: 37, y: 153, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'q': {
frame: { x: 73, y: 153, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'r_blocked': {
frame: { x: 1, y: 172, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'r_door': {
frame: { x: 37, y: 172, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
'x': {
frame: { x: 73, y: 172, w: 34, h: 17 },
rotated: false,
trimmed: false,
spriteSourceSize: { x: 0, y: 0, w: 34, h: 17 },
sourceSize: { w: 34, h: 17 },
},
},
meta: {
app: 'https://www.codeandweb.com/texturepacker',
version: '1.0',
image: 'tiles.png',
format: 'RGBA8888',
size: { w: 108, h: 190 },
scale: '1',
smartupdate:
'$TexturePacker:SmartUpdate:6d0f8373580629749f786a0b0f6c6bb9:96dff9df69bdc6938cf02f254bbe028b:accbe1e7e294ded8391337fc1c446319$',
},
};

View File

@ -4,8 +4,8 @@ import { FaArrowDown, FaArrowLeft, FaArrowRight, FaArrowUp } from 'react-icons/f
import { SendMessageComposer } from '../../../api';
import { Base, Button, Column, ColumnProps, Flex, Grid } from '../../../common';
import { useMessageEvent } from '../../../hooks';
import { FloorplanEditor } from '../common/FloorplanEditor';
import { useFloorplanEditorContext } from '../FloorplanEditorContext';
import { FloorplanEditor } from '../common/FloorplanEditor';
export const FloorplanCanvasView: FC<ColumnProps> = props =>
{
@ -32,7 +32,7 @@ export const FloorplanCanvasView: FC<ColumnProps> = props =>
setOccupiedTilesReceived(true);
elementRef.current.scrollTo((FloorplanEditor.instance.view.width / 3), 0);
elementRef.current.scrollTo((FloorplanEditor.instance.renderer.canvas.width / 3), 0);
});
useMessageEvent<RoomEntryTileMessageEvent>(RoomEntryTileMessageEvent, event =>
@ -86,6 +86,25 @@ export const FloorplanCanvasView: FC<ColumnProps> = props =>
}
}
const onPointerEvent = (event: PointerEvent) =>
{
event.preventDefault();
switch(event.type)
{
case 'pointerout':
case 'pointerup':
FloorplanEditor.instance.onPointerRelease();
break;
case 'pointerdown':
FloorplanEditor.instance.onPointerDown(event);
break;
case 'pointermove':
FloorplanEditor.instance.onPointerMove(event);
break;
}
}
useEffect(() =>
{
return () =>
@ -116,11 +135,34 @@ export const FloorplanCanvasView: FC<ColumnProps> = props =>
SendMessageComposer(new GetRoomEntryTileMessageComposer());
SendMessageComposer(new GetOccupiedTilesMessageComposer());
FloorplanEditor.instance.tilemapRenderer.interactive = true;
const currentElement = elementRef.current;
if(!elementRef.current) return;
if(!currentElement) return;
elementRef.current.appendChild(FloorplanEditor.instance.renderer.view);
currentElement.appendChild(FloorplanEditor.instance.renderer.canvas);
currentElement.addEventListener('pointerup', onPointerEvent);
currentElement.addEventListener('pointerout', onPointerEvent);
currentElement.addEventListener('pointerdown', onPointerEvent);
currentElement.addEventListener('pointermove', onPointerEvent);
return () =>
{
if(currentElement)
{
currentElement.removeEventListener('pointerup', onPointerEvent);
currentElement.removeEventListener('pointerout', onPointerEvent);
currentElement.removeEventListener('pointerdown', onPointerEvent);
currentElement.removeEventListener('pointermove', onPointerEvent);
}
}
}, []);
return (

View File

@ -2,7 +2,7 @@ import { NitroConfiguration, RoomSessionEvent } from '@nitrots/nitro-renderer';
import { FC, useState } from 'react';
import { GetConfiguration } from '../../api';
import { LayoutAvatarImageView } from '../../common';
import { useRoomSessionManagerEvent, useSessionInfo } from '../../hooks';
import { useNitroEvent, useSessionInfo } from '../../hooks';
import { WidgetSlotView } from './views/widgets/WidgetSlotView';
const widgetSlotCount = 7;
@ -12,7 +12,7 @@ export const HotelView: FC<{}> = props =>
const [ isVisible, setIsVisible ] = useState(true);
const { userFigure = null } = useSessionInfo();
useRoomSessionManagerEvent<RoomSessionEvent>([
useNitroEvent<RoomSessionEvent>([
RoomSessionEvent.CREATED,
RoomSessionEvent.ENDED ], event =>
{

View File

@ -1,8 +1,8 @@
import { BadgePointLimitsEvent, ILinkEventTracker, IRoomSession, RoomEngineObjectEvent, RoomEngineObjectPlacedEvent, RoomPreviewer, RoomSessionEvent } from '@nitrots/nitro-renderer';
import { FC, useEffect, useState } from 'react';
import { AddEventLinkTracker, GetLocalization, GetRoomEngine, isObjectMoverRequested, LocalizeText, RemoveLinkEventTracker, setObjectMoverRequested, UnseenItemCategory } from '../../api';
import { AddEventLinkTracker, GetLocalization, GetRoomEngine, LocalizeText, RemoveLinkEventTracker, UnseenItemCategory, isObjectMoverRequested, setObjectMoverRequested } from '../../api';
import { NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView } from '../../common';
import { useInventoryTrade, useInventoryUnseenTracker, useMessageEvent, useRoomEngineEvent, useRoomSessionManagerEvent } from '../../hooks';
import { useInventoryTrade, useInventoryUnseenTracker, useMessageEvent, useNitroEvent } from '../../hooks';
import { InventoryBadgeView } from './views/badge/InventoryBadgeView';
import { InventoryBotView } from './views/bot/InventoryBotView';
import { InventoryFurnitureView } from './views/furniture/InventoryFurnitureView';
@ -32,7 +32,7 @@ export const InventoryView: FC<{}> = props =>
setIsVisible(false);
}
useRoomEngineEvent<RoomEngineObjectPlacedEvent>(RoomEngineObjectEvent.PLACED, event =>
useNitroEvent<RoomEngineObjectPlacedEvent>(RoomEngineObjectEvent.PLACED, event =>
{
if(!isObjectMoverRequested()) return;
@ -41,7 +41,7 @@ export const InventoryView: FC<{}> = props =>
if(!event.placedInRoom) setIsVisible(true);
});
useRoomSessionManagerEvent<RoomSessionEvent>([
useNitroEvent<RoomSessionEvent>([
RoomSessionEvent.CREATED,
RoomSessionEvent.ENDED
], event =>

View File

@ -6,18 +6,19 @@ interface LoadingViewProps
isError: boolean;
message: string;
percent: number;
showPercent?: boolean;
}
export const LoadingView: FC<LoadingViewProps> = props =>
{
const { isError = false, message = '', percent = 0 } = props;
const { isError = false, message = '', percent = 0, showPercent = true } = props;
return (
<Column fullHeight position="relative" className="nitro-loading">
<Base fullHeight className="container h-100">
<Column fullHeight alignItems="center" justifyContent="end">
<Base className="connecting-duck" />
<Column size={ 6 } className="text-center py-4">
{ showPercent && <Column size={ 6 } className="text-center py-4">
{ isError && (message && message.length) ?
<Base className="fs-4 text-shadow">{ message }</Base>
:
@ -27,7 +28,7 @@ export const LoadingView: FC<LoadingViewProps> = props =>
</>
}
</Column>
</Column> }
</Column>
</Base>
</Column>

View File

@ -2,7 +2,7 @@ import { HabboWebTools, ILinkEventTracker, RoomSessionEvent } from '@nitrots/nit
import { FC, useEffect, useState } from 'react';
import { AddEventLinkTracker, GetCommunication, RemoveLinkEventTracker } from '../../api';
import { Base, TransitionAnimation, TransitionAnimationTypes } from '../../common';
import { useRoomSessionManagerEvent } from '../../hooks';
import { useNitroEvent } from '../../hooks';
import { AchievementsView } from '../achievements/AchievementsView';
import { AvatarEditorView } from '../avatar-editor/AvatarEditorView';
import { CameraWidgetView } from '../camera/CameraWidgetView';
@ -33,14 +33,14 @@ export const MainView: FC<{}> = props =>
const [ isReady, setIsReady ] = useState(false);
const [ landingViewVisible, setLandingViewVisible ] = useState(true);
useRoomSessionManagerEvent<RoomSessionEvent>(RoomSessionEvent.CREATED, event => setLandingViewVisible(false));
useRoomSessionManagerEvent<RoomSessionEvent>(RoomSessionEvent.ENDED, event => setLandingViewVisible(event.openLandingView));
useNitroEvent<RoomSessionEvent>(RoomSessionEvent.CREATED, event => setLandingViewVisible(false));
useNitroEvent<RoomSessionEvent>(RoomSessionEvent.ENDED, event => setLandingViewVisible(event.openLandingView));
useEffect(() =>
{
setIsReady(true);
GetCommunication().connection.onReady();
GetCommunication().connection.ready();
}, []);
useEffect(() =>

View File

@ -2,7 +2,7 @@ import { ILinkEventTracker, RoomEngineEvent, RoomId, RoomObjectCategory, RoomObj
import { FC, useEffect, useRef, useState } from 'react';
import { AddEventLinkTracker, CreateLinkEvent, GetRoomSession, ISelectedUser, RemoveLinkEventTracker } from '../../api';
import { Base, Button, DraggableWindowPosition, NitroCardContentView, NitroCardHeaderView, NitroCardView } from '../../common';
import { useModTools, useObjectSelectedEvent, useRoomEngineEvent } from '../../hooks';
import { useModTools, useNitroEvent, useObjectSelectedEvent } from '../../hooks';
import { ModToolsChatlogView } from './views/room/ModToolsChatlogView';
import { ModToolsRoomView } from './views/room/ModToolsRoomView';
import { ModToolsTicketsView } from './views/tickets/ModToolsTicketsView';
@ -18,7 +18,7 @@ export const ModToolsView: FC<{}> = props =>
const { openRooms = [], openRoomChatlogs = [], openUserChatlogs = [], openUserInfos = [], openRoomInfo = null, closeRoomInfo = null, toggleRoomInfo = null, openRoomChatlog = null, closeRoomChatlog = null, toggleRoomChatlog = null, openUserInfo = null, closeUserInfo = null, toggleUserInfo = null, openUserChatlog = null, closeUserChatlog = null, toggleUserChatlog = null } = useModTools();
const elementRef = useRef<HTMLDivElement>(null);
useRoomEngineEvent<RoomEngineEvent>([
useNitroEvent<RoomEngineEvent>([
RoomEngineEvent.INITIALIZED,
RoomEngineEvent.DISPOSED
], event =>

View File

@ -3,7 +3,7 @@ import { FC, useCallback, useEffect, useRef, useState } from 'react';
import { FaPlus } from 'react-icons/fa';
import { AddEventLinkTracker, LocalizeText, RemoveLinkEventTracker, SendMessageComposer, TryVisitRoom } from '../../api';
import { Base, Column, NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView } from '../../common';
import { useNavigator, useRoomSessionManagerEvent } from '../../hooks';
import { useNavigator, useNitroEvent } from '../../hooks';
import { NavigatorDoorStateView } from './views/NavigatorDoorStateView';
import { NavigatorRoomCreatorView } from './views/NavigatorRoomCreatorView';
import { NavigatorRoomInfoView } from './views/NavigatorRoomInfoView';
@ -26,7 +26,7 @@ export const NavigatorView: FC<{}> = props =>
const pendingSearch = useRef<{ value: string, code: string }>(null);
const elementRef = useRef<HTMLDivElement>();
useRoomSessionManagerEvent<RoomSessionEvent>(RoomSessionEvent.CREATED, event =>
useNitroEvent<RoomSessionEvent>(RoomSessionEvent.CREATED, event =>
{
setIsVisible(false);
setCreatorOpen(false);

View File

@ -1,7 +1,7 @@
import { RoomEngineObjectEvent, RoomEngineRoomAdEvent, RoomEngineTriggerWidgetEvent, RoomEngineUseProductEvent, RoomId, RoomSessionErrorMessageEvent, RoomZoomEvent } from '@nitrots/nitro-renderer';
import { FC } from 'react';
import { DispatchUiEvent, GetRoomEngine, LocalizeText, NotificationAlertType, RoomWidgetUpdateRoomObjectEvent } from '../../../api';
import { useNotification, useRoom, useRoomEngineEvent, useRoomSessionManagerEvent } from '../../../hooks';
import { useNitroEvent, useNotification, useRoom } from '../../../hooks';
import { AvatarInfoWidgetView } from './avatar-info/AvatarInfoWidgetView';
import { ChatInputView } from './chat-input/ChatInputView';
import { ChatWidgetView } from './chat/ChatWidgetView';
@ -21,9 +21,9 @@ export const RoomWidgetsView: FC<{}> = props =>
const { roomSession = null } = useRoom();
const { simpleAlert = null } = useNotification();
useRoomEngineEvent<RoomZoomEvent>(RoomZoomEvent.ROOM_ZOOM, event => GetRoomEngine().setRoomInstanceRenderingCanvasScale(event.roomId, 1, event.level, null, null, false, event.asDelta));
useNitroEvent<RoomZoomEvent>(RoomZoomEvent.ROOM_ZOOM, event => GetRoomEngine().setRoomInstanceRenderingCanvasScale(event.roomId, 1, event.level, null, null, false, event.asDelta));
useRoomEngineEvent<RoomEngineObjectEvent>(
useNitroEvent<RoomEngineObjectEvent>(
[
RoomEngineTriggerWidgetEvent.REQUEST_TEASER,
RoomEngineTriggerWidgetEvent.REQUEST_ECOTRONBOX,
@ -87,7 +87,7 @@ export const RoomWidgetsView: FC<{}> = props =>
if(dispatchEvent) DispatchUiEvent(updateEvent);
});
useRoomSessionManagerEvent<RoomSessionErrorMessageEvent>(
useNitroEvent<RoomSessionErrorMessageEvent>(
[
RoomSessionErrorMessageEvent.RSEME_KICKED,
RoomSessionErrorMessageEvent.RSEME_PETS_FORBIDDEN_IN_HOTEL,

View File

@ -2,7 +2,7 @@ import { RoomEngineEvent, RoomEnterEffect, RoomSessionDanceEvent } from '@nitrot
import { FC, useState } from 'react';
import { AvatarInfoFurni, AvatarInfoPet, AvatarInfoRentableBot, AvatarInfoUser, GetConfiguration, GetSessionDataManager, RoomWidgetUpdateRentableBotChatEvent } from '../../../../api';
import { Column } from '../../../../common';
import { useAvatarInfoWidget, useRoom, useRoomEngineEvent, useRoomSessionManagerEvent, useUiEvent } from '../../../../hooks';
import { useAvatarInfoWidget, useNitroEvent, useRoom, useUiEvent } from '../../../../hooks';
import { AvatarInfoPetTrainingPanelView } from './AvatarInfoPetTrainingPanelView';
import { AvatarInfoRentableBotChatView } from './AvatarInfoRentableBotChatView';
import { AvatarInfoUseProductConfirmView } from './AvatarInfoUseProductConfirmView';
@ -29,17 +29,17 @@ export const AvatarInfoWidgetView: FC<{}> = props =>
const { avatarInfo = null, setAvatarInfo = null, activeNameBubble = null, setActiveNameBubble = null, nameBubbles = [], removeNameBubble = null, productBubbles = [], confirmingProduct = null, updateConfirmingProduct = null, removeProductBubble = null, isDecorating = false, setIsDecorating = null } = useAvatarInfoWidget();
const { roomSession = null } = useRoom();
useRoomEngineEvent<RoomEngineEvent>(RoomEngineEvent.NORMAL_MODE, event =>
useNitroEvent<RoomEngineEvent>(RoomEngineEvent.NORMAL_MODE, event =>
{
if(isGameMode) setGameMode(false);
});
useRoomEngineEvent<RoomEngineEvent>(RoomEngineEvent.GAME_MODE, event =>
useNitroEvent<RoomEngineEvent>(RoomEngineEvent.GAME_MODE, event =>
{
if(!isGameMode) setGameMode(true);
});
useRoomSessionManagerEvent<RoomSessionDanceEvent>(RoomSessionDanceEvent.RSDE_DANCE, event =>
useNitroEvent<RoomSessionDanceEvent>(RoomSessionDanceEvent.RSDE_DANCE, event =>
{
if(event.roomIndex !== roomSession.ownRoomIndex) return;

View File

@ -2,8 +2,8 @@ import { CrackableDataType, GroupInformationComposer, GroupInformationEvent, Now
import { FC, useCallback, useEffect, useState } from 'react';
import { FaTimes } from 'react-icons/fa';
import { AvatarInfoFurni, CreateLinkEvent, GetGroupInformation, GetNitroInstance, GetRoomEngine, LocalizeText, SendMessageComposer } from '../../../../../api';
import { Base, Button, Column, Flex, LayoutBadgeImageView, LayoutLimitedEditionCompactPlateView, LayoutRarityLevelView, Text, UserProfileIconView } from '../../../../../common';
import { useMessageEvent, useRoom, useSoundEvent } from '../../../../../hooks';
import { Base, Button, Column, Flex, LayoutBadgeImageView, LayoutLimitedEditionCompactPlateView, LayoutRarityLevelView, LayoutRoomObjectImageView, Text, UserProfileIconView } from '../../../../../common';
import { useMessageEvent, useNitroEvent, useRoom } from '../../../../../hooks';
interface InfoStandWidgetFurniViewProps
{
@ -40,12 +40,12 @@ export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props
const [ songName, setSongName ] = useState<string>('');
const [ songCreator, setSongCreator ] = useState<string>('');
useSoundEvent<NowPlayingEvent>(NowPlayingEvent.NPE_SONG_CHANGED, event =>
useNitroEvent<NowPlayingEvent>(NowPlayingEvent.NPE_SONG_CHANGED, event =>
{
setSongId(event.id);
}, (isJukeBox || isSongDisk));
useSoundEvent<NowPlayingEvent>(SongInfoReceivedEvent.SIR_TRAX_SONG_INFO_RECEIVED, event =>
useNitroEvent<NowPlayingEvent>(SongInfoReceivedEvent.SIR_TRAX_SONG_INFO_RECEIVED, event =>
{
if(event.id !== songId) return;
@ -347,8 +347,9 @@ export const InfoStandWidgetFurniView: FC<InfoStandWidgetFurniViewProps> = props
<div className="position-absolute end-0">
<LayoutRarityLevelView level={ avatarInfo.stuffData.rarityLevel } />
</div> }
{ avatarInfo.image && avatarInfo.image.src.length &&
<img className="d-block mx-auto" src={ avatarInfo.image.src } alt="" /> }
<Flex fullWidth center>
<LayoutRoomObjectImageView roomId={ roomSession.roomId } objectId={ avatarInfo.id } category={ avatarInfo.category } />
</Flex>
</Flex>
<hr className="m-0" />
</Column>

View File

@ -3,7 +3,7 @@ import { Dispatch, FC, FocusEvent, KeyboardEvent, SetStateAction, useEffect, use
import { FaPencilAlt, FaTimes } from 'react-icons/fa';
import { AvatarInfoUser, CloneObject, GetConfiguration, GetGroupInformation, GetSessionDataManager, GetUserProfile, LocalizeText, SendMessageComposer } from '../../../../../api';
import { Column, Flex, LayoutAvatarImageView, LayoutBadgeImageView, Text, UserProfileIconView } from '../../../../../common';
import { useMessageEvent, useRoom, useRoomSessionManagerEvent } from '../../../../../hooks';
import { useMessageEvent, useNitroEvent, useRoom } from '../../../../../hooks';
import { InfoStandWidgetUserRelationshipsView } from './InfoStandWidgetUserRelationshipsView';
import { InfoStandWidgetUserTagsView } from './InfoStandWidgetUserTagsView';
@ -45,7 +45,7 @@ export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props =
}
}
useRoomSessionManagerEvent<RoomSessionUserBadgesEvent>(RoomSessionUserBadgesEvent.RSUBE_BADGES, event =>
useNitroEvent<RoomSessionUserBadgesEvent>(RoomSessionUserBadgesEvent.RSUBE_BADGES, event =>
{
if(!avatarInfo || (avatarInfo.webID !== event.userId)) return;
@ -63,7 +63,7 @@ export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props =
});
});
useRoomSessionManagerEvent<RoomSessionUserFigureUpdateEvent>(RoomSessionUserFigureUpdateEvent.USER_FIGURE, event =>
useNitroEvent<RoomSessionUserFigureUpdateEvent>(RoomSessionUserFigureUpdateEvent.USER_FIGURE, event =>
{
if(!avatarInfo || (avatarInfo.roomIndex !== event.roomIndex)) return;
@ -79,7 +79,7 @@ export const InfoStandWidgetUserView: FC<InfoStandWidgetUserViewProps> = props =
});
});
useRoomSessionManagerEvent<RoomSessionFavoriteGroupUpdateEvent>(RoomSessionFavoriteGroupUpdateEvent.FAVOURITE_GROUP_UPDATE, event =>
useNitroEvent<RoomSessionFavoriteGroupUpdateEvent>(RoomSessionFavoriteGroupUpdateEvent.FAVOURITE_GROUP_UPDATE, event =>
{
if(!avatarInfo || (avatarInfo.roomIndex !== event.roomIndex)) return;

View File

@ -2,8 +2,8 @@ import { RoomEngineTriggerWidgetEvent } from '@nitrots/nitro-renderer';
import { FC, useEffect, useMemo, useState } from 'react';
import ReactSlider from 'react-slider';
import { ColorUtils, FurnitureDimmerUtilities, GetConfiguration, LocalizeText } from '../../../../api';
import { Base, Button, classNames, Column, Flex, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView, Text } from '../../../../common';
import { useFurnitureDimmerWidget, useRoomEngineEvent } from '../../../../hooks';
import { Base, Button, Column, Flex, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardTabsItemView, NitroCardTabsView, NitroCardView, Text, classNames } from '../../../../common';
import { useFurnitureDimmerWidget, useNitroEvent } from '../../../../hooks';
export const FurnitureDimmerView: FC<{}> = props =>
{
@ -17,7 +17,7 @@ export const FurnitureDimmerView: FC<{}> = props =>
setIsVisible(false);
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REMOVE_DIMMER, event => setIsVisible(false));
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REMOVE_DIMMER, event => setIsVisible(false));
useEffect(() =>
{

View File

@ -3,7 +3,7 @@ import { FC, useState } from 'react';
import { FaChevronDown, FaChevronUp } from 'react-icons/fa';
import { ColorUtils, LocalizeText } from '../../../../api';
import { Base, Column, Flex, LayoutGridItem, Text } from '../../../../common';
import { useSessionDataManagerEvent } from '../../../../hooks';
import { useNitroEvent } from '../../../../hooks';
const colorMap = {
'purple': 9452386,
@ -22,7 +22,7 @@ export const MysteryBoxExtensionView: FC<{}> = props =>
const [ keyColor, setKeyColor ] = useState<string>('');
const [ boxColor, setBoxColor ] = useState<string>('');
useSessionDataManagerEvent<MysteryBoxKeysUpdateEvent>(MysteryBoxKeysUpdateEvent.MYSTERY_BOX_KEYS_UPDATE, event =>
useNitroEvent<MysteryBoxKeysUpdateEvent>(MysteryBoxKeysUpdateEvent.MYSTERY_BOX_KEYS_UPDATE, event =>
{
setKeyColor(event.keyColor);
setBoxColor(event.boxColor);

View File

@ -29,9 +29,9 @@ export const RoomThumbnailWidgetView: FC<{}> = props =>
}
});
const receiveTexture = (texture: NitroRenderTexture) =>
const receiveTexture = async (texture: NitroRenderTexture) =>
{
GetRoomEngine().saveTextureAsScreenshot(texture, true);
await GetRoomEngine().saveTextureAsScreenshot(texture, true);
setIsVisible(false);
}

View File

@ -2,7 +2,7 @@ import { Dispose, DropBounce, EaseOut, JumpBy, Motions, NitroToolbarAnimateIconE
import { FC, useState } from 'react';
import { CreateLinkEvent, GetConfiguration, GetSessionDataManager, MessengerIconState, OpenMessengerChat, VisitDesktop } from '../../api';
import { Base, Flex, LayoutAvatarImageView, LayoutItemCountView, TransitionAnimation, TransitionAnimationTypes } from '../../common';
import { useAchievements, useFriends, useInventoryUnseenTracker, useMessageEvent, useMessenger, useRoomEngineEvent, useSessionInfo } from '../../hooks';
import { useAchievements, useFriends, useInventoryUnseenTracker, useMessageEvent, useMessenger, useNitroEvent, useSessionInfo } from '../../hooks';
import { ToolbarMeView } from './ToolbarMeView';
export const ToolbarView: FC<{ isInRoom: boolean }> = props =>
@ -24,7 +24,7 @@ export const ToolbarView: FC<{ isInRoom: boolean }> = props =>
setUseGuideTool(parser.isAllowed(PerkEnum.USE_GUIDE_TOOL));
});
useRoomEngineEvent<NitroToolbarAnimateIconEvent>(NitroToolbarAnimateIconEvent.ANIMATE_ICON, event =>
useNitroEvent<NitroToolbarAnimateIconEvent>(NitroToolbarAnimateIconEvent.ANIMATE_ICON, event =>
{
const animationIconToToolbar = (iconName: string, image: HTMLImageElement, x: number, y: number) =>
{

View File

@ -2,7 +2,7 @@ import { ExtendedProfileChangedMessageEvent, RelationshipStatusInfoEvent, Relati
import { FC, useState } from 'react';
import { CreateLinkEvent, GetRoomSession, GetSessionDataManager, GetUserProfile, LocalizeText, SendMessageComposer } from '../../api';
import { Column, Flex, Grid, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../common';
import { useMessageEvent, useRoomEngineEvent } from '../../hooks';
import { useMessageEvent, useNitroEvent } from '../../hooks';
import { BadgesContainerView } from './views/BadgesContainerView';
import { FriendsContainerView } from './views/FriendsContainerView';
import { GroupsContainerView } from './views/GroupsContainerView';
@ -78,7 +78,7 @@ export const UserProfileView: FC<{}> = props =>
GetUserProfile(parser.userId);
});
useRoomEngineEvent<RoomEngineObjectEvent>(RoomEngineObjectEvent.SELECTED, event =>
useNitroEvent<RoomEngineObjectEvent>(RoomEngineObjectEvent.SELECTED, event =>
{
if(!userProfile) return;

View File

@ -8,7 +8,7 @@ import { WiredConditionBaseView } from './WiredConditionBaseView';
export const WiredConditionUserCountInRoomView: FC<{}> = props =>
{
const [ min, setMin ] = useState(1);
const [ max, setMax ] = useState(1);
const [ max, setMax ] = useState(0);
const { trigger = null, setIntParams = null } = useWired();
const save = () => setIntParams([ min, max ]);
@ -23,7 +23,7 @@ export const WiredConditionUserCountInRoomView: FC<{}> = props =>
else
{
setMin(1);
setMax(1);
setMax(0);
}
}, [ trigger ]);
@ -42,8 +42,8 @@ export const WiredConditionUserCountInRoomView: FC<{}> = props =>
<Text bold>{ LocalizeText('wiredfurni.params.usercountmax', [ 'value' ], [ max.toString() ]) }</Text>
<ReactSlider
className={ 'nitro-slider' }
min={ 1 }
max={ 50 }
min={ 0 }
max={ 125 }
value={ max }
onChange={ event => setMax(event) } />
</Column>

View File

@ -2,7 +2,7 @@ import { InitCameraMessageEvent, IRoomCameraWidgetEffect, RequestCameraConfigura
import { useEffect, useState } from 'react';
import { useBetween } from 'use-between';
import { CameraPicture, GetRoomCameraWidgetManager, SendMessageComposer } from '../../api';
import { useCameraEvent, useMessageEvent } from '../events';
import { useMessageEvent, useNitroEvent } from '../events';
const useCameraState = () =>
{
@ -12,7 +12,7 @@ const useCameraState = () =>
const [ myLevel, setMyLevel ] = useState(10);
const [ price, setPrice ] = useState<{ credits: number, duckets: number, publishDucketPrice: number }>(null);
useCameraEvent<RoomCameraWidgetManagerEvent>(RoomCameraWidgetManagerEvent.INITIALIZED, event =>
useNitroEvent<RoomCameraWidgetManagerEvent>(RoomCameraWidgetManagerEvent.INITIALIZED, event =>
{
setAvailableEffects(Array.from(GetRoomCameraWidgetManager().effects.values()));
});

View File

@ -2,8 +2,8 @@ import { BuildersClubFurniCountMessageEvent, BuildersClubPlaceRoomItemMessageCom
import { useCallback, useEffect, useRef, useState } from 'react';
import { useBetween } from 'use-between';
import { BuilderFurniPlaceableStatus, CatalogNode, CatalogPage, CatalogPetPalette, CatalogType, CreateLinkEvent, DispatchUiEvent, FurniCategory, GetFurnitureData, GetProductDataForLocalization, GetRoomEngine, GetRoomSession, GiftWrappingConfiguration, ICatalogNode, ICatalogOptions, ICatalogPage, IPageLocalization, IProduct, IPurchasableOffer, IPurchaseOptions, LocalizeText, NotificationAlertType, Offer, PageLocalization, PlacedObjectPurchaseData, PlaySound, Product, ProductTypeEnum, RequestedPage, SearchResult, SendMessageComposer, SoundNames } from '../../api';
import { CatalogPurchasedEvent, CatalogPurchaseFailureEvent, CatalogPurchaseNotAllowedEvent, CatalogPurchaseSoldOutEvent, InventoryFurniAddedEvent } from '../../events';
import { useMessageEvent, useRoomEngineEvent, useUiEvent } from '../events';
import { CatalogPurchaseFailureEvent, CatalogPurchaseNotAllowedEvent, CatalogPurchaseSoldOutEvent, CatalogPurchasedEvent, InventoryFurniAddedEvent } from '../../events';
import { useMessageEvent, useNitroEvent, useUiEvent } from '../events';
import { useNotification } from '../notification';
import { useCatalogPlaceMultipleItems } from './useCatalogPlaceMultipleItems';
import { useCatalogSkipPurchaseConfirmation } from './useCatalogSkipPurchaseConfirmation';
@ -685,7 +685,7 @@ const useCatalogState = () =>
useUiEvent<CatalogPurchasedEvent>(CatalogPurchasedEvent.PURCHASE_SUCCESS, event => PlaySound(SoundNames.CREDITS));
useRoomEngineEvent<RoomEngineObjectPlacedEvent>(RoomEngineObjectPlacedEvent.PLACED, event =>
useNitroEvent<RoomEngineObjectPlacedEvent>(RoomEngineObjectPlacedEvent.PLACED, event =>
{
if(!objectMoverRequested || (event.type !== RoomEngineObjectPlacedEvent.PLACED)) return;

View File

@ -2,7 +2,7 @@ import { GetGuestRoomResultEvent, NewConsoleMessageEvent, RoomInviteEvent, RoomS
import { useState } from 'react';
import { useBetween } from 'use-between';
import { ChatEntryType, ChatHistoryCurrentDate, IChatEntry, IRoomHistoryEntry, MessengerHistoryCurrentDate } from '../../api';
import { useMessageEvent, useRoomSessionManagerEvent } from '../events';
import { useMessageEvent, useNitroEvent } from '../events';
const CHAT_HISTORY_MAX = 1000;
const ROOM_HISTORY_MAX = 10;
@ -64,7 +64,7 @@ const useChatHistoryState = () =>
});
}
useRoomSessionManagerEvent<RoomSessionEvent>(RoomSessionEvent.STARTED, event => setNeedsRoomInsert(true));
useNitroEvent<RoomSessionEvent>(RoomSessionEvent.STARTED, event => setNeedsRoomInsert(true));
useMessageEvent<GetGuestRoomResultEvent>(GetGuestRoomResultEvent, event =>
{

View File

@ -1,2 +0,0 @@
export * from './useCommunicationEvent';
export * from './useConfigurationEvent';

View File

@ -1,5 +0,0 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetCommunication } from '../../../api';
import { useEventDispatcher } from '../useEventDispatcher';
export const useCommunicationEvent = <T extends NitroEvent>(type: string | string[], handler: (event: T) => void) => useEventDispatcher(type, GetCommunication().events, handler);

View File

@ -1,5 +0,0 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetConfigurationManager } from '../../../api';
import { useEventDispatcher } from '../useEventDispatcher';
export const useConfigurationEvent = <T extends NitroEvent>(type: string | string[], handler: (event: T) => void) => useEventDispatcher(type, GetConfigurationManager().events, handler);

View File

@ -1,5 +1,4 @@
export * from './core';
export * from './nitro';
export * from './useEventDispatcher';
export * from './useMessageEvent';
export * from './useNitroEvent';
export * from './useUiEvent';

View File

@ -1,8 +0,0 @@
export * from './useAvatarEvent';
export * from './useCameraEvent';
export * from './useLocalizationEvent';
export * from './useMainEvent';
export * from './useRoomEngineEvent';
export * from './useRoomSessionManagerEvent';
export * from './useSessionDataManagerEvent';
export * from './useSoundEvent';

View File

@ -1,5 +0,0 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetAvatarRenderManager } from '../../../api';
import { useEventDispatcher } from '../useEventDispatcher';
export const useAvatarEvent = <T extends NitroEvent>(type: string | string[], handler: (event: T) => void) => useEventDispatcher(type, GetAvatarRenderManager().events, handler);

View File

@ -1,5 +0,0 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetNitroInstance } from '../../../api';
import { useEventDispatcher } from '../useEventDispatcher';
export const useCameraEvent = <T extends NitroEvent>(type: string | string[], handler: (event: T) => void) => useEventDispatcher(type, GetNitroInstance().cameraManager.events, handler);

View File

@ -1,5 +0,0 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetNitroInstance } from '../../../api';
import { useEventDispatcher } from '../useEventDispatcher';
export const useLocalizationEvent = <T extends NitroEvent>(type: string | string[], handler: (event: T) => void) => useEventDispatcher(type, GetNitroInstance().localization.events, handler);

View File

@ -1,5 +0,0 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetNitroInstance } from '../../../api';
import { useEventDispatcher } from '../useEventDispatcher';
export const useMainEvent = <T extends NitroEvent>(type: string | string[], handler: (event: T) => void) => useEventDispatcher(type, GetNitroInstance().events, handler);

View File

@ -1,5 +0,0 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetRoomEngine } from '../../../api';
import { useEventDispatcher } from '../useEventDispatcher';
export const useRoomEngineEvent = <T extends NitroEvent>(type: string | string[], handler: (event: T) => void) => useEventDispatcher(type, GetRoomEngine().events, handler);

View File

@ -1,5 +0,0 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetRoomSessionManager } from '../../../api';
import { useEventDispatcher } from '../useEventDispatcher';
export const useRoomSessionManagerEvent = <T extends NitroEvent>(type: string | string[], handler: (event: T) => void) => useEventDispatcher(type, GetRoomSessionManager().events, handler);

View File

@ -1,5 +0,0 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetSessionDataManager } from '../../../api';
import { useEventDispatcher } from '../useEventDispatcher';
export const useSessionDataManagerEvent = <T extends NitroEvent>(type: string | string, handler: (event: T) => void) => useEventDispatcher(type, GetSessionDataManager().events, handler);

View File

@ -1,5 +0,0 @@
import { NitroEvent } from '@nitrots/nitro-renderer';
import { GetNitroInstance } from '../../../api';
import { useEventDispatcher } from '../useEventDispatcher';
export const useSoundEvent = <T extends NitroEvent>(type: string | string[], handler: (event: T) => void, enabled = true) => useEventDispatcher(type, GetNitroInstance().soundManager.events, handler, enabled);

View File

@ -0,0 +1,4 @@
import { NitroEvent, NitroEventDispatcher } from '@nitrots/nitro-renderer';
import { useEventDispatcher } from './useEventDispatcher';
export const useNitroEvent = <T extends NitroEvent>(type: string | string[], handler: (event: T) => void, enabled = true) => useEventDispatcher(type, NitroEventDispatcher, handler, enabled);

View File

@ -1,10 +1,9 @@
export * from './UseMountEffect';
export * from './achievements';
export * from './camera';
export * from './catalog';
export * from './chat-history';
export * from './events';
export * from './events/core';
export * from './events/nitro';
export * from './friends';
export * from './game-center';
export * from './groups';
@ -17,6 +16,5 @@ export * from './purse';
export * from './rooms';
export * from './session';
export * from './useLocalStorage';
export * from './UseMountEffect';
export * from './useSharedVisibility';
export * from './wired';

View File

@ -258,7 +258,7 @@ const useNotificationState = () =>
simpleAlert( LocalizeText(('opening.hours.' + (parser.userThrowOutAtClose ? 'disconnected' : 'closed')), [ 'h', 'm' ], [ getTimeZeroPadded(parser.openHour), getTimeZeroPadded(parser.openMinute) ]), NotificationAlertType.DEFAULT, null, null, LocalizeText('opening.hours.title'));
});
useMessageEvent<PetReceivedMessageEvent>(PetReceivedMessageEvent, event =>
useMessageEvent<PetReceivedMessageEvent>(PetReceivedMessageEvent, async event =>
{
const parser = event.getParser();
@ -268,7 +268,7 @@ const useNotificationState = () =>
const imageResult = GetRoomEngine().getRoomObjectPetImage(parser.pet.typeId, parser.pet.paletteId, parseInt(parser.pet.color, 16), new Vector3d(45 * 3), 64, null, true);
if(imageResult) imageUrl = imageResult.getImage().src;
if(imageResult) imageUrl = (await imageResult.getImage())?.src;
showSingleBubble(text, NotificationBubbleType.PETLEVEL, imageUrl);
});
@ -284,7 +284,7 @@ const useNotificationState = () =>
setAlerts(prevValue => [ alertItem, ...prevValue ]);
});
useMessageEvent<PetLevelNotificationEvent>(PetLevelNotificationEvent, event =>
useMessageEvent<PetLevelNotificationEvent>(PetLevelNotificationEvent, async event =>
{
const parser = event.getParser();
@ -292,7 +292,7 @@ const useNotificationState = () =>
const imageResult = GetRoomEngine().getRoomObjectPetImage(parser.figureData.typeId, parser.figureData.paletteId, parseInt(parser.figureData.color, 16), new Vector3d(45 * 3), 64, null, true);
if(imageResult) imageUrl = imageResult.getImage().src;
if(imageResult) imageUrl = (await imageResult.getImage())?.src;
showSingleBubble(LocalizeText('notifications.text.petlevel', [ 'pet_name', 'level' ], [ parser.petName, parser.level.toString() ]), NotificationBubbleType.PETLEVEL, imageUrl);
});

View File

@ -2,7 +2,7 @@ import { AdjustmentFilter, ColorConverter, IRoomSession, NitroContainer, NitroSp
import { useEffect, useState } from 'react';
import { useBetween } from 'use-between';
import { CanManipulateFurniture, DispatchUiEvent, GetNitroInstance, GetRoomEngine, GetRoomSession, InitializeRoomInstanceRenderingCanvas, IsFurnitureSelectionDisabled, ProcessRoomObjectOperation, RoomWidgetUpdateBackgroundColorPreviewEvent, RoomWidgetUpdateRoomObjectEvent, SetActiveRoomId, StartRoomSession } from '../../api';
import { useRoomEngineEvent, useRoomSessionManagerEvent, useUiEvent } from '../events';
import { useNitroEvent, useUiEvent } from '../events';
const useRoomState = () =>
{
@ -51,7 +51,7 @@ const useRoomState = () =>
roomBackground.tint = originalRoomBackgroundColor;
});
useRoomEngineEvent<RoomObjectHSLColorEnabledEvent>(RoomObjectHSLColorEnabledEvent.ROOM_BACKGROUND_COLOR, event =>
useNitroEvent<RoomObjectHSLColorEnabledEvent>(RoomObjectHSLColorEnabledEvent.ROOM_BACKGROUND_COLOR, event =>
{
if(RoomId.isRoomPreviewerId(event.roomId)) return;
@ -59,7 +59,7 @@ const useRoomState = () =>
else updateRoomBackgroundColor(0, 0, 0, true);
});
useRoomEngineEvent<RoomBackgroundColorEvent>(RoomBackgroundColorEvent.ROOM_COLOR, event =>
useNitroEvent<RoomBackgroundColorEvent>(RoomBackgroundColorEvent.ROOM_COLOR, event =>
{
if(RoomId.isRoomPreviewerId(event.roomId)) return;
@ -75,7 +75,7 @@ const useRoomState = () =>
updateRoomFilter(ColorConverter.hslToRGB(((ColorConverter.rgbToHSL(color) & 0xFFFF00) + brightness)));
});
useRoomEngineEvent<RoomEngineEvent>([
useNitroEvent<RoomEngineEvent>([
RoomEngineEvent.INITIALIZED,
RoomEngineEvent.DISPOSED
], event =>
@ -98,7 +98,7 @@ const useRoomState = () =>
}
});
useRoomSessionManagerEvent<RoomSessionEvent>([
useNitroEvent<RoomSessionEvent>([
RoomSessionEvent.CREATED,
RoomSessionEvent.ENDED
], event =>
@ -114,7 +114,7 @@ const useRoomState = () =>
}
});
useRoomEngineEvent<RoomEngineObjectEvent>([
useNitroEvent<RoomEngineObjectEvent>([
RoomEngineObjectEvent.SELECTED,
RoomEngineObjectEvent.DESELECTED,
RoomEngineObjectEvent.ADDED,
@ -205,13 +205,7 @@ const useRoomState = () =>
const height = Math.floor(window.innerHeight);
const renderer = nitroInstance.application.renderer;
if(renderer)
{
renderer.view.style.width = `${ width }px`;
renderer.view.style.height = `${ height }px`;
renderer.resolution = window.devicePixelRatio;
renderer.resize(width, height);
}
if(renderer) renderer.resize(width, height);
const displayObject = roomEngine.getRoomInstanceDisplay(roomId, canvasId, width, height, RoomGeometry.SCALE_ZOOMED_IN);
const canvas = GetRoomEngine().getRoomInstanceRenderingCanvas(roomId, canvasId);
@ -267,9 +261,6 @@ const useRoomState = () =>
const width = Math.floor(window.innerWidth);
const height = Math.floor(window.innerHeight);
renderer.view.style.width = `${ width }px`;
renderer.view.style.height = `${ height }px`;
renderer.resolution = window.devicePixelRatio;
renderer.resize(width, height);
background.width = width;

View File

@ -1,7 +1,7 @@
import { ApplyTonerComposer, ColorConverter, RoomEngineTriggerWidgetEvent, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { useEffect, useState } from 'react';
import { CanManipulateFurniture, ColorUtils, DispatchUiEvent, GetRoomEngine, RoomWidgetUpdateBackgroundColorPreviewEvent, SendMessageComposer } from '../../../../api';
import { useRoomEngineEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
import { useFurniRemovedEvent } from '../../engine';
import { useRoom } from '../../useRoom';
@ -30,7 +30,7 @@ const useFurnitureBackgroundColorWidgetState = () =>
setColor(0);
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_BACKGROUND_COLOR, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_BACKGROUND_COLOR, event =>
{
if(!CanManipulateFurniture(roomSession, event.objectId, event.category)) return;

View File

@ -1,7 +1,7 @@
import { RoomEngineTriggerWidgetEvent, RoomObjectVariable, StringDataType } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine, GetSessionDataManager, LocalizeBadgeDescription, LocalizeBadgeName, LocalizeText } from '../../../../api';
import { useRoomEngineEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
import { useNotification } from '../../../notification';
import { useFurniRemovedEvent } from '../../engine';
@ -27,7 +27,7 @@ const useFurnitureBadgeDisplayWidgetState = () =>
setSenderName('');
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>([
useNitroEvent<RoomEngineTriggerWidgetEvent>([
RoomEngineTriggerWidgetEvent.REQUEST_BADGE_DISPLAY_ENGRAVING,
RoomEngineTriggerWidgetEvent.REQUEST_ACHIEVEMENT_RESOLUTION_ENGRAVING
], event =>
@ -49,7 +49,7 @@ const useFurnitureBadgeDisplayWidgetState = () =>
setSenderName(stringStuff.getValue(3));
});
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_ACHIEVEMENT_RESOLUTION_FAILED, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_ACHIEVEMENT_RESOLUTION_FAILED, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);

View File

@ -1,7 +1,7 @@
import { ContextMenuEnum, GroupFurniContextMenuInfoMessageEvent, GroupFurniContextMenuInfoMessageParser, RoomEngineTriggerWidgetEvent, RoomObjectCategory, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine, IsOwnerOfFurniture, TryJoinGroup, TryVisitRoom } from '../../../../api';
import { useMessageEvent, useRoomEngineEvent } from '../../../events';
import { useMessageEvent, useNitroEvent } from '../../../events';
import { useRoom } from '../../useRoom';
export const MONSTERPLANT_SEED_CONFIRMATION: string = 'MONSTERPLANT_SEED_CONFIRMATION';
@ -75,7 +75,7 @@ const useFurnitureContextMenuWidgetState = () =>
onClose();
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>([
useNitroEvent<RoomEngineTriggerWidgetEvent>([
RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU,
RoomEngineTriggerWidgetEvent.CLOSE_FURNI_CONTEXT_MENU,
RoomEngineTriggerWidgetEvent.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG,

View File

@ -1,7 +1,7 @@
import { CraftableProductsEvent, CraftComposer, CraftingRecipeEvent, CraftingRecipeIngredientParser, CraftingRecipesAvailableEvent, CraftingResultEvent, GetCraftableProductsComposer, GetCraftingRecipeComposer, RoomEngineTriggerWidgetEvent, RoomWidgetEnum } from '@nitrots/nitro-renderer';
import { useEffect, useState } from 'react';
import { GetRoomEngine, ICraftingIngredient, ICraftingRecipe, LocalizeText, SendMessageComposer } from '../../../../api';
import { useMessageEvent, useRoomEngineEvent } from '../../../events';
import { useMessageEvent, useNitroEvent } from '../../../events';
import { useInventoryFurni } from '../../../inventory';
import { useNotification } from './../../../notification';
@ -49,7 +49,7 @@ const useFurnitureCraftingWidgetState = () =>
if(!cache) SendMessageComposer(new GetCraftingRecipeComposer(recipe.name));
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.OPEN_WIDGET, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.OPEN_WIDGET, event =>
{
if (event.widget !== RoomWidgetEnum.CRAFTING) return;

View File

@ -1,7 +1,7 @@
import { RoomControllerLevel, RoomEngineDimmerStateEvent, RoomEngineTriggerWidgetEvent, RoomId, RoomSessionDimmerPresetsEvent } from '@nitrots/nitro-renderer';
import { useEffect, useState } from 'react';
import { DimmerFurnitureWidgetPresetItem, FurnitureDimmerUtilities, GetSessionDataManager } from '../../../../api';
import { useRoomEngineEvent, useRoomSessionManagerEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
import { useRoom } from '../../useRoom';
const useFurnitureDimmerWidgetState = () =>
@ -56,14 +56,14 @@ const useFurnitureDimmerWidgetState = () =>
FurnitureDimmerUtilities.savePreset(preset.id, selectedEffectId, selectedColor, selectedBrightness, true);
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_DIMMER, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_DIMMER, event =>
{
if(!canOpenWidget()) return;
roomSession.requestMoodlightSettings();
});
useRoomSessionManagerEvent<RoomSessionDimmerPresetsEvent>(RoomSessionDimmerPresetsEvent.ROOM_DIMMER_PRESETS, event =>
useNitroEvent<RoomSessionDimmerPresetsEvent>(RoomSessionDimmerPresetsEvent.ROOM_DIMMER_PRESETS, event =>
{
const presets: DimmerFurnitureWidgetPresetItem[] = [];
@ -82,7 +82,7 @@ const useFurnitureDimmerWidgetState = () =>
setSelectedPresetId(event.selectedPresetId);
});
useRoomEngineEvent<RoomEngineDimmerStateEvent>(RoomEngineDimmerStateEvent.ROOM_COLOR, event =>
useNitroEvent<RoomEngineDimmerStateEvent>(RoomEngineDimmerStateEvent.ROOM_COLOR, event =>
{
if(RoomId.isRoomPreviewerId(event.roomId)) return;

View File

@ -1,7 +1,7 @@
import { FurnitureExchangeComposer, RoomEngineTriggerWidgetEvent, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine, GetRoomSession, IsOwnerOfFurniture } from '../../../../api';
import { useRoomEngineEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
import { useFurniRemovedEvent } from '../../engine';
const useFurnitureExchangeWidgetState = () =>
@ -24,7 +24,7 @@ const useFurnitureExchangeWidgetState = () =>
onClose();
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_CREDITFURNI, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_CREDITFURNI, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);

View File

@ -1,7 +1,7 @@
import { RoomEngineTriggerWidgetEvent, RoomObjectCategory, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine, IPhotoData } from '../../../../api';
import { useRoomEngineEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
import { useFurniRemovedEvent } from '../../engine';
import { useRoom } from '../../useRoom';
@ -21,7 +21,7 @@ const useFurnitureExternalImageWidgetState = () =>
setCurrentPhotos([]);
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_EXTERNAL_IMAGE, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_EXTERNAL_IMAGE, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);
const roomTotalImages = GetRoomEngine().getRoomObjects(roomSession?.roomId, RoomObjectCategory.WALL);

View File

@ -1,7 +1,7 @@
import { FriendFurniConfirmLockMessageComposer, LoveLockFurniFinishedEvent, LoveLockFurniFriendConfirmedEvent, LoveLockFurniStartEvent, RoomEngineTriggerWidgetEvent, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine, GetRoomSession } from '../../../../api';
import { useMessageEvent, useRoomEngineEvent } from '../../../events';
import { useMessageEvent, useNitroEvent } from '../../../events';
import { useFurniRemovedEvent } from '../../engine';
const useFurnitureFriendFurniWidgetState = () =>
@ -42,7 +42,7 @@ const useFurnitureFriendFurniWidgetState = () =>
useMessageEvent<LoveLockFurniFinishedEvent>(LoveLockFurniFinishedEvent, event => onClose());
useMessageEvent<LoveLockFurniFriendConfirmedEvent>(LoveLockFurniFriendConfirmedEvent, event => onClose());
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_ENGRAVING, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_ENGRAVING, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);

View File

@ -1,7 +1,7 @@
import { HighScoreDataType, ObjectDataFactory, RoomEngineTriggerWidgetEvent, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine } from '../../../../api';
import { useRoomEngineEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
import { useRoom } from '../../useRoom';
const SCORE_TYPES = [ 'perteam', 'mostwins', 'classic' ];
@ -15,7 +15,7 @@ const useFurnitureHighScoreWidgetState = () =>
const getScoreType = (type: number) => SCORE_TYPES[type];
const getClearType = (type: number) => CLEAR_TYPES[type];
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_HIGH_SCORE_DISPLAY, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_HIGH_SCORE_DISPLAY, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);
@ -36,7 +36,7 @@ const useFurnitureHighScoreWidgetState = () =>
});
});
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_HIDE_HIGH_SCORE_DISPLAY, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_HIDE_HIGH_SCORE_DISPLAY, event =>
{
if(event.roomId !== roomSession.roomId) return;

View File

@ -1,12 +1,12 @@
import { RoomEngineTriggerWidgetEvent, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { CreateLinkEvent, GetRoomEngine } from '../../../../api';
import { useRoomEngineEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
const INTERNALLINK = 'internalLink';
const useFurnitureInternalLinkWidgetState = () =>
{
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_INTERNAL_LINK, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_INTERNAL_LINK, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);

View File

@ -1,7 +1,7 @@
import { FurnitureMannequinSaveLookComposer, FurnitureMannequinSaveNameComposer, FurnitureMultiStateComposer, HabboClubLevelEnum, RoomEngineTriggerWidgetEvent, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetAvatarRenderManager, GetRoomEngine, MannequinUtilities, SendMessageComposer } from '../../../../api';
import { useRoomEngineEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
import { useFurniRemovedEvent } from '../../engine';
const useFurnitureMannequinWidgetState = () =>
@ -47,7 +47,7 @@ const useFurnitureMannequinWidgetState = () =>
SendMessageComposer(new FurnitureMannequinSaveNameComposer(objectId, name));
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_MANNEQUIN, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_MANNEQUIN, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);

View File

@ -1,7 +1,7 @@
import { AddJukeboxDiskComposer, AdvancedMap, FurnitureListAddOrUpdateEvent, FurnitureListEvent, FurnitureListRemovedEvent, FurnitureMultiStateComposer, IAdvancedMap, IMessageEvent, ISongInfo, NotifyPlayedSongEvent, NowPlayingEvent, PlayListStatusEvent, RemoveJukeboxDiskComposer, RoomControllerLevel, RoomEngineTriggerWidgetEvent, SongDiskInventoryReceivedEvent } from '@nitrots/nitro-renderer';
import { useCallback, useState } from 'react';
import { GetNitroInstance, GetRoomEngine, GetSessionDataManager, IsOwnerOfFurniture, LocalizeText, NotificationAlertType, NotificationBubbleType, SendMessageComposer } from '../../../../api';
import { useMessageEvent, useRoomEngineEvent, useSoundEvent } from '../../../events';
import { useMessageEvent, useNitroEvent } from '../../../events';
import { useNotification } from '../../../notification';
import { useFurniRemovedEvent } from '../../engine';
import { useRoom } from '../../useRoom';
@ -28,7 +28,7 @@ const useFurniturePlaylistEditorWidgetState = () =>
const togglePlayPause = useCallback((furniId: number, position: number) => SendMessageComposer(new FurnitureMultiStateComposer(furniId, position)), []);
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_PLAYLIST_EDITOR, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_PLAYLIST_EDITOR, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);
@ -56,27 +56,27 @@ const useFurniturePlaylistEditorWidgetState = () =>
onClose();
});
useSoundEvent<NowPlayingEvent>(NowPlayingEvent.NPE_SONG_CHANGED, event =>
useNitroEvent<NowPlayingEvent>(NowPlayingEvent.NPE_SONG_CHANGED, event =>
{
setCurrentPlayingIndex(event.position);
});
useSoundEvent<NotifyPlayedSongEvent>(NotifyPlayedSongEvent.NOTIFY_PLAYED_SONG, event =>
useNitroEvent<NotifyPlayedSongEvent>(NotifyPlayedSongEvent.NOTIFY_PLAYED_SONG, event =>
{
showSingleBubble(LocalizeText('soundmachine.notification.playing', [ 'songname', 'songauthor' ], [ event.name, event.creator ]), NotificationBubbleType.SOUNDMACHINE)
});
useSoundEvent<SongDiskInventoryReceivedEvent>(SongDiskInventoryReceivedEvent.SDIR_SONG_DISK_INVENTORY_RECEIVENT_EVENT, event =>
useNitroEvent<SongDiskInventoryReceivedEvent>(SongDiskInventoryReceivedEvent.SDIR_SONG_DISK_INVENTORY_RECEIVENT_EVENT, event =>
{
setDiskInventory(GetNitroInstance().soundManager.musicController?.songDiskInventory.clone());
});
useSoundEvent<PlayListStatusEvent>(PlayListStatusEvent.PLUE_PLAY_LIST_UPDATED, event =>
useNitroEvent<PlayListStatusEvent>(PlayListStatusEvent.PLUE_PLAY_LIST_UPDATED, event =>
{
setPlaylist(GetNitroInstance().soundManager.musicController?.getRoomItemPlaylist()?.entries.concat())
});
useSoundEvent<PlayListStatusEvent>(PlayListStatusEvent.PLUE_PLAY_LIST_FULL, event =>
useNitroEvent<PlayListStatusEvent>(PlayListStatusEvent.PLUE_PLAY_LIST_FULL, event =>
{
simpleAlert(LocalizeText('playlist.editor.alert.playlist.full'), NotificationAlertType.ALERT, '', '', LocalizeText('playlist.editor.alert.playlist.full.title'));
});

View File

@ -2,7 +2,7 @@ import { IFurnitureData, IGetImageListener, PetFigureData, RoomEngineTriggerWidg
import { useMemo, useState } from 'react';
import { useRoom } from '../../..';
import { GetRoomEngine, GetSessionDataManager, IsOwnerOfFurniture, LocalizeText, ProductTypeEnum } from '../../../../api';
import { useRoomEngineEvent, useRoomSessionManagerEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
import { useFurniRemovedEvent } from '../../engine';
const FLOOR: string = 'floor';
@ -51,21 +51,25 @@ const useFurniturePresentWidgetState = () =>
const imageListener: IGetImageListener = useMemo(() =>
{
// async fix image
return {
imageReady: (id, texture, image) =>
{
(async () =>
{
if(!image && texture)
{
image = TextureUtils.generateImage(texture);
image = await TextureUtils.generateImage(texture);
}
setImageUrl(image.src);
})();
},
imageFailed: null
}
}, []);
useRoomSessionManagerEvent<RoomSessionPresentEvent>(RoomSessionPresentEvent.RSPE_PRESENT_OPENED, event =>
useNitroEvent<RoomSessionPresentEvent>(RoomSessionPresentEvent.RSPE_PRESENT_OPENED, event =>
{
let furniData: IFurnitureData = null;
@ -165,16 +169,22 @@ const useFurniturePresentWidgetState = () =>
{
const petFigureData = new PetFigureData(petfigureString);
(async () =>
{
const petImage = GetRoomEngine().getRoomObjectPetImage(petFigureData.typeId, petFigureData.paletteId, petFigureData.color, new Vector3d(90), 64, imageListener, true, 0, petFigureData.customParts);
if(petImage) setImageUrl(petImage.getImage().src);
if(petImage) setImageUrl((await petImage.getImage()).src);
})();
}
}
else
{
(async () =>
{
const furniImage = GetRoomEngine().getFurnitureFloorImage(event.classId, new Vector3d(90), 64, imageListener);
if(furniImage) setImageUrl(furniImage.getImage().src);
if(furniImage) setImageUrl((await furniImage.getImage()).src);
})();
}
const productData = GetSessionDataManager().getProductData(event.productCode);
@ -193,7 +203,7 @@ const useFurniturePresentWidgetState = () =>
setPlacedInRoom(event.placedInRoom);
});
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_PRESENT, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_PRESENT, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);

View File

@ -1,7 +1,7 @@
import { GetGuestRoomMessageComposer, GetGuestRoomResultEvent, RoomEngineTriggerWidgetEvent, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine, SendMessageComposer } from '../../../../api';
import { useMessageEvent, useRoomEngineEvent } from '../../../events';
import { useMessageEvent, useNitroEvent } from '../../../events';
const INTERNALLINK = 'internalLink';
@ -9,7 +9,7 @@ const useFurnitureRoomLinkWidgetState = () =>
{
const [ roomIdToEnter, setRoomIdToEnter ] = useState(0);
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_ROOM_LINK, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_ROOM_LINK, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);

View File

@ -1,7 +1,7 @@
import { FurnitureStackHeightComposer, FurnitureStackHeightEvent, RoomEngineTriggerWidgetEvent } from '@nitrots/nitro-renderer';
import { useEffect, useState } from 'react';
import { CanManipulateFurniture, GetRoomEngine, GetRoomSession, SendMessageComposer } from '../../../../api';
import { useMessageEvent, useRoomEngineEvent } from '../../../events';
import { useMessageEvent, useNitroEvent } from '../../../events';
import { useFurniRemovedEvent } from '../../engine';
const MAX_HEIGHT: number = 40;
@ -43,7 +43,7 @@ const useFurnitureStackHeightWidgetState = () =>
updateHeight(parser.height, true);
});
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_STACK_HEIGHT, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_STACK_HEIGHT, event =>
{
if(!CanManipulateFurniture(GetRoomSession(), event.objectId, event.category)) return;

View File

@ -1,7 +1,7 @@
import { RoomEngineTriggerWidgetEvent, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine, GetRoomSession, GetSessionDataManager, IsOwnerOfFurniture } from '../../../../api';
import { useRoomEngineEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
import { useFurniRemovedEvent } from '../../engine';
const useFurnitureStickieWidgetState = () =>
@ -41,7 +41,7 @@ const useFurnitureStickieWidgetState = () =>
const trash = () => GetRoomEngine().deleteRoomObject(objectId, category);
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_STICKIE, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_STICKIE, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);

View File

@ -1,7 +1,7 @@
import { RoomEngineTriggerWidgetEvent, RoomObjectVariable } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine } from '../../../../api';
import { useRoomEngineEvent } from '../../../events';
import { useNitroEvent } from '../../../events';
import { useFurniRemovedEvent } from '../../engine';
const useFurnitureTrophyWidgetState = () =>
@ -23,7 +23,7 @@ const useFurnitureTrophyWidgetState = () =>
setMessage('');
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_TROPHY, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_TROPHY, event =>
{
const roomObject = GetRoomEngine().getRoomObject(event.roomId, event.objectId, event.category);

View File

@ -1,7 +1,7 @@
import { ControlYoutubeDisplayPlaybackMessageComposer, GetYoutubeDisplayStatusMessageComposer, RoomEngineTriggerWidgetEvent, RoomId, SecurityLevel, SetYoutubeDisplayPlaylistMessageComposer, YoutubeControlVideoMessageEvent, YoutubeDisplayPlaylist, YoutubeDisplayPlaylistsEvent, YoutubeDisplayVideoMessageEvent } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine, GetSessionDataManager, IsOwnerOfFurniture, SendMessageComposer, YoutubeVideoPlaybackStateEnum } from '../../../../api';
import { useMessageEvent, useRoomEngineEvent } from '../../../events';
import { useMessageEvent, useNitroEvent } from '../../../events';
import { useFurniRemovedEvent } from '../../engine';
const CONTROL_COMMAND_PREVIOUS_VIDEO = 0;
@ -56,7 +56,7 @@ const useFurnitureYoutubeWidgetState = () =>
SendMessageComposer(new SetYoutubeDisplayPlaylistMessageComposer(objectId, video));
}
useRoomEngineEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_YOUTUBE, event =>
useNitroEvent<RoomEngineTriggerWidgetEvent>(RoomEngineTriggerWidgetEvent.REQUEST_YOUTUBE, event =>
{
if(RoomId.isRoomPreviewerId(event.roomId)) return;

View File

@ -1,7 +1,7 @@
import { RoomEngineObjectEvent, RoomEngineUseProductEvent, RoomObjectCategory, RoomObjectType, RoomObjectVariable, RoomSessionPetInfoUpdateEvent, RoomSessionPetStatusUpdateEvent, RoomSessionUserDataUpdateEvent } from '@nitrots/nitro-renderer';
import { useEffect, useState } from 'react';
import { AvatarInfoFurni, AvatarInfoName, AvatarInfoPet, AvatarInfoRentableBot, AvatarInfoUser, AvatarInfoUtilities, CanManipulateFurniture, FurniCategory, GetRoomEngine, GetSessionDataManager, IAvatarInfo, IsOwnerOfFurniture, RoomWidgetUpdateRoomObjectEvent, UseProductItem } from '../../../api';
import { useRoomEngineEvent, useRoomSessionManagerEvent, useUiEvent } from '../../events';
import { useNitroEvent, useUiEvent } from '../../events';
import { useFriends } from '../../friends';
import { useWired } from '../../wired';
import { useObjectDeselectedEvent, useObjectRollOutEvent, useObjectRollOverEvent, useObjectSelectedEvent } from '../engine';
@ -113,7 +113,7 @@ const useAvatarInfoWidgetState = () =>
// roomSession.userDataManager.requestPetInfo(petData.id);
}
useRoomSessionManagerEvent<RoomSessionUserDataUpdateEvent>(RoomSessionUserDataUpdateEvent.USER_DATA_UPDATED, event =>
useNitroEvent<RoomSessionUserDataUpdateEvent>(RoomSessionUserDataUpdateEvent.USER_DATA_UPDATED, event =>
{
if(!event.addedUsers.length) return;
@ -148,7 +148,7 @@ const useAvatarInfoWidgetState = () =>
});
});
useRoomSessionManagerEvent<RoomSessionPetInfoUpdateEvent>(RoomSessionPetInfoUpdateEvent.PET_INFO, event =>
useNitroEvent<RoomSessionPetInfoUpdateEvent>(RoomSessionPetInfoUpdateEvent.PET_INFO, event =>
{
const petData = event.petInfo;
@ -164,7 +164,7 @@ const useAvatarInfoWidgetState = () =>
setPendingPetId(-1);
});
useRoomSessionManagerEvent<RoomSessionPetStatusUpdateEvent>(RoomSessionPetStatusUpdateEvent.PET_STATUS_UPDATE, event =>
useNitroEvent<RoomSessionPetStatusUpdateEvent>(RoomSessionPetStatusUpdateEvent.PET_STATUS_UPDATE, event =>
{
/* var _local_2:Boolean;
var _local_3:Boolean;
@ -188,12 +188,12 @@ const useAvatarInfoWidgetState = () =>
this._container.events.dispatchEvent(_local_7); */
});
useRoomEngineEvent<RoomEngineUseProductEvent>(RoomEngineUseProductEvent.USE_PRODUCT_FROM_INVENTORY, event =>
useNitroEvent<RoomEngineUseProductEvent>(RoomEngineUseProductEvent.USE_PRODUCT_FROM_INVENTORY, event =>
{
// this._Str_23199((k as RoomEngineUseProductEvent).inventoryStripId, (k as RoomEngineUseProductEvent).furnitureTypeId);
});
useRoomEngineEvent<RoomEngineUseProductEvent>(RoomEngineUseProductEvent.USE_PRODUCT_FROM_ROOM, event =>
useNitroEvent<RoomEngineUseProductEvent>(RoomEngineUseProductEvent.USE_PRODUCT_FROM_ROOM, event =>
{
const roomObject = GetRoomEngine().getRoomObject(roomSession.roomId, event.objectId, RoomObjectCategory.FLOOR);
@ -257,7 +257,7 @@ const useAvatarInfoWidgetState = () =>
if(useProductBubbles.length) setProductBubbles(useProductBubbles);
});
useRoomEngineEvent<RoomEngineObjectEvent>(RoomEngineObjectEvent.REQUEST_MANIPULATION, event =>
useNitroEvent<RoomEngineObjectEvent>(RoomEngineObjectEvent.REQUEST_MANIPULATION, event =>
{
if(!CanManipulateFurniture(roomSession, event.objectId, event.category)) return;

View File

@ -1,7 +1,7 @@
import { AvatarExpressionEnum, GetTicker, HabboClubLevelEnum, RoomControllerLevel, RoomEngineObjectEvent, RoomObjectCategory, RoomRotatingEffect, RoomSessionChatEvent, RoomSettingsComposer, RoomShakingEffect, RoomZoomEvent, TextureUtils } from '@nitrots/nitro-renderer';
import { AvatarExpressionEnum, GetTicker, HabboClubLevelEnum, NitroEventDispatcher, RoomControllerLevel, RoomEngineObjectEvent, RoomObjectCategory, RoomRotatingEffect, RoomSessionChatEvent, RoomSettingsComposer, RoomShakingEffect, RoomZoomEvent, TextureUtils } from '@nitrots/nitro-renderer';
import { useEffect, useState } from 'react';
import { ChatMessageTypeEnum, CreateLinkEvent, GetClubMemberLevel, GetConfiguration, GetRoomEngine, GetSessionDataManager, LocalizeText, SendMessageComposer } from '../../../api';
import { useRoomEngineEvent, useRoomSessionManagerEvent } from '../../events';
import { useNitroEvent } from '../../events';
import { useNotification } from '../../notification';
import { useObjectSelectedEvent } from '../engine';
import { useRoom } from '../useRoom';
@ -104,22 +104,25 @@ const useChatInputWidgetState = () =>
return null;
case ':iddqd':
case ':flip':
GetRoomEngine().events.dispatchEvent(new RoomZoomEvent(roomSession.roomId, -1, true));
NitroEventDispatcher.dispatchEvent(new RoomZoomEvent(roomSession.roomId, -1, true));
return null;
case ':zoom':
GetRoomEngine().events.dispatchEvent(new RoomZoomEvent(roomSession.roomId, parseFloat(secondPart), false));
NitroEventDispatcher.dispatchEvent(new RoomZoomEvent(roomSession.roomId, parseFloat(secondPart), false));
return null;
case ':screenshot':
const texture = GetRoomEngine().createTextureFromRoom(roomSession.roomId, 1);
(async () =>
{
const image = new Image();
image.src = TextureUtils.generateImageUrl(texture);
image.src = await TextureUtils.generateImageUrl(texture);
const newWindow = window.open('');
newWindow.document.write(image.outerHTML);
})();
return null;
case ':pickall':
if(roomSession.isRoomOwner || GetSessionDataManager().isModerator)
@ -188,7 +191,7 @@ const useChatInputWidgetState = () =>
}
}
useRoomSessionManagerEvent<RoomSessionChatEvent>(RoomSessionChatEvent.FLOOD_EVENT, event =>
useNitroEvent<RoomSessionChatEvent>(RoomSessionChatEvent.FLOOD_EVENT, event =>
{
setFloodBlocked(true);
setFloodBlockedSeconds(parseFloat(event.message));
@ -205,7 +208,7 @@ const useChatInputWidgetState = () =>
setSelectedUsername(userData.name);
});
useRoomEngineEvent<RoomEngineObjectEvent>(RoomEngineObjectEvent.DESELECTED, event => setSelectedUsername(''));
useNitroEvent<RoomEngineObjectEvent>(RoomEngineObjectEvent.DESELECTED, event => setSelectedUsername(''));
useEffect(() =>
{

View File

@ -1,14 +1,10 @@
import { AvatarFigurePartType, AvatarScaleType, AvatarSetType, GetGuestRoomResultEvent, NitroPoint, PetFigureData, RoomChatSettings, RoomChatSettingsEvent, RoomDragEvent, RoomObjectCategory, RoomObjectType, RoomObjectVariable, RoomSessionChatEvent, RoomUserData, SystemChatStyleEnum, TextureUtils, Vector3d } from '@nitrots/nitro-renderer';
import { GetGuestRoomResultEvent, NitroPoint, PetFigureData, RoomChatSettings, RoomChatSettingsEvent, RoomDragEvent, RoomObjectCategory, RoomObjectType, RoomObjectVariable, RoomSessionChatEvent, RoomUserData, SystemChatStyleEnum } from '@nitrots/nitro-renderer';
import { useEffect, useMemo, useRef, useState } from 'react';
import { ChatBubbleMessage, ChatEntryType, ChatHistoryCurrentDate, GetAvatarRenderManager, GetConfiguration, GetRoomEngine, GetRoomObjectScreenLocation, IRoomChatSettings, LocalizeText, PlaySound, RoomChatFormatter } from '../../../api';
import { useMessageEvent, useRoomEngineEvent, useRoomSessionManagerEvent } from '../../events';
import { ChatBubbleMessage, ChatBubbleUtilities, ChatEntryType, ChatHistoryCurrentDate, GetConfiguration, GetRoomEngine, GetRoomObjectScreenLocation, IRoomChatSettings, LocalizeText, PlaySound, RoomChatFormatter } from '../../../api';
import { useMessageEvent, useNitroEvent } from '../../events';
import { useRoom } from '../useRoom';
import { useChatHistory } from './../../chat-history';
const avatarColorCache: Map<string, number> = new Map();
const avatarImageCache: Map<string, string> = new Map();
const petImageCache: Map<string, string> = new Map();
const useChatWidgetState = () =>
{
const [ chatMessages, setChatMessages ] = useState<ChatBubbleMessage[]>([]);
@ -38,64 +34,7 @@ const useChatWidgetState = () =>
}
}, [ chatSettings ]);
const setFigureImage = (figure: string) =>
{
const avatarImage = GetAvatarRenderManager().createAvatarImage(figure, AvatarScaleType.LARGE, null, {
resetFigure: figure =>
{
if(isDisposed.current) return;
setFigureImage(figure);
},
dispose: () =>
{},
disposed: false
});
if(!avatarImage) return;
const image = avatarImage.getCroppedImage(AvatarSetType.HEAD);
const color = avatarImage.getPartColor(AvatarFigurePartType.CHEST);
avatarColorCache.set(figure, ((color && color.rgb) || 16777215));
avatarImage.dispose();
avatarImageCache.set(figure, image.src);
return image.src;
}
const getUserImage = (figure: string) =>
{
let existing = avatarImageCache.get(figure);
if(!existing) existing = setFigureImage(figure);
return existing;
}
const getPetImage = (figure: string, direction: number, _arg_3: boolean, scale: number = 64, posture: string = null) =>
{
let existing = petImageCache.get((figure + posture));
if(existing) return existing;
const figureData = new PetFigureData(figure);
const typeId = figureData.typeId;
const image = GetRoomEngine().getRoomObjectPetImage(typeId, figureData.paletteId, figureData.color, new Vector3d((direction * 45)), scale, null, false, 0, figureData.customParts, posture);
if(image)
{
existing = TextureUtils.generateImageUrl(image.data);
petImageCache.set((figure + posture), existing);
}
return existing;
}
useRoomSessionManagerEvent<RoomSessionChatEvent>(RoomSessionChatEvent.CHAT_EVENT, event =>
useNitroEvent<RoomSessionChatEvent>(RoomSessionChatEvent.CHAT_EVENT, async event =>
{
const roomObject = GetRoomEngine().getRoomObject(roomSession.roomId, event.objectId, RoomObjectCategory.UNIT);
const bubbleLocation = roomObject ? GetRoomObjectScreenLocation(roomSession.roomId, roomObject?.id, RoomObjectCategory.UNIT) : new NitroPoint();
@ -119,11 +58,11 @@ const useChatWidgetState = () =>
switch(userType)
{
case RoomObjectType.PET:
imageUrl = getPetImage(figure, 2, true, 64, roomObject.model.getValue<string>(RoomObjectVariable.FIGURE_POSTURE));
imageUrl = await ChatBubbleUtilities.getPetImage(figure, 2, true, 64, roomObject.model.getValue<string>(RoomObjectVariable.FIGURE_POSTURE));
petType = new PetFigureData(figure).typeId;
break;
case RoomObjectType.USER:
imageUrl = getUserImage(figure);
imageUrl = await ChatBubbleUtilities.getUserImage(figure);
break;
case RoomObjectType.RENTABLE_BOT:
case RoomObjectType.BOT:
@ -131,7 +70,7 @@ const useChatWidgetState = () =>
break;
}
avatarColor = avatarColorCache.get(figure);
avatarColor = ChatBubbleUtilities.AVATAR_COLOR_CACHE.get(figure);
username = userData.name;
}
@ -211,7 +150,7 @@ const useChatWidgetState = () =>
addChatEntry({ id: -1, webId: userData.webID, entityId: userData.roomIndex, name: username, imageUrl, style: styleId, chatType: chatType, entityType: userData.type, message: formattedText, timestamp: ChatHistoryCurrentDate(), type: ChatEntryType.TYPE_CHAT, roomId: roomSession.roomId, color });
});
useRoomEngineEvent<RoomDragEvent>(RoomDragEvent.ROOM_DRAG, event =>
useNitroEvent<RoomDragEvent>(RoomDragEvent.ROOM_DRAG, event =>
{
if(!chatMessages.length || (event.roomId !== roomSession.roomId)) return;

View File

@ -1,7 +1,7 @@
import { RoomSessionDoorbellEvent } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomSession } from '../../../api';
import { useRoomSessionManagerEvent } from '../../events';
import { useNitroEvent } from '../../events';
const useDoorbellWidgetState = () =>
{
@ -34,9 +34,9 @@ const useDoorbellWidgetState = () =>
removeUser(userName);
}
useRoomSessionManagerEvent<RoomSessionDoorbellEvent>(RoomSessionDoorbellEvent.DOORBELL, event => addUser(event.userName));
useRoomSessionManagerEvent<RoomSessionDoorbellEvent>(RoomSessionDoorbellEvent.RSDE_REJECTED, event => removeUser(event.userName));
useRoomSessionManagerEvent<RoomSessionDoorbellEvent>(RoomSessionDoorbellEvent.RSDE_ACCEPTED, event => removeUser(event.userName));
useNitroEvent<RoomSessionDoorbellEvent>(RoomSessionDoorbellEvent.DOORBELL, event => addUser(event.userName));
useNitroEvent<RoomSessionDoorbellEvent>(RoomSessionDoorbellEvent.RSDE_REJECTED, event => removeUser(event.userName));
useNitroEvent<RoomSessionDoorbellEvent>(RoomSessionDoorbellEvent.RSDE_ACCEPTED, event => removeUser(event.userName));
return { users, addUser, removeUser, answer };
}

View File

@ -1,7 +1,7 @@
import { OpenPetPackageMessageComposer, RoomObjectCategory, RoomSessionPetPackageEvent } from '@nitrots/nitro-renderer';
import { useState } from 'react';
import { GetRoomEngine, LocalizeText, SendMessageComposer } from '../../../api';
import { useRoomSessionManagerEvent } from '../../events';
import { useNitroEvent } from '../../events';
const usePetPackageWidgetState = () =>
{
@ -49,7 +49,7 @@ const usePetPackageWidgetState = () =>
}
}
useRoomSessionManagerEvent<RoomSessionPetPackageEvent>(RoomSessionPetPackageEvent.RSOPPE_OPEN_PET_PACKAGE_REQUESTED, event =>
useNitroEvent<RoomSessionPetPackageEvent>(RoomSessionPetPackageEvent.RSOPPE_OPEN_PET_PACKAGE_REQUESTED, event =>
{
if (!event) return;
@ -60,7 +60,7 @@ const usePetPackageWidgetState = () =>
setIsVisible(true);
});
useRoomSessionManagerEvent<RoomSessionPetPackageEvent>(RoomSessionPetPackageEvent.RSOPPE_OPEN_PET_PACKAGE_RESULT, event =>
useNitroEvent<RoomSessionPetPackageEvent>(RoomSessionPetPackageEvent.RSOPPE_OPEN_PET_PACKAGE_RESULT, event =>
{
if (!event) return;

View File

@ -1,6 +1,6 @@
import { RoomSessionPollEvent } from '@nitrots/nitro-renderer';
import { DispatchUiEvent, RoomWidgetPollUpdateEvent } from '../../../api';
import { useRoomSessionManagerEvent } from '../../events';
import { useNitroEvent } from '../../events';
import { useRoom } from '../useRoom';
const usePollWidgetState = () =>
@ -13,7 +13,7 @@ const usePollWidgetState = () =>
const answerPoll = (pollId: number, questionId: number, answers: string[]) => roomSession.sendPollAnswerMessage(pollId, questionId, answers);
useRoomSessionManagerEvent<RoomSessionPollEvent>(RoomSessionPollEvent.OFFER, event =>
useNitroEvent<RoomSessionPollEvent>(RoomSessionPollEvent.OFFER, event =>
{
const pollEvent = new RoomWidgetPollUpdateEvent(RoomWidgetPollUpdateEvent.OFFER, event.id);
@ -23,7 +23,7 @@ const usePollWidgetState = () =>
DispatchUiEvent(pollEvent);
});
useRoomSessionManagerEvent<RoomSessionPollEvent>(RoomSessionPollEvent.ERROR, event =>
useNitroEvent<RoomSessionPollEvent>(RoomSessionPollEvent.ERROR, event =>
{
const pollEvent = new RoomWidgetPollUpdateEvent(RoomWidgetPollUpdateEvent.ERROR, event.id);
@ -33,7 +33,7 @@ const usePollWidgetState = () =>
DispatchUiEvent(pollEvent);
});
useRoomSessionManagerEvent<RoomSessionPollEvent>(RoomSessionPollEvent.CONTENT, event =>
useNitroEvent<RoomSessionPollEvent>(RoomSessionPollEvent.CONTENT, event =>
{
const pollEvent = new RoomWidgetPollUpdateEvent(RoomWidgetPollUpdateEvent.CONTENT, event.id);

View File

@ -1,7 +1,7 @@
import { AvatarAction, IQuestion, RoomSessionWordQuizEvent } from '@nitrots/nitro-renderer';
import { useEffect, useState } from 'react';
import { GetRoomEngine, VoteValue } from '../../../api';
import { useRoomSessionManagerEvent } from '../../events';
import { useNitroEvent } from '../../events';
import { useRoom } from '../useRoom';
import { usePollWidget } from './usePollWidget';
@ -34,7 +34,7 @@ const useWordQuizWidgetState = () =>
setAnswerSent(true);
}
useRoomSessionManagerEvent<RoomSessionWordQuizEvent>(RoomSessionWordQuizEvent.ANSWERED, event =>
useNitroEvent<RoomSessionWordQuizEvent>(RoomSessionWordQuizEvent.ANSWERED, event =>
{
const userData = roomSession.userDataManager.getUserData(event.userId);
@ -59,7 +59,7 @@ const useWordQuizWidgetState = () =>
GetRoomEngine().updateRoomObjectUserGesture(roomSession.roomId, userData.roomIndex, AvatarAction.getGestureId((event.value === '0') ? AvatarAction.GESTURE_SAD : AvatarAction.GESTURE_SMILE));
});
useRoomSessionManagerEvent<RoomSessionWordQuizEvent>(RoomSessionWordQuizEvent.FINISHED, event =>
useNitroEvent<RoomSessionWordQuizEvent>(RoomSessionWordQuizEvent.FINISHED, event =>
{
if(question && (question.id === event.questionId))
{
@ -77,7 +77,7 @@ const useWordQuizWidgetState = () =>
setUserAnswers(new Map());
});
useRoomSessionManagerEvent<RoomSessionWordQuizEvent>(RoomSessionWordQuizEvent.QUESTION, event =>
useNitroEvent<RoomSessionWordQuizEvent>(RoomSessionWordQuizEvent.QUESTION, event =>
{
setPollId(event.id);
setQuestion(event.question);

View File

@ -1,9 +1,8 @@
import { FigureUpdateEvent, RoomUnitChatStyleComposer, UserInfoDataParser, UserInfoEvent, UserSettingsEvent } from '@nitrots/nitro-renderer';
import { useEffect, useState } from 'react';
import { useState } from 'react';
import { useBetween } from 'use-between';
import { GetLocalStorage, GetSessionDataManager, SendMessageComposer } from '../../api';
import { GetSessionDataManager, SendMessageComposer } from '../../api';
import { useMessageEvent } from '../events';
import { useLocalStorage } from '../useLocalStorage';
const useSessionInfoState = () =>
{
@ -12,7 +11,6 @@ const useSessionInfoState = () =>
const [ chatStyleId, setChatStyleId ] = useState<number>(0);
const [ userRespectRemaining, setUserRespectRemaining ] = useState<number>(0);
const [ petRespectRemaining, setPetRespectRemaining ] = useState<number>(0);
const [ screenSize, setScreenSize ] = useLocalStorage('nitro.screensize', { width: window.innerWidth, height: window.innerHeight });
const updateChatStyleId = (styleId: number) =>
{
@ -59,34 +57,6 @@ const useSessionInfoState = () =>
setChatStyleId(parser.chatType);
});
useEffect(() =>
{
const currentScreenSize = <{ width: number, height: number }>GetLocalStorage('nitro.screensize');
if(currentScreenSize && ((currentScreenSize.width !== window.innerWidth) || (currentScreenSize.height !== window.innerHeight)))
{
let i = window.localStorage.length;
while(i > 0)
{
const key = window.localStorage.key(i);
if(key && key.startsWith('nitro.window')) window.localStorage.removeItem(key);
i--;
}
}
const onResize = (event: UIEvent) => setScreenSize({ width: window.innerWidth, height: window.innerHeight });
window.addEventListener('resize', onResize);
return () =>
{
window.removeEventListener('resize', onResize);
}
}, [ setScreenSize ]);
return { userInfo, userFigure, chatStyleId, userRespectRemaining, petRespectRemaining, respectUser, respectPet, updateChatStyleId };
}

View File

@ -1,4 +1,4 @@
import { ConditionDefinition, Triggerable, TriggerDefinition, UpdateActionMessageComposer, UpdateConditionMessageComposer, UpdateTriggerMessageComposer, WiredActionDefinition, WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent, WiredSaveSuccessEvent } from '@nitrots/nitro-renderer';
import { ConditionDefinition, OpenMessageComposer, Triggerable, TriggerDefinition, UpdateActionMessageComposer, UpdateConditionMessageComposer, UpdateTriggerMessageComposer, WiredActionDefinition, WiredFurniActionEvent, WiredFurniConditionEvent, WiredFurniTriggerEvent, WiredOpenEvent, WiredSaveSuccessEvent } from '@nitrots/nitro-renderer';
import { useEffect, useState } from 'react';
import { useBetween } from 'use-between';
import { IsOwnerOfFloorFurniture, LocalizeText, SendMessageComposer, WiredFurniType, WiredSelectionVisualizer } from '../../api';
@ -80,6 +80,13 @@ const useWiredState = () =>
});
}
useMessageEvent<WiredOpenEvent>(WiredOpenEvent, event =>
{
const parser = event.getParser();
SendMessageComposer(new OpenMessageComposer(parser.stuffId));
});
useMessageEvent<WiredSaveSuccessEvent>(WiredSaveSuccessEvent, event =>
{
const parser = event.getParser();

278
yarn.lock
View File

@ -417,47 +417,6 @@
"@jridgewell/resolve-uri" "3.1.0"
"@jridgewell/sourcemap-codec" "1.4.14"
"@nitrots/nitro-renderer@^1.6.6":
version "1.6.6"
resolved "https://registry.yarnpkg.com/@nitrots/nitro-renderer/-/nitro-renderer-1.6.6.tgz#c6e572720113e9bdd5b797795772c34761778a42"
integrity sha512-VMxn4gAV49G1nnOrtL6koLnJglHdp83zILcKe8DTZsZXX6GOGU2wST1sSnHvdcH28KpesqrCP5dyJGKC/0ylYQ==
dependencies:
"@pixi/app" "~6.5.0"
"@pixi/basis" "~6.5.0"
"@pixi/canvas-display" "~6.5.0"
"@pixi/canvas-extract" "~6.5.0"
"@pixi/canvas-renderer" "~6.5.0"
"@pixi/constants" "~6.5.0"
"@pixi/core" "~6.5.0"
"@pixi/display" "~6.5.0"
"@pixi/events" "~6.5.0"
"@pixi/extensions" "~6.5.0"
"@pixi/extract" "~6.5.0"
"@pixi/filter-alpha" "~6.5.0"
"@pixi/filter-color-matrix" "~6.5.0"
"@pixi/graphics" "~6.5.0"
"@pixi/graphics-extras" "~6.5.0"
"@pixi/interaction" "~6.5.0"
"@pixi/loaders" "~6.5.0"
"@pixi/math" "~6.5.0"
"@pixi/math-extras" "~6.5.0"
"@pixi/mixin-cache-as-bitmap" "~6.5.0"
"@pixi/mixin-get-child-by-name" "~6.5.0"
"@pixi/mixin-get-global-position" "~6.5.0"
"@pixi/polyfill" "~6.5.0"
"@pixi/runner" "~6.5.0"
"@pixi/settings" "~6.5.0"
"@pixi/sprite" "~6.5.0"
"@pixi/sprite-tiling" "~6.5.0"
"@pixi/spritesheet" "~6.5.0"
"@pixi/text" "~6.5.0"
"@pixi/ticker" "~6.5.0"
"@pixi/tilemap" "^3.2.2"
"@pixi/utils" "~6.5.0"
gifuct-js "^2.1.2"
howler "^2.2.3"
pako "^2.0.4"
"@nodelib/fs.scandir@2.1.5":
version "2.1.5"
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
@ -479,176 +438,6 @@
"@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0"
"@pixi/app@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/app/-/app-6.5.10.tgz#4877929bd53595484c1d334e4cda43bb9d27eca1"
integrity sha512-VsNHLajZ5Dbc/Zrj7iWmIl3eu6Fec+afjW/NXXezD8Sp3nTDF0bv5F+GDgN/zSc2gqIvPHyundImT7hQGBDghg==
"@pixi/basis@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/basis/-/basis-6.5.10.tgz#17955c2b3c34bf9e143ca13d69fc1618f6e7c027"
integrity sha512-FPhp93S/v8mrebosS1lleEkVCgaQDKMn0ml5jKofoW5wqYF2dLst0evUhMYQ/oZiauxaGrBpULv55d5kPFYoBQ==
"@pixi/canvas-display@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/canvas-display/-/canvas-display-6.5.10.tgz#995a932da869fa999131b72c5914398f235fdd9c"
integrity sha512-pT0uhEoy24ei/5JwCYgpf+4A5vP8X5zFICJJOm2bE0k/veLc/nIpHj8SL3jG4CDmYGNAntVodEy+/E23HfzZxQ==
"@pixi/canvas-extract@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/canvas-extract/-/canvas-extract-6.5.10.tgz#33a486f3b79f547795a8ac25d841d0389b3a5152"
integrity sha512-HEgZYvomZx3slLUDbX/tyn2+x8PprFUI5FdRHIN72uED34O09RrbvtQgymrCJCs/aZg+cxd85LRdmNIBn/LyLA==
"@pixi/canvas-renderer@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/canvas-renderer/-/canvas-renderer-6.5.10.tgz#3f035bc2ab91d4804b6885c086aeda4946845c65"
integrity sha512-DzRJLtjt4fuxMj8kgwBxJgmdf3hmuzC8nTElEHbDH07FbVJSwD9GzNIxFli82jrKUo1nyMBoI4bUU+D+MOhAFw==
"@pixi/constants@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/constants/-/constants-6.5.10.tgz#ac0a9c55db0d3dadcd85aa31a251db493c3bd80b"
integrity sha512-PUF2Y9YISRu5eVrVVHhHCWpc/KmxQTg3UH8rIUs8UI9dCK41/wsPd3pEahzf7H47v7x1HCohVZcFO3XQc1bUDw==
"@pixi/core@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/core/-/core-6.5.10.tgz#b92207164526fa4a6d285ccd13cb62bdee50b493"
integrity sha512-Gdzp5ENypyglvsh5Gv3teUZnZnmizo4xOsL+QqmWALdFlJXJwLJMVhKVThV/q/095XR6i4Ou54oshn+m4EkuFw==
dependencies:
"@types/offscreencanvas" "^2019.6.4"
"@pixi/display@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/display/-/display-6.5.10.tgz#3ebe4c56556086160087946d5437808b6fadae08"
integrity sha512-NxFdDDxlbH5fQkzGHraLGoTMucW9pVgXqQm13TSmkA3NWIi/SItHL4qT2SI8nmclT9Vid1VDEBCJFAbdeuQw1Q==
"@pixi/events@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/events/-/events-6.5.10.tgz#b02007a6309c2c995f885f65c7c4a8244b4fd38f"
integrity sha512-LRKZ4tkilgTKRI4hmYEBhEzUbDMOf9YBnBPXDJgfe08k5/taVPVvEhMn4cs5UKTf9ALxTF+EOzrg8n2+kfMuJA==
"@pixi/extensions@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/extensions/-/extensions-6.5.10.tgz#5909d0b3f3c5ecfdc74efe5db2869a64a9cecb8c"
integrity sha512-EIUGza+E+sCy3dupuIjvRK/WyVyfSzHb5XsxRaxNrPwvG1iIUIqNqZ3owLYCo4h17fJWrj/yXVufNNtUKQccWQ==
"@pixi/extract@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/extract/-/extract-6.5.10.tgz#0d198b437aecb1bc358b59a70a268c816e6ca810"
integrity sha512-hXFIc4EGs14GFfXAjT1+6mzopzCMWeXeai38/Yod3vuBXkkp8+ksen6kE09vTnB9l1IpcIaCM+XZEokuqoGX2A==
"@pixi/filter-alpha@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/filter-alpha/-/filter-alpha-6.5.10.tgz#0eada7e25bc896e89e173ac318a617d09e280bea"
integrity sha512-GWHLJvY0QOIDRjVx0hdUff6nl/PePQg84i8XXPmANrvA+gJ/eSRTQRmQcdgInQfawENADB/oRqpcCct6IAcKpQ==
"@pixi/filter-color-matrix@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/filter-color-matrix/-/filter-color-matrix-6.5.10.tgz#5410e85b194631096725ba256d54ec5d7de4e5f0"
integrity sha512-C2S44/EoWTrhqedLWOZTq9GZV5loEq1+MhyK9AUzEubWGMHhou1Juhn2mRZ7R6flKPCRQNKrXpStUwCAouud3Q==
"@pixi/graphics-extras@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/graphics-extras/-/graphics-extras-6.5.10.tgz#ee0133233e7adbcb1d026d662c38a37408fbe486"
integrity sha512-PgaOKubX+3GobTqDtTRnF50AqA+z06kr/WNWXoT5/fcWMcW5rwcUpsL00R9ZTi37ohoZUMjAyfLUr7sIUQpzdA==
"@pixi/graphics@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/graphics/-/graphics-6.5.10.tgz#7a5a5d263a612629b8df59479b99ce938353ced2"
integrity sha512-KPHGJ910fi8bRQQ+VcTIgrK+bKIm8yAQaZKPqMtm14HzHPGcES6HkgeNY1sd7m8J4aS9btm5wOSyFu0p5IzTpA==
"@pixi/interaction@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/interaction/-/interaction-6.5.10.tgz#c477d42206f3a2ed11bf06f3147bcd3906a872fa"
integrity sha512-v809pJmXA2B9dV/vdrDMUqJT+fBB/ARZli2YRmI2dPbEbkaYr8FNmxCAJnwT8o+ymTx044Ie820hn9tVrtMtfA==
"@pixi/loaders@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/loaders/-/loaders-6.5.10.tgz#7d7bdc1686eae2842e4d701abd4b480f9fcd5930"
integrity sha512-AuK7mXBmyVsDFL9DDFPB8sqP8fwQ2NOktvu98bQuJl0/p/UeK/0OAQnF3wcf3FeBv5YGXfNHL21c2DCisjKfTg==
"@pixi/math-extras@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/math-extras/-/math-extras-6.5.10.tgz#907338a877dbd371df0a161ef13afa5a43fcac67"
integrity sha512-TG2zzvdV0F7FmZtsjSrW12ub+QUZadBRCQZt0IaxTl6VBhysBaYhPILC5YpfGhim1uuF1L8W0LLWaGLI8T3VNg==
"@pixi/math@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/math/-/math-6.5.10.tgz#0d9b9e12a7e9a920306e1425901348b9c7f054ad"
integrity sha512-fxeu7ykVbMGxGV2S3qRTupHToeo1hdWBm8ihyURn3BMqJZe2SkZEECPd5RyvIuuNUtjRnmhkZRnF3Jsz2S+L0g==
"@pixi/mixin-cache-as-bitmap@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/mixin-cache-as-bitmap/-/mixin-cache-as-bitmap-6.5.10.tgz#5f8a7ee6620c9734bcce091508004a4a818f13e9"
integrity sha512-HV4qPZt8R7uuPZf1XE5S0e3jbN4+/EqgAIkueIyK3Em+0IO1rCmIbzzYxFPxkElMUu5VvN1r4hXK846z9ITnhw==
"@pixi/mixin-get-child-by-name@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/mixin-get-child-by-name/-/mixin-get-child-by-name-6.5.10.tgz#2fa1002998381be562ec0aa35b44d866d2d435e3"
integrity sha512-YYd9wjnI/4aKY0H5Ij413UppVZn3YE1No2CZrNevV6WbhylsJucowY3hJihtl9mxkpwtaUIyWMjmphkbOinbzA==
"@pixi/mixin-get-global-position@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/mixin-get-global-position/-/mixin-get-global-position-6.5.10.tgz#963395e60c58bc2631f7eb4c4fd479dedbf7a1ec"
integrity sha512-A83gTZP9CdQAyrAvOZl1P707Q0QvIC0V8UnBAMd4GxuhMOXJtXVPCdmfPVXUrfoywgnH+/Bgimq5xhsXTf8Hzg==
"@pixi/polyfill@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/polyfill/-/polyfill-6.5.10.tgz#4a74cf5c709e429f2220b840944ce3215a871aa5"
integrity sha512-KDTWyr285VvPM8GGTVIZAhmxGrOlTznUGK/9kWS3GtrogwLWn41S/86Yej1gYvotVyUomCcOok33Jzahb+vX1w==
dependencies:
object-assign "^4.1.1"
promise-polyfill "^8.2.0"
"@pixi/runner@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/runner/-/runner-6.5.10.tgz#a103dcb70025f13523995b80728077c8071f5ba7"
integrity sha512-4HiHp6diCmigJT/DSbnqQP62OfWKmZB7zPWMdV1AEdr4YT1QxzXAW1wHg7dkoEfyTHqZKl0tm/zcqKq/iH7tMA==
"@pixi/settings@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/settings/-/settings-6.5.10.tgz#11de6bd63b8a1182cd3bd7ea3df698de92d18e9a"
integrity sha512-ypAS5L7pQ2Qb88yQK72bXtc7sD8OrtLWNXdZ/gnw5kwSWCFaOSoqhKqJCXrR5DQtN98+RQefwbEAmMvqobhFyw==
"@pixi/sprite-tiling@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/sprite-tiling/-/sprite-tiling-6.5.10.tgz#b4d692a49145f174e399dc2c7ed6b290f5f73a9a"
integrity sha512-lDFcPuwExrdJhli+WmjPivChjeCG6NiRl36iQ8n2zVi/MYVv9qfKCA6IdU7HBWk1AZdsg6KUTpwfmVLUI+qz3w==
"@pixi/sprite@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/sprite/-/sprite-6.5.10.tgz#2acdf87f8f12e5bf6077117b5e383c07d6803e52"
integrity sha512-UiK+8LgM9XQ/SBDKjRgZ8WggdOSlFRXqiWjEZVmNkiyU8HvXeFzWPRhpc8RR1zDwAUhZWKtMhF8X/ba9m+z2lg==
"@pixi/spritesheet@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/spritesheet/-/spritesheet-6.5.10.tgz#c725d85206eec0ea36d60ff3ff138c01a9201bb0"
integrity sha512-7uOZ1cYyYtPb0ZEgXV1SZ8ujtluZNY0TL5z3+Qc8cgGGZK/MaWG7N6Wf+uR4BR2x8FLNwcyN5IjbQDKCpblrmg==
"@pixi/text@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/text/-/text-6.5.10.tgz#5e6f62343d9148d29a861836ac81c8f5fe7b36d0"
integrity sha512-ikwkonLJ+6QmEVW8Ji9fS5CjrKNbU4mHzYuwRQas/VJQuSWgd0myCcaw6ZbF1oSfQe70HgbNOR0sH8Q3Com0qg==
"@pixi/ticker@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/ticker/-/ticker-6.5.10.tgz#e9d47bb7fe32600d7febe0487c2afb8a3c7abc70"
integrity sha512-UqX1XYtzqFSirmTOy8QAK4Ccg4KkIZztrBdRPKwFSOEiKAJoGDCSBmyQBo/9aYQKGObbNnrJ7Hxv3/ucg3/1GA==
"@pixi/tilemap@^3.2.2":
version "3.2.2"
resolved "https://registry.yarnpkg.com/@pixi/tilemap/-/tilemap-3.2.2.tgz#8327e5d7007a90be640a0b1eb9943a1e405b57e4"
integrity sha512-svdmMyJP63vdae3t66tCmE8IWeO/6lD1xXU+5gzfxqxJS5seTp2bm8mQok2c8PF0O6l/NYlLz6BRklOuEuHboQ==
"@pixi/utils@~6.5.0":
version "6.5.10"
resolved "https://registry.yarnpkg.com/@pixi/utils/-/utils-6.5.10.tgz#05969e4e86ebfdf023de25d53b8270f04ba0c5a6"
integrity sha512-4f4qDMmAz9IoSAe08G2LAxUcEtG9jSdudfsMQT2MG+OpfToirboE6cNoO0KnLCvLzDVE/mfisiQ9uJbVA9Ssdw==
dependencies:
"@types/earcut" "^2.1.0"
earcut "^2.2.4"
eventemitter3 "^3.1.0"
url "^0.11.0"
"@popperjs/core@^2.11.6":
version "2.11.8"
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
@ -703,11 +492,6 @@
"@babel/runtime" "^7.16.7"
"@reach/observe-rect" "^1.1.0"
"@types/earcut@^2.1.0":
version "2.1.1"
resolved "https://registry.yarnpkg.com/@types/earcut/-/earcut-2.1.1.tgz#573a0af609f17005c751f6f4ffec49cfe358ea51"
integrity sha512-w8oigUCDjElRHRRrMvn/spybSMyX8MTkKA5Dv+tS1IE/TgmNZPqUYtvYBXGY8cieSE66gm+szeK+bnbxC2xHTQ==
"@types/json-schema@^7.0.9":
version "7.0.12"
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.12.tgz#d70faba7039d5fca54c83c7dbab41051d2b6f6cb"
@ -723,11 +507,6 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.16.19.tgz#cb03fca8910fdeb7595b755126a8a78144714eea"
integrity sha512-IXl7o+R9iti9eBW4Wg2hx1xQDig183jj7YLn8F7udNceyfkbn1ZxmzZXuak20gR40D7pIkIY1kYGx5VIGbaHKA==
"@types/offscreencanvas@^2019.6.4":
version "2019.7.0"
resolved "https://registry.yarnpkg.com/@types/offscreencanvas/-/offscreencanvas-2019.7.0.tgz#e4a932069db47bb3eabeb0b305502d01586fa90d"
integrity sha512-PGcyveRIpL1XIqK8eBsmRBt76eFgtzuPiSTyKHZxnGemp2yzGzWpjYKAfK3wIMiU7eH+851yEpiuP8JZerTmWg==
"@types/prop-types@*":
version "15.7.5"
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
@ -1232,11 +1011,6 @@ dom-helpers@^5.0.1, dom-helpers@^5.2.0, dom-helpers@^5.2.1:
"@babel/runtime" "^7.8.7"
csstype "^3.0.2"
earcut@^2.2.4:
version "2.2.4"
resolved "https://registry.yarnpkg.com/earcut/-/earcut-2.2.4.tgz#6d02fd4d68160c114825d06890a92ecaae60343a"
integrity sha512-/pjZsA1b4RPHbeWZQn66SWS8nZZWLQQ23oE3Eam7aroEFGEvwKAsJfZ9ytiEMycfzXWpca4FA9QIOehf7PocBQ==
electron-to-chromium@^1.4.431:
version "1.4.467"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.467.tgz#b0660bf644baff7eedea33b8c742fb53ec60e3c2"
@ -1547,11 +1321,6 @@ esutils@^2.0.2:
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==
eventemitter3@^3.1.0:
version "3.1.2"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-3.1.2.tgz#2d3d48f9c346698fce83a85d7d664e98535df6e7"
integrity sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==
fast-deep-equal@3.1.3, fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3:
version "3.1.3"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525"
@ -1680,13 +1449,6 @@ get-symbol-description@^1.0.0:
call-bind "^1.0.2"
get-intrinsic "^1.1.1"
gifuct-js@^2.1.2:
version "2.1.2"
resolved "https://registry.yarnpkg.com/gifuct-js/-/gifuct-js-2.1.2.tgz#06152437ba30ec914db8398bd838bd0fbc8a6ecd"
integrity sha512-rI2asw77u0mGgwhV3qA+OEgYqaDn5UNqgs+Bx0FGwSpuqfYn+Ir6RQY5ENNQ8SbIiG/m5gVa7CD5RriO4f4Lsg==
dependencies:
js-binary-schema-parser "^2.0.3"
glob-parent@^5.1.2, glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
@ -1802,11 +1564,6 @@ has@^1.0.3:
dependencies:
function-bind "^1.1.1"
howler@^2.2.3:
version "2.2.3"
resolved "https://registry.yarnpkg.com/howler/-/howler-2.2.3.tgz#a2eff9b08b586798e7a2ee17a602a90df28715da"
integrity sha512-QM0FFkw0LRX1PR8pNzJVAY25JhIWvbKMBFM4gqk+QdV+kPXOhleWGCB6AiAF/goGjIHK2e/nIElplvjQwhr0jg==
ignore@^5.2.0:
version "5.2.4"
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
@ -1996,11 +1753,6 @@ isexe@^2.0.0:
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
js-binary-schema-parser@^2.0.3:
version "2.0.3"
resolved "https://registry.yarnpkg.com/js-binary-schema-parser/-/js-binary-schema-parser-2.0.3.tgz#3d7848748e8586e63b34e8911b643f59cfb6396e"
integrity sha512-xezGJmOb4lk/M1ZZLTR/jaBHQ4gG/lqQnJqdIv4721DMggsa1bDVlHXNeHYogaIEHD9vCRv0fcL4hMA+Coarkg==
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@ -2273,11 +2025,6 @@ p-locate@^5.0.0:
dependencies:
p-limit "^3.0.2"
pako@^2.0.4:
version "2.1.0"
resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86"
integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==
parent-module@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2"
@ -2334,11 +2081,6 @@ prelude-ls@^1.2.1:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==
promise-polyfill@^8.2.0:
version "8.3.0"
resolved "https://registry.yarnpkg.com/promise-polyfill/-/promise-polyfill-8.3.0.tgz#9284810268138d103807b11f4e23d5e945a4db63"
integrity sha512-H5oELycFml5yto/atYqmjyigJoAo3+OXwolYiH7OfQuYlAqhxNvTfiNMbV9hsC6Yp83yE5r2KTVmtrG6R9i6Pg==
prop-types-extra@^1.1.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/prop-types-extra/-/prop-types-extra-1.1.1.tgz#58c3b74cbfbb95d304625975aa2f0848329a010b"
@ -2365,23 +2107,11 @@ prop-types@^15.6.2, prop-types@^15.8.1:
object-assign "^4.1.1"
react-is "^16.13.1"
punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
integrity sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==
punycode@^2.1.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f"
integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==
qs@^6.11.0:
version "6.11.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.2.tgz#64bea51f12c1f5da1bc01496f48ffcff7c69d7d9"
integrity sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==
dependencies:
side-channel "^1.0.4"
queue-microtask@^1.2.2:
version "1.2.3"
resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243"
@ -2836,14 +2566,6 @@ uri-js@^4.2.2:
dependencies:
punycode "^2.1.0"
url@^0.11.0:
version "0.11.1"
resolved "https://registry.yarnpkg.com/url/-/url-0.11.1.tgz#26f90f615427eca1b9f4d6a28288c147e2302a32"
integrity sha512-rWS3H04/+mzzJkv0eZ7vEDGiQbgquI1fGfOad6zKvgYQi1SzMmhl7c/DdRGxhaWrVH6z0qWITo8rpnxK/RfEhA==
dependencies:
punycode "^1.4.1"
qs "^6.11.0"
use-between@^1.3.4:
version "1.3.5"
resolved "https://registry.yarnpkg.com/use-between/-/use-between-1.3.5.tgz#8f9db513414d204e0046c5692828e209cec4d564"