From ad17aa364ead388d035feb3be12b7ebe33389ec1 Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 23 Jul 2023 16:10:37 -0400 Subject: [PATCH] Updates --- src/api/room/renderer/IRoomRenderingCanvas.ts | 7 +-- src/common/Disposable.ts | 40 ---------------- src/common/index.ts | 2 - src/{common => events}/EventDispatcher.ts | 0 src/events/NitroEventDispatcher.ts | 2 +- src/events/index.ts | 1 + src/index.ts | 1 - src/nitro/Nitro.ts | 2 +- src/nitro/avatar/AvatarImage.ts | 12 ++--- src/nitro/avatar/AvatarStructure.ts | 2 +- src/nitro/avatar/cache/AvatarImageCache.ts | 5 +- src/nitro/camera/RoomCameraWidgetManager.ts | 5 +- src/nitro/room/RoomMessageHandler.ts | 46 ++++--------------- src/nitro/room/RoomObjectEventHandler.ts | 41 ++++------------- src/nitro/room/RoomObjectLogicFactory.ts | 3 +- .../room/object/logic/MovingObjectLogic.ts | 4 +- .../FurnitureEditableRoomLinkLogic.ts | 4 +- .../furniture/FurnitureFloorHoleLogic.ts | 4 +- .../logic/furniture/FurnitureJukeboxLogic.ts | 4 +- .../object/logic/furniture/FurnitureLogic.ts | 4 +- .../FurnitureRoomBackgroundColorLogic.ts | 4 +- .../furniture/FurnitureRoomDimmerLogic.ts | 4 +- .../furniture/FurnitureSoundBlockLogic.ts | 4 +- .../furniture/FurnitureSoundMachineLogic.ts | 4 +- .../avatar/AvatarVisualizationData.ts | 10 +--- .../IsometricImageFurniVisualization.ts | 4 +- .../visualization/pet/ExperienceData.ts | 5 +- .../room/RoomVisualizationData.ts | 28 +++-------- src/nitro/session/badge/BadgeImageManager.ts | 7 +-- src/pixi-proxy/NitroPolygon.ts | 4 -- src/pixi-proxy/NitroSpritesheet.ts | 4 -- src/pixi-proxy/index.ts | 2 - .../RoomObjectSpriteVisualization.ts | 5 +- src/room/renderer/RoomSpriteCanvas.ts | 10 ++-- 34 files changed, 82 insertions(+), 202 deletions(-) delete mode 100644 src/common/Disposable.ts delete mode 100644 src/common/index.ts rename src/{common => events}/EventDispatcher.ts (100%) delete mode 100644 src/pixi-proxy/NitroPolygon.ts delete mode 100644 src/pixi-proxy/NitroSpritesheet.ts diff --git a/src/api/room/renderer/IRoomRenderingCanvas.ts b/src/api/room/renderer/IRoomRenderingCanvas.ts index 2d509d27..256e01f1 100644 --- a/src/api/room/renderer/IRoomRenderingCanvas.ts +++ b/src/api/room/renderer/IRoomRenderingCanvas.ts @@ -1,5 +1,6 @@ import { Point, RenderTexture } from '@pixi/core'; -import { DisplayObject } from '@pixi/display'; +import { Container } from '@pixi/display'; +import { Sprite } from '@pixi/sprite'; import { IRoomGeometry } from '../IRoomGeometry'; import { RoomObjectSpriteData } from '../RoomObjectSpriteData'; import { ISortableSprite } from '../object'; @@ -26,8 +27,8 @@ export interface IRoomRenderingCanvas moveDown(): void; id: number; geometry: IRoomGeometry; - master: DisplayObject; - display: DisplayObject; + master: Sprite; + display: Container; screenOffsetX: number; screenOffsetY: number; scale: number; diff --git a/src/common/Disposable.ts b/src/common/Disposable.ts deleted file mode 100644 index b4a9be5b..00000000 --- a/src/common/Disposable.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { IDisposable } from '../api'; - -export class Disposable implements IDisposable -{ - protected _isDisposed: boolean; - protected _isDisposing: boolean; - - constructor() - { - this._isDisposed = false; - this._isDisposing = false; - } - - public dispose(): void - { - if(this._isDisposed || this._isDisposing) return; - - this._isDisposing = true; - - this.onDispose(); - - this._isDisposed = true; - this._isDisposing = false; - } - - protected onDispose(): void - { - return; - } - - public get disposed(): boolean - { - return this._isDisposed; - } - - public get isDisposing(): boolean - { - return this._isDisposing; - } -} diff --git a/src/common/index.ts b/src/common/index.ts deleted file mode 100644 index 6e5d597e..00000000 --- a/src/common/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './Disposable'; -export * from './EventDispatcher'; diff --git a/src/common/EventDispatcher.ts b/src/events/EventDispatcher.ts similarity index 100% rename from src/common/EventDispatcher.ts rename to src/events/EventDispatcher.ts diff --git a/src/events/NitroEventDispatcher.ts b/src/events/NitroEventDispatcher.ts index 08468c18..a131ff71 100644 --- a/src/events/NitroEventDispatcher.ts +++ b/src/events/NitroEventDispatcher.ts @@ -1,4 +1,4 @@ import { IEventDispatcher } from '../api'; -import { EventDispatcher } from '../common'; +import { EventDispatcher } from './EventDispatcher'; export const NitroEventDispatcher: IEventDispatcher = new EventDispatcher(); diff --git a/src/events/index.ts b/src/events/index.ts index fae4c597..a9a27dc6 100644 --- a/src/events/index.ts +++ b/src/events/index.ts @@ -1,3 +1,4 @@ +export * from './EventDispatcher'; export * from './NitroEventDispatcher'; export * from './NitroEventType'; export * from './NitroSettingsEvent'; diff --git a/src/index.ts b/src/index.ts index 53cc465d..031e4cc5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,4 @@ export * from './api'; -export * from './common'; export * from './events'; export * from './nitro'; export * from './pixi-proxy'; diff --git a/src/nitro/Nitro.ts b/src/nitro/Nitro.ts index 735b5dd6..3ea4f03e 100644 --- a/src/nitro/Nitro.ts +++ b/src/nitro/Nitro.ts @@ -2,7 +2,7 @@ import { Application, IApplicationOptions } from '@pixi/app'; import { SCALE_MODES } from '@pixi/constants'; import { BaseTexture, TextureGCSystem, settings } from '@pixi/core'; import { AssetManager, IAvatarRenderManager, ICommunicationManager, IConfigurationManager, IEventDispatcher, ILinkEventTracker, ILocalizationManager, IRoomCameraWidgetManager, IRoomEngine, ISessionDataManager, ISoundManager, NitroConfiguration, NitroLogger } from '../api'; -import { EventDispatcher } from '../common'; +import { EventDispatcher } from '../events'; import { GetTicker, PixiApplicationProxy } from '../pixi-proxy'; import { INitro } from './INitro'; import { NitroVersion } from './NitroVersion'; diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index 66dbdd7a..74e73979 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -3,7 +3,7 @@ import { Container } from '@pixi/display'; import { ColorMatrixFilter } from '@pixi/filter-color-matrix'; import { Sprite } from '@pixi/sprite'; 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 { GetTickerTime, NitroSprite, PaletteMapFilter, PixiApplicationProxy, TextureUtils } from '../../pixi-proxy'; import { AvatarFigureContainer } from './AvatarFigureContainer'; import { AvatarStructure } from './AvatarStructure'; import { EffectAssetDownloadManager } from './EffectAssetDownloadManager'; @@ -323,7 +323,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener this._image = null; - const container = new NitroContainer(); + const container = new Container(); let isCachable = true; let partCount = (_local_6.length - 1); @@ -358,7 +358,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener point.x += avatarCanvas.regPoint.x; point.y += avatarCanvas.regPoint.y; - const partContainer = new NitroContainer(); + const partContainer = new Container(); partContainer.addChild(partCacheContainer); @@ -526,7 +526,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener point.x += avatarCanvas.regPoint.x; point.y += avatarCanvas.regPoint.y; - const partContainer = new NitroContainer(); + const partContainer = new Container(); partContainer.addChild(partCacheContainer); @@ -553,7 +553,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!avatarCanvas) return null; const setTypes = this.getBodyParts(setType, this._mainAction.definition.geometryType, this._mainDirection); - const container = new NitroContainer(); + const container = new Container(); let partCount = (setTypes.length - 1); @@ -585,7 +585,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener point.x += avatarCanvas.regPoint.x; point.y += avatarCanvas.regPoint.y; - const partContainer = new NitroContainer(); + const partContainer = new Container(); partContainer.addChild(partCacheContainer); diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index e2fabe6c..b49539fa 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -1,6 +1,6 @@ import { Point } from '@pixi/core'; import { AvatarDirectionAngle, IActionDefinition, IActiveActionData, IAssetAnimation, IAssetManager, IAvatarFigureContainer, IAvatarImage, IAvatarRenderManager, IFigureData, IFigurePartSet, IPartColor, IStructureData } from '../../api'; -import { EventDispatcher } from '../../common'; +import { EventDispatcher } from '../../events'; import { AvatarImagePartContainer } from './AvatarImagePartContainer'; import { AvatarRenderManager } from './AvatarRenderManager'; import { ActionDefinition, AvatarActionManager } from './actions'; diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index e9605522..552091af 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -1,6 +1,7 @@ import { Matrix, Point, Rectangle, Texture } from '@pixi/core'; +import { Container } from '@pixi/display'; import { AvatarDirectionAngle, AvatarFigurePartType, AvatarScaleType, GeometryType, IActiveActionData, IAvatarImage, RoomObjectSpriteData } from '../../../api'; -import { GetTickerTime, NitroContainer, NitroSprite } from '../../../pixi-proxy'; +import { GetTickerTime, NitroSprite } from '../../../pixi-proxy'; import { AvatarImageBodyPartContainer } from '../AvatarImageBodyPartContainer'; import { AvatarImagePartContainer } from '../AvatarImagePartContainer'; import { AvatarStructure } from '../AvatarStructure'; @@ -472,7 +473,7 @@ export class AvatarImageCache for(const data of k) data && bounds.enlarge(data.offsetRect); const point = new Point(-(bounds.x), -(bounds.y)); - const container = new NitroContainer(); + const container = new Container(); const sprite = new NitroSprite(Texture.EMPTY); diff --git a/src/nitro/camera/RoomCameraWidgetManager.ts b/src/nitro/camera/RoomCameraWidgetManager.ts index a3276d28..43b75b5b 100644 --- a/src/nitro/camera/RoomCameraWidgetManager.ts +++ b/src/nitro/camera/RoomCameraWidgetManager.ts @@ -1,8 +1,9 @@ import { Texture } from '@pixi/core'; +import { Container } from '@pixi/display'; import { ColorMatrix, ColorMatrixFilter } from '@pixi/filter-color-matrix'; import { IRoomCameraWidgetEffect, IRoomCameraWidgetManager, IRoomCameraWidgetSelectedEffect, NitroConfiguration } from '../../api'; import { NitroEventDispatcher, RoomCameraWidgetManagerEvent } from '../../events'; -import { NitroContainer, NitroSprite, TextureUtils } from '../../pixi-proxy'; +import { NitroSprite, TextureUtils } from '../../pixi-proxy'; import { RoomCameraWidgetEffect } from './RoomCameraWidgetEffect'; export class RoomCameraWidgetManager implements IRoomCameraWidgetManager @@ -49,7 +50,7 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager public async applyEffects(texture: Texture, selectedEffects: IRoomCameraWidgetSelectedEffect[], isZoomed: boolean): Promise { - const container = new NitroContainer(); + const container = new Container(); const sprite = new NitroSprite(texture); container.addChild(sprite); diff --git a/src/nitro/room/RoomMessageHandler.ts b/src/nitro/room/RoomMessageHandler.ts index 9b132f2a..70161313 100644 --- a/src/nitro/room/RoomMessageHandler.ts +++ b/src/nitro/room/RoomMessageHandler.ts @@ -1,53 +1,25 @@ import { AvatarGuideStatus, IConnection, IRoomCreator, IVector3D, LegacyDataType, ObjectRolling, PetType, RoomObjectType, RoomObjectUserType, RoomObjectVariable, Vector3d } from '../../api'; -import { Disposable } from '../../common'; import { DiceValueMessageEvent, FloorHeightMapEvent, FurnitureAliasesComposer, FurnitureAliasesEvent, FurnitureDataEvent, FurnitureFloorAddEvent, FurnitureFloorDataParser, FurnitureFloorEvent, FurnitureFloorRemoveEvent, FurnitureFloorUpdateEvent, FurnitureWallAddEvent, FurnitureWallDataParser, FurnitureWallEvent, FurnitureWallRemoveEvent, FurnitureWallUpdateEvent, GetRoomEntryDataMessageComposer, GuideSessionEndedMessageEvent, GuideSessionErrorMessageEvent, GuideSessionStartedMessageEvent, IgnoreResultEvent, ItemDataUpdateMessageEvent, ObjectsDataUpdateEvent, ObjectsRollingEvent, OneWayDoorStatusMessageEvent, PetExperienceEvent, PetFigureUpdateEvent, RoomEntryTileMessageEvent, RoomEntryTileMessageParser, RoomHeightMapEvent, RoomHeightMapUpdateEvent, RoomPaintEvent, RoomReadyMessageEvent, RoomUnitChatEvent, RoomUnitChatShoutEvent, RoomUnitChatWhisperEvent, RoomUnitDanceEvent, RoomUnitEffectEvent, RoomUnitEvent, RoomUnitExpressionEvent, RoomUnitHandItemEvent, RoomUnitIdleEvent, RoomUnitInfoEvent, RoomUnitNumberEvent, RoomUnitRemoveEvent, RoomUnitStatusEvent, RoomUnitTypingEvent, RoomVisualizationSettingsEvent, UserInfoEvent, YouArePlayingGameEvent } from '../communication'; import { RoomPlaneParser } from './object/RoomPlaneParser'; import { RoomVariableEnum } from './RoomVariableEnum'; import { FurnitureStackingHeightMap, LegacyWallGeometry } from './utils'; -export class RoomMessageHandler extends Disposable +export class RoomMessageHandler { - private _connection: IConnection; + private _connection: IConnection = null; private _roomCreator: IRoomCreator; - private _planeParser: RoomPlaneParser; - private _latestEntryTileEvent: RoomEntryTileMessageEvent; + private _planeParser: RoomPlaneParser = new RoomPlaneParser(); + private _latestEntryTileEvent: RoomEntryTileMessageEvent = null; - private _currentRoomId: number; - private _ownUserId: number; - private _initialConnection: boolean; - private _guideId: number; - private _requesterId: number; + private _currentRoomId: number = 0; + private _ownUserId: number = 0; + private _initialConnection: boolean = true; + private _guideId: number = -1; + private _requesterId: number = -1; constructor(roomCreator: IRoomCreator) { - super(); - - this._connection = null; this._roomCreator = roomCreator; - this._planeParser = new RoomPlaneParser(); - this._latestEntryTileEvent = null; - - this._currentRoomId = 0; - this._ownUserId = 0; - this._initialConnection = true; - this._guideId = -1; - this._requesterId = -1; - } - - protected onDispose(): void - { - super.onDispose(); - - this._connection = null; - this._roomCreator = null; - this._latestEntryTileEvent = null; - - if(this._planeParser) - { - this._planeParser.dispose(); - - this._planeParser = null; - } } public setConnection(connection: IConnection) diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 1e064a3e..938dea27 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -1,5 +1,4 @@ import { IFurnitureStackingHeightMap, ILegacyWallGeometry, IObjectData, IRoomCanvasMouseListener, IRoomEngineServices, IRoomGeometry, IRoomObject, IRoomObjectController, IRoomObjectEventManager, ISelectedRoomObjectData, IVector3D, MouseEventType, NitroConfiguration, NitroLogger, RoomObjectCategory, RoomObjectOperationType, RoomObjectPlacementSource, RoomObjectType, RoomObjectUserType, RoomObjectVariable, Vector3d } from '../../api'; -import { Disposable } from '../../common'; import { NitroEventDispatcher, RoomEngineDimmerStateEvent, RoomEngineObjectEvent, RoomEngineObjectPlacedEvent, RoomEngineObjectPlacedOnUserEvent, RoomEngineObjectPlaySoundEvent, RoomEngineRoomAdEvent, RoomEngineSamplePlaybackEvent, RoomEngineTriggerWidgetEvent, RoomEngineUseProductEvent, RoomObjectBadgeAssetEvent, RoomObjectDataRequestEvent, RoomObjectDimmerStateUpdateEvent, RoomObjectEvent, RoomObjectFloorHoleEvent, RoomObjectFurnitureActionEvent, RoomObjectHSLColorEnabledEvent, RoomObjectHSLColorEnableEvent, RoomObjectMouseEvent, RoomObjectMoveEvent, RoomObjectPlaySoundIdEvent, RoomObjectRoomAdEvent, RoomObjectSamplePlaybackEvent, RoomObjectSoundMachineEvent, RoomObjectStateChangedEvent, RoomObjectTileMouseEvent, RoomObjectWallMouseEvent, RoomObjectWidgetRequestEvent, RoomSpriteMouseEvent } from '../../events'; import { RoomEnterEffect, RoomId, RoomObjectUpdateMessage } from '../../room'; import { BotPlaceComposer, FurnitureColorWheelComposer, FurnitureDiceActivateComposer, FurnitureDiceDeactivateComposer, FurnitureFloorUpdateComposer, FurnitureGroupInfoComposer, FurnitureMultiStateComposer, FurnitureOneWayDoorComposer, FurniturePickupComposer, FurniturePlaceComposer, FurniturePostItPlaceComposer, FurnitureRandomStateComposer, FurnitureWallMultiStateComposer, FurnitureWallUpdateComposer, GetItemDataComposer, GetResolutionAchievementsMessageComposer, PetMoveComposer, PetPlaceComposer, RemoveWallItemComposer, RoomUnitLookComposer, RoomUnitWalkComposer, SetItemDataMessageComposer, SetObjectDataMessageComposer } from '../communication'; @@ -7,47 +6,23 @@ import { Nitro } from '../Nitro'; import { ObjectAvatarSelectedMessage, ObjectDataUpdateMessage, ObjectSelectedMessage, ObjectTileCursorUpdateMessage, ObjectVisibilityUpdateMessage } from './messages'; import { SelectedRoomObjectData } from './utils'; -export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMouseListener, IRoomObjectEventManager +export class RoomObjectEventHandler implements IRoomCanvasMouseListener, IRoomObjectEventManager { private _roomEngine: IRoomEngineServices; - private _eventIds: Map>; + private _eventIds: Map> = new Map(); - private _selectedAvatarId: number; - private _selectedObjectId: number; - private _selectedObjectCategory: number; - private _whereYouClickIsWhereYouGo: boolean; - private _objectPlacementSource: string; + private _selectedAvatarId: number = -1; + private _selectedObjectId: number = -1; + private _selectedObjectCategory: number = -2; + private _whereYouClickIsWhereYouGo: boolean = true; + private _objectPlacementSource: string = null; constructor(roomEngine: IRoomEngineServices) { - super(); - this._roomEngine = roomEngine; - this._eventIds = new Map(); - - this._selectedAvatarId = -1; - this._selectedObjectId = -1; - this._selectedObjectCategory = -2; - this._whereYouClickIsWhereYouGo = true; - this._objectPlacementSource = null; - - this.onRoomEngineObjectEvent = this.onRoomEngineObjectEvent.bind(this); - - NitroEventDispatcher.addEventListener(RoomEngineObjectEvent.ADDED, this.onRoomEngineObjectEvent); - } - - public dispose(): void - { - if(this._eventIds) - { - this._eventIds = null; - } - - NitroEventDispatcher.removeEventListener(RoomEngineObjectEvent.ADDED, this.onRoomEngineObjectEvent); - - this._roomEngine = null; + NitroEventDispatcher.addEventListener(RoomEngineObjectEvent.ADDED, event => this.onRoomEngineObjectEvent(event)); } private onRoomEngineObjectEvent(event: RoomEngineObjectEvent): void diff --git a/src/nitro/room/RoomObjectLogicFactory.ts b/src/nitro/room/RoomObjectLogicFactory.ts index 06a74f35..de5f95e0 100644 --- a/src/nitro/room/RoomObjectLogicFactory.ts +++ b/src/nitro/room/RoomObjectLogicFactory.ts @@ -1,6 +1,5 @@ import { IEventDispatcher, IRoomObjectEventHandler, IRoomObjectLogicFactory, NitroLogger, RoomObjectLogicType } from '../../api'; -import { EventDispatcher } from '../../common'; -import { RoomObjectEvent } from '../../events'; +import { EventDispatcher, RoomObjectEvent } from '../../events'; import { RoomObjectLogicBase } from '../../room'; import { AvatarLogic, FurnitureAchievementResolutionLogic, FurnitureBadgeDisplayLogic, FurnitureChangeStateWhenStepOnLogic, FurnitureClothingChangeLogic, FurnitureCounterClockLogic, FurnitureCrackableLogic, FurnitureCraftingGizmoLogic, FurnitureCreditLogic, FurnitureCuckooClockLogic, FurnitureCustomStackHeightLogic, FurnitureDiceLogic, FurnitureEcotronBoxLogic, FurnitureEditableInternalLinkLogic, FurnitureEditableRoomLinkLogic, FurnitureEffectBoxLogic, FurnitureExternalImageLogic, FurnitureFireworksLogic, FurnitureFloorHoleLogic, FurnitureGroupForumTerminalLogic, FurnitureGuildCustomizedLogic, FurnitureHabboWheelLogic, FurnitureHighScoreLogic, FurnitureHockeyScoreLogic, FurnitureHweenLovelockLogic, FurnitureIceStormLogic, FurnitureInternalLinkLogic, FurnitureJukeboxLogic, FurnitureLogic, FurnitureLoveLockLogic, FurnitureMannequinLogic, FurnitureMonsterplantSeedLogic, FurnitureMultiHeightLogic, FurnitureMultiStateLogic, FurnitureMysteryBoxLogic, FurnitureMysteryTrophyLogic, FurnitureOneWayDoorLogic, FurniturePetCustomizationLogic, FurniturePlaceholderLogic, FurniturePlanetSystemLogic, FurniturePresentLogic, FurniturePurchaseableClothingLogic, FurniturePushableLogic, FurnitureRandomStateLogic, FurnitureRandomTeleportLogic, FurnitureRentableSpaceLogic, FurnitureRoomBackgroundColorLogic, FurnitureRoomBackgroundLogic, FurnitureRoomBillboardLogic, FurnitureRoomDimmerLogic, FurnitureScoreLogic, FurnitureSongDiskLogic, FurnitureSoundBlockLogic, FurnitureSoundMachineLogic, FurnitureStickieLogic, FurnitureTrophyLogic, FurnitureVoteCounterLogic, FurnitureVoteMajorityLogic, FurnitureWelcomeGiftLogic, FurnitureWindowLogic, FurnitureYoutubeLogic, PetLogic, RoomLogic, SelectionArrowLogic, TileCursorLogic } from './object'; diff --git a/src/nitro/room/object/logic/MovingObjectLogic.ts b/src/nitro/room/object/logic/MovingObjectLogic.ts index ac3907bc..888ff24f 100644 --- a/src/nitro/room/object/logic/MovingObjectLogic.ts +++ b/src/nitro/room/object/logic/MovingObjectLogic.ts @@ -28,11 +28,11 @@ export class MovingObjectLogic extends RoomObjectLogicBase this._updateInterval = MovingObjectLogic.DEFAULT_UPDATE_INTERVAL; } - protected onDispose(): void + public dispose(): void { this._liftAmount = 0; - super.onDispose(); + super.dispose(); } public update(time: number): void diff --git a/src/nitro/room/object/logic/furniture/FurnitureEditableRoomLinkLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureEditableRoomLinkLogic.ts index f7c1eee0..6bde4957 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureEditableRoomLinkLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureEditableRoomLinkLogic.ts @@ -29,7 +29,7 @@ export class FurnitureEditableRoomLinkLogic extends FurnitureLogic } } - protected onDispose(): void + public dispose(): void { if(this._timer) { @@ -38,7 +38,7 @@ export class FurnitureEditableRoomLinkLogic extends FurnitureLogic this._timer = null; } - super.onDispose(); + super.dispose(); } private setAutomaticStateIndex(state: number): void diff --git a/src/nitro/room/object/logic/furniture/FurnitureFloorHoleLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureFloorHoleLogic.ts index 37fb6151..bed32104 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureFloorHoleLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureFloorHoleLogic.ts @@ -26,14 +26,14 @@ export class FurnitureFloorHoleLogic extends FurnitureMultiStateLogic return this.mergeTypes(super.getEventTypes(), types); } - protected onDispose(): void + public dispose(): void { if(this._currentState === FurnitureFloorHoleLogic.STATE_HOLE) { this.eventDispatcher.dispatchEvent(new RoomObjectFloorHoleEvent(RoomObjectFloorHoleEvent.REMOVE_HOLE, this.object)); } - super.onDispose(); + super.dispose(); } public update(time: number): void diff --git a/src/nitro/room/object/logic/furniture/FurnitureJukeboxLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureJukeboxLogic.ts index 3e315f20..377885ee 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureJukeboxLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureJukeboxLogic.ts @@ -23,11 +23,11 @@ export class FurnitureJukeboxLogic extends FurnitureMultiStateLogic return this.mergeTypes(super.getEventTypes(), types); } - protected onDispose(): void + public dispose(): void { this.requestDispose(); - super.onDispose(); + super.dispose(); } public processUpdateMessage(message: RoomObjectUpdateMessage): void diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index 9e82af85..140405fb 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -131,12 +131,12 @@ export class FurnitureLogic extends MovingObjectLogic model.setValue(RoomObjectVariable.FURNITURE_ALPHA_MULTIPLIER, 1); } - protected onDispose(): void + public dispose(): void { this._storedRotateMessage = null; this._directions = null; - super.onDispose(); + super.dispose(); } public setObject(object: IRoomObjectController): void diff --git a/src/nitro/room/object/logic/furniture/FurnitureRoomBackgroundColorLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRoomBackgroundColorLogic.ts index 7877388e..65612eec 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureRoomBackgroundColorLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureRoomBackgroundColorLogic.ts @@ -26,7 +26,7 @@ export class FurnitureRoomBackgroundColorLogic extends FurnitureMultiStateLogic return this.mergeTypes(super.getEventTypes(), types); } - protected onDispose(): void + public dispose(): void { if(this._roomColorUpdated) { @@ -43,7 +43,7 @@ export class FurnitureRoomBackgroundColorLogic extends FurnitureMultiStateLogic this._roomColorUpdated = false; } - super.onDispose(); + super.dispose(); } public processUpdateMessage(message: RoomObjectUpdateMessage): void diff --git a/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts index de04b420..64746d53 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts @@ -26,7 +26,7 @@ export class FurnitureRoomDimmerLogic extends FurnitureLogic return this.mergeTypes(super.getEventTypes(), types); } - protected onDispose(): void + public dispose(): void { if(this._roomColorUpdated) { @@ -44,7 +44,7 @@ export class FurnitureRoomDimmerLogic extends FurnitureLogic } } - super.onDispose(); + super.dispose(); } public processUpdateMessage(message: RoomObjectUpdateMessage): void diff --git a/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts index 70d87b29..e9679e4f 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts @@ -43,14 +43,14 @@ export class FurnitureSoundBlockLogic extends FurnitureMultiStateLogic this.object.model.setValue(RoomObjectVariable.FURNITURE_SOUNDBLOCK_RELATIVE_ANIMATION_SPEED, 1); } - protected onDispose(): void + public dispose(): void { if(this._state !== FurnitureSoundBlockLogic.STATE_UNINITIALIZED) { this.eventDispatcher.dispatchEvent(new RoomObjectSamplePlaybackEvent(RoomObjectSamplePlaybackEvent.ROOM_OBJECT_DISPOSED, this.object, this._sampleId)); } - super.onDispose(); + super.dispose(); } public processUpdateMessage(message: RoomObjectUpdateMessage): void diff --git a/src/nitro/room/object/logic/furniture/FurnitureSoundMachineLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureSoundMachineLogic.ts index fee543b7..480e50b3 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureSoundMachineLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureSoundMachineLogic.ts @@ -22,11 +22,11 @@ export class FurnitureSoundMachineLogic extends FurnitureMultiStateLogic return this.mergeTypes(super.getEventTypes(), types); } - protected onDispose(): void + public dispose(): void { this.requestDispose(); - super.onDispose(); + super.dispose(); } public processUpdateMessage(message: RoomObjectUpdateMessage): void diff --git a/src/nitro/room/object/visualization/avatar/AvatarVisualizationData.ts b/src/nitro/room/object/visualization/avatar/AvatarVisualizationData.ts index d24e20e3..273a2f67 100644 --- a/src/nitro/room/object/visualization/avatar/AvatarVisualizationData.ts +++ b/src/nitro/room/object/visualization/avatar/AvatarVisualizationData.ts @@ -1,22 +1,16 @@ import { Resource, Texture } from '@pixi/core'; import { AvatarScaleType, IAssetData, IAvatarEffectListener, IAvatarImage, IAvatarImageListener, IAvatarRenderManager, IObjectVisualizationData } from '../../../../../api'; -import { Disposable } from '../../../../../common'; -export class AvatarVisualizationData extends Disposable implements IObjectVisualizationData +export class AvatarVisualizationData implements IObjectVisualizationData { private _avatarRenderer: IAvatarRenderManager; - constructor() - { - super(); - } - public initialize(asset: IAssetData): boolean { return true; } - public onDispose(): void + public dispose(): void { this._avatarRenderer = null; } diff --git a/src/nitro/room/object/visualization/furniture/IsometricImageFurniVisualization.ts b/src/nitro/room/object/visualization/furniture/IsometricImageFurniVisualization.ts index ad157382..6e5bd9d5 100644 --- a/src/nitro/room/object/visualization/furniture/IsometricImageFurniVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/IsometricImageFurniVisualization.ts @@ -1,6 +1,6 @@ import { Matrix, Resource, Texture } from '@pixi/core'; import { IGraphicAsset } from '../../../../../api'; -import { NitroSprite, NitroTexture, TextureUtils } from '../../../../../pixi-proxy'; +import { NitroSprite, TextureUtils } from '../../../../../pixi-proxy'; import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization'; export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualization @@ -95,7 +95,7 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza if(this._hasOutline) { const container = new NitroSprite(); - const background = new NitroSprite(NitroTexture.WHITE); + const background = new NitroSprite(Texture.WHITE); background.tint = 0x000000; background.width = (texture.width + 40); diff --git a/src/nitro/room/object/visualization/pet/ExperienceData.ts b/src/nitro/room/object/visualization/pet/ExperienceData.ts index 535c7ff4..f318d61c 100644 --- a/src/nitro/room/object/visualization/pet/ExperienceData.ts +++ b/src/nitro/room/object/visualization/pet/ExperienceData.ts @@ -1,7 +1,8 @@ import { RenderTexture, Resource, Texture } from '@pixi/core'; +import { Container } from '@pixi/display'; import { Sprite } from '@pixi/sprite'; import { Text } from '@pixi/text'; -import { NitroContainer, NitroSprite, PixiApplicationProxy, TextureUtils } from '../../../../../pixi-proxy'; +import { NitroSprite, PixiApplicationProxy, TextureUtils } from '../../../../../pixi-proxy'; export class ExperienceData { @@ -22,7 +23,7 @@ export class ExperienceData { if(!this._sprite || (this._amount === amount)) return null; - const container = new NitroContainer(); + const container = new Container(); container.addChild(this._sprite); diff --git a/src/nitro/room/object/visualization/room/RoomVisualizationData.ts b/src/nitro/room/object/visualization/room/RoomVisualizationData.ts index 749c2ee8..93498200 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualizationData.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualizationData.ts @@ -1,26 +1,14 @@ import { IAssetData, IGraphicAssetCollection, IObjectVisualizationData } from '../../../../../api'; -import { Disposable } from '../../../../../common'; import { PlaneMaskManager } from './mask'; import { FloorRasterizer, LandscapeRasterizer, WallRasterizer } from './rasterizer'; -export class RoomVisualizationData extends Disposable implements IObjectVisualizationData +export class RoomVisualizationData implements IObjectVisualizationData { - private _wallRasterizer: WallRasterizer; - private _floorRasterizer: FloorRasterizer; - private _landscapeRasterizer: LandscapeRasterizer; - private _maskManager: PlaneMaskManager; - private _initialized: boolean; - - constructor() - { - super(); - - this._wallRasterizer = new WallRasterizer(); - this._floorRasterizer = new FloorRasterizer(); - this._landscapeRasterizer = new LandscapeRasterizer(); - this._maskManager = new PlaneMaskManager(); - this._initialized = false; - } + private _wallRasterizer: WallRasterizer = new WallRasterizer(); + private _floorRasterizer: FloorRasterizer = new FloorRasterizer(); + private _landscapeRasterizer: LandscapeRasterizer = new LandscapeRasterizer(); + private _maskManager: PlaneMaskManager = new PlaneMaskManager(); + private _initialized: boolean = false; public initialize(asset: IAssetData): boolean { @@ -45,7 +33,7 @@ export class RoomVisualizationData extends Disposable implements IObjectVisualiz return true; } - protected onDispose(): void + public dispose(): void { if(this._wallRasterizer) { @@ -74,8 +62,6 @@ export class RoomVisualizationData extends Disposable implements IObjectVisualiz this._maskManager = null; } - - super.onDispose(); } public setGraphicAssetCollection(collection: IGraphicAssetCollection): void diff --git a/src/nitro/session/badge/BadgeImageManager.ts b/src/nitro/session/badge/BadgeImageManager.ts index 98e2761b..852a6f12 100644 --- a/src/nitro/session/badge/BadgeImageManager.ts +++ b/src/nitro/session/badge/BadgeImageManager.ts @@ -1,7 +1,8 @@ import { Resource, Texture } from '@pixi/core'; +import { Container } from '@pixi/display'; import { IAssetManager, IDisposable, IMessageEvent, NitroConfiguration } from '../../../api'; import { BadgeImageReadyEvent, NitroEventDispatcher } from '../../../events'; -import { NitroContainer, NitroSprite, NitroTexture, TextureUtils } from '../../../pixi-proxy'; +import { NitroSprite, TextureUtils } from '../../../pixi-proxy'; import { GroupBadgePartsEvent } from '../../communication'; import { SessionDataManager } from './../SessionDataManager'; import { BadgeInfo } from './BadgeInfo'; @@ -186,8 +187,8 @@ export class BadgeImageManager implements IDisposable private renderGroupBadge(groupBadge: GroupBadge): void { - const container = new NitroContainer(); - const tempSprite = new NitroSprite(NitroTexture.EMPTY); + const container = new Container(); + const tempSprite = new NitroSprite(Texture.EMPTY); tempSprite.width = GroupBadgePart.IMAGE_WIDTH; tempSprite.height = GroupBadgePart.IMAGE_HEIGHT; diff --git a/src/pixi-proxy/NitroPolygon.ts b/src/pixi-proxy/NitroPolygon.ts deleted file mode 100644 index f0dcd566..00000000 --- a/src/pixi-proxy/NitroPolygon.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Polygon } from '@pixi/core'; - -export class NitroPolygon extends Polygon -{} diff --git a/src/pixi-proxy/NitroSpritesheet.ts b/src/pixi-proxy/NitroSpritesheet.ts deleted file mode 100644 index 25fdfce7..00000000 --- a/src/pixi-proxy/NitroSpritesheet.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Spritesheet } from '@pixi/spritesheet'; - -export class NitroSpritesheet extends Spritesheet -{} diff --git a/src/pixi-proxy/index.ts b/src/pixi-proxy/index.ts index cdd2e6c7..77de13b9 100644 --- a/src/pixi-proxy/index.ts +++ b/src/pixi-proxy/index.ts @@ -8,11 +8,9 @@ export * from './NitroBaseTexture'; export * from './NitroContainer'; export * from './NitroFilter'; export * from './NitroPoint'; -export * from './NitroPolygon'; export * from './NitroRectangle'; export * from './NitroRenderTexture'; export * from './NitroSprite'; -export * from './NitroSpritesheet'; export * from './NitroTexture'; export * from './PaletteMapFilter'; export * from './PixiApplicationProxy'; diff --git a/src/room/object/visualization/RoomObjectSpriteVisualization.ts b/src/room/object/visualization/RoomObjectSpriteVisualization.ts index 9db7fd85..d6272602 100644 --- a/src/room/object/visualization/RoomObjectSpriteVisualization.ts +++ b/src/room/object/visualization/RoomObjectSpriteVisualization.ts @@ -1,6 +1,7 @@ import { Point, Rectangle, RenderTexture } from '@pixi/core'; +import { Container } from '@pixi/display'; import { IGraphicAssetCollection, IObjectVisualizationData, IRoomGeometry, IRoomObjectController, IRoomObjectSprite, IRoomObjectSpriteVisualization, RoomObjectSpriteData } from '../../../api'; -import { NitroContainer, NitroSprite, TextureUtils } from '../../../pixi-proxy'; +import { NitroSprite, TextureUtils } from '../../../pixi-proxy'; import { RoomObjectSprite } from './RoomObjectSprite'; export class RoomObjectSpriteVisualization implements IRoomObjectSpriteVisualization @@ -147,7 +148,7 @@ export class RoomObjectSpriteVisualization implements IRoomObjectSpriteVisualiza return b.relativeDepth - a.relativeDepth; }); - const container = new NitroContainer(); + const container = new Container(); index = 0; diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 4cc4283d..b5ac1708 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -1,11 +1,11 @@ import { Matrix, Point, Rectangle, RenderTexture } from '@pixi/core'; -import { Container, DisplayObject } from '@pixi/display'; +import { Container } from '@pixi/display'; import { Graphics } from '@pixi/graphics'; import { Sprite } from '@pixi/sprite'; import { IRoomCanvasMouseListener, IRoomGeometry, IRoomObject, IRoomObjectSprite, IRoomObjectSpriteVisualization, IRoomRenderingCanvas, IRoomSpriteCanvasContainer, IRoomSpriteMouseEvent, MouseEventType, RoomObjectSpriteData, RoomObjectSpriteType, Vector3d } from '../../api'; import { RoomSpriteMouseEvent } from '../../events'; import { Nitro } from '../../nitro/Nitro'; -import { GetTicker, NitroContainer, NitroSprite, PixiApplicationProxy } from '../../pixi-proxy'; +import { GetTicker, NitroSprite, PixiApplicationProxy } from '../../pixi-proxy'; import { RoomEnterEffect, RoomGeometry, RoomRotatingEffect, RoomShakingEffect } from '../utils'; import { RoomObjectCache, RoomObjectCacheItem } from './cache'; import { ExtendedSprite, ObjectMouseData, SortableSprite } from './utils'; @@ -127,7 +127,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if(!this._display) { - const display = new NitroContainer(); + const display = new Container(); this._master.addChild(display); @@ -1200,12 +1200,12 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas return this._geometry; } - public get master(): DisplayObject + public get master(): Sprite { return this._master; } - public get display(): DisplayObject + public get display(): Container { return this._display; }