From 1571d0ac893cc085b96b3aa4b06f99d7178f3c19 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 14 Jul 2021 03:10:54 -0400 Subject: [PATCH] Update typings --- src/core/asset/AssetManager.ts | 10 ++--- src/core/asset/IAssetManager.ts | 6 +-- src/nitro/avatar/cache/ImageData.ts | 8 ++-- src/nitro/camera/IRoomCameraWidgetEffect.ts | 4 +- src/nitro/camera/RoomCameraWidgetEffect.ts | 10 ++--- src/nitro/communication/NitroMessages.ts | 3 +- .../messages/incoming/IncomingHeader.ts | 1 + .../incoming/room/pet/PetExperienceEvent.ts | 15 +++++++ .../messages/incoming/room/pet/index.ts | 1 + .../parser/room/pet/PetExperienceParser.ts | 43 +++++++++++++++++++ .../messages/parser/room/pet/index.ts | 1 + src/nitro/room/RoomContentLoader.ts | 4 +- src/nitro/room/RoomEngine.ts | 4 +- src/nitro/room/RoomMessageHandler.ts | 12 +++++- src/nitro/room/object/RoomObjectVariable.ts | 1 + src/nitro/room/object/logic/pet/PetLogic.ts | 9 ++++ .../avatar/AvatarVisualization.ts | 4 +- .../avatar/AvatarVisualizationData.ts | 6 +-- .../avatar/additions/FloatingHeartAddition.ts | 4 +- .../avatar/additions/FloatingIdleZAddition.ts | 4 +- .../avatar/additions/MutedBubbleAddition.ts | 4 +- .../avatar/additions/NumberBubbleAddition.ts | 6 +-- .../avatar/additions/TypingBubbleAddition.ts | 6 +-- .../FurnitureBrandedImageVisualization.ts | 4 +- .../FurnitureRoomBackgroundVisualization.ts | 6 +-- .../FurnitureThumbnailVisualization.ts | 10 ++--- .../object/visualization/room/RoomPlane.ts | 6 +-- .../visualization/room/RoomVisualization.ts | 4 +- .../room/rasterizer/basic/PlaneRasterizer.ts | 4 +- .../room/rasterizer/basic/PlaneTexture.ts | 6 +-- .../rasterizer/basic/PlaneTextureBitmap.ts | 8 ++-- src/nitro/session/BadgeImageManager.ts | 8 ++-- src/nitro/session/BadgeInfo.ts | 10 ++--- src/nitro/session/ISessionDataManager.ts | 6 +-- src/nitro/session/SessionDataManager.ts | 6 +-- .../session/events/BadgeImageReadyEvent.ts | 10 ++--- .../pixi-tilemap/CompositeRectTileLayer.ts | 6 +-- .../pixi-tilemap/MultiTextureResource.ts | 2 +- .../floorplan/pixi-tilemap/RectTileLayer.ts | 10 ++--- .../object/visualization/IRoomObjectSprite.ts | 4 +- .../object/visualization/RoomObjectSprite.ts | 8 ++-- .../visualization/utils/GraphicAsset.ts | 10 ++--- .../utils/GraphicAssetCollection.ts | 8 ++-- .../utils/GraphicAssetPalette.ts | 4 +- .../visualization/utils/IGraphicAsset.ts | 6 +-- .../utils/IGraphicAssetCollection.ts | 6 +-- src/room/renderer/utils/ExtendedSprite.ts | 6 +-- src/room/utils/Rasterizer.ts | 8 ++-- src/room/utils/TextureUtils.ts | 4 +- 49 files changed, 209 insertions(+), 127 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/room/pet/PetExperienceEvent.ts create mode 100644 src/nitro/communication/messages/parser/room/pet/PetExperienceParser.ts diff --git a/src/core/asset/AssetManager.ts b/src/core/asset/AssetManager.ts index 7bf6d22d..ce079e62 100644 --- a/src/core/asset/AssetManager.ts +++ b/src/core/asset/AssetManager.ts @@ -1,6 +1,6 @@ -import { BaseTexture, ILoaderResource, Loader, LoaderResource, Spritesheet, Texture } from 'pixi.js'; +import { BaseTexture, ILoaderResource, Loader, LoaderResource, Resource, Spritesheet, Texture } from 'pixi.js'; +import { IGraphicAsset } from '../../room'; import { GraphicAssetCollection } from '../../room/object/visualization/utils/GraphicAssetCollection'; -import { IGraphicAsset } from '../../room/object/visualization/utils/IGraphicAsset'; import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection'; import { Disposable } from '../common/disposable/Disposable'; import { INitroLogger } from '../common/logger/INitroLogger'; @@ -12,7 +12,7 @@ import { NitroBundle } from './NitroBundle'; export class AssetManager extends Disposable implements IAssetManager { private _logger: INitroLogger; - private _textures: Map; + private _textures: Map>; private _collections: Map; constructor() @@ -29,7 +29,7 @@ export class AssetManager extends Disposable implements IAssetManager return (name.substring(0, name.lastIndexOf('.')) || name); } - public getTexture(name: string): Texture + public getTexture(name: string): Texture { if(!name) return null; @@ -40,7 +40,7 @@ export class AssetManager extends Disposable implements IAssetManager return existing; } - public setTexture(name: string, texture: Texture): void + public setTexture(name: string, texture: Texture): void { if(!name || !texture) return; diff --git a/src/core/asset/IAssetManager.ts b/src/core/asset/IAssetManager.ts index 4bd63332..fdb83a62 100644 --- a/src/core/asset/IAssetManager.ts +++ b/src/core/asset/IAssetManager.ts @@ -1,5 +1,5 @@ -import { Spritesheet, Texture } from 'pixi.js'; +import { Resource, Spritesheet, Texture } from 'pixi.js'; import { IGraphicAsset } from '../../room/object/visualization/utils/IGraphicAsset'; import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection'; import { IAssetData } from './interfaces'; @@ -7,8 +7,8 @@ import { IAssetData } from './interfaces'; export interface IAssetManager { dispose(): void; - getTexture(name: string): Texture; - setTexture(name: string, texture: Texture): void; + getTexture(name: string): Texture; + setTexture(name: string, texture: Texture): void; getAsset(name: string): IGraphicAsset; getCollection(name: string): IGraphicAssetCollection; createCollection(data: IAssetData, spritesheet: Spritesheet): IGraphicAssetCollection; diff --git a/src/nitro/avatar/cache/ImageData.ts b/src/nitro/avatar/cache/ImageData.ts index ce28dbec..571da19a 100644 --- a/src/nitro/avatar/cache/ImageData.ts +++ b/src/nitro/avatar/cache/ImageData.ts @@ -1,15 +1,15 @@ -import { Container, Point, Rectangle, Texture } from 'pixi.js'; +import { Container, Point, Rectangle, Resource, Texture } from 'pixi.js'; export class ImageData { - private _texture: Texture; + private _texture: Texture; private _container: Container; private _rect: Rectangle; private _regPoint: Point; private _flipH: boolean; private _colorTransform: number; - constructor(texture: Texture, rectangle: Rectangle, _arg_3: Point, flipH: boolean, color: number, container: Container = null) + constructor(texture: Texture, rectangle: Rectangle, _arg_3: Point, flipH: boolean, color: number, container: Container = null) { this._texture = texture; this._container = container; @@ -28,7 +28,7 @@ export class ImageData this._colorTransform = null; } - public get texture(): Texture + public get texture(): Texture { return this._texture; } diff --git a/src/nitro/camera/IRoomCameraWidgetEffect.ts b/src/nitro/camera/IRoomCameraWidgetEffect.ts index c6c37afc..5cdfdf0b 100644 --- a/src/nitro/camera/IRoomCameraWidgetEffect.ts +++ b/src/nitro/camera/IRoomCameraWidgetEffect.ts @@ -1,11 +1,11 @@ import { ColorMatrix } from '@pixi/filter-color-matrix'; -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; export interface IRoomCameraWidgetEffect { name: string; minLevel: number; - texture: Texture; + texture: Texture; colorMatrix: ColorMatrix; blendMode: number; } diff --git a/src/nitro/camera/RoomCameraWidgetEffect.ts b/src/nitro/camera/RoomCameraWidgetEffect.ts index 2209a619..a1083ec9 100644 --- a/src/nitro/camera/RoomCameraWidgetEffect.ts +++ b/src/nitro/camera/RoomCameraWidgetEffect.ts @@ -1,16 +1,16 @@ import { ColorMatrix } from '@pixi/filter-color-matrix'; -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { IRoomCameraWidgetEffect } from './IRoomCameraWidgetEffect'; export class RoomCameraWidgetEffect implements IRoomCameraWidgetEffect { private _name: string; private _minLevel: number = -1; - private _texture: Texture = null; + private _texture: Texture = null; private _colorMatrix: ColorMatrix = null; private _blendMode: number = null; - constructor(name: string, minLevel: number = -1, texture: Texture = null, colorMatrix: ColorMatrix = null, blendMode: number = null) + constructor(name: string, minLevel: number = -1, texture: Texture = null, colorMatrix: ColorMatrix = null, blendMode: number = null) { this._name = name; this._minLevel = minLevel; @@ -24,12 +24,12 @@ export class RoomCameraWidgetEffect implements IRoomCameraWidgetEffect return this._name; } - public get texture(): Texture + public get texture(): Texture { return this._texture; } - public set texture(texture: Texture) + public set texture(texture: Texture) { this._texture = texture; } diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 2eb4cde2..6281ed81 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,5 +1,5 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, FurnitureGuildInfoComposer, MysteryBoxKeysEvent, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from './messages'; +import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, FurnitureGuildInfoComposer, MysteryBoxKeysEvent, PetExperienceEvent, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent'; @@ -639,6 +639,7 @@ export class NitroMessages implements IMessageConfiguration // PET this._events.set(IncomingHeader.PET_FIGURE_UPDATE, PetFigureUpdateEvent); this._events.set(IncomingHeader.PET_INFO, PetInfoEvent); + this._events.set(IncomingHeader.PET_EXPERIENCE, PetExperienceEvent); // SESSION this._events.set(IncomingHeader.PLAYING_GAME, YouArePlayingGameEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 775f22f8..4736b23b 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -251,4 +251,5 @@ export class IncomingHeader public static CATALOG_RECEIVE_PET_BREEDS = 3331; public static CATALOG_APPROVE_NAME_RESULT = 1503; public static OBJECTS_DATA_UPDATE = 1453; + public static PET_EXPERIENCE = 2156; } diff --git a/src/nitro/communication/messages/incoming/room/pet/PetExperienceEvent.ts b/src/nitro/communication/messages/incoming/room/pet/PetExperienceEvent.ts new file mode 100644 index 00000000..29510634 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/pet/PetExperienceEvent.ts @@ -0,0 +1,15 @@ +import { IMessageEvent, MessageEvent } from '../../../../../../core/communication/messages'; +import { PetExperienceParser } from '../../../parser'; + +export class PetExperienceEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, PetExperienceParser); + } + + public getParser(): PetExperienceParser + { + return this.parser as PetExperienceParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/pet/index.ts b/src/nitro/communication/messages/incoming/room/pet/index.ts index a4e9295d..b1cdd4fa 100644 --- a/src/nitro/communication/messages/incoming/room/pet/index.ts +++ b/src/nitro/communication/messages/incoming/room/pet/index.ts @@ -1,5 +1,6 @@ export * from './BreedingPetInfo'; export * from './PetBreedingResultData'; +export * from './PetExperienceEvent'; export * from './PetFigureUpdateEvent'; export * from './PetInfoEvent'; export * from './RarityCategoryData'; diff --git a/src/nitro/communication/messages/parser/room/pet/PetExperienceParser.ts b/src/nitro/communication/messages/parser/room/pet/PetExperienceParser.ts new file mode 100644 index 00000000..04f826fe --- /dev/null +++ b/src/nitro/communication/messages/parser/room/pet/PetExperienceParser.ts @@ -0,0 +1,43 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; + +export class PetExperienceParser implements IMessageParser +{ + private _petId: number; + private _roomIndex: number; + private _gainedExperience: number; + + public flush(): boolean + { + this._petId = -1; + this._roomIndex = -1; + this._gainedExperience = 0; + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._petId = wrapper.readInt(); + this._roomIndex = wrapper.readInt(); + this._gainedExperience = wrapper.readInt(); + + return true; + } + + public get petId(): number + { + return this._petId; + } + + public get roomIndex(): number + { + return this._roomIndex; + } + + public get gainedExperience(): number + { + return this._gainedExperience; + } +} diff --git a/src/nitro/communication/messages/parser/room/pet/index.ts b/src/nitro/communication/messages/parser/room/pet/index.ts index 2ab199b3..156da9ae 100644 --- a/src/nitro/communication/messages/parser/room/pet/index.ts +++ b/src/nitro/communication/messages/parser/room/pet/index.ts @@ -1,2 +1,3 @@ +export * from './PetExperienceParser'; export * from './PetFigureUpdateParser'; export * from './PetInfoParser'; diff --git a/src/nitro/room/RoomContentLoader.ts b/src/nitro/room/RoomContentLoader.ts index dde2c370..38afc6fd 100644 --- a/src/nitro/room/RoomContentLoader.ts +++ b/src/nitro/room/RoomContentLoader.ts @@ -1,4 +1,4 @@ -import { BaseTexture, ILoaderResource, Loader, LoaderResource, Spritesheet, Texture } from 'pixi.js'; +import { BaseTexture, ILoaderResource, Loader, LoaderResource, Resource, Spritesheet, Texture } from 'pixi.js'; import { IAssetData } from '../../core/asset/interfaces'; import { NitroBundle } from '../../core/asset/NitroBundle'; import { INitroLogger } from '../../core/common/logger/INitroLogger'; @@ -316,7 +316,7 @@ export class RoomContentLoader implements IFurnitureDataListener return image; } - public addAssetToCollection(collectionName: string, assetName: string, texture: Texture): boolean + public addAssetToCollection(collectionName: string, assetName: string, texture: Texture): boolean { const collection = this.getCollection(collectionName); diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 40ac3c0b..5214c572 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -1,4 +1,4 @@ -import { Container, DisplayObject, Matrix, Point, Rectangle, RenderTexture, Sprite, Texture } from 'pixi.js'; +import { Container, DisplayObject, Matrix, Point, Rectangle, RenderTexture, Resource, Sprite, Texture } from 'pixi.js'; import { IDisposable } from '../../core/common/disposable/IDisposable'; import { IUpdateReceiver } from '../../core/common/IUpdateReceiver'; import { NitroLogger } from '../../core/common/logger/NitroLogger'; @@ -2727,7 +2727,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._roomObjectEventHandler.cancelRoomObjectInsert(this._activeRoomId); } - private addOverlayIconSprite(k: Sprite, _arg_2: string, _arg_3: Texture, scale: number = 1): Sprite + private addOverlayIconSprite(k: Sprite, _arg_2: string, _arg_3: Texture, scale: number = 1): Sprite { if(!k || !_arg_3) return; diff --git a/src/nitro/room/RoomMessageHandler.ts b/src/nitro/room/RoomMessageHandler.ts index d7484d56..26de8274 100644 --- a/src/nitro/room/RoomMessageHandler.ts +++ b/src/nitro/room/RoomMessageHandler.ts @@ -3,7 +3,7 @@ import { IConnection } from '../../core/communication/connections/IConnection'; import { IVector3D } from '../../room/utils/IVector3D'; import { Vector3d } from '../../room/utils/Vector3d'; import { PetType } from '../avatar/pets/PetType'; -import { ObjectsDataUpdateEvent } from '../communication'; +import { ObjectsDataUpdateEvent, PetExperienceEvent } from '../communication'; import { ObjectsRollingEvent } from '../communication/messages/incoming/room/engine/ObjectsRollingEvent'; import { FurnitureFloorAddEvent } from '../communication/messages/incoming/room/furniture/floor/FurnitureFloorAddEvent'; import { FurnitureFloorEvent } from '../communication/messages/incoming/room/furniture/floor/FurnitureFloorEvent'; @@ -142,6 +142,7 @@ export class RoomMessageHandler extends Disposable this._connection.addMessageEvent(new RoomUnitChatWhisperEvent(this.onRoomUnitChatEvent.bind(this))); this._connection.addMessageEvent(new RoomUnitTypingEvent(this.onRoomUnitTypingEvent.bind(this))); this._connection.addMessageEvent(new PetFigureUpdateEvent(this.onPetFigureUpdateEvent.bind(this))); + this._connection.addMessageEvent(new PetExperienceEvent(this.onPetExperienceEvent.bind(this))); this._connection.addMessageEvent(new YouArePlayingGameEvent(this.onYouArePlayingGameEvent.bind(this))); this._connection.addMessageEvent(new FurnitureState2Event(this.onFurnitureState2Event.bind(this))); this._connection.addMessageEvent(new IgnoreResultEvent(this.onIgnoreResultEvent.bind(this))); @@ -859,6 +860,15 @@ export class RoomMessageHandler extends Disposable this._roomCreator.updateRoomObjectUserFigure(this._currentRoomId, parser.roomIndex, parser.figureData.figuredata, '' , '', parser.isRiding); } + private onPetExperienceEvent(event: PetExperienceEvent): void + { + const parser = event.getParser(); + + if(!parser) return; + + this._roomCreator.updateRoomObjectUserAction(this._currentRoomId, parser.roomIndex, RoomObjectVariable.FIGURE_GAINED_EXPERIENCE, parser.gainedExperience); + } + private onYouArePlayingGameEvent(event: YouArePlayingGameEvent): void { if(!event) return; diff --git a/src/nitro/room/object/RoomObjectVariable.ts b/src/nitro/room/object/RoomObjectVariable.ts index 074f2464..a264ba15 100644 --- a/src/nitro/room/object/RoomObjectVariable.ts +++ b/src/nitro/room/object/RoomObjectVariable.ts @@ -28,6 +28,7 @@ export class RoomObjectVariable public static FIGURE_IS_TYPING: string = 'figure_is_typing'; public static FIGURE_IS_MUTED: string = 'figure_is_muted'; public static FIGURE_GAINED_EXPERIENCE: string = 'figure_gained_experience'; + public static FIGURE_EXPERIENCE_TIMESTAMP: string = 'figure_experience_timestamp'; public static FIGURE_NUMBER_VALUE: string = 'figure_number_value'; public static FIGURE_IS_PLAYING_GAME: string = 'figure_is_playing_game'; public static FIGURE_GUIDE_STATUS: string = 'figure_guide_status'; diff --git a/src/nitro/room/object/logic/pet/PetLogic.ts b/src/nitro/room/object/logic/pet/PetLogic.ts index e234da40..a2bb2452 100644 --- a/src/nitro/room/object/logic/pet/PetLogic.ts +++ b/src/nitro/room/object/logic/pet/PetLogic.ts @@ -9,6 +9,7 @@ import { PetFigureData } from '../../../../avatar/pets/PetFigureData'; import { PetType } from '../../../../avatar/pets/PetType'; import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomObjectMoveEvent } from '../../../events/RoomObjectMoveEvent'; +import { ObjectAvatarExperienceUpdateMessage } from '../../../messages'; import { ObjectAvatarChatUpdateMessage } from '../../../messages/ObjectAvatarChatUpdateMessage'; import { ObjectAvatarFigureUpdateMessage } from '../../../messages/ObjectAvatarFigureUpdateMessage'; import { ObjectAvatarPetGestureUpdateMessage } from '../../../messages/ObjectAvatarPetGestureUpdateMessage'; @@ -213,6 +214,14 @@ export class PetLogic extends MovingObjectLogic return; } + + if(message instanceof ObjectAvatarExperienceUpdateMessage) + { + model.setValue(RoomObjectVariable.FIGURE_EXPERIENCE_TIMESTAMP, this.time); + model.setValue(RoomObjectVariable.FIGURE_GAINED_EXPERIENCE, message.gainedExperience); + + return; + } } public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void diff --git a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts index 17e9f397..7db073d5 100644 --- a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts +++ b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts @@ -1,4 +1,4 @@ -import { BLEND_MODES, Texture } from 'pixi.js'; +import { BLEND_MODES, Resource, Texture } from 'pixi.js'; import { AdvancedMap } from '../../../../../core/utils/AdvancedMap'; import { AlphaTolerance } from '../../../../../room/object/enum/AlphaTolerance'; import { RoomObjectSpriteType } from '../../../../../room/object/enum/RoomObjectSpriteType'; @@ -1090,7 +1090,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement } } - public getAvatarRenderAsset(name: string): Texture + public getAvatarRenderAsset(name: string): Texture { const url = (Nitro.instance.getConfiguration('images.url') + '/additions/' + name + '.png'); diff --git a/src/nitro/room/object/visualization/avatar/AvatarVisualizationData.ts b/src/nitro/room/object/visualization/avatar/AvatarVisualizationData.ts index 1c5df421..fc7d77ae 100644 --- a/src/nitro/room/object/visualization/avatar/AvatarVisualizationData.ts +++ b/src/nitro/room/object/visualization/avatar/AvatarVisualizationData.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { IAssetData } from '../../../../../core/asset/interfaces'; import { Disposable } from '../../../../../core/common/disposable/Disposable'; import { IObjectVisualizationData } from '../../../../../room/object/visualization/IRoomObjectVisualizationData'; @@ -37,7 +37,7 @@ export class AvatarVisualizationData extends Disposable implements IObjectVisual return avatarImage; } - public getAvatarRendererAsset(name: string): Texture + public getAvatarRendererAsset(name: string): Texture { if(!this._avatarRenderer) return null; @@ -58,4 +58,4 @@ export class AvatarVisualizationData extends Disposable implements IObjectVisual { return 0; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/avatar/additions/FloatingHeartAddition.ts b/src/nitro/room/object/visualization/avatar/additions/FloatingHeartAddition.ts index 6eef7f99..d3f00035 100644 --- a/src/nitro/room/object/visualization/avatar/additions/FloatingHeartAddition.ts +++ b/src/nitro/room/object/visualization/avatar/additions/FloatingHeartAddition.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { IRoomObjectSprite } from '../../../../../../room/object/visualization/IRoomObjectSprite'; import { Nitro } from '../../../../../Nitro'; import { AvatarVisualization } from '../AvatarVisualization'; @@ -12,7 +12,7 @@ export class FloatingHeartAddition extends ExpressionAddition private static STATE_FLOAT: number = 2; private static STATE_COMPLETE: number = 3; - private _asset: Texture; + private _asset: Texture; private _startTime: number; private _delta: number; private _offsetY: number; diff --git a/src/nitro/room/object/visualization/avatar/additions/FloatingIdleZAddition.ts b/src/nitro/room/object/visualization/avatar/additions/FloatingIdleZAddition.ts index b926196f..4dec65c5 100644 --- a/src/nitro/room/object/visualization/avatar/additions/FloatingIdleZAddition.ts +++ b/src/nitro/room/object/visualization/avatar/additions/FloatingIdleZAddition.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { IRoomObjectSprite } from '../../../../../../room/object/visualization/IRoomObjectSprite'; import { Nitro } from '../../../../../Nitro'; import { AvatarVisualization } from '../AvatarVisualization'; @@ -14,7 +14,7 @@ export class FloatingIdleZAddition implements IAvatarAddition private _id: number; private _visualization: AvatarVisualization; - private _asset: Texture; + private _asset: Texture; private _startTime: number; private _offsetY: number; private _scale: number; diff --git a/src/nitro/room/object/visualization/avatar/additions/MutedBubbleAddition.ts b/src/nitro/room/object/visualization/avatar/additions/MutedBubbleAddition.ts index 95027090..c4ac6d7f 100644 --- a/src/nitro/room/object/visualization/avatar/additions/MutedBubbleAddition.ts +++ b/src/nitro/room/object/visualization/avatar/additions/MutedBubbleAddition.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { IRoomObjectSprite } from '../../../../../../room/object/visualization/IRoomObjectSprite'; import { AvatarVisualization } from '../AvatarVisualization'; import { IAvatarAddition } from './IAvatarAddition'; @@ -7,7 +7,7 @@ export class MutedBubbleAddition implements IAvatarAddition { private _id: number; private _visualization: AvatarVisualization; - private _asset: Texture; + private _asset: Texture; constructor(id: number, visualization: AvatarVisualization) { diff --git a/src/nitro/room/object/visualization/avatar/additions/NumberBubbleAddition.ts b/src/nitro/room/object/visualization/avatar/additions/NumberBubbleAddition.ts index abd120cf..1e76a4bd 100644 --- a/src/nitro/room/object/visualization/avatar/additions/NumberBubbleAddition.ts +++ b/src/nitro/room/object/visualization/avatar/additions/NumberBubbleAddition.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { IRoomObjectSprite } from '../../../../../../room/object/visualization/IRoomObjectSprite'; import { AvatarVisualization } from '../AvatarVisualization'; import { IAvatarAddition } from './IAvatarAddition'; @@ -7,7 +7,7 @@ export class NumberBubbleAddition implements IAvatarAddition { private _id: number; private _visualization: AvatarVisualization; - private _asset: Texture; + private _asset: Texture; private _scale: number; private _number: number; private _numberValueFadeDirection: number; @@ -180,4 +180,4 @@ export class NumberBubbleAddition implements IAvatarAddition { return this._id; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/avatar/additions/TypingBubbleAddition.ts b/src/nitro/room/object/visualization/avatar/additions/TypingBubbleAddition.ts index 3210d89a..129b9c0c 100644 --- a/src/nitro/room/object/visualization/avatar/additions/TypingBubbleAddition.ts +++ b/src/nitro/room/object/visualization/avatar/additions/TypingBubbleAddition.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { IRoomObjectSprite } from '../../../../../../room/object/visualization/IRoomObjectSprite'; import { AvatarVisualization } from '../AvatarVisualization'; import { IAvatarAddition } from './IAvatarAddition'; @@ -7,7 +7,7 @@ export class TypingBubbleAddition implements IAvatarAddition { private _id: number; private _visualization: AvatarVisualization; - private _asset: Texture; + private _asset: Texture; private _relativeDepth: number; constructor(id: number, visualization: AvatarVisualization) @@ -96,4 +96,4 @@ export class TypingBubbleAddition implements IAvatarAddition { this._relativeDepth = depth; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/furniture/FurnitureBrandedImageVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureBrandedImageVisualization.ts index db331687..1692c8bb 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureBrandedImageVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureBrandedImageVisualization.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { Nitro } from '../../../../Nitro'; import { RoomObjectVariable } from '../../RoomObjectVariable'; import { FurnitureVisualization } from './FurnitureVisualization'; @@ -80,7 +80,7 @@ export class FurnitureBrandedImageVisualization extends FurnitureVisualization return flag; } - protected imageReady(texture: Texture, imageUrl: string): void + protected imageReady(texture: Texture, imageUrl: string): void { if(!texture) { diff --git a/src/nitro/room/object/visualization/furniture/FurnitureRoomBackgroundVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureRoomBackgroundVisualization.ts index 60d52c8c..68eecc3c 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureRoomBackgroundVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureRoomBackgroundVisualization.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { DirectionalOffsetData } from '../data/DirectionalOffsetData'; import { FurnitureBrandedImageVisualization } from './FurnitureBrandedImageVisualization'; @@ -6,7 +6,7 @@ export class FurnitureRoomBackgroundVisualization extends FurnitureBrandedImageV { private _imageOffset: DirectionalOffsetData; - protected imageReady(texture: Texture, imageUrl: string): void + protected imageReady(texture: Texture, imageUrl: string): void { super.imageReady(texture, imageUrl); @@ -56,4 +56,4 @@ export class FurnitureRoomBackgroundVisualization extends FurnitureBrandedImageV { return super.getLayerZOffset(scale, direction, layerId) + (-(this._offsetZ)); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts index 3a4813ec..9d5842f5 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts @@ -1,4 +1,4 @@ -import { Matrix, Rectangle, Sprite, Texture } from 'pixi.js'; +import { Matrix, Rectangle, Resource, Sprite, Texture } from 'pixi.js'; import { IGraphicAsset } from '../../../../../room/object/visualization/utils/IGraphicAsset'; import { TextureUtils } from '../../../../../room/utils/TextureUtils'; import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization'; @@ -8,7 +8,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat protected static THUMBNAIL: string = 'THUMBNAIL'; private _thumbnailAssetNameNormal: string; - private _thumbnailImageNormal: Texture; + private _thumbnailImageNormal: Texture; private _thumbnailDirection: number; private _thumbnailChanged: boolean; @@ -27,7 +27,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat return !(this._thumbnailImageNormal == null); } - public setThumbnailImages(k: Texture): void + public setThumbnailImages(k: Texture): void { this._thumbnailImageNormal = k; this._thumbnailChanged = true; @@ -61,7 +61,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat this._thumbnailDirection = this.direction; } - private addThumbnailAsset(k: Texture, scale: number): void + private addThumbnailAsset(k: Texture, scale: number): void { let layerId = 0; @@ -88,7 +88,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat } } - private generateTransformedThumbnail(texture: Texture, asset: IGraphicAsset): Texture + private generateTransformedThumbnail(texture: Texture, asset: IGraphicAsset): Texture { const _local_3 = 1.1; const matrix = new Matrix(); diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index e66e15ed..8b58fa20 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -1,4 +1,4 @@ -import { Graphics, Matrix, Point, Rectangle, RenderTexture, Texture } from 'pixi.js'; +import { Graphics, Matrix, Point, Rectangle, RenderTexture, Resource, Texture } from 'pixi.js'; import { IRoomPlane } from '../../../../../room/object/visualization/IRoomPlane'; import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; import { IVector3D } from '../../../../../room/utils/IVector3D'; @@ -149,7 +149,7 @@ export class RoomPlane implements IRoomPlane return this._canBeVisible; } - public get bitmapData(): Texture + public get bitmapData(): Texture { if(!this.visible || !this._bitmapData) return null; @@ -295,7 +295,7 @@ export class RoomPlane implements IRoomPlane this._disposed = true; } - public copyBitmapData(k: Texture): Texture + public copyBitmapData(k: Texture): Texture { if(!this.visible || !this._bitmapData || !k) return null; diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index 1d0bfe72..8d99a452 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -1,4 +1,4 @@ -import { Rectangle, RenderTexture, Texture } from 'pixi.js'; +import { Rectangle, RenderTexture, Resource, Texture } from 'pixi.js'; import { AdvancedMap } from '../../../../../core/utils/AdvancedMap'; import { AlphaTolerance } from '../../../../../room/object/enum/AlphaTolerance'; import { RoomObjectSpriteType } from '../../../../../room/object/enum/RoomObjectSpriteType'; @@ -982,7 +982,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements k.name = ((_arg_3 + '_') + this._assetUpdateCounter); } - private getPlaneBitmap(k: RoomPlane, _arg_2: string): Texture + private getPlaneBitmap(k: RoomPlane, _arg_2: string): Texture { return k.bitmapData; } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts index 8b5a45a9..bf2ea63e 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -1,4 +1,4 @@ -import { Graphics, Point, Texture } from 'pixi.js'; +import { Graphics, Point, Resource, Texture } from 'pixi.js'; import { IGraphicAsset } from '../../../../../../../room/object/visualization/utils/IGraphicAsset'; import { IGraphicAssetCollection } from '../../../../../../../room/object/visualization/utils/IGraphicAssetCollection'; import { IRoomGeometry } from '../../../../../../../room/utils/IRoomGeometry'; @@ -252,7 +252,7 @@ export class PlaneRasterizer implements IPlaneRasterizer if(texture) { - let newTexture: Texture = texture; + let newTexture: Texture = texture; if(asset.flipH) { diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTexture.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTexture.ts index e6655d58..f0cee232 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTexture.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTexture.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { IVector3D } from '../../../../../../../room/utils/IVector3D'; import { PlaneTextureBitmap } from './PlaneTextureBitmap'; @@ -29,12 +29,12 @@ export class PlaneTexture } } - public addBitmap(k: Texture, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1, _arg_6: string = null): void + public addBitmap(k: Texture, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1, _arg_6: string = null): void { this._bitmaps.push(new PlaneTextureBitmap(k, _arg_2, _arg_3, _arg_4, _arg_5, _arg_6)); } - public getBitmap(k: IVector3D): Texture + public getBitmap(k: IVector3D): Texture { const _local_2 = this.getPlaneTextureBitmap(k); diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTextureBitmap.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTextureBitmap.ts index 9adfdc53..a2d10ba3 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTextureBitmap.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTextureBitmap.ts @@ -1,18 +1,18 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; export class PlaneTextureBitmap { public static MIN_NORMAL_COORDINATE_VALUE: number = -1; public static MAX_NORMAL_COORDINATE_VALUE: number = 1; - private _bitmap: Texture; + private _bitmap: Texture; private _normalMinX: number; private _normalMaxX: number; private _normalMinY: number; private _normalMaxY: number; private _assetName: string; - constructor(k: Texture, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1, _arg_6: string = null) + constructor(k: Texture, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1, _arg_6: string = null) { this._normalMinX = _arg_2; this._normalMaxX = _arg_3; @@ -22,7 +22,7 @@ export class PlaneTextureBitmap this._bitmap = k; } - public get bitmap(): Texture + public get bitmap(): Texture { return this._bitmap; } diff --git a/src/nitro/session/BadgeImageManager.ts b/src/nitro/session/BadgeImageManager.ts index 6bdf786f..020b8b4e 100644 --- a/src/nitro/session/BadgeImageManager.ts +++ b/src/nitro/session/BadgeImageManager.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { IAssetManager } from '../../core/asset/IAssetManager'; import { IEventDispatcher } from '../../core/events/IEventDispatcher'; import { Nitro } from '../Nitro'; @@ -26,7 +26,7 @@ export class BadgeImageManager this._assets = null; } - public getBadgeImage(badgeName: string, type: string = 'normal_badge', load: boolean = true): Texture + public getBadgeImage(badgeName: string, type: string = 'normal_badge', load: boolean = true): Texture { let badge = this.getBadgeTexture(badgeName, type); @@ -51,7 +51,7 @@ export class BadgeImageManager return null; } - private getBadgeTexture(badgeName: string, type: string = 'normal_badge'): Texture + private getBadgeTexture(badgeName: string, type: string = 'normal_badge'): Texture { const existing = this._assets.getTexture(badgeName); @@ -79,7 +79,7 @@ export class BadgeImageManager return null; } - private getBadgePlaceholder(): Texture + private getBadgePlaceholder(): Texture { const existing = this._assets.getTexture('loading_icon'); diff --git a/src/nitro/session/BadgeInfo.ts b/src/nitro/session/BadgeInfo.ts index 53a1484f..0196680a 100644 --- a/src/nitro/session/BadgeInfo.ts +++ b/src/nitro/session/BadgeInfo.ts @@ -1,17 +1,17 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; export class BadgeInfo { - private _image: Texture; + private _image: Texture; private _placeHolder: boolean; - constructor(image: Texture, placeHolder: boolean) + constructor(image: Texture, placeHolder: boolean) { this._image = image; this._placeHolder = placeHolder; } - public get image(): Texture + public get image(): Texture { return this._image; } @@ -20,4 +20,4 @@ export class BadgeInfo { return this._placeHolder; } -} \ No newline at end of file +} diff --git a/src/nitro/session/ISessionDataManager.ts b/src/nitro/session/ISessionDataManager.ts index 88c902c8..60663058 100644 --- a/src/nitro/session/ISessionDataManager.ts +++ b/src/nitro/session/ISessionDataManager.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { INitroManager } from '../../core/common/INitroManager'; import { INitroCommunicationManager } from '../communication/INitroCommunicationManager'; import { IFurnitureData } from './furniture/IFurnitureData'; @@ -17,9 +17,9 @@ export interface ISessionDataManager extends INitroManager getProductData(type: string): IProductData; getBadgeUrl(name: string): string; getGroupBadgeUrl(name: string): string; - getBadgeImage(name: string): Texture; + getBadgeImage(name: string): Texture; loadBadgeImage(name: string): string; - getGroupBadgeImage(name: string): Texture; + getGroupBadgeImage(name: string): Texture; loadGroupBadgeImage(name: string): string; hasSecurity(level: number): boolean; giveRespect(userId: number): void; diff --git a/src/nitro/session/SessionDataManager.ts b/src/nitro/session/SessionDataManager.ts index ca7c6f53..421e702d 100644 --- a/src/nitro/session/SessionDataManager.ts +++ b/src/nitro/session/SessionDataManager.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { NitroManager } from '../../core/common/NitroManager'; import { IMessageComposer } from '../../core/communication/messages/IMessageComposer'; import { NitroEvent } from '../../core/events/NitroEvent'; @@ -472,12 +472,12 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana return this._badgeImageManager.getBadgeUrl(name, BadgeImageManager.GROUP_BADGE); } - public getBadgeImage(name: string): Texture + public getBadgeImage(name: string): Texture { return this._badgeImageManager.getBadgeImage(name); } - public getGroupBadgeImage(name: string): Texture + public getGroupBadgeImage(name: string): Texture { return this._badgeImageManager.getBadgeImage(name, BadgeImageManager.GROUP_BADGE); } diff --git a/src/nitro/session/events/BadgeImageReadyEvent.ts b/src/nitro/session/events/BadgeImageReadyEvent.ts index b7418010..3b01d338 100644 --- a/src/nitro/session/events/BadgeImageReadyEvent.ts +++ b/src/nitro/session/events/BadgeImageReadyEvent.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { NitroEvent } from '../../../core/events/NitroEvent'; export class BadgeImageReadyEvent extends NitroEvent @@ -6,9 +6,9 @@ export class BadgeImageReadyEvent extends NitroEvent public static IMAGE_READY: string = 'BIME_BADGE_IMAGE_READY'; private _badgeId: string; - private _image: Texture; + private _image: Texture; - constructor(badgeId: string, image: Texture) + constructor(badgeId: string, image: Texture) { super(BadgeImageReadyEvent.IMAGE_READY); @@ -21,8 +21,8 @@ export class BadgeImageReadyEvent extends NitroEvent return this._badgeId; } - public get image(): Texture + public get image(): Texture { return this._image; } -} \ No newline at end of file +} diff --git a/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts b/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts index 19a6146c..3e2847d3 100644 --- a/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts +++ b/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts @@ -1,4 +1,4 @@ -import { Container, Matrix, Renderer, Texture } from 'pixi.js'; +import { Container, Matrix, Renderer, Resource, Texture } from 'pixi.js'; import { Constant } from './Constant'; import { RectTileLayer } from './RectTileLayer'; @@ -118,9 +118,9 @@ export class CompositeRectTileLayer extends Container return this; } - addFrame(texture_: Texture | string | number, x: number, y: number, animX?: number, animY?: number, animWidth?: number, animHeight?: number, alpha?: number, yaxis?: number, xaxis?: number): this + addFrame(texture_: Texture | string | number, x: number, y: number, animX?: number, animY?: number, animWidth?: number, animHeight?: number, alpha?: number, yaxis?: number, xaxis?: number): this { - let texture: Texture; + let texture: Texture; let layer: RectTileLayer = null; let ind = 0; const children = this.children; diff --git a/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts b/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts index b35e2165..31655f5a 100644 --- a/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts +++ b/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts @@ -45,7 +45,7 @@ export class MultiTextureResource extends Resource boundSprites: Array = []; dirties: Array = []; - setTexture(ind: number, texture: Texture) + setTexture(ind: number, texture: Texture) { const spr = this.boundSprites[ind]; if(spr.texture.baseTexture === texture.baseTexture) diff --git a/src/room/floorplan/pixi-tilemap/RectTileLayer.ts b/src/room/floorplan/pixi-tilemap/RectTileLayer.ts index da61e7b9..1ff6f139 100644 --- a/src/room/floorplan/pixi-tilemap/RectTileLayer.ts +++ b/src/room/floorplan/pixi-tilemap/RectTileLayer.ts @@ -1,4 +1,4 @@ -import { Bounds, Container, DRAW_MODES, groupD8, Matrix, Rectangle, Renderer, Texture } from 'pixi.js'; +import { Bounds, Container, DRAW_MODES, groupD8, Matrix, Rectangle, Renderer, Resource, Texture } from 'pixi.js'; import { Constant } from './Constant'; import { RectTileGeom } from './RectTileShader'; import { TileRenderer } from './TileRenderer'; @@ -24,7 +24,7 @@ export const POINT_STRUCT_SIZE_TWO = (Object.keys(PointStruct).length / 2); //export const POINT_STRUCT_SIZE = 12; export class RectTileLayer extends Container { - constructor(zIndex: number, texture: Texture | Array) + constructor(zIndex: number, texture: Texture | Array) { super(); this.initialize(zIndex, texture); @@ -44,7 +44,7 @@ export class RectTileLayer extends Container offsetY = 0; compositeParent = false; - initialize(zIndex: number, textures: Texture | Array) + initialize(zIndex: number, textures: Texture | Array) { if(!textures) { @@ -67,9 +67,9 @@ export class RectTileLayer extends Container this.hasAnim = false; } - addFrame(texture_: Texture | string | number, x: number, y: number, animX: number, animY: number) + addFrame(texture_: Texture | string | number, x: number, y: number, animX: number, animY: number) { - let texture: Texture; + let texture: Texture; let textureIndex = 0; if(typeof texture_ === 'number') diff --git a/src/room/object/visualization/IRoomObjectSprite.ts b/src/room/object/visualization/IRoomObjectSprite.ts index f3d7b1b1..9be4e40c 100644 --- a/src/room/object/visualization/IRoomObjectSprite.ts +++ b/src/room/object/visualization/IRoomObjectSprite.ts @@ -1,4 +1,4 @@ -import { Container, Filter, Texture } from 'pixi.js'; +import { Container, Filter, Resource, Texture } from 'pixi.js'; export interface IRoomObjectSprite { @@ -6,7 +6,7 @@ export interface IRoomObjectSprite name: string; type: string; spriteType: number; - texture: Texture; + texture: Texture; container: Container; width: number; height: number; diff --git a/src/room/object/visualization/RoomObjectSprite.ts b/src/room/object/visualization/RoomObjectSprite.ts index 62ef73b0..8e6c15f0 100644 --- a/src/room/object/visualization/RoomObjectSprite.ts +++ b/src/room/object/visualization/RoomObjectSprite.ts @@ -1,4 +1,4 @@ -import { BLEND_MODES, Container, Filter, Texture } from 'pixi.js'; +import { BLEND_MODES, Container, Filter, Resource, Texture } from 'pixi.js'; import { AlphaTolerance } from '../enum/AlphaTolerance'; import { RoomObjectSpriteType } from '../enum/RoomObjectSpriteType'; import { IRoomObjectSprite } from './IRoomObjectSprite'; @@ -11,7 +11,7 @@ export class RoomObjectSprite implements IRoomObjectSprite private _name: string; private _type: string; private _spriteType: number; - private _texture: Texture; + private _texture: Texture; private _container: Container; private _width: number; @@ -123,12 +123,12 @@ export class RoomObjectSprite implements IRoomObjectSprite this._spriteType = type; } - public get texture(): Texture + public get texture(): Texture { return this._texture; } - public set texture(texture: Texture) + public set texture(texture: Texture) { if(this._texture === texture) return; diff --git a/src/room/object/visualization/utils/GraphicAsset.ts b/src/room/object/visualization/utils/GraphicAsset.ts index 5f34b765..54fa8b37 100644 --- a/src/room/object/visualization/utils/GraphicAsset.ts +++ b/src/room/object/visualization/utils/GraphicAsset.ts @@ -1,4 +1,4 @@ -import { Rectangle, Texture } from 'pixi.js'; +import { Rectangle, Resource, Texture } from 'pixi.js'; import { IGraphicAsset } from './IGraphicAsset'; export class GraphicAsset implements IGraphicAsset @@ -7,7 +7,7 @@ export class GraphicAsset implements IGraphicAsset private _name: string; private _source: string; - private _texture: Texture; + private _texture: Texture; private _usesPalette: boolean; private _x: number; private _y: number; @@ -18,7 +18,7 @@ export class GraphicAsset implements IGraphicAsset private _rectangle: Rectangle; private _initialized: boolean; - public static createAsset(name: string, source: string, texture: Texture, x: number, y: number, flipH: boolean = false, flipV: boolean = false, usesPalette: boolean = false): GraphicAsset + public static createAsset(name: string, source: string, texture: Texture, x: number, y: number, flipH: boolean = false, flipV: boolean = false, usesPalette: boolean = false): GraphicAsset { const graphicAsset = (GraphicAsset.GRAPHIC_POOL.length ? GraphicAsset.GRAPHIC_POOL.pop() : new GraphicAsset()); @@ -73,7 +73,7 @@ export class GraphicAsset implements IGraphicAsset return this._source; } - public get texture(): Texture + public get texture(): Texture { return this._texture; } @@ -137,4 +137,4 @@ export class GraphicAsset implements IGraphicAsset return this._rectangle; } -} \ No newline at end of file +} diff --git a/src/room/object/visualization/utils/GraphicAssetCollection.ts b/src/room/object/visualization/utils/GraphicAssetCollection.ts index 7f0a4f19..eddd0063 100644 --- a/src/room/object/visualization/utils/GraphicAssetCollection.ts +++ b/src/room/object/visualization/utils/GraphicAssetCollection.ts @@ -161,7 +161,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection } } - private createAsset(name: string, source: string, texture: Texture, flipH: boolean, flipV: boolean, x: number, y: number, usesPalette: boolean): boolean + private createAsset(name: string, source: string, texture: Texture, flipH: boolean, flipV: boolean, x: number, y: number, usesPalette: boolean): boolean { if(this._assets.get(name)) return false; @@ -172,7 +172,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection return true; } - private replaceAsset(name: string, source: string, texture: Texture, flipH: boolean, flipV: boolean, x: number, y: number, usesPalette: boolean): boolean + private replaceAsset(name: string, source: string, texture: Texture, flipH: boolean, flipV: boolean, x: number, y: number, usesPalette: boolean): boolean { const existing = this._assets.get(name); @@ -254,7 +254,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection return existing; } - public addAsset(name: string, texture: Texture, override: boolean, x: number = 0, y: number = 0, flipH: boolean = false, flipV: boolean = false): boolean + public addAsset(name: string, texture: Texture, override: boolean, x: number = 0, y: number = 0, flipH: boolean = false, flipV: boolean = false): boolean { if(!name || !texture) return false; @@ -301,7 +301,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection existing.recycle(); } - public getLibraryAsset(name: string): Texture + public getLibraryAsset(name: string): Texture { if(!name) return null; diff --git a/src/room/object/visualization/utils/GraphicAssetPalette.ts b/src/room/object/visualization/utils/GraphicAssetPalette.ts index 29a1cc70..9a49d6aa 100644 --- a/src/room/object/visualization/utils/GraphicAssetPalette.ts +++ b/src/room/object/visualization/utils/GraphicAssetPalette.ts @@ -1,4 +1,4 @@ -import { Sprite, Texture } from 'pixi.js'; +import { Resource, Sprite, Texture } from 'pixi.js'; import { TextureUtils } from '../../../utils'; export class GraphicAssetPalette @@ -22,7 +22,7 @@ export class GraphicAssetPalette } - public applyPalette(texture: Texture): Texture + public applyPalette(texture: Texture): Texture { const sprite = Sprite.from(texture); const textureCanvas = TextureUtils.generateCanvas(sprite); diff --git a/src/room/object/visualization/utils/IGraphicAsset.ts b/src/room/object/visualization/utils/IGraphicAsset.ts index ccb372a8..54ce1d75 100644 --- a/src/room/object/visualization/utils/IGraphicAsset.ts +++ b/src/room/object/visualization/utils/IGraphicAsset.ts @@ -1,10 +1,10 @@ -import { Rectangle, Texture } from 'pixi.js'; +import { Rectangle, Resource, Texture } from 'pixi.js'; export interface IGraphicAsset { name: string; source: string; - texture: Texture; + texture: Texture; usesPalette: boolean; x: number; y: number; @@ -15,4 +15,4 @@ export interface IGraphicAsset flipH: boolean; flipV: boolean; rectangle: Rectangle; -} \ No newline at end of file +} diff --git a/src/room/object/visualization/utils/IGraphicAssetCollection.ts b/src/room/object/visualization/utils/IGraphicAssetCollection.ts index 1d4b0eaf..6fb07a6a 100644 --- a/src/room/object/visualization/utils/IGraphicAssetCollection.ts +++ b/src/room/object/visualization/utils/IGraphicAssetCollection.ts @@ -1,4 +1,4 @@ -import { Texture } from 'pixi.js'; +import { Resource, Texture } from 'pixi.js'; import { IAssetData } from '../../../../core/asset/interfaces'; import { GraphicAssetPalette } from './GraphicAssetPalette'; import { IGraphicAsset } from './IGraphicAsset'; @@ -14,10 +14,10 @@ export interface IGraphicAssetCollection getPaletteNames(): string[]; getPaletteColors(paletteName: string): number[]; getPalette(name: string): GraphicAssetPalette; - addAsset(name: string, texture: Texture, override: boolean, x?: number, y?: number, flipH?: boolean, flipV?: boolean): boolean; + addAsset(name: string, texture: Texture, override: boolean, x?: number, y?: number, flipH?: boolean, flipV?: boolean): boolean; disposeAsset(name: string): void; referenceCount: number; referenceTimestamp: number; name: string; data: IAssetData; -} \ No newline at end of file +} diff --git a/src/room/renderer/utils/ExtendedSprite.ts b/src/room/renderer/utils/ExtendedSprite.ts index fd86fe9a..004f6528 100644 --- a/src/room/renderer/utils/ExtendedSprite.ts +++ b/src/room/renderer/utils/ExtendedSprite.ts @@ -1,4 +1,4 @@ -import { BaseTexture, BLEND_MODES, Point, RenderTexture, Sprite, Texture } from 'pixi.js'; +import { BaseTexture, BLEND_MODES, Point, RenderTexture, Resource, Sprite, Texture } from 'pixi.js'; import { TextureUtils } from '../../utils'; export class ExtendedSprite extends Sprite @@ -13,7 +13,7 @@ export class ExtendedSprite extends Sprite private _pairedSpriteId: number; private _pairedSpriteUpdateCounter: number; - constructor(texture: Texture = null) + constructor(texture: Texture = null) { super(texture); @@ -45,7 +45,7 @@ export class ExtendedSprite extends Sprite super.calculateVertices(); } - public setTexture(texture: Texture): void + public setTexture(texture: Texture): void { if(!texture) texture = Texture.EMPTY; diff --git a/src/room/utils/Rasterizer.ts b/src/room/utils/Rasterizer.ts index 0e3a4a94..7f2b29ff 100644 --- a/src/room/utils/Rasterizer.ts +++ b/src/room/utils/Rasterizer.ts @@ -1,4 +1,4 @@ -import { Graphics, Matrix, Texture } from 'pixi.js'; +import { Graphics, Matrix, Resource, Texture } from 'pixi.js'; import { TextureUtils } from './TextureUtils'; export class Rasterizer @@ -61,7 +61,7 @@ export class Rasterizer // k.unlock(); // } - public static getFlipHBitmapData(k: Texture): Texture + public static getFlipHBitmapData(k: Texture): Texture { if(!k) return null; @@ -83,7 +83,7 @@ export class Rasterizer return TextureUtils.generateTexture(graphic); } - public static getFlipVBitmapData(k: Texture): Texture + public static getFlipVBitmapData(k: Texture): Texture { if(!k) return null; @@ -105,7 +105,7 @@ export class Rasterizer return TextureUtils.generateTexture(graphic); } - public static getFlipHVBitmapData(k: Texture): Texture + public static getFlipHVBitmapData(k: Texture): Texture { if(!k) return null; diff --git a/src/room/utils/TextureUtils.ts b/src/room/utils/TextureUtils.ts index 9a86c11b..8b33a592 100644 --- a/src/room/utils/TextureUtils.ts +++ b/src/room/utils/TextureUtils.ts @@ -1,5 +1,5 @@ import { Extract } from '@pixi/extract'; -import { AbstractRenderer, DisplayObject, Rectangle, Renderer, RenderTexture, SCALE_MODES, Texture } from 'pixi.js'; +import { AbstractRenderer, DisplayObject, Rectangle, Renderer, RenderTexture, Resource, SCALE_MODES, Texture } from 'pixi.js'; import { Nitro } from '../../nitro/Nitro'; export class TextureUtils @@ -13,7 +13,7 @@ export class TextureUtils return TextureUtils.getRenderer().generateTexture(displayObject, scaleMode, resolution, region); } - public static generateTextureFromImage(image: HTMLImageElement): Texture + public static generateTextureFromImage(image: HTMLImageElement): Texture { if(!image) return null;