mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-26 17:30:52 +01:00
Update AssetManager
This commit is contained in:
parent
a495deff38
commit
0988b32474
@ -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;
|
||||
}
|
||||
|
@ -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>
|
||||
{
|
3
src/api/asset/GetAssetManager.ts
Normal file
3
src/api/asset/GetAssetManager.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import { AssetManager } from './AssetManager';
|
||||
|
||||
export const GetAssetManager = () => AssetManager._INSTANCE;
|
@ -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
|
||||
{
|
@ -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
|
||||
{
|
@ -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;
|
||||
|
@ -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';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { IBinaryWriter } from './IBinaryWriter';
|
||||
import { IBinaryWriter } from '../utils';
|
||||
import { IConnection } from './IConnection';
|
||||
import { IMessageDataWrapper } from './IMessageDataWrapper';
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { IBinaryReader } from './IBinaryReader';
|
||||
import { IBinaryReader } from '../utils';
|
||||
|
||||
export interface IMessageDataWrapper
|
||||
{
|
||||
|
@ -1,6 +1,4 @@
|
||||
export * from './enums';
|
||||
export * from './IBinaryReader';
|
||||
export * from './IBinaryWriter';
|
||||
export * from './ICodec';
|
||||
export * from './ICommunicationManager';
|
||||
export * from './IConnection';
|
||||
|
@ -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';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { IAdvancedMap } from '../../../IAdvancedMap';
|
||||
import { IAdvancedMap } from '../../../utils';
|
||||
import { IPartColor } from './IPartColor';
|
||||
|
||||
export interface IPalette
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { IAdvancedMap } from '../../../IAdvancedMap';
|
||||
import { IAdvancedMap } from '../../../utils';
|
||||
import { IFigurePartSet } from './IFigurePartSet';
|
||||
|
||||
export interface ISetType
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { IAdvancedMap } from '../IAdvancedMap';
|
||||
import { IAdvancedMap } from '../utils';
|
||||
import { IRoomObjectController } from './object';
|
||||
|
||||
export interface IRoomObjectManager
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { IAdvancedMap } from '../../IAdvancedMap';
|
||||
import { IAdvancedMap } from '../../utils';
|
||||
import { IRoomObjectModel } from './IRoomObjectModel';
|
||||
|
||||
export interface IRoomObjectModelController extends IRoomObjectModel
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { IAdvancedMap } from '../../api';
|
||||
import { IAdvancedMap } from './IAdvancedMap';
|
||||
|
||||
export class AdvancedMap<T, U> implements IAdvancedMap<T, U>
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
import { IBinaryReader } from '../../api';
|
||||
import { IBinaryReader } from './IBinaryReader';
|
||||
|
||||
export class BinaryReader implements IBinaryReader
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
import { IBinaryWriter } from '../../api';
|
||||
import { IBinaryWriter } from './IBinaryWriter';
|
||||
|
||||
export class BinaryWriter implements IBinaryWriter
|
||||
{
|
@ -1,4 +1,4 @@
|
||||
import { IDisposable } from './common';
|
||||
import { IDisposable } from '../common';
|
||||
|
||||
export interface IAdvancedMap<T = any, U = any> extends IDisposable
|
||||
{
|
@ -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
|
||||
{
|
@ -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';
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,30 @@
|
||||
export class NitroVersion
|
||||
{
|
||||
public static RENDERER_VERSION: string = '1.4.4';
|
||||
public static RENDERER_VERSION: string = '1.4.2';
|
||||
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} `);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
export * from './AssetManager';
|
||||
export * from './GraphicAsset';
|
||||
export * from './GraphicAssetCollection';
|
||||
export * from './GraphicAssetGifCollection';
|
||||
export * from './GraphicAssetPalette';
|
||||
export * from './NitroBundle';
|
@ -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';
|
||||
|
@ -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';
|
||||
|
@ -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} `);
|
||||
}
|
||||
};
|
@ -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';
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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 { 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)
|
||||
{
|
||||
|
@ -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';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { BaseTexture, Texture } from '@pixi/core';
|
||||
import { decompressFrames, parseGIF } from 'gifuct-js';
|
||||
import { IAssetData, IRoomGeometry, MapDataType, MouseEventType, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter } from '../../../../../api';
|
||||
import { GetAssetManager, IAssetData, IRoomGeometry, MapDataType, MouseEventType, RoomObjectVariable, RoomWidgetEnumItemExtradataParameter } from '../../../../../api';
|
||||
import { RoomObjectRoomAdEvent } from '../../../../../events';
|
||||
import { RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room';
|
||||
import { Nitro } from '../../../../Nitro';
|
||||
@ -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;
|
||||
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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';
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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';
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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';
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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';
|
||||
|
@ -1,6 +1,4 @@
|
||||
import { IAdvancedMap, IMessageEvent, IMusicController, IPlaylistController } from '../../../api';
|
||||
import { ISongInfo } from '../../../api/nitro/sound/common/ISongInfo';
|
||||
import { AdvancedMap } from '../../../core';
|
||||
import { AdvancedMap, IAdvancedMap, IMessageEvent, IMusicController, IPlaylistController, ISongInfo } from '../../../api';
|
||||
import { RoomObjectSoundMachineEvent } from '../../../events';
|
||||
import { GetNowPlayingMessageComposer, GetSongInfoMessageComposer, GetUserSongDisksMessageComposer, TraxSongInfoMessageEvent, UserSongDisksInventoryMessageEvent } from '../../communication';
|
||||
import { Nitro } from '../../Nitro';
|
||||
@ -22,10 +20,10 @@ export class MusicController implements IMusicController
|
||||
private _requestedSongs: Map<number, boolean>;
|
||||
private _availableSongs: Map<number, SongDataEntry>;
|
||||
private _songRequestsPerPriority: SongStartRequestData[];
|
||||
private _songRequestCountsPerPriority:number[];
|
||||
private _songRequestCountsPerPriority: number[];
|
||||
private _diskInventoryMissingData: number[];
|
||||
private _songDiskInventory: IAdvancedMap<number, number>;
|
||||
private _priorityPlaying:number = -1;
|
||||
private _priorityPlaying: number = -1;
|
||||
private _requestNumberPlaying: number = -1;
|
||||
private _messageEvents: IMessageEvent[];
|
||||
private _roomItemPlaylist: IPlaylistController;
|
||||
@ -112,7 +110,7 @@ export class MusicController implements IMusicController
|
||||
|
||||
public getSongInfo(k: number): ISongInfo
|
||||
{
|
||||
const _local_2:SongDataEntry = this.getSongDataEntry(k);
|
||||
const _local_2: SongDataEntry = this.getSongDataEntry(k);
|
||||
if(!_local_2)
|
||||
{
|
||||
this.requestSongInfoWithoutSamples(k);
|
||||
@ -187,8 +185,8 @@ export class MusicController implements IMusicController
|
||||
|
||||
public get samplesIdsInUse(): number[]
|
||||
{
|
||||
let _local_3:SongStartRequestData;
|
||||
let _local_4:SongDataEntry;
|
||||
let _local_3: SongStartRequestData;
|
||||
let _local_4: SongDataEntry;
|
||||
let k = [];
|
||||
for(let i = 0; i < this._songRequestsPerPriority.length; i++)
|
||||
{
|
||||
@ -229,7 +227,7 @@ export class MusicController implements IMusicController
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
protected onTraxSongComplete(k:SoundManagerEvent):void
|
||||
protected onTraxSongComplete(k: SoundManagerEvent): void
|
||||
{
|
||||
console.log((('Song ' + k.id) + ' finished playing'));
|
||||
if(this.getSongIdPlayingAtPriority(this._priorityPlaying) == k.id)
|
||||
@ -329,7 +327,7 @@ export class MusicController implements IMusicController
|
||||
}
|
||||
}
|
||||
|
||||
private areSamplesRequested(k:number):boolean
|
||||
private areSamplesRequested(k: number): boolean
|
||||
{
|
||||
if(!this._requestedSongs.get(k))
|
||||
{
|
||||
@ -338,9 +336,9 @@ export class MusicController implements IMusicController
|
||||
return this._requestedSongs.get(k);
|
||||
}
|
||||
|
||||
private processSongEntryForPlaying(k:number, _arg_2:boolean=true):boolean
|
||||
private processSongEntryForPlaying(k: number, _arg_2: boolean = true): boolean
|
||||
{
|
||||
const songData:SongDataEntry = this.getSongDataEntry(k);
|
||||
const songData: SongDataEntry = this.getSongDataEntry(k);
|
||||
if(!songData)
|
||||
{
|
||||
this.addSongInfoRequest(k);
|
||||
@ -380,7 +378,7 @@ export class MusicController implements IMusicController
|
||||
return true;
|
||||
}
|
||||
|
||||
private playSongObject(priority:number, songId:number):boolean
|
||||
private playSongObject(priority: number, songId: number): boolean
|
||||
{
|
||||
if((((songId == -1) || (priority < 0)) || (priority >= MusicPriorities.PRIORITY_COUNT)))
|
||||
{
|
||||
@ -391,7 +389,7 @@ export class MusicController implements IMusicController
|
||||
{
|
||||
_local_3 = true;
|
||||
}
|
||||
const songData:SongDataEntry = this.getSongDataEntry(songId);
|
||||
const songData: SongDataEntry = this.getSongDataEntry(songId);
|
||||
if(!songData)
|
||||
{
|
||||
console.log((('WARNING: Unable to find song entry id ' + songId) + ' that was supposed to be loaded.'));
|
||||
@ -408,7 +406,7 @@ export class MusicController implements IMusicController
|
||||
let fadeInSeconds = 2;
|
||||
let fadeOutSeconds = 1;
|
||||
|
||||
const songRequestData:SongStartRequestData = this.getSongStartRequest(priority);
|
||||
const songRequestData: SongStartRequestData = this.getSongStartRequest(priority);
|
||||
|
||||
console.log(songRequestData);
|
||||
|
||||
@ -453,7 +451,7 @@ export class MusicController implements IMusicController
|
||||
return true;
|
||||
}
|
||||
|
||||
private notifySongPlaying(k:SongDataEntry):void
|
||||
private notifySongPlaying(k: SongDataEntry): void
|
||||
{
|
||||
const _local_2 = 8000;
|
||||
const timeNow = Date.now();
|
||||
@ -465,7 +463,7 @@ export class MusicController implements IMusicController
|
||||
}
|
||||
}
|
||||
|
||||
private addSongStartRequest(priority:number, songId:number, startPos:number, playLength:number, fadeInSeconds:number, fadeOutSeconds:number):boolean
|
||||
private addSongStartRequest(priority: number, songId: number, startPos: number, playLength: number, fadeInSeconds: number, fadeOutSeconds: number): boolean
|
||||
{
|
||||
if(((priority < 0) || (priority >= MusicPriorities.PRIORITY_COUNT)))
|
||||
{
|
||||
@ -477,9 +475,9 @@ export class MusicController implements IMusicController
|
||||
return true;
|
||||
}
|
||||
|
||||
private getSongDataEntry(k:number):SongDataEntry
|
||||
private getSongDataEntry(k: number): SongDataEntry
|
||||
{
|
||||
let entry:SongDataEntry;
|
||||
let entry: SongDataEntry;
|
||||
if(this._availableSongs)
|
||||
{
|
||||
entry = (this._availableSongs.get(k));
|
||||
@ -487,7 +485,7 @@ export class MusicController implements IMusicController
|
||||
return entry;
|
||||
}
|
||||
|
||||
private getSongStartRequest(k:number):SongStartRequestData
|
||||
private getSongStartRequest(k: number): SongStartRequestData
|
||||
{
|
||||
return this._songRequestsPerPriority[k];
|
||||
}
|
||||
@ -506,7 +504,7 @@ export class MusicController implements IMusicController
|
||||
return this._songRequestsPerPriority[priorityIndex].songId;
|
||||
}
|
||||
|
||||
private getSongRequestCountAtPriority(k:number):number
|
||||
private getSongRequestCountAtPriority(k: number): number
|
||||
{
|
||||
if(((k < 0) || (k >= MusicPriorities.PRIORITY_COUNT)))
|
||||
{
|
||||
@ -515,9 +513,9 @@ export class MusicController implements IMusicController
|
||||
return this._songRequestCountsPerPriority[k];
|
||||
}
|
||||
|
||||
private playSongWithHighestPriority():void
|
||||
private playSongWithHighestPriority(): void
|
||||
{
|
||||
let _local_3:number;
|
||||
let _local_3: number;
|
||||
this._priorityPlaying = -1;
|
||||
this._songIdPlaying = -1;
|
||||
this._requestNumberPlaying = -1;
|
||||
@ -534,7 +532,7 @@ export class MusicController implements IMusicController
|
||||
}
|
||||
}
|
||||
|
||||
private resetSongStartRequest(priority:number):void
|
||||
private resetSongStartRequest(priority: number): void
|
||||
{
|
||||
if(((priority >= 0) && (priority < MusicPriorities.PRIORITY_COUNT)))
|
||||
{
|
||||
@ -542,12 +540,12 @@ export class MusicController implements IMusicController
|
||||
}
|
||||
}
|
||||
|
||||
private reRequestSongAtPriority(k:number):void
|
||||
private reRequestSongAtPriority(k: number): void
|
||||
{
|
||||
this._songRequestCountsPerPriority[k] = (this._songRequestCountsPerPriority[k] + 1);
|
||||
}
|
||||
|
||||
private stopSongAtPriority(priority:number):boolean
|
||||
private stopSongAtPriority(priority: number): boolean
|
||||
{
|
||||
if(((priority == this._priorityPlaying) && (this._priorityPlaying >= 0)))
|
||||
{
|
||||
@ -565,18 +563,18 @@ export class MusicController implements IMusicController
|
||||
return false;
|
||||
}
|
||||
|
||||
private onSoundMachineInit(k:Event):void
|
||||
private onSoundMachineInit(k: Event): void
|
||||
{
|
||||
this.disposeRoomPlaylist();
|
||||
//this._roomItemPlaylist = (new SoundMachinePlayListController(this._soundManager, this, this._events) as IPlaylistController);
|
||||
}
|
||||
|
||||
private onSoundMachineDispose(k:Event):void
|
||||
private onSoundMachineDispose(k: Event): void
|
||||
{
|
||||
this.disposeRoomPlaylist();
|
||||
}
|
||||
|
||||
private onJukeboxInit(k:Event):void
|
||||
private onJukeboxInit(k: Event): void
|
||||
{
|
||||
this.disposeRoomPlaylist();
|
||||
this._roomItemPlaylist = (new JukeboxPlaylistController() as IPlaylistController);
|
||||
@ -584,12 +582,12 @@ export class MusicController implements IMusicController
|
||||
Nitro.instance.communication.connection.send(new GetNowPlayingMessageComposer());
|
||||
}
|
||||
|
||||
private onJukeboxDispose(k:Event):void
|
||||
private onJukeboxDispose(k: Event): void
|
||||
{
|
||||
this.disposeRoomPlaylist();
|
||||
}
|
||||
|
||||
private disposeRoomPlaylist():void
|
||||
private disposeRoomPlaylist(): void
|
||||
{
|
||||
if(this._roomItemPlaylist)
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { IAdvancedMap, IRoomObjectController, IRoomObjectManager } from '../api';
|
||||
import { AdvancedMap } from '../core';
|
||||
import { AdvancedMap, IAdvancedMap, IRoomObjectController, IRoomObjectManager } from '../api';
|
||||
import { RoomObject } from './object';
|
||||
|
||||
export class RoomObjectManager implements IRoomObjectManager
|
||||
|
Loading…
Reference in New Issue
Block a user