This commit is contained in:
dank074 2022-11-12 23:15:55 -06:00
commit 52743e0d98
112 changed files with 316 additions and 339 deletions

View File

@ -1,7 +1,7 @@
{
"name": "@nitrots/nitro-renderer",
"description": "Javascript library for rendering Nitro in the browser using PixiJS",
"version": "1.4.2",
"version": "1.4.7",
"publishConfig": {
"access": "public"
},
@ -17,8 +17,7 @@
"type": "module",
"scripts": {
"compile": "tsc --project ./tsconfig.json",
"eslint": "eslint ./src --fix",
"postinstall": "node ./post-install.js"
"eslint": "eslint ./src --fix"
},
"dependencies": {
"howler": "^2.2.3",

View File

@ -1,34 +0,0 @@
function install()
{
return;
// try
// {
// const params = {};
// params['packageName'] = process.env.npm_package_name;
// params['packageVersion'] = process.env.npm_package_version;
// const data = JSON.stringify(params);
// const request = httpsRequest({
// hostname: 'install.nitrots.co',
// port: 443,
// path: '/collect',
// method: 'POST',
// headers: {
// 'Content-Type': 'application/json',
// 'Content-Length': data.length
// }
// });
// request.write(data);
// request.end();
// }
// catch (e)
// {
// //
// }
}
install();

View File

@ -1,4 +1,3 @@
import { IAssetManager } from './asset';
import { IDisposable } from './common';
import { ICommunicationManager } from './communication';
import { IConfigurationManager } from './configuration';
@ -6,6 +5,5 @@ import { IConfigurationManager } from './configuration';
export interface INitroCore extends IDisposable
{
configuration: IConfigurationManager;
asset: IAssetManager;
communication: ICommunicationManager;
}

View File

@ -1,24 +1,20 @@
import { BaseTexture, Resource, Texture } from '@pixi/core';
import { Loader, LoaderResource } from '@pixi/loaders';
import { Spritesheet } from '@pixi/spritesheet';
import { IAssetData, IAssetManager, IGraphicAsset, IGraphicAssetCollection, NitroLogger } from '../../api';
import { Disposable } from '../common';
import { ArrayBufferToBase64 } from '../utils';
import { NitroLogger } from '../common';
import { ArrayBufferToBase64, NitroBundle } from '../utils';
import { GraphicAssetCollection } from './GraphicAssetCollection';
import { NitroBundle } from './NitroBundle';
import { IAssetData } from './IAssetData';
import { IAssetManager } from './IAssetManager';
import { IGraphicAsset } from './IGraphicAsset';
import { IGraphicAssetCollection } from './IGraphicAssetCollection';
export class AssetManager extends Disposable implements IAssetManager
export class AssetManager implements IAssetManager
{
private _textures: Map<string, Texture<Resource>>;
private _collections: Map<string, IGraphicAssetCollection>;
public static _INSTANCE: IAssetManager = new AssetManager();
constructor()
{
super();
this._textures = new Map();
this._collections = new Map();
}
private _textures: Map<string, Texture<Resource>> = new Map();
private _collections: Map<string, IGraphicAssetCollection> = new Map();
public getTexture(name: string): Texture<Resource>
{

View File

@ -0,0 +1,3 @@
import { AssetManager } from './AssetManager';
export const GetAssetManager = () => AssetManager._INSTANCE;

View File

@ -1,6 +1,6 @@
import { Resource, Texture } from '@pixi/core';
import { Rectangle } from '@pixi/math';
import { IGraphicAsset } from '../../api';
import { IGraphicAsset } from './IGraphicAsset';
export class GraphicAsset implements IGraphicAsset
{

View File

@ -1,10 +1,14 @@
import { BaseTexture, Resource, Texture } from '@pixi/core';
import { Spritesheet } from '@pixi/spritesheet';
import { Dict } from '@pixi/utils';
import { IAsset, IAssetData, IAssetPalette, IGraphicAsset, IGraphicAssetCollection } from '../../api';
import { GetTickerTime } from '../../pixi-proxy';
import { GraphicAsset } from './GraphicAsset';
import { GraphicAssetPalette } from './GraphicAssetPalette';
import { IAsset } from './IAsset';
import { IAssetData } from './IAssetData';
import { IAssetPalette } from './IAssetPalette';
import { IGraphicAsset } from './IGraphicAsset';
import { IGraphicAssetCollection } from './IGraphicAssetCollection';
export class GraphicAssetCollection implements IGraphicAssetCollection
{

View File

@ -7,7 +7,6 @@ import { IGraphicAssetCollection } from './IGraphicAssetCollection';
export interface IAssetManager
{
dispose(): void;
getTexture(name: string): Texture<Resource>;
setTexture(name: string, texture: Texture<Resource>): void;
getAsset(name: string): IGraphicAsset;

View File

@ -1,4 +1,10 @@
export * from './animation';
export * from './AssetManager';
export * from './GetAssetManager';
export * from './GraphicAsset';
export * from './GraphicAssetCollection';
export * from './GraphicAssetGifCollection';
export * from './GraphicAssetPalette';
export * from './IAsset';
export * from './IAssetAlias';
export * from './IAssetData';

View File

@ -1,4 +1,4 @@
import { IBinaryWriter } from './IBinaryWriter';
import { IBinaryWriter } from '../utils';
import { IConnection } from './IConnection';
import { IMessageDataWrapper } from './IMessageDataWrapper';

View File

@ -1,4 +1,4 @@
import { IBinaryReader } from './IBinaryReader';
import { IBinaryReader } from '../utils';
export interface IMessageDataWrapper
{

View File

@ -1,6 +1,4 @@
export * from './enums';
export * from './IBinaryReader';
export * from './IBinaryWriter';
export * from './ICodec';
export * from './ICommunicationManager';
export * from './IConnection';

View File

@ -13,7 +13,6 @@ export * from './common';
export * from './communication';
export * from './communication/enums';
export * from './configuration';
export * from './IAdvancedMap';
export * from './INitroCore';
export * from './nitro';
export * from './nitro/avatar';
@ -36,6 +35,7 @@ export * from './nitro/room/utils';
export * from './nitro/session';
export * from './nitro/session/enum';
export * from './nitro/sound';
export * from './nitro/sound/common';
export * from './room';
export * from './room/object';
export * from './room/object/enum';
@ -45,3 +45,4 @@ export * from './room/renderer';
export * from './ui';
export * from './ui/widget';
export * from './ui/widget/enums';
export * from './utils';

View File

@ -1,4 +1,4 @@
import { IAdvancedMap } from '../../../IAdvancedMap';
import { IAdvancedMap } from '../../../utils';
import { IPartColor } from './IPartColor';
export interface IPalette

View File

@ -1,4 +1,4 @@
import { IAdvancedMap } from '../../../IAdvancedMap';
import { IAdvancedMap } from '../../../utils';
import { IFigurePartSet } from './IFigurePartSet';
export interface ISetType

View File

@ -1,25 +1,25 @@
import { IAdvancedMap } from '../../IAdvancedMap';
import { ISongInfo } from './common/ISongInfo';
import { IAdvancedMap } from '../../utils';
import { ISongInfo } from './common';
import { IPlaylistController } from './IPlaylistController';
export interface IMusicController
{
getRoomItemPlaylist(_arg_1?:number):IPlaylistController;
getSongDiskInventorySize():number;
getSongDiskInventoryDiskId(_arg_1:number):number;
getSongDiskInventorySongId(_arg_1:number):number;
getSongInfo(_arg_1:number):ISongInfo;
getSongIdPlayingAtPriority(_arg_1:number):number;
playSong(songId:number, priority:number, startPos?:number, playLength?:number, fadeInSeconds?:number, fadeOutSeconds?:number):boolean;
stop(priority:number):void;
addSongInfoRequest(_arg_1:number):void;
requestSongInfoWithoutSamples(_arg_1:number):void;
requestUserSongDisks():void;
onSongLoaded(_arg_1:number):void;
updateVolume(_arg_1:number):void;
samplesUnloaded(_arg_1:number[]):void;
get samplesIdsInUse():number[];
getRoomItemPlaylist(_arg_1?: number): IPlaylistController;
getSongDiskInventorySize(): number;
getSongDiskInventoryDiskId(_arg_1: number): number;
getSongDiskInventorySongId(_arg_1: number): number;
getSongInfo(_arg_1: number): ISongInfo;
getSongIdPlayingAtPriority(_arg_1: number): number;
playSong(songId: number, priority: number, startPos?: number, playLength?: number, fadeInSeconds?: number, fadeOutSeconds?: number): boolean;
stop(priority: number): void;
addSongInfoRequest(_arg_1: number): void;
requestSongInfoWithoutSamples(_arg_1: number): void;
requestUserSongDisks(): void;
onSongLoaded(_arg_1: number): void;
updateVolume(_arg_1: number): void;
samplesUnloaded(_arg_1: number[]): void;
get samplesIdsInUse(): number[];
get songDiskInventory(): IAdvancedMap<number, number>
init(): void;
dispose():void;
dispose(): void;
}

View File

@ -1,4 +1,4 @@
import { IAdvancedMap } from '../IAdvancedMap';
import { IAdvancedMap } from '../utils';
import { IRoomObjectController } from './object';
export interface IRoomObjectManager

View File

@ -1,4 +1,4 @@
import { IAdvancedMap } from '../../IAdvancedMap';
import { IAdvancedMap } from '../../utils';
import { IRoomObjectModel } from './IRoomObjectModel';
export interface IRoomObjectModelController extends IRoomObjectModel

View File

@ -1,4 +1,4 @@
import { IAdvancedMap } from '../../api';
import { IAdvancedMap } from './IAdvancedMap';
export class AdvancedMap<T, U> implements IAdvancedMap<T, U>
{

View File

@ -1,4 +1,4 @@
import { IBinaryReader } from '../../api';
import { IBinaryReader } from './IBinaryReader';
export class BinaryReader implements IBinaryReader
{

View File

@ -1,4 +1,4 @@
import { IBinaryWriter } from '../../api';
import { IBinaryWriter } from './IBinaryWriter';
export class BinaryWriter implements IBinaryWriter
{

View File

@ -1,4 +1,4 @@
import { IDisposable } from './common';
import { IDisposable } from '../common';
export interface IAdvancedMap<T = any, U = any> extends IDisposable
{

View File

@ -1,6 +1,7 @@
import { BaseTexture } from '@pixi/core';
import { Data, inflate } from 'pako';
import { ArrayBufferToBase64, BinaryReader } from '../utils';
import { ArrayBufferToBase64 } from './ArrayBufferToBase64';
import { BinaryReader } from './BinaryReader';
export class NitroBundle
{

View File

@ -2,4 +2,7 @@ export * from './AdvancedMap';
export * from './ArrayBufferToBase64';
export * from './BinaryReader';
export * from './BinaryWriter';
export * from './SayHello';
export * from './IAdvancedMap';
export * from './IBinaryReader';
export * from './IBinaryWriter';
export * from './NitroBundle';

View File

@ -1,36 +1,26 @@
import { IAssetManager, ICommunicationManager, IConfigurationManager, INitroCore } from '../api';
import { AssetManager } from './asset';
import { ICommunicationManager, IConfigurationManager, INitroCore } from '../api';
import { Disposable } from './common';
import { CommunicationManager } from './communication';
import { ConfigurationManager } from './configuration';
import { SayHello } from './utils';
import { NitroVersion } from './NitroVersion';
export class NitroCore extends Disposable implements INitroCore
{
private _configuration: IConfigurationManager;
private _communication: ICommunicationManager;
private _asset: IAssetManager;
constructor()
{
super();
SayHello();
NitroVersion.sayHello();
this._configuration = new ConfigurationManager();
this._communication = new CommunicationManager();
this._asset = new AssetManager();
}
protected onDispose(): void
{
if(this._asset)
{
this._asset.dispose();
this._asset = null;
}
if(this._communication)
{
this._communication.dispose();
@ -48,9 +38,4 @@ export class NitroCore extends Disposable implements INitroCore
{
return this._communication;
}
public get asset(): IAssetManager
{
return this._asset;
}
}

View File

@ -1,5 +1,30 @@
export class NitroVersion
{
public static RENDERER_VERSION: string = '1.4.2';
public static RENDERER_VERSION: string = '1.4.7';
public static UI_VERSION: string = '';
public static sayHello(): void
{
if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1)
{
const args = [
`\n %c %c %c Nitro ${NitroVersion.UI_VERSION} - Renderer ${NitroVersion.RENDERER_VERSION} %c %c %c https://discord.nitrodev.co %c %c \n\n`,
'background: #ffffff; padding:5px 0;',
'background: #ffffff; padding:5px 0;',
'color: #ffffff; background: #000000; padding:5px 0;',
'background: #ffffff; padding:5px 0;',
'background: #ffffff; padding:5px 0;',
'background: #000000; padding:5px 0;',
'background: #ffffff; padding:5px 0;',
'background: #ffffff; padding:5px 0;'
];
self.console.log(...args);
}
else if(self.console)
{
self.console.log(`Nitro ${NitroVersion.UI_VERSION} - Renderer ${NitroVersion.RENDERER_VERSION} `);
}
}
}

View File

@ -1,6 +0,0 @@
export * from './AssetManager';
export * from './GraphicAsset';
export * from './GraphicAssetCollection';
export * from './GraphicAssetGifCollection';
export * from './GraphicAssetPalette';
export * from './NitroBundle';

View File

@ -1,5 +1,4 @@
import { IBinaryWriter, ICodec, IConnection, IMessageDataWrapper } from '../../../../api';
import { BinaryReader, BinaryWriter } from '../../../utils';
import { BinaryReader, BinaryWriter, IBinaryWriter, ICodec, IConnection, IMessageDataWrapper } from '../../../../api';
import { Byte } from '../Byte';
import { Short } from '../Short';
import { EvaWireDataWrapper } from './EvaWireDataWrapper';

View File

@ -1,4 +1,3 @@
export * from './asset';
export * from './common';
export * from './communication';
export * from './communication/codec';
@ -7,4 +6,3 @@ export * from './communication/messages';
export * from './configuration';
export * from './NitroCore';
export * from './NitroVersion';
export * from './utils';

View File

@ -1,26 +0,0 @@
import { NitroVersion } from '../NitroVersion';
export const SayHello = () =>
{
if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1)
{
const args = [
`\n %c %c %c Nitro ${NitroVersion.UI_VERSION} - Renderer ${NitroVersion.RENDERER_VERSION} %c %c %c https://discord.nitrodev.co %c %c \n\n`,
'background: #ffffff; padding:5px 0;',
'background: #ffffff; padding:5px 0;',
'color: #ffffff; background: #000000; padding:5px 0;',
'background: #ffffff; padding:5px 0;',
'background: #ffffff; padding:5px 0;',
'background: #000000; padding:5px 0;',
'background: #ffffff; padding:5px 0;',
'background: #ffffff; padding:5px 0;'
];
self.console.log(...args);
}
else if(self.console)
{
self.console.log(`Nitro ${NitroVersion.UI_VERSION} - Renderer ${NitroVersion.RENDERER_VERSION} `);
}
};

View File

@ -1,4 +1,4 @@
import { NitroEvent } from '../../events';
import { NitroEvent } from '../core';
export class RoomContentLoadedEvent extends NitroEvent
{

View File

@ -14,6 +14,7 @@ export class RoomEngineObjectEvent extends RoomEngineEvent
public static REQUEST_MANIPULATION: string = 'REOE_REQUEST_MANIPULATION';
public static MOUSE_ENTER: string = 'REOE_MOUSE_ENTER';
public static MOUSE_LEAVE: string = 'REOE_MOUSE_LEAVE';
public static DOUBLE_CLICK: string = 'REOE_DOUBLE_CLICK';
private _objectId: number;
private _category: number;

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectBadgeAssetEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectDataRequestEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectDimmerStateUpdateEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectFloorHoleEvent extends RoomObjectEvent
{

View File

@ -1,4 +1,4 @@
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectFurnitureActionEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectHSLColorEnableEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectMoveEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectRoomAdEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectSamplePlaybackEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectStateChangedEvent extends RoomObjectEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectMouseEvent } from '../../room';
import { RoomObjectMouseEvent } from './RoomObjectMouseEvent';
export class RoomObjectTileMouseEvent extends RoomObjectMouseEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject, IVector3D, Vector3d } from '../../api';
import { RoomObjectMouseEvent } from '../../room';
import { RoomObjectMouseEvent } from './RoomObjectMouseEvent';
export class RoomObjectWallMouseEvent extends RoomObjectMouseEvent
{

View File

@ -1,5 +1,5 @@
import { IRoomObject } from '../../api';
import { RoomObjectEvent } from '../../room';
import { RoomObjectEvent } from './RoomObjectEvent';
export class RoomObjectWidgetRequestEvent extends RoomObjectEvent
{

View File

@ -1,4 +1,4 @@
import { NitroEvent } from '../../events';
import { NitroEvent } from '../core';
export class RoomToObjectEvent extends NitroEvent
{

View File

@ -1,5 +1,5 @@
import { IVector3D } from '../../api';
import { RoomToObjectEvent } from '../../room';
import { RoomToObjectEvent } from './RoomToObjectEvent';
export class RoomToObjectOwnAvatarMoveEvent extends RoomToObjectEvent
{

View File

@ -1,4 +1,5 @@
export * from './RoomBackgroundColorEvent';
export * from './RoomContentLoadedEvent';
export * from './RoomDragEvent';
export * from './RoomEngineDimmerStateEvent';
export * from './RoomEngineEvent';
@ -13,10 +14,12 @@ export * from './RoomEngineUseProductEvent';
export * from './RoomObjectBadgeAssetEvent';
export * from './RoomObjectDataRequestEvent';
export * from './RoomObjectDimmerStateUpdateEvent';
export * from './RoomObjectEvent';
export * from './RoomObjectFloorHoleEvent';
export * from './RoomObjectFurnitureActionEvent';
export * from './RoomObjectHSLColorEnabledEvent';
export * from './RoomObjectHSLColorEnableEvent';
export * from './RoomObjectMouseEvent';
export * from './RoomObjectMoveEvent';
export * from './RoomObjectPlaySoundIdEvent';
export * from './RoomObjectRoomAdEvent';
@ -26,5 +29,7 @@ export * from './RoomObjectStateChangedEvent';
export * from './RoomObjectTileMouseEvent';
export * from './RoomObjectWallMouseEvent';
export * from './RoomObjectWidgetRequestEvent';
export * from './RoomSpriteMouseEvent';
export * from './RoomToObjectEvent';
export * from './RoomToObjectOwnAvatarMoveEvent';
export * from './RoomZoomEvent';

View File

@ -1,5 +1,4 @@
import { Application } from '@pixi/app';
import { Ticker } from '@pixi/ticker';
import { IAvatarRenderManager, IEventDispatcher, ILinkEventTracker, INitroCommunicationManager, INitroCore, INitroLocalizationManager, IRoomCameraWidgetManager, IRoomEngine, IRoomManager, IRoomSessionManager, ISessionDataManager, ISoundManager, IWorkerEventTracker } from '../api';
export interface INitro
@ -32,8 +31,6 @@ export interface INitro
soundManager: ISoundManager;
width: number;
height: number;
ticker: Ticker;
time: number;
isReady: boolean;
isDisposed: boolean;
}

View File

@ -1,11 +1,10 @@
import { Application, IApplicationOptions } from '@pixi/app';
import { SCALE_MODES } from '@pixi/constants';
import { settings } from '@pixi/settings';
import { Ticker } from '@pixi/ticker';
import { IAvatarRenderManager, IEventDispatcher, ILinkEventTracker, INitroCommunicationManager, INitroCore, INitroLocalizationManager, IRoomCameraWidgetManager, IRoomEngine, IRoomManager, IRoomSessionManager, ISessionDataManager, ISoundManager, IWorkerEventTracker, NitroConfiguration } from '../api';
import { ConfigurationEvent, EventDispatcher, NitroCore } from '../core';
import { NitroEvent, RoomEngineEvent } from '../events';
import { PixiApplicationProxy } from '../pixi-proxy';
import { GetTicker, PixiApplicationProxy } from '../pixi-proxy';
import { RoomManager } from '../room';
import { AvatarRenderManager } from './avatar';
import { RoomCameraWidgetManager } from './camera';
@ -200,9 +199,9 @@ export class Nitro implements INitro
private onConfigurationLoadedEvent(event: ConfigurationEvent): void
{
const animationFPS = NitroConfiguration.getValue<number>('system.animation.fps', 24);
const limitsFPS = NitroConfiguration.getValue<boolean>('system.limits.fps', true);
const limitsFPS = NitroConfiguration.getValue<boolean>('system.limits.fps', false);
if(limitsFPS) Nitro.instance.ticker.maxFPS = animationFPS;
if(limitsFPS) GetTicker().maxFPS = animationFPS;
}
private onRoomEngineReady(event: RoomEngineEvent): void
@ -392,16 +391,6 @@ export class Nitro implements INitro
return this._application.renderer.height;
}
public get ticker(): Ticker
{
return Ticker.shared;
}
public get time(): number
{
return this.ticker.lastTime;
}
public get isReady(): boolean
{
return this._isReady;

View File

@ -3,8 +3,7 @@ import { Container } from '@pixi/display';
import { ColorMatrixFilter } from '@pixi/filter-color-matrix';
import { Rectangle } from '@pixi/math';
import { Sprite } from '@pixi/sprite';
import { AvatarAction, AvatarDirectionAngle, AvatarScaleType, AvatarSetType, IActionDefinition, IActiveActionData, IAdvancedMap, IAnimationLayerData, IAvatarDataContainer, IAvatarEffectListener, IAvatarFigureContainer, IAvatarImage, IGraphicAsset, IPartColor, ISpriteDataContainer } from '../../api';
import { AdvancedMap } from '../../core';
import { AdvancedMap, AvatarAction, AvatarDirectionAngle, AvatarScaleType, AvatarSetType, IActionDefinition, IActiveActionData, IAdvancedMap, IAnimationLayerData, IAvatarDataContainer, IAvatarEffectListener, IAvatarFigureContainer, IAvatarImage, IGraphicAsset, IPartColor, ISpriteDataContainer } from '../../api';
import { GetTickerTime, NitroContainer, NitroSprite, PaletteMapFilter, PixiApplicationProxy, TextureUtils } from '../../pixi-proxy';
import { ActiveActionData } from './actions';
import { AssetAliasCollection } from './alias';

View File

@ -1,7 +1,6 @@
import { AvatarSetType, IAssetManager, IAvatarEffectListener, IAvatarFigureContainer, IAvatarImage, IAvatarImageListener, IAvatarRenderManager, IFigureData, IFigurePartSet, IFigureSetData, IGraphicAsset, INitroEvent, IStructureData, NitroConfiguration, NitroLogger } from '../../api';
import { AvatarSetType, GetAssetManager, IAssetManager, IAvatarEffectListener, IAvatarFigureContainer, IAvatarImage, IAvatarImageListener, IAvatarRenderManager, IFigureData, IFigurePartSet, IFigureSetData, IGraphicAsset, INitroEvent, IStructureData, NitroConfiguration, NitroLogger } from '../../api';
import { NitroManager } from '../../core';
import { AvatarRenderEvent, NitroEvent } from '../../events';
import { Nitro } from '../Nitro';
import { FigureDataContainer } from '../utils';
import { AssetAliasCollection } from './alias';
import { AvatarAssetDownloadManager } from './AvatarAssetDownloadManager';
@ -70,13 +69,13 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa
this.loadAnimations();
this.loadFigureData();
this._aliasCollection = new AssetAliasCollection(this, Nitro.instance.core.asset);
this._aliasCollection = new AssetAliasCollection(this, GetAssetManager());
this._aliasCollection.init();
if(!this._avatarAssetDownloadManager)
{
this._avatarAssetDownloadManager = new AvatarAssetDownloadManager(Nitro.instance.core.asset, this._structure);
this._avatarAssetDownloadManager = new AvatarAssetDownloadManager(GetAssetManager(), this._structure);
this._avatarAssetDownloadManager.addEventListener(AvatarAssetDownloadManager.DOWNLOADER_READY, this.onAvatarAssetDownloaderReady);
this._avatarAssetDownloadManager.addEventListener(AvatarAssetDownloadManager.LIBRARY_LOADED, this.onAvatarAssetDownloaded);
@ -84,7 +83,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa
if(!this._effectAssetDownloadManager)
{
this._effectAssetDownloadManager = new EffectAssetDownloadManager(Nitro.instance.core.asset, this._structure);
this._effectAssetDownloadManager = new EffectAssetDownloadManager(GetAssetManager(), this._structure);
this._effectAssetDownloadManager.addEventListener(EffectAssetDownloadManager.DOWNLOADER_READY, this.onEffectAssetDownloaderReady);
this._effectAssetDownloadManager.addEventListener(EffectAssetDownloadManager.LIBRARY_LOADED, this.onEffectAssetDownloaded);
@ -136,7 +135,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa
{
const defaultActions = NitroConfiguration.getValue<string>('avatar.default.actions');
if(defaultActions) this._structure.initActions(Nitro.instance.core.asset, defaultActions);
if(defaultActions) this._structure.initActions(GetAssetManager(), defaultActions);
const request = new XMLHttpRequest();
@ -442,7 +441,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa
public get assets(): IAssetManager
{
return Nitro.instance.core.asset;
return GetAssetManager();
}
public get isReady(): boolean

View File

@ -1,5 +1,4 @@
import { IAdvancedMap, IFigureDataPalette, IPalette, IPartColor } from '../../../../api';
import { AdvancedMap } from '../../../../core';
import { AdvancedMap, IAdvancedMap, IFigureDataPalette, IPalette, IPartColor } from '../../../../api';
import { PartColor } from './PartColor';
export class Palette implements IPalette

View File

@ -1,5 +1,4 @@
import { IAdvancedMap, IFigureDataSetType, IFigurePartSet, ISetType } from '../../../../api';
import { AdvancedMap } from '../../../../core';
import { AdvancedMap, IAdvancedMap, IFigureDataSetType, IFigurePartSet, ISetType } from '../../../../api';
import { FigurePartSet } from './FigurePartSet';
export class SetType implements ISetType

View File

@ -1,5 +1,4 @@
import { IAdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../../api';
import { AdvancedMap } from '../../../../../../core';
import { AdvancedMap, IAdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../../api';
export class BadgesParser implements IMessageParser
{

View File

@ -1,5 +1,4 @@
import { IAdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../api';
import { AdvancedMap } from '../../../../../core';
import { AdvancedMap, IAdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class UnseenItemsParser implements IMessageParser
{

View File

@ -1,5 +1,4 @@
import { IAdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../api';
import { AdvancedMap } from '../../../../../core';
import { AdvancedMap, IAdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class JukeboxSongDisksMessageParser implements IMessageParser
{

View File

@ -1,5 +1,4 @@
import { IAdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../api';
import { AdvancedMap } from '../../../../../core';
import { AdvancedMap, IAdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class UserSongDisksInventoryMessageParser implements IMessageParser
{

View File

@ -1,5 +1,4 @@
import { IAdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../../api';
import { AdvancedMap } from '../../../../../../core';
import { AdvancedMap, IAdvancedMap, IMessageDataWrapper, IMessageParser } from '../../../../../../api';
import { RelationshipStatusInfo } from './RelationshipStatusInfo';
export class RelationshipStatusInfoMessageParser implements IMessageParser

View File

@ -1,11 +1,9 @@
import { BaseTexture, Resource, Texture } from '@pixi/core';
import { Loader, LoaderResource } from '@pixi/loaders';
import { Spritesheet } from '@pixi/spritesheet';
import { FurnitureType, IAssetData, IEventDispatcher, IFurnitureData, IFurnitureDataListener, IGraphicAssetCollection, IGraphicAssetGifCollection, IPetColorResult, IRoomContentListener, IRoomContentLoader, IRoomObject, ISessionDataManager, NitroConfiguration, NitroLogger, RoomObjectCategory, RoomObjectUserType, RoomObjectVariable, RoomObjectVisualizationType } from '../../api';
import { GraphicAssetCollection, GraphicAssetGifCollection, NitroBundle } from '../../core';
import { FurnitureType, GetAssetManager, GraphicAssetCollection, GraphicAssetGifCollection, IAssetData, IEventDispatcher, IFurnitureData, IFurnitureDataListener, IGraphicAssetCollection, IGraphicAssetGifCollection, IPetColorResult, IRoomContentListener, IRoomContentLoader, IRoomObject, ISessionDataManager, NitroBundle, NitroConfiguration, NitroLogger, RoomObjectCategory, RoomObjectUserType, RoomObjectVariable, RoomObjectVisualizationType } from '../../api';
import { NitroEvent } from '../../events';
import { RoomContentLoadedEvent } from '../../room/events/RoomContentLoadedEvent';
import { Nitro } from '../Nitro';
import { RoomContentLoadedEvent } from '../../events/room/RoomContentLoadedEvent';
import { PetColorResult } from './PetColorResult';
export class RoomContentLoader implements IFurnitureDataListener, IRoomContentLoader
@ -282,7 +280,7 @@ export class RoomContentLoader implements IFurnitureDataListener, IRoomContentLo
if(!existing)
{
const globalCollection = Nitro.instance.core.asset.getCollection(name);
const globalCollection = GetAssetManager().getCollection(name);
if(globalCollection)
{

View File

@ -3,12 +3,11 @@ import { Container, DisplayObject } from '@pixi/display';
import { Matrix, Point, Rectangle } from '@pixi/math';
import { IConnection, IDisposable, IFurnitureStackingHeightMap, IGetImageListener, IImageResult, ILegacyWallGeometry, IMessageComposer, INitroCommunicationManager, INitroEvent, IObjectData, IPetColorResult, IPetCustomPart, IRoomContentListener, IRoomContentLoader, IRoomCreator, IRoomEngine, IRoomEngineServices, IRoomGeometry, IRoomInstance, IRoomManager, IRoomManagerListener, IRoomObject, IRoomObjectController, IRoomObjectLogicFactory, IRoomObjectVisualizationFactory, IRoomRenderer, IRoomRendererFactory, IRoomRenderingCanvas, IRoomSessionManager, ISelectedRoomObjectData, ISessionDataManager, ITileObjectMap, IUpdateReceiver, IVector3D, LegacyDataType, MouseEventType, NitroConfiguration, NitroLogger, ObjectDataFactory, RoomControllerLevel, RoomObjectCategory, RoomObjectUserType, RoomObjectVariable, ToolbarIconEnum, Vector3d } from '../../api';
import { NitroManager } from '../../core';
import { BadgeImageReadyEvent, NitroToolbarAnimateIconEvent, RoomBackgroundColorEvent, RoomDragEvent, RoomEngineEvent, RoomEngineObjectEvent, RoomObjectFurnitureActionEvent, RoomSessionEvent, RoomToObjectOwnAvatarMoveEvent } from '../../events';
import { GetTickerTime, NitroSprite, TextureUtils } from '../../pixi-proxy';
import { NumberBank, RoomEnterEffect, RoomGeometry, RoomInstance, RoomObjectEvent, RoomObjectMouseEvent, RoomObjectUpdateMessage, RoomRendererFactory } from '../../room';
import { BadgeImageReadyEvent, NitroToolbarAnimateIconEvent, RoomBackgroundColorEvent, RoomDragEvent, RoomEngineEvent, RoomEngineObjectEvent, RoomObjectEvent, RoomObjectFurnitureActionEvent, RoomObjectMouseEvent, RoomSessionEvent, RoomToObjectOwnAvatarMoveEvent } from '../../events';
import { GetTicker, GetTickerTime, NitroSprite, TextureUtils } from '../../pixi-proxy';
import { NumberBank, RoomEnterEffect, RoomGeometry, RoomInstance, RoomObjectUpdateMessage, RoomRendererFactory } from '../../room';
import { PetFigureData } from '../avatar';
import { RenderRoomMessageComposer, RenderRoomThumbnailMessageComposer } from '../communication';
import { Nitro } from '../Nitro';
import { FurniId } from '../utils';
import { ImageResult } from './ImageResult';
import { ObjectAvatarCarryObjectUpdateMessage, ObjectAvatarChatUpdateMessage, ObjectAvatarDanceUpdateMessage, ObjectAvatarEffectUpdateMessage, ObjectAvatarExperienceUpdateMessage, ObjectAvatarExpressionUpdateMessage, ObjectAvatarFigureUpdateMessage, ObjectAvatarFlatControlUpdateMessage, ObjectAvatarGestureUpdateMessage, ObjectAvatarGuideStatusUpdateMessage, ObjectAvatarMutedUpdateMessage, ObjectAvatarOwnMessage, ObjectAvatarPetGestureUpdateMessage, ObjectAvatarPlayerValueUpdateMessage, ObjectAvatarPlayingGameUpdateMessage, ObjectAvatarPostureUpdateMessage, ObjectAvatarSignUpdateMessage, ObjectAvatarSleepUpdateMessage, ObjectAvatarTypingUpdateMessage, ObjectAvatarUpdateMessage, ObjectAvatarUseObjectUpdateMessage, ObjectDataUpdateMessage, ObjectGroupBadgeUpdateMessage, ObjectHeightUpdateMessage, ObjectItemDataUpdateMessage, ObjectModelDataUpdateMessage, ObjectMoveUpdateMessage, ObjectRoomColorUpdateMessage, ObjectRoomFloorHoleUpdateMessage, ObjectRoomMaskUpdateMessage, ObjectRoomPlanePropertyUpdateMessage, ObjectRoomPlaneVisibilityUpdateMessage, ObjectRoomUpdateMessage, ObjectStateUpdateMessage } from './messages';
@ -151,7 +150,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
this.events.addEventListener(RoomContentLoader.LOADER_READY, this.onRoomContentLoaderReadyEvent);
Nitro.instance.ticker.add(this.update, this);
GetTicker().add(this.update, this);
document.addEventListener('visibilitychange', this.runVisibilityUpdate);
}
@ -167,7 +166,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
document.removeEventListener('visibilitychange', this.runVisibilityUpdate);
Nitro.instance.ticker.remove(this.update, this);
GetTicker().remove(this.update, this);
if(this._roomObjectEventHandler) this._roomObjectEventHandler.dispose();
@ -787,12 +786,12 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
{
if(flag)
{
Nitro.instance.ticker.remove(this.update, this);
GetTicker().remove(this.update, this);
}
else
{
Nitro.instance.ticker.remove(this.update, this);
Nitro.instance.ticker.add(this.update, this);
GetTicker().remove(this.update, this);
GetTicker().add(this.update, this);
}
}

View File

@ -1,7 +1,7 @@
import { IFurnitureStackingHeightMap, ILegacyWallGeometry, IObjectData, IRoomCanvasMouseListener, IRoomEngineServices, IRoomGeometry, IRoomObject, IRoomObjectController, IRoomObjectEventManager, ISelectedRoomObjectData, IVector3D, MouseEventType, NitroConfiguration, NitroLogger, RoomObjectCategory, RoomObjectOperationType, RoomObjectPlacementSource, RoomObjectType, RoomObjectUserType, RoomObjectVariable, Vector3d } from '../../api';
import { Disposable } from '../../core';
import { RoomEngineDimmerStateEvent, RoomEngineObjectEvent, RoomEngineObjectPlacedEvent, RoomEngineObjectPlacedOnUserEvent, RoomEngineObjectPlaySoundEvent, RoomEngineRoomAdEvent, RoomEngineSamplePlaybackEvent, RoomEngineTriggerWidgetEvent, RoomEngineUseProductEvent, RoomObjectBadgeAssetEvent, RoomObjectDataRequestEvent, RoomObjectDimmerStateUpdateEvent, RoomObjectFloorHoleEvent, RoomObjectFurnitureActionEvent, RoomObjectHSLColorEnabledEvent, RoomObjectHSLColorEnableEvent, RoomObjectMoveEvent, RoomObjectPlaySoundIdEvent, RoomObjectRoomAdEvent, RoomObjectSamplePlaybackEvent, RoomObjectSoundMachineEvent, RoomObjectStateChangedEvent, RoomObjectTileMouseEvent, RoomObjectWallMouseEvent, RoomObjectWidgetRequestEvent } from '../../events';
import { RoomEnterEffect, RoomId, RoomObjectEvent, RoomObjectMouseEvent, RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../room';
import { RoomEngineDimmerStateEvent, RoomEngineObjectEvent, RoomEngineObjectPlacedEvent, RoomEngineObjectPlacedOnUserEvent, RoomEngineObjectPlaySoundEvent, RoomEngineRoomAdEvent, RoomEngineSamplePlaybackEvent, RoomEngineTriggerWidgetEvent, RoomEngineUseProductEvent, RoomObjectBadgeAssetEvent, RoomObjectDataRequestEvent, RoomObjectDimmerStateUpdateEvent, RoomObjectEvent, RoomObjectFloorHoleEvent, RoomObjectFurnitureActionEvent, RoomObjectHSLColorEnabledEvent, RoomObjectHSLColorEnableEvent, RoomObjectMouseEvent, RoomObjectMoveEvent, RoomObjectPlaySoundIdEvent, RoomObjectRoomAdEvent, RoomObjectSamplePlaybackEvent, RoomObjectSoundMachineEvent, RoomObjectStateChangedEvent, RoomObjectTileMouseEvent, RoomObjectWallMouseEvent, RoomObjectWidgetRequestEvent, RoomSpriteMouseEvent } from '../../events';
import { RoomEnterEffect, RoomId, RoomObjectUpdateMessage } from '../../room';
import { BotPlaceComposer, FurnitureColorWheelComposer, FurnitureDiceActivateComposer, FurnitureDiceDeactivateComposer, FurnitureFloorUpdateComposer, FurnitureGroupInfoComposer, FurnitureMultiStateComposer, FurnitureOneWayDoorComposer, FurniturePickupComposer, FurniturePlaceComposer, FurniturePostItPlaceComposer, FurnitureRandomStateComposer, FurnitureWallMultiStateComposer, FurnitureWallUpdateComposer, GetItemDataComposer, GetResolutionAchievementsMessageComposer, PetMoveComposer, PetPlaceComposer, RemoveWallItemComposer, RoomUnitLookComposer, RoomUnitWalkComposer, SetItemDataMessageComposer, SetObjectDataMessageComposer } from '../communication';
import { Nitro } from '../Nitro';
import { ObjectAvatarSelectedMessage, ObjectDataUpdateMessage, ObjectSelectedMessage, ObjectTileCursorUpdateMessage, ObjectVisibilityUpdateMessage } from './messages';
@ -296,6 +296,9 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
case RoomObjectMouseEvent.CLICK:
this.handleRoomObjectMouseClickEvent(event, roomId);
return;
case RoomObjectMouseEvent.DOUBLE_CLICK:
this.handleRoomObjectMouseDoubleClickEvent(event, roomId);
return;
case RoomObjectMouseEvent.MOUSE_MOVE:
this.handleRoomObjectMouseMoveEvent(event, roomId);
return;
@ -491,6 +494,18 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
}
}
private handleRoomObjectMouseDoubleClickEvent(event: RoomObjectMouseEvent, roomId: number): void
{
const id = event.objectId;
const type = event.objectType;
const category = this._roomEngine.getRoomObjectCategoryForType(type);
if(this._roomEngine.events)
{
this._roomEngine.events.dispatchEvent(new RoomEngineObjectEvent(RoomEngineObjectEvent.DOUBLE_CLICK, roomId, id, category));
}
}
private handleRoomObjectMouseMoveEvent(event: RoomObjectMouseEvent, roomId: number): void
{
if(!event) return;

View File

@ -1,8 +1,8 @@
import { AvatarAction, IRoomGeometry, IRoomObjectModel, MouseEventType, RoomObjectVariable, Vector3d } from '../../../../../api';
import { RoomObjectFurnitureActionEvent, RoomObjectMoveEvent } from '../../../../../events';
import { RoomObjectFurnitureActionEvent, RoomObjectMouseEvent, RoomObjectMoveEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { GetTickerTime } from '../../../../../pixi-proxy';
import { RoomObjectMouseEvent, RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectUpdateMessage } from '../../../../../room';
import { ObjectAvatarCarryObjectUpdateMessage, ObjectAvatarChatUpdateMessage, ObjectAvatarDanceUpdateMessage, ObjectAvatarEffectUpdateMessage, ObjectAvatarExpressionUpdateMessage, ObjectAvatarFigureUpdateMessage, ObjectAvatarFlatControlUpdateMessage, ObjectAvatarGestureUpdateMessage, ObjectAvatarMutedUpdateMessage, ObjectAvatarOwnMessage, ObjectAvatarPlayerValueUpdateMessage, ObjectAvatarPlayingGameUpdateMessage, ObjectAvatarPostureUpdateMessage, ObjectAvatarSelectedMessage, ObjectAvatarSignUpdateMessage, ObjectAvatarSleepUpdateMessage, ObjectAvatarTypingUpdateMessage, ObjectAvatarUpdateMessage, ObjectAvatarUseObjectUpdateMessage } from '../../../messages';
import { MovingObjectLogic } from '../MovingObjectLogic';
@ -57,7 +57,7 @@ export class AvatarLogic extends MovingObjectLogic
public getEventTypes(): string[]
{
const types = [RoomObjectMouseEvent.CLICK, RoomObjectMoveEvent.POSITION_CHANGED, RoomObjectMouseEvent.MOUSE_ENTER, RoomObjectMouseEvent.MOUSE_LEAVE, RoomObjectFurnitureActionEvent.MOUSE_BUTTON, RoomObjectFurnitureActionEvent.MOUSE_ARROW];
const types = [RoomObjectMouseEvent.CLICK, RoomObjectMouseEvent.DOUBLE_CLICK, RoomObjectMoveEvent.POSITION_CHANGED, RoomObjectMouseEvent.MOUSE_ENTER, RoomObjectMouseEvent.MOUSE_LEAVE, RoomObjectFurnitureActionEvent.MOUSE_BUTTON, RoomObjectFurnitureActionEvent.MOUSE_ARROW];
return this.mergeTypes(super.getEventTypes(), types);
}
@ -461,6 +461,9 @@ export class AvatarLogic extends MovingObjectLogic
case MouseEventType.MOUSE_CLICK:
eventType = RoomObjectMouseEvent.CLICK;
break;
case MouseEventType.DOUBLE_CLICK:
eventType = RoomObjectMouseEvent.DOUBLE_CLICK;
break;
case MouseEventType.ROLL_OVER:
eventType = RoomObjectMouseEvent.MOUSE_ENTER;

View File

@ -1,6 +1,6 @@
import { RoomObjectVariable } from '../../../../../api';
import { RoomObjectBadgeAssetEvent, RoomObjectWidgetRequestEvent } from '../../../../../events';
import { RoomObjectEvent, RoomObjectUpdateMessage } from '../../../../../room';
import { RoomObjectBadgeAssetEvent, RoomObjectEvent, RoomObjectWidgetRequestEvent } from '../../../../../events';
import { RoomObjectUpdateMessage } from '../../../../../room';
import { ObjectGroupBadgeUpdateMessage, ObjectSelectedMessage } from '../../../messages';
import { FurnitureBadgeDisplayLogic } from './FurnitureBadgeDisplayLogic';

View File

@ -1,6 +1,5 @@
import { IRoomGeometry, MouseEventType } from '../../../../../api';
import { RoomObjectStateChangedEvent } from '../../../../../events';
import { RoomObjectEvent, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectEvent, RoomObjectStateChangedEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureCounterClockLogic extends FurnitureLogic

View File

@ -1,6 +1,5 @@
import { IRoomGeometry, MouseEventType } from '../../../../../api';
import { RoomObjectFurnitureActionEvent } from '../../../../../events';
import { RoomObjectEvent, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectEvent, RoomObjectFurnitureActionEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureDiceLogic extends FurnitureLogic

View File

@ -1,6 +1,5 @@
import { IAssetData, IRoomGeometry, MouseEventType, RoomObjectVariable } from '../../../../../api';
import { RoomObjectWidgetRequestEvent } from '../../../../../events';
import { RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectWidgetRequestEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureEditableInternalLinkLogic extends FurnitureLogic

View File

@ -1,6 +1,5 @@
import { IAssetData, IParticleSystem, IRoomGeometry, MouseEventType, RoomObjectVariable } from '../../../../../api';
import { RoomObjectStateChangedEvent } from '../../../../../events';
import { RoomObjectEvent, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectEvent, RoomObjectStateChangedEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureFireworksLogic extends FurnitureLogic

View File

@ -1,7 +1,7 @@
import { IRoomGeometry, MouseEventType, RoomObjectVariable, StringDataType } from '../../../../../api';
import { RoomObjectBadgeAssetEvent, RoomObjectWidgetRequestEvent } from '../../../../../events';
import { RoomObjectBadgeAssetEvent, RoomObjectWidgetRequestEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { GetTickerTime } from '../../../../../pixi-proxy';
import { RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectUpdateMessage } from '../../../../../room';
import { ObjectDataUpdateMessage, ObjectGroupBadgeUpdateMessage, ObjectSelectedMessage } from '../../../messages';
import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic';

View File

@ -1,6 +1,5 @@
import { IRoomGeometry, MouseEventType } from '../../../../../api';
import { RoomObjectStateChangedEvent } from '../../../../../events';
import { RoomObjectEvent, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectEvent, RoomObjectStateChangedEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureHockeyScoreLogic extends FurnitureLogic

View File

@ -1,6 +1,5 @@
import { IAssetData, IRoomGeometry, MouseEventType, RoomObjectVariable } from '../../../../../api';
import { RoomObjectWidgetRequestEvent } from '../../../../../events';
import { RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectWidgetRequestEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureInternalLinkLogic extends FurnitureLogic

View File

@ -1,6 +1,6 @@
import { IAssetData, IRoomGeometry, IRoomObjectController, IRoomObjectModel, IVector3D, MouseEventType, NitroConfiguration, RoomObjectVariable, Vector3d } from '../../../../../api';
import { RoomObjectRoomAdEvent, RoomObjectStateChangedEvent, RoomObjectWidgetRequestEvent } from '../../../../../events';
import { RoomObjectMouseEvent, RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectMouseEvent, RoomObjectRoomAdEvent, RoomObjectStateChangedEvent, RoomObjectWidgetRequestEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { RoomObjectUpdateMessage } from '../../../../../room';
import { ObjectDataUpdateMessage, ObjectHeightUpdateMessage, ObjectItemDataUpdateMessage, ObjectMoveUpdateMessage, ObjectSelectedMessage } from '../../../messages';
import { MovingObjectLogic } from '../MovingObjectLogic';

View File

@ -1,6 +1,5 @@
import { IRoomGeometry, MouseEventType } from '../../../../../api';
import { RoomObjectFurnitureActionEvent } from '../../../../../events';
import { RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectFurnitureActionEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureMultiStateLogic extends FurnitureLogic

View File

@ -1,6 +1,6 @@
import { IAssetData, IParticleSystem, IRoomGeometry, MapDataType, MouseEventType, RoomObjectVariable } from '../../../../../api';
import { RoomObjectFurnitureActionEvent, RoomObjectWidgetRequestEvent } from '../../../../../events';
import { RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectFurnitureActionEvent, RoomObjectWidgetRequestEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { RoomObjectUpdateMessage } from '../../../../../room';
import { ObjectDataUpdateMessage, ObjectModelDataUpdateMessage } from '../../../messages';
import { FurnitureLogic } from './FurnitureLogic';

View File

@ -1,5 +1,4 @@
import { RoomObjectVariable, RoomWidgetEnum } from '../../../../../api';
import { AdvancedMap } from '../../../../../core';
import { AdvancedMap, RoomObjectVariable, RoomWidgetEnum } from '../../../../../api';
import { RoomObjectDataRequestEvent } from '../../../../../events';
import { FurnitureLogic } from './FurnitureLogic';

View File

@ -1,6 +1,6 @@
import { IRoomGeometry, MouseEventType, NumberDataType, RoomObjectVariable } from '../../../../../api';
import { RoomObjectHSLColorEnableEvent, RoomObjectWidgetRequestEvent } from '../../../../../events';
import { RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectHSLColorEnableEvent, RoomObjectWidgetRequestEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { RoomObjectUpdateMessage } from '../../../../../room';
import { ObjectDataUpdateMessage } from '../../../messages';
import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic';

View File

@ -1,8 +1,8 @@
import { BaseTexture, Texture } from '@pixi/core';
import { decompressFrames, parseGIF } from 'gifuct-js';
import { IAssetData, IRoomGeometry, MapDataType, MouseEventType, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter } from '../../../../../api';
import { RoomObjectRoomAdEvent } from '../../../../../events';
import { RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room';
import { GetAssetManager, IAssetData, IRoomGeometry, MapDataType, MouseEventType, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter } from '../../../../../api';
import { RoomObjectRoomAdEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { RoomObjectUpdateMessage } from '../../../../../room';
import { Nitro } from '../../../../Nitro';
import { ObjectAdUpdateMessage, ObjectDataUpdateMessage } from '../../../messages';
import { FurnitureLogic } from './FurnitureLogic';
@ -208,7 +208,7 @@ export class FurnitureRoomBrandingLogic extends FurnitureLogic
}
else
{
const asset = Nitro.instance.core && Nitro.instance.core.asset;
const asset = GetAssetManager();
if(!asset) return;

View File

@ -1,6 +1,5 @@
import { IRoomGeometry, MouseEventType } from '../../../../../api';
import { RoomObjectStateChangedEvent } from '../../../../../events';
import { RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectStateChangedEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic';
export class FurnitureWelcomeGiftLogic extends FurnitureMultiStateLogic

View File

@ -1,6 +1,6 @@
import { IAssetData, IRoomGeometry, IRoomObjectModel, MouseEventType, PetType, RoomObjectVariable, Vector3d } from '../../../../../api';
import { RoomObjectMoveEvent } from '../../../../../events';
import { RoomObjectMouseEvent, RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectMouseEvent, RoomObjectMoveEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { RoomObjectUpdateMessage } from '../../../../../room';
import { PetFigureData } from '../../../../avatar';
import { ObjectAvatarChatUpdateMessage, ObjectAvatarExperienceUpdateMessage, ObjectAvatarFigureUpdateMessage, ObjectAvatarPetGestureUpdateMessage, ObjectAvatarPostureUpdateMessage, ObjectAvatarSelectedMessage, ObjectAvatarSleepUpdateMessage, ObjectAvatarUpdateMessage } from '../../../messages';
import { MovingObjectLogic } from '../MovingObjectLogic';

View File

@ -1,7 +1,7 @@
import { Point } from '@pixi/math';
import { IRoomGeometry, IRoomObjectModel, MouseEventType, NitroConfiguration, RoomObjectVariable, Vector3d } from '../../../../../api';
import { RoomObjectTileMouseEvent, RoomObjectWallMouseEvent } from '../../../../../events';
import { ColorConverter, RoomObjectEvent, RoomObjectLogicBase, RoomObjectMouseEvent, RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room';
import { RoomObjectEvent, RoomObjectMouseEvent, RoomObjectTileMouseEvent, RoomObjectWallMouseEvent, RoomSpriteMouseEvent } from '../../../../../events';
import { ColorConverter, RoomObjectLogicBase, RoomObjectUpdateMessage } from '../../../../../room';
import { ObjectRoomColorUpdateMessage, ObjectRoomFloorHoleUpdateMessage, ObjectRoomMapUpdateMessage, ObjectRoomMaskUpdateMessage, ObjectRoomPlanePropertyUpdateMessage, ObjectRoomPlaneVisibilityUpdateMessage, ObjectRoomUpdateMessage } from '../../../messages';
import { RoomMapData } from '../../RoomMapData';
import { RoomPlaneBitmapMaskData } from '../../RoomPlaneBitmapMaskData';

View File

@ -1,7 +1,6 @@
import { BLEND_MODES } from '@pixi/constants';
import { Resource, Texture } from '@pixi/core';
import { AlphaTolerance, AvatarAction, AvatarGuideStatus, AvatarSetType, IAdvancedMap, IAvatarEffectListener, IAvatarImage, IAvatarImageListener, IGraphicAsset, IObjectVisualizationData, IRoomGeometry, IRoomObject, IRoomObjectModel, RoomObjectSpriteType, RoomObjectVariable } from '../../../../../api';
import { AdvancedMap } from '../../../../../core';
import { AdvancedMap, AlphaTolerance, AvatarAction, AvatarGuideStatus, AvatarSetType, IAdvancedMap, IAvatarEffectListener, IAvatarImage, IAvatarImageListener, IGraphicAsset, IObjectVisualizationData, IRoomGeometry, IRoomObject, IRoomObjectModel, RoomObjectSpriteType, RoomObjectVariable } from '../../../../../api';
import { RoomObjectSpriteVisualization } from '../../../../../room';
import { ExpressionAdditionFactory, FloatingIdleZAddition, GameClickTargetAddition, GuideStatusBubbleAddition, IAvatarAddition, MutedBubbleAddition, NumberBubbleAddition, TypingBubbleAddition } from './additions';
import { AvatarVisualizationData } from './AvatarVisualizationData';

View File

@ -1,6 +1,5 @@
import { Resource, Texture } from '@pixi/core';
import { RoomObjectVariable } from '../../../../../api';
import { GraphicAssetGifCollection } from '../../../../../core';
import { GetAssetManager, GraphicAssetGifCollection, RoomObjectVariable } from '../../../../../api';
import { Nitro } from '../../../../Nitro';
import { FurnitureVisualization } from './FurnitureVisualization';
@ -147,7 +146,7 @@ export class FurnitureBrandedImageVisualization extends FurnitureVisualization
}
else
{
texture = Nitro.instance.core.asset.getTexture(imageUrl);
texture = GetAssetManager().getTexture(imageUrl);
}
if(!texture) return false;
@ -183,7 +182,7 @@ export class FurnitureBrandedImageVisualization extends FurnitureVisualization
if(!this._imageUrl) return;
const texture = Nitro.instance.core.asset.getTexture(this._imageUrl);
const texture = GetAssetManager().getTexture(this._imageUrl);
if(!texture) return;

View File

@ -1,5 +1,4 @@
import { IAdvancedMap, IParticleSystem, NitroLogger, RoomObjectVariable } from '../../../../../api';
import { AdvancedMap } from '../../../../../core';
import { AdvancedMap, IAdvancedMap, IParticleSystem, NitroLogger, RoomObjectVariable } from '../../../../../api';
import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization';
import { FurnitureParticleSystem } from './FurnitureParticleSystem';

View File

@ -1,4 +1,7 @@
import { RenderTexture, Resource, Texture } from '@pixi/core';
import { Matrix } from '@pixi/math';
import { IGraphicAsset, IRoomObjectSprite, RoomObjectVariable } from '../../../../../api';
import { NitroSprite, PixiApplicationProxy } from '../../../../../pixi-proxy';
import { IsometricImageFurniVisualization } from './IsometricImageFurniVisualization';
export class FurnitureGuildIsometricBadgeVisualization extends IsometricImageFurniVisualization
@ -33,6 +36,58 @@ export class FurnitureGuildIsometricBadgeVisualization extends IsometricImageFur
return flag;
}
protected generateTransformedThumbnail(texture: Texture<Resource>, asset: IGraphicAsset): Texture<Resource>
{
const scale = 1.1;
const matrix = new Matrix();
const difference = (asset.width / texture.width);
console.log(((0.5 * difference) * texture.width));
switch(this.direction)
{
case 2:
matrix.a = difference;
matrix.b = (-0.5 * difference);
matrix.c = 0;
matrix.d = (difference * scale);
matrix.tx = 0;
matrix.ty = 20;
break;
case 0:
case 4:
matrix.a = difference;
matrix.b = (0.5 * difference);
matrix.c = 0;
matrix.d = (difference * scale);
matrix.tx = 0;
matrix.ty = 0;
break;
default:
matrix.a = difference;
matrix.b = 0;
matrix.c = 0;
matrix.d = difference;
matrix.tx = 0;
matrix.ty = 0;
}
const sprite = new NitroSprite(texture);
const renderTexture = RenderTexture.create({
width: (asset.width + matrix.tx),
height: (asset.height + matrix.ty)
});
PixiApplicationProxy.instance.renderer.render(sprite, {
renderTexture,
clear: true,
transform: matrix
});
return renderTexture;
}
protected getLayerColor(scale: number, layerId: number, colorId: number): number
{
const tag = this.getLayerTag(scale, this._direction, layerId);

View File

@ -1,8 +1,7 @@
import { RenderTexture, Resource, Texture } from '@pixi/core';
import { Matrix } from '@pixi/math';
import { IGraphicAsset } from '../../../../../api';
import { GetAssetManager, IGraphicAsset } from '../../../../../api';
import { NitroSprite, PixiApplicationProxy } from '../../../../../pixi-proxy';
import { Nitro } from '../../../../Nitro';
import { FurnitureBBVisualization } from './FurnitureBBVisualization';
import { FurnitureBrandedImageVisualization } from './FurnitureBrandedImageVisualization';
@ -154,7 +153,7 @@ export class FurnitureIsometricBBVisualization extends FurnitureBBVisualization
}
else
{
this.generateTransformedImage(Nitro.instance.core.asset.getTexture(this._imageUrl), this.getAsset(super.getSpriteAssetName(scale, layerId)));
this.generateTransformedImage(GetAssetManager().getTexture(this._imageUrl), this.getAsset(super.getSpriteAssetName(scale, layerId)));
}
}

View File

@ -2,8 +2,7 @@ import { RenderTexture, Texture } from '@pixi/core';
import { AlphaFilter } from '@pixi/filter-alpha';
import { Graphics } from '@pixi/graphics';
import { Matrix } from '@pixi/math';
import { IAdvancedMap, IGraphicAsset, IParticleSystem, IRoomObjectSprite } from '../../../../../api';
import { AdvancedMap } from '../../../../../core';
import { AdvancedMap, IAdvancedMap, IGraphicAsset, IParticleSystem, IRoomObjectSprite } from '../../../../../api';
import { NitroPoint, NitroSprite, PixiApplicationProxy } from '../../../../../pixi-proxy';
import { Vector3D } from '../../../../avatar';
import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization';

View File

@ -91,7 +91,7 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
}
}
private generateTransformedThumbnail(texture: Texture<Resource>, asset: IGraphicAsset): Texture<Resource>
protected generateTransformedThumbnail(texture: Texture<Resource>, asset: IGraphicAsset): Texture<Resource>
{
if(this._hasOutline)
{

View File

@ -1,6 +1,5 @@
import { Resource, Texture } from '@pixi/core';
import { IGraphicAsset, IObjectVisualizationData, IRoomGeometry, RoomObjectVariable, RoomObjectVisualizationType } from '../../../../../api';
import { Nitro } from '../../../../Nitro';
import { GetAssetManager, IGraphicAsset, IObjectVisualizationData, IRoomGeometry, RoomObjectVariable, RoomObjectVisualizationType } from '../../../../../api';
import { AnimationData, AnimationStateData, DirectionData, LayerData } from '../data';
import { FurnitureAnimatedVisualization, FurnitureVisualizationData } from '../furniture';
import { ExperienceData } from './ExperienceData';
@ -594,6 +593,6 @@ export class PetVisualization extends FurnitureAnimatedVisualization
public getPetAdditionAsset(name: string): Texture<Resource>
{
return Nitro.instance.core.asset.getTexture(name);
return GetAssetManager().getTexture(name);
}
}

View File

@ -1,7 +1,6 @@
import { RenderTexture, Resource, Texture } from '@pixi/core';
import { Rectangle } from '@pixi/math';
import { AlphaTolerance, IObjectVisualizationData, IPlaneVisualization, IRoomGeometry, IRoomObjectModel, IRoomObjectSprite, IRoomPlane, RoomObjectSpriteType, RoomObjectVariable, Vector3d } from '../../../../../api';
import { AdvancedMap } from '../../../../../core';
import { AdvancedMap, AlphaTolerance, IObjectVisualizationData, IPlaneVisualization, IRoomGeometry, IRoomObjectModel, IRoomObjectSprite, IRoomPlane, RoomObjectSpriteType, RoomObjectVariable, Vector3d } from '../../../../../api';
import { RoomObjectSpriteVisualization } from '../../../../../room';
import { RoomMapData } from '../../RoomMapData';
import { RoomMapMaskData } from '../../RoomMapMaskData';

View File

@ -135,8 +135,8 @@ export class LandscapeRasterizer extends PlaneRasterizer
const assetId = item.assetId;
const x = this.getCoordinateValue(item.x || '', item.randomX || '');
const y = this.getCoordinateValue(item.y || '', item.randomY || '');
const speedX = item.speedX ? item.speedX / NitroConfiguration.getValue<number>('system.animation.fps') : 0;
const speedY = item.speedY ? item.speedY / NitroConfiguration.getValue<number>('system.animation.fps') : 0;
const speedX = item.speedX ? item.speedX / NitroConfiguration.getValue<number>('system.animation.fps', 24) : 0;
const speedY = item.speedY ? item.speedY / NitroConfiguration.getValue<number>('system.animation.fps', 24) : 0;
animationItems.push({
asset: assetId,

View File

@ -1,5 +1,5 @@
import { Resource, Texture } from '@pixi/core';
import { IFurnitureData, IFurnitureDataListener, IGroupInformationManager, IMessageComposer, INitroCommunicationManager, INitroEvent, IProductData, IProductDataListener, ISessionDataManager, NitroConfiguration, NoobnessLevelEnum, SecurityLevel } from '../../api';
import { GetAssetManager, IFurnitureData, IFurnitureDataListener, IGroupInformationManager, IMessageComposer, INitroCommunicationManager, INitroEvent, IProductData, IProductDataListener, ISessionDataManager, NitroConfiguration, NoobnessLevelEnum, SecurityLevel } from '../../api';
import { NitroManager } from '../../core';
import { MysteryBoxKeysUpdateEvent, NitroSettingsEvent, SessionDataPreferencesEvent, UserNameUpdateEvent } from '../../events';
import { AvailabilityStatusMessageEvent, ChangeUserNameResultMessageEvent, FigureUpdateEvent, InClientLinkEvent, MysteryBoxKeysEvent, NoobnessLevelMessageEvent, PetRespectComposer, RoomReadyMessageEvent, RoomUnitChatComposer, UserInfoEvent, UserNameChangeMessageEvent, UserPermissionsEvent, UserRespectComposer } from '../communication';
@ -175,7 +175,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana
{
if(this._badgeImageManager) return;
this._badgeImageManager = new BadgeImageManager(Nitro.instance.core.asset, this);
this._badgeImageManager = new BadgeImageManager(GetAssetManager(), this);
this._badgeImageManager.init();
}

View File

@ -1,5 +1,5 @@
import { IAdvancedMap, IMusicController, INitroEvent, ISoundManager, NitroConfiguration } from '../../api';
import { AdvancedMap, NitroManager } from '../../core';
import { AdvancedMap, IAdvancedMap, IMusicController, INitroEvent, ISoundManager, NitroConfiguration } from '../../api';
import { NitroManager } from '../../core';
import { NitroSettingsEvent, NitroSoundEvent, RoomEngineEvent, RoomEngineObjectEvent, RoomEngineSamplePlaybackEvent } from '../../events';
import { Nitro } from '../Nitro';
import { MusicController } from './music/MusicController';

Some files were not shown because too many files have changed in this diff Show More