Update API

This commit is contained in:
Bill 2021-08-13 02:56:26 -04:00
parent 567064b716
commit cfcea786fa
6 changed files with 26 additions and 13 deletions

View File

@ -1,4 +1,4 @@
import { ConfigurationEvent, LegacyExternalInterface, Nitro, NitroCommunicationDemoEvent, NitroEvent, NitroLocalizationEvent, RoomEngineEvent, WebGL } from '@nitrots/nitro-renderer'; import { ConfigurationEvent, LegacyExternalInterface, Nitro, NitroCommunicationDemoEvent, NitroEvent, NitroLocalizationEvent, NitroVersion, RoomEngineEvent, WebGL } from '@nitrots/nitro-renderer';
import { FC, useCallback, useState } from 'react'; import { FC, useCallback, useState } from 'react';
import { GetCommunication, GetConfiguration, GetNitroInstance } from './api'; import { GetCommunication, GetConfiguration, GetNitroInstance } from './api';
import { useConfigurationEvent } from './hooks/events/core/configuration/configuration-event'; import { useConfigurationEvent } from './hooks/events/core/configuration/configuration-event';
@ -17,7 +17,11 @@ export const App: FC<{}> = props =>
//@ts-ignore //@ts-ignore
if(!NitroConfig) throw new Error('NitroConfig is not defined!'); if(!NitroConfig) throw new Error('NitroConfig is not defined!');
if(!GetNitroInstance()) Nitro.bootstrap(); if(!GetNitroInstance())
{
NitroVersion.UI_VERSION = '2.0.0';
Nitro.bootstrap();
}
const getPreloadAssetUrls = useCallback(() => const getPreloadAssetUrls = useCallback(() =>
{ {

View File

@ -1,6 +0,0 @@
import { GetRoomSessionManager } from '../nitro';
export function VisitRoom(roomId: number, password: string = null): void
{
GetRoomSessionManager().createSession(roomId, password);
}

View File

@ -0,0 +1,6 @@
import { GetRoomSessionManager } from './GetRoomSessionManager';
export function CreateRoomSession(roomId: number, password: string = null): void
{
GetRoomSessionManager().createSession(roomId, password);
}

View File

@ -0,0 +1,7 @@
import { DesktopViewComposer } from '@nitrots/nitro-renderer';
import { SendMessageHook } from '../../../hooks';
export function GoToDesktop(): void
{
SendMessageHook(new DesktopViewComposer());
}

View File

@ -1,4 +1,5 @@
export * from './CanManipulateFurniture'; export * from './CanManipulateFurniture';
export * from './CreateRoomSession';
export * from './GetCanStandUp'; export * from './GetCanStandUp';
export * from './GetCanUseExpression'; export * from './GetCanUseExpression';
export * from './GetClubMemberLevel'; export * from './GetClubMemberLevel';
@ -9,6 +10,7 @@ export * from './GetProductDataForLocalization';
export * from './GetRoomSession'; export * from './GetRoomSession';
export * from './GetRoomSessionManager'; export * from './GetRoomSessionManager';
export * from './GetSessionDataManager'; export * from './GetSessionDataManager';
export * from './GoToDesktop';
export * from './HasHabboClub'; export * from './HasHabboClub';
export * from './HasHabboVip'; export * from './HasHabboVip';
export * from './IsOwnerOfFurniture'; export * from './IsOwnerOfFurniture';

View File

@ -1,12 +1,12 @@
import { DesktopViewComposer, Dispose, DropBounce, EaseOut, JumpBy, Motions, NitroToolbarAnimateIconEvent, Queue, UserFigureEvent, UserInfoDataParser, UserInfoEvent, Wait } from '@nitrots/nitro-renderer'; import { Dispose, DropBounce, EaseOut, JumpBy, Motions, NitroToolbarAnimateIconEvent, Queue, UserFigureEvent, UserInfoDataParser, UserInfoEvent, Wait } from '@nitrots/nitro-renderer';
import { FC, useCallback, useState } from 'react'; import { FC, useCallback, useState } from 'react';
import { GetRoomSession, GetRoomSessionManager } from '../../api'; import { GetRoomSession, GetRoomSessionManager, GoToDesktop } from '../../api';
import { AvatarEditorEvent, CatalogEvent, FriendListEvent, InventoryEvent, NavigatorEvent, RoomWidgetCameraEvent } from '../../events'; import { AvatarEditorEvent, CatalogEvent, FriendListEvent, InventoryEvent, NavigatorEvent, RoomWidgetCameraEvent } from '../../events';
import { AchievementsUIEvent } from '../../events/achievements'; import { AchievementsUIEvent } from '../../events/achievements';
import { UnseenItemTrackerUpdateEvent } from '../../events/inventory/UnseenItemTrackerUpdateEvent'; import { UnseenItemTrackerUpdateEvent } from '../../events/inventory/UnseenItemTrackerUpdateEvent';
import { ModToolsEvent } from '../../events/mod-tools/ModToolsEvent'; import { ModToolsEvent } from '../../events/mod-tools/ModToolsEvent';
import { dispatchUiEvent, useRoomEngineEvent, useUiEvent } from '../../hooks'; import { dispatchUiEvent, useRoomEngineEvent, useUiEvent } from '../../hooks';
import { CreateMessageHook, SendMessageHook } from '../../hooks/messages/message-event'; import { CreateMessageHook } from '../../hooks/messages/message-event';
import { TransitionAnimation } from '../../layout/transitions/TransitionAnimation'; import { TransitionAnimation } from '../../layout/transitions/TransitionAnimation';
import { TransitionAnimationTypes } from '../../layout/transitions/TransitionAnimation.types'; import { TransitionAnimationTypes } from '../../layout/transitions/TransitionAnimation.types';
import { AvatarImageView } from '../shared/avatar-image/AvatarImageView'; import { AvatarImageView } from '../shared/avatar-image/AvatarImageView';
@ -128,8 +128,8 @@ export const ToolbarView: FC<ToolbarViewProps> = props =>
const visitDesktop = useCallback(() => const visitDesktop = useCallback(() =>
{ {
if(!GetRoomSession()) return; if(!GetRoomSession()) return;
SendMessageHook(new DesktopViewComposer()); GoToDesktop();
GetRoomSessionManager().removeSession(-1); GetRoomSessionManager().removeSession(-1);
}, []); }, []);