From 6e1c16ce064fee5eb0335d5cb308b4e4404b0753 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 8 May 2021 17:00:08 -0500 Subject: [PATCH 001/155] _Str_20330 -> processRoomCanvasMouseEvent --- src/nitro/room/RoomObjectEventHandler.ts | 2 +- src/room/renderer/IRoomCanvasMouseListener.ts | 4 ++-- src/room/renderer/RoomSpriteCanvas.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 58a20147..66a8b265 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -147,7 +147,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - public _Str_20330(event: RoomSpriteMouseEvent, object: IRoomObject, geometry: IRoomGeometry): void + public processRoomCanvasMouseEvent(event: RoomSpriteMouseEvent, object: IRoomObject, geometry: IRoomGeometry): void { if(!event || !object) return; diff --git a/src/room/renderer/IRoomCanvasMouseListener.ts b/src/room/renderer/IRoomCanvasMouseListener.ts index e12f2002..ad32882a 100644 --- a/src/room/renderer/IRoomCanvasMouseListener.ts +++ b/src/room/renderer/IRoomCanvasMouseListener.ts @@ -4,5 +4,5 @@ import { IRoomGeometry } from '../utils/IRoomGeometry'; export interface IRoomCanvasMouseListener { - _Str_20330(event: RoomSpriteMouseEvent, object: IRoomObject, geometry: IRoomGeometry): void -} \ No newline at end of file + processRoomCanvasMouseEvent(event: RoomSpriteMouseEvent, object: IRoomObject, geometry: IRoomGeometry): void +} diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index e9b25172..5f03729e 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -961,7 +961,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if(this._mouseListener) { - this._mouseListener._Str_20330(event, roomObject, this._geometry); + this._mouseListener.processRoomCanvasMouseEvent(event, roomObject, this._geometry); } else { From 5693b6f558b9ba8775419706d20c3f97f8e0f2e7 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 8 May 2021 18:17:01 -0500 Subject: [PATCH 002/155] cleaned up Rasterizer --- .../room/rasterizer/basic/PlaneRasterizer.ts | 4 ++-- src/room/utils/Rasterizer.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) 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 61a601bd..ceacb8fc 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -256,7 +256,7 @@ export class PlaneRasterizer implements IPlaneRasterizer if(asset.flipH) { - newTexture = Rasterizer._Str_16640(texture); + newTexture = Rasterizer.getFlipHBitmapData(texture); } plane._Str_16790(newTexture, normalMinX, normalMaxX, normalMinY, normalMaxY, assetName); @@ -606,4 +606,4 @@ export class PlaneRasterizer implements IPlaneRasterizer return planes._Str_8988(); } -} \ No newline at end of file +} diff --git a/src/room/utils/Rasterizer.ts b/src/room/utils/Rasterizer.ts index 091e29a5..0e3a4a94 100644 --- a/src/room/utils/Rasterizer.ts +++ b/src/room/utils/Rasterizer.ts @@ -61,7 +61,7 @@ export class Rasterizer // k.unlock(); // } - public static _Str_16640(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 _Str_20706(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 _Str_20356(k: Texture): Texture + public static getFlipHVBitmapData(k: Texture): Texture { if(!k) return null; @@ -126,4 +126,4 @@ export class Rasterizer return TextureUtils.generateTexture(graphic); } -} \ No newline at end of file +} From 67eb04635fab1a571c6a9ce6710e986790187714 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 8 May 2021 18:29:07 -0500 Subject: [PATCH 003/155] PointMath cleanup --- src/room/utils/PointMath.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/room/utils/PointMath.ts b/src/room/utils/PointMath.ts index aaa112e2..376204c3 100644 --- a/src/room/utils/PointMath.ts +++ b/src/room/utils/PointMath.ts @@ -7,13 +7,13 @@ export class PointMath return new Point((k.x + _arg_2.x), (k.y + _arg_2.y)); } - public static _Str_15193(k: Point, _arg_2: Point): Point + public static sub(k: Point, _arg_2: Point): Point { return new Point((k.x - _arg_2.x), (k.y - _arg_2.y)); } - public static _Str_6038(k: Point, _arg_2: number): Point + public static mul(k: Point, _arg_2: number): Point { return new Point((k.x * _arg_2), (k.y * _arg_2)); } -} \ No newline at end of file +} From 2bbf980a8115af8dfce7ba2810f70152ce23544a Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 8 May 2021 18:54:33 -0500 Subject: [PATCH 004/155] cleanup NumberBank --- src/nitro/room/RoomEngine.ts | 12 ++++++------ src/room/utils/NumberBank.ts | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 0433a9e2..9b27a9bd 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2750,7 +2750,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato { if(!this._roomContentLoader || (id === -1)) return; - this._thumbnailObjectIdBank._Str_15187((id - 1)); + this._thumbnailObjectIdBank.freeNumber((id - 1)); const listeners = this._thumbnailCallbacks.get(assetName); @@ -3013,7 +3013,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!roomInstance) return imageResult; } - let objectId = this._imageObjectIdBank._Str_19709(); + let objectId = this._imageObjectIdBank.reserveNumber(); const objectCategory = this.getRoomObjectCategoryForType(type); if(objectId < 0) return imageResult; @@ -3124,7 +3124,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato { roomInstance.removeRoomObject(objectId, objectCategory); - this._imageObjectIdBank._Str_15187((objectId - 1)); + this._imageObjectIdBank.freeNumber((objectId - 1)); imageResult.id = 0; } @@ -3153,7 +3153,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!roomInstance) return imageResult; } - let objectId = this._thumbnailObjectIdBank._Str_19709(); + let objectId = this._thumbnailObjectIdBank.reserveNumber(); const objectCategory = this.getRoomObjectCategoryForType(type); if(objectId < 0) return imageResult; @@ -3190,7 +3190,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato imageResult.image = asset; } - this._thumbnailObjectIdBank._Str_15187((objectId - 1)); + this._thumbnailObjectIdBank.freeNumber((objectId - 1)); imageResult.id = 0; } @@ -3246,7 +3246,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato roomInstance.removeRoomObject(objectId, objectCategory); - this._imageObjectIdBank._Str_15187((objectId - 1)); + this._imageObjectIdBank.freeNumber((objectId - 1)); const imageListeners = this._imageCallbacks.get(objectId.toString()); diff --git a/src/room/utils/NumberBank.ts b/src/room/utils/NumberBank.ts index a9cca763..631f5374 100644 --- a/src/room/utils/NumberBank.ts +++ b/src/room/utils/NumberBank.ts @@ -26,7 +26,7 @@ this._freeNumbers = null; } - public _Str_19709(): number + public reserveNumber(): number { if(this._freeNumbers.length > 0) { @@ -40,7 +40,7 @@ return -1; } - public _Str_15187(k: number): void + public freeNumber(k: number): void { const i = this._reservedNumbers.indexOf(k); @@ -51,4 +51,4 @@ this._freeNumbers.push(k); } } -} \ No newline at end of file +} From 128da52d81a1e33cb686745fcaa1d1b6190ad4c1 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 8 May 2021 19:00:57 -0500 Subject: [PATCH 005/155] cleaned ColorConverter --- src/nitro/room/object/logic/room/RoomLogic.ts | 4 ++-- src/room/utils/ColorConverter.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nitro/room/object/logic/room/RoomLogic.ts b/src/nitro/room/object/logic/room/RoomLogic.ts index 762f11db..0add56a8 100644 --- a/src/nitro/room/object/logic/room/RoomLogic.ts +++ b/src/nitro/room/object/logic/room/RoomLogic.ts @@ -163,10 +163,10 @@ export class RoomLogic extends RoomObjectLogicBase this._Str_3576 = newColor; } - let _local_5 = ColorConverter._Str_22130(color); + let _local_5 = ColorConverter.rgbToHSL(color); _local_5 = ((_local_5 & 0xFFFF00) + newColor); - color = ColorConverter._Str_13949(_local_5); + color = ColorConverter.hslToRGB(_local_5); if(this.object.model) this.object.model.setValue(RoomObjectVariable.ROOM_BACKGROUND_COLOR, color); } diff --git a/src/room/utils/ColorConverter.ts b/src/room/utils/ColorConverter.ts index 81563d95..2c86a4dd 100644 --- a/src/room/utils/ColorConverter.ts +++ b/src/room/utils/ColorConverter.ts @@ -42,7 +42,7 @@ export class ColorConverter return 'rgba(' + [r, g, b, 1].join(',') + ')'; } - public static _Str_22130(k: number): number + public static rgbToHSL(k: number): number { const _local_2: number = (((k >> 16) & 0xFF) / 0xFF); const _local_3: number = (((k >> 8) & 0xFF) / 0xFF); @@ -108,7 +108,7 @@ export class ColorConverter return _local_14; } - public static _Str_13949(k: number): number + public static hslToRGB(k: number): number { let _local_12: number; let _local_13: number; @@ -285,7 +285,7 @@ export class ColorConverter return new Vector3d((((_local_2 * 0.4124) + (_local_3 * 0.3576)) + (_local_4 * 0.1805)), (((_local_2 * 0.2126) + (_local_3 * 0.7152)) + (_local_4 * 0.0722)), (((_local_2 * 0.0193) + (_local_3 * 0.1192)) + (_local_4 * 0.9505))); } - public static _Str_22784(k:IVector3D):IVector3D + public static xyz2CieLab(k:IVector3D):IVector3D { let _local_2: number = (k.x / 95.047); let _local_3: number = (k.y / 100); @@ -319,6 +319,6 @@ export class ColorConverter public static rgb2CieLab(k: number):IVector3D { - return ColorConverter._Str_22784(ColorConverter.rgb2xyz(k)); + return ColorConverter.xyz2CieLab(ColorConverter.rgb2xyz(k)); } } From a6f8bb4d542da0fb2ee1ce88a01b9c64bdb4e18b Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 8 May 2021 19:09:57 -0500 Subject: [PATCH 006/155] cleanup SortableSprite --- src/room/renderer/utils/SortableSprite.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/room/renderer/utils/SortableSprite.ts b/src/room/renderer/utils/SortableSprite.ts index cbe34c72..f220a94d 100644 --- a/src/room/renderer/utils/SortableSprite.ts +++ b/src/room/renderer/utils/SortableSprite.ts @@ -3,7 +3,7 @@ import { ISortableSprite } from '../../object/visualization/ISortableSprite'; export class SortableSprite implements ISortableSprite { - public static _Str_17154: number = 100000000; + public static Z_INFINITY: number = 100000000; private _name: string; private _sprite: IRoomObjectSprite; @@ -24,7 +24,7 @@ export class SortableSprite implements ISortableSprite public dispose(): void { - this._z = -(SortableSprite._Str_17154); + this._z = -(SortableSprite.Z_INFINITY); this._sprite = null; } @@ -77,4 +77,4 @@ export class SortableSprite implements ISortableSprite { this._z = z; } -} \ No newline at end of file +} From 9ed63945a43fec463bb9eb29c7a1e4bc2f8c3968 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 8 May 2021 19:31:05 -0500 Subject: [PATCH 007/155] cleaned RoomObjectSprite --- .../avatar/AvatarVisualization.ts | 8 +++--- .../furniture/FurnitureVisualization.ts | 2 +- .../object/visualization/IRoomObjectSprite.ts | 6 ++-- .../object/visualization/RoomObjectSprite.ts | 28 +++++++++---------- src/room/renderer/RoomSpriteCanvas.ts | 10 +++---- src/room/renderer/utils/ExtendedSprite.ts | 12 ++++---- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts index 8eea44c9..62efb7d1 100644 --- a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts +++ b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts @@ -1052,18 +1052,18 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement if(scale < 48) { - sprite._Str_3582 = 'sh_std_sd_1_0_0'; + sprite.libraryAssetName = 'sh_std_sd_1_0_0'; - this._shadow = this._avatarImage.getAsset(sprite._Str_3582); + this._shadow = this._avatarImage.getAsset(sprite.libraryAssetName); offsetX = -8; offsetY = ((this._canStandUp) ? 6 : -3); } else { - sprite._Str_3582 = 'h_std_sd_1_0_0'; + sprite.libraryAssetName = 'h_std_sd_1_0_0'; - this._shadow = this._avatarImage.getAsset(sprite._Str_3582); + this._shadow = this._avatarImage.getAsset(sprite.libraryAssetName); offsetX = -17; offsetY = ((this._canStandUp) ? 10 : -7); diff --git a/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts index 22463980..6cdecc42 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts @@ -318,7 +318,7 @@ export class FurnitureVisualization extends RoomObjectSpriteVisualization sprite.relativeDepth = (relativeDepth * FurnitureVisualization.DEPTH_MULTIPLIER); sprite.name = assetName; - sprite._Str_3582 = this.getLibraryAssetNameForSprite(assetData, sprite); + sprite.libraryAssetName = this.getLibraryAssetNameForSprite(assetData, sprite); sprite.posture = this.getPostureForAsset(scale, assetData.source); sprite.clickHandling = false; } diff --git a/src/room/object/visualization/IRoomObjectSprite.ts b/src/room/object/visualization/IRoomObjectSprite.ts index de50bf6a..f3d7b1b1 100644 --- a/src/room/object/visualization/IRoomObjectSprite.ts +++ b/src/room/object/visualization/IRoomObjectSprite.ts @@ -19,8 +19,8 @@ export interface IRoomObjectSprite blendMode: number; color: number; relativeDepth: number; - _Str_4593: boolean; - _Str_3582: string; + varyingDepth: boolean; + libraryAssetName: string; clickHandling: boolean; visible: boolean; tag: string; @@ -29,4 +29,4 @@ export interface IRoomObjectSprite filters: Filter[]; updateCounter: number; updateContainer: boolean; -} \ No newline at end of file +} diff --git a/src/room/object/visualization/RoomObjectSprite.ts b/src/room/object/visualization/RoomObjectSprite.ts index 386b71cc..0777cd6b 100644 --- a/src/room/object/visualization/RoomObjectSprite.ts +++ b/src/room/object/visualization/RoomObjectSprite.ts @@ -26,8 +26,8 @@ export class RoomObjectSprite implements IRoomObjectSprite private _blendMode: number; private _color: number; private _relativeDepth: number; - private _Str_8253: boolean; - private _Str_11397: string; + private _varyingDepth: boolean; + private _libraryAssetName: string; private _clickHandling: boolean; private _visible: boolean; private _tag: string; @@ -59,8 +59,8 @@ export class RoomObjectSprite implements IRoomObjectSprite this._blendMode = BLEND_MODES.NORMAL; this._color = 0xFFFFFF; this._relativeDepth = 0; - this._Str_8253 = false; - this._Str_11397 = ''; + this._varyingDepth = false; + this._libraryAssetName = ''; this._clickHandling = false; this._visible = true; this._tag = ''; @@ -303,28 +303,28 @@ export class RoomObjectSprite implements IRoomObjectSprite this._updateCounter++; } - public get _Str_4593(): boolean + public get varyingDepth(): boolean { - return this._Str_8253; + return this._varyingDepth; } - public set _Str_4593(flag: boolean) + public set varyingDepth(flag: boolean) { - if(flag === this._Str_8253) return; + if(flag === this._varyingDepth) return; - this._Str_8253 = flag; + this._varyingDepth = flag; this._updateCounter++; } - public get _Str_3582(): string + public get libraryAssetName(): string { - return this._Str_11397; + return this._libraryAssetName; } - public set _Str_3582(value: string) + public set libraryAssetName(value: string) { - this._Str_11397 = value; + this._libraryAssetName = value; } public get clickHandling(): boolean @@ -419,4 +419,4 @@ export class RoomObjectSprite implements IRoomObjectSprite { this._updateContainer = flag; } -} \ No newline at end of file +} diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 5f03729e..1cce93c6 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -512,7 +512,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if((sprite.spriteType === RoomObjectSpriteType._Str_11629) || (sprite.spriteType === RoomObjectSpriteType._Str_10494)) { - sortableSprite.sprite._Str_3582 = 'avatar_' + object.id; + sortableSprite.sprite.libraryAssetName = 'avatar_' + object.id; } sortableSprite.x = (spriteX - this._screenOffsetX); @@ -564,9 +564,9 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if(!objectSprite || !extendedSprite) return false; - if(extendedSprite._Str_4593 !== objectSprite._Str_4593) + if(extendedSprite.varyingDepth !== objectSprite.varyingDepth) { - if(extendedSprite._Str_4593 && !objectSprite._Str_4593) + if(extendedSprite.varyingDepth && !objectSprite.varyingDepth) { this._display.removeChildAt(index); @@ -585,7 +585,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas extendedSprite.tag = objectSprite.tag; extendedSprite.alphaTolerance = objectSprite.alphaTolerance; extendedSprite.name = sprite.name; - extendedSprite._Str_4593 = objectSprite._Str_4593; + extendedSprite.varyingDepth = objectSprite.varyingDepth; extendedSprite.clickHandling = objectSprite.clickHandling; extendedSprite.filters = objectSprite.filters; @@ -663,7 +663,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas extendedSprite.offsetX = sprite.offsetX; extendedSprite.offsetY = sprite.offsetY; extendedSprite.name = sprite.name; - extendedSprite._Str_4593 = sprite._Str_4593; + extendedSprite.varyingDepth = sprite.varyingDepth; extendedSprite.clickHandling = sprite.clickHandling; extendedSprite.blendMode = sprite.blendMode; extendedSprite.filters = sprite.filters; diff --git a/src/room/renderer/utils/ExtendedSprite.ts b/src/room/renderer/utils/ExtendedSprite.ts index 9b6ad263..aceeed9b 100644 --- a/src/room/renderer/utils/ExtendedSprite.ts +++ b/src/room/renderer/utils/ExtendedSprite.ts @@ -7,7 +7,7 @@ export class ExtendedSprite extends Sprite private _offsetY: number; private _tag: string; private _alphaTolerance: number; - private _Str_8253: boolean; + private _varyingDepth: boolean; private _clickHandling: boolean; private _pairedSpriteId: number; @@ -21,7 +21,7 @@ export class ExtendedSprite extends Sprite this._offsetY = 0; this._tag = ''; this._alphaTolerance = 128; - this._Str_8253 = false; + this._varyingDepth = false; this._clickHandling = false; this._pairedSpriteId = -1; @@ -219,14 +219,14 @@ export class ExtendedSprite extends Sprite this._alphaTolerance = tolerance; } - public get _Str_4593(): boolean + public get varyingDepth(): boolean { - return this._Str_8253; + return this._varyingDepth; } - public set _Str_4593(flag: boolean) + public set varyingDepth(flag: boolean) { - this._Str_8253 = flag; + this._varyingDepth = flag; } public get clickHandling(): boolean From 2721da03b794c1a6af754ad40ce619a88926b413 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 9 May 2021 02:17:20 -0500 Subject: [PATCH 008/155] _Str_1577 -> objectId --- src/nitro/session/IRoomSession.ts | 2 +- src/nitro/session/RoomSession.ts | 4 ++-- src/nitro/session/events/RoomSessionPetPackageEvent.ts | 2 +- src/room/renderer/RoomSpriteCanvas.ts | 2 +- src/room/renderer/cache/RoomObjectCache.ts | 4 ++-- src/room/renderer/cache/RoomObjectCacheItem.ts | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/nitro/session/IRoomSession.ts b/src/nitro/session/IRoomSession.ts index 6a8116a6..20341709 100644 --- a/src/nitro/session/IRoomSession.ts +++ b/src/nitro/session/IRoomSession.ts @@ -5,7 +5,7 @@ import { UserDataManager } from './UserDataManager'; export interface IRoomSession extends IDisposable { - openGift(_Str_1577: number): void; + openGift(objectId: number): void; setConnection(connection: IConnection): void; setControllerLevel(level: number): void; setOwnRoomIndex(roomIndex: number): void; diff --git a/src/nitro/session/RoomSession.ts b/src/nitro/session/RoomSession.ts index 61d43077..87239c33 100644 --- a/src/nitro/session/RoomSession.ts +++ b/src/nitro/session/RoomSession.ts @@ -257,9 +257,9 @@ export class RoomSession extends Disposable implements IRoomSession this._connection.send(new MoodlightSettingsComposer()); } - public openGift(_Str_1577: number): void + public openGift(objectId: number): void { - this._connection.send(new OpenPresentComposer(_Str_1577)); + this._connection.send(new OpenPresentComposer(objectId)); } public get connection(): IConnection diff --git a/src/nitro/session/events/RoomSessionPetPackageEvent.ts b/src/nitro/session/events/RoomSessionPetPackageEvent.ts index 845f19d6..72f06e43 100644 --- a/src/nitro/session/events/RoomSessionPetPackageEvent.ts +++ b/src/nitro/session/events/RoomSessionPetPackageEvent.ts @@ -21,7 +21,7 @@ export class RoomSessionPetPackageEvent extends RoomSessionEvent this._nameValidationInfo = _arg_6; } - public get _Str_1577(): number + public get objectId(): number { return this._objectId; } diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 1cce93c6..28021979 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -429,7 +429,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas } const cache = this.getCacheItem(identifier); - cache._Str_1577 = object.instanceId; + cache.objectId = object.instanceId; const locationCache = cache.location; const sortableCache = cache.sprites; diff --git a/src/room/renderer/cache/RoomObjectCache.ts b/src/room/renderer/cache/RoomObjectCache.ts index 66af0995..c080769c 100644 --- a/src/room/renderer/cache/RoomObjectCache.ts +++ b/src/room/renderer/cache/RoomObjectCache.ts @@ -79,7 +79,7 @@ export class RoomObjectCache { const data = new RoomObjectSpriteData(); - data.objectId = item._Str_1577; + data.objectId = item.objectId; data.x = sprite.x; data.y = sprite.y; data.z = sprite.z; @@ -145,4 +145,4 @@ export class RoomObjectCache return sprites; } -} \ No newline at end of file +} diff --git a/src/room/renderer/cache/RoomObjectCacheItem.ts b/src/room/renderer/cache/RoomObjectCacheItem.ts index 8bcc0afe..9b2dfffe 100644 --- a/src/room/renderer/cache/RoomObjectCacheItem.ts +++ b/src/room/renderer/cache/RoomObjectCacheItem.ts @@ -40,13 +40,13 @@ export class RoomObjectCacheItem } } - public get _Str_1577(): number + public get objectId(): number { return this._objectId; } - public set _Str_1577(k:number) + public set objectId(k:number) { this._objectId = k; } -} \ No newline at end of file +} From 7b446c50746afd830694295fa0936cfbcf528944 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 9 May 2021 02:23:18 -0500 Subject: [PATCH 009/155] _Str_3008 -> spriteCount --- src/nitro/room/utils/SpriteDataCollector.ts | 6 +++--- src/room/renderer/RoomSpriteCanvas.ts | 2 +- .../renderer/cache/RoomObjectSortableSpriteCacheItem.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/nitro/room/utils/SpriteDataCollector.ts b/src/nitro/room/utils/SpriteDataCollector.ts index 07607bb6..e8f2c264 100644 --- a/src/nitro/room/utils/SpriteDataCollector.ts +++ b/src/nitro/room/utils/SpriteDataCollector.ts @@ -19,7 +19,7 @@ export class SpriteDataCollector private static _Str_17558: number = 30; private _Str_6409: number; - private _Str_3008: number = 0; + private spriteCount: number = 0; private _Str_18433: number = 0; private static _Str_22230(k: RoomObjectSpriteData[], _arg_2: RoomEngine): RoomObjectSpriteData[] @@ -197,7 +197,7 @@ export class SpriteDataCollector if(!this._Str_6409) this._Str_6409 = _local_9.z; - this._Str_3008++; + this.spriteCount++; } } @@ -319,7 +319,7 @@ export class SpriteDataCollector _local_9 = ((this._Str_6409) ? this._Str_6409 : 0); } - _local_9 = (_local_9 + ((this._Str_3008 * 1.776104) + (_arg_3.length * 2.31743))); + _local_9 = (_local_9 + ((this.spriteCount * 1.776104) + (_arg_3.length * 2.31743))); const _local_10 = new PlaneDrawingData(null, _arg_2); diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 28021979..fafd9c78 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -449,7 +449,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if(!sortableCache._Str_17574(visualization.instanceId, visualization.updateSpriteCounter) && !update) { - return sortableCache._Str_3008; + return sortableCache.spriteCount; } let x = vector.x; diff --git a/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts b/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts index 808c3680..c4b78d1b 100644 --- a/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts +++ b/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts @@ -15,7 +15,7 @@ export class RoomObjectSortableSpriteCacheItem this._isEmpty = false; } - public get _Str_3008(): number + public get spriteCount(): number { return this._sprites.length; } @@ -75,4 +75,4 @@ export class RoomObjectSortableSpriteCacheItem this._isEmpty = (this._sprites.length) ? false : true; } -} \ No newline at end of file +} From f5fee23147da0326583cfe36109f0a997cc7283d Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 9 May 2021 02:25:33 -0500 Subject: [PATCH 010/155] _Str_12937 -> addSprite --- src/room/renderer/RoomSpriteCanvas.ts | 2 +- src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index fafd9c78..4c09710f 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -501,7 +501,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas { sortableSprite = new SortableSprite(); - sortableCache._Str_12937(sortableSprite); + sortableCache.addSprite(sortableSprite); this._sortableSprites.push(sortableSprite); diff --git a/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts b/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts index c4b78d1b..8b5c0c2b 100644 --- a/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts +++ b/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts @@ -30,7 +30,7 @@ export class RoomObjectSortableSpriteCacheItem this._Str_20276(0); } - public _Str_12937(sprite: SortableSprite): void + public addSprite(sprite: SortableSprite): void { this._sprites.push(sprite); } From 19d028e8da12ec94c4915ba9931dc250fd88bd86 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 9 May 2021 02:29:43 -0500 Subject: [PATCH 011/155] cleanup RoomObjectSortableSpriteCacheItem --- src/room/renderer/RoomSpriteCanvas.ts | 6 +++--- src/room/renderer/cache/RoomObjectCache.ts | 4 ++-- .../cache/RoomObjectSortableSpriteCacheItem.ts | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 4c09710f..4aabceb9 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -447,7 +447,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if(locationCache.locationChanged) update = true; - if(!sortableCache._Str_17574(visualization.instanceId, visualization.updateSpriteCounter) && !update) + if(!sortableCache.needsUpdate(visualization.instanceId, visualization.updateSpriteCounter) && !update) { return sortableCache.spriteCount; } @@ -495,7 +495,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if(!this.isSpriteVisible(spriteX, spriteY, texture.width, texture.height)) continue; } - let sortableSprite = sortableCache._Str_2505(spriteCount); + let sortableSprite = sortableCache.getSprite(spriteCount); if(!sortableSprite) { @@ -523,7 +523,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas count++; } - sortableCache._Str_20276(spriteCount); + sortableCache.setSpriteCount(spriteCount); this._canvasUpdated = true; diff --git a/src/room/renderer/cache/RoomObjectCache.ts b/src/room/renderer/cache/RoomObjectCache.ts index c080769c..8c39578d 100644 --- a/src/room/renderer/cache/RoomObjectCache.ts +++ b/src/room/renderer/cache/RoomObjectCache.ts @@ -67,7 +67,7 @@ export class RoomObjectCache { if(!item) continue; - const sprites = item.sprites && item.sprites._Str_9272; + const sprites = item.sprites && item.sprites.sprites; if(!sprites || !sprites.length) continue; @@ -137,7 +137,7 @@ export class RoomObjectCache for(const item of this._data.values()) { - for(const sprite of item.sprites._Str_9272) + for(const sprite of item.sprites.sprites) { if(sprite.sprite.spriteType === RoomObjectSpriteType._Str_8616) sprites.push(sprite); } diff --git a/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts b/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts index 8b5c0c2b..e90db65d 100644 --- a/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts +++ b/src/room/renderer/cache/RoomObjectSortableSpriteCacheItem.ts @@ -27,7 +27,7 @@ export class RoomObjectSortableSpriteCacheItem public dispose(): void { - this._Str_20276(0); + this.setSpriteCount(0); } public addSprite(sprite: SortableSprite): void @@ -35,17 +35,17 @@ export class RoomObjectSortableSpriteCacheItem this._sprites.push(sprite); } - public _Str_2505(k: number): SortableSprite + public getSprite(k: number): SortableSprite { return this._sprites[k]; } - public get _Str_9272(): SortableSprite[] + public get sprites(): SortableSprite[] { return this._sprites; } - public _Str_17574(k: number, _arg_2: number): boolean + public needsUpdate(k: number, _arg_2: number): boolean { if((k === this._updateId1) && (_arg_2 === this._updateId2)) return false; @@ -55,7 +55,7 @@ export class RoomObjectSortableSpriteCacheItem return true; } - public _Str_20276(k: number): void + public setSpriteCount(k: number): void { if(k < this._sprites.length) { From 4e54c9155429385d7c93a5f1e10a4fa80e4f2b60 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 9 May 2021 02:51:27 -0500 Subject: [PATCH 012/155] clean AvatarFigureContainer --- src/nitro/avatar/AvatarAssetDownloadManager.ts | 4 ++-- src/nitro/avatar/AvatarFigureContainer.ts | 18 +++++++++--------- src/nitro/avatar/AvatarRenderManager.ts | 12 ++++++------ src/nitro/avatar/AvatarStructure.ts | 6 +++--- src/nitro/avatar/IAvatarFigureContainer.ts | 14 +++++++------- src/nitro/utils/FigureDataContainer.ts | 4 ++-- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/nitro/avatar/AvatarAssetDownloadManager.ts b/src/nitro/avatar/AvatarAssetDownloadManager.ts index c69d75ee..0e865672 100644 --- a/src/nitro/avatar/AvatarAssetDownloadManager.ts +++ b/src/nitro/avatar/AvatarAssetDownloadManager.ts @@ -240,7 +240,7 @@ export class AvatarAssetDownloadManager extends EventDispatcher if(!figureData) return pendingLibraries; - const setKeys = container._Str_1016(); + const setKeys = container.getPartTypeIds(); for(const key of setKeys) { @@ -284,7 +284,7 @@ export class AvatarAssetDownloadManager extends EventDispatcher return; } - const figure = container._Str_1008(); + const figure = container.getFigureString(); const pendingLibraries = this.getAvatarFigurePendingLibraries(container); if(pendingLibraries && pendingLibraries.length) diff --git a/src/nitro/avatar/AvatarFigureContainer.ts b/src/nitro/avatar/AvatarFigureContainer.ts index 8b0fc32c..7055e141 100644 --- a/src/nitro/avatar/AvatarFigureContainer.ts +++ b/src/nitro/avatar/AvatarFigureContainer.ts @@ -11,12 +11,12 @@ export class AvatarFigureContainer implements IAvatarFigureContainer this.parseFigure(figure); } - public _Str_1016(): IterableIterator + public getPartTypeIds(): IterableIterator { return this.partSets().keys(); } - public _Str_744(k: string): boolean + public hasPartType(k: string): boolean { return this.partSets().get(k) !== null; } @@ -30,7 +30,7 @@ export class AvatarFigureContainer implements IAvatarFigureContainer return existing.get('setid'); } - public _Str_815(k: string): number[] + public getPartColorIds(k: string): number[] { const existing = this.partSets().get(k); @@ -39,7 +39,7 @@ export class AvatarFigureContainer implements IAvatarFigureContainer return existing.get('colorids'); } - public _Str_830(k: string, _arg_2: number, _arg_3: number[]): void + public updatePart(k: string, _arg_2: number, _arg_3: number[]): void { const set: Map = new Map(); @@ -53,12 +53,12 @@ export class AvatarFigureContainer implements IAvatarFigureContainer existingSets.set(k, set); } - public _Str_923(k: string): void + public removePart(k: string): void { this.partSets().delete(k); } - public _Str_1008(): string + public getFigureString(): string { const parts: string[] = []; @@ -71,7 +71,7 @@ export class AvatarFigureContainer implements IAvatarFigureContainer setParts.push(key); setParts.push(this.getPartSetId(key)); - setParts = setParts.concat(this._Str_815(key)); + setParts = setParts.concat(this.getPartColorIds(key)); parts.push(setParts.join('-')); } @@ -109,8 +109,8 @@ export class AvatarFigureContainer implements IAvatarFigureContainer index++; } - this._Str_830(type, setId, colors); + this.updatePart(type, setId, colors); } } } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/AvatarRenderManager.ts b/src/nitro/avatar/AvatarRenderManager.ts index ea201067..58c7af97 100644 --- a/src/nitro/avatar/AvatarRenderManager.ts +++ b/src/nitro/avatar/AvatarRenderManager.ts @@ -316,13 +316,13 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa for(const id of typeIds) { - if(!container._Str_744(id)) + if(!container.hasPartType(id)) { const figurePartSet = this._structure._Str_2264(id, gender); if(figurePartSet) { - container._Str_830(id, figurePartSet.id, [0]); + container.updatePart(id, figurePartSet.id, [0]); isValid = true; } @@ -341,7 +341,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa if(partSet) { - container._Str_830(id, partSet.id, [0]); + container.updatePart(id, partSet.id, [0]); isValid = true; } @@ -359,7 +359,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa if(!this._structure) return 0; const figureData = this._structure.figureData; - const parts = Array.from(container._Str_1016()); + const parts = Array.from(container.getPartTypeIds()); let clubLevel = 0; @@ -374,7 +374,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa clubLevel = Math.max(partSet.clubLevel, clubLevel); const palette = figureData._Str_783(set._Str_734); - const colors = container._Str_815(part); + const colors = container.getPartColorIds(part); for(const colorId of colors) { @@ -418,7 +418,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa container._Str_2088(partSet.type, partSet.id, container.getColourIds(partSet.type)); } - return container._Str_1008(); + return container.getFigureString(); } private _Str_1667(k: number[]): IFigurePartSet[] diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index df60a542..5ace993a 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -153,7 +153,7 @@ export class AvatarStructure extends EventDispatcher public _Str_867(k: IAvatarFigureContainer, _arg_2: string, _arg_3: number = 0): IPartColor { - const _local_4 = k._Str_815(_arg_2); + const _local_4 = k.getPartColorIds(_arg_2); if((!(_local_4)) || (_local_4.length < _arg_3)) return null; @@ -388,7 +388,7 @@ export class AvatarStructure extends EventDispatcher } const _local_16 = this._geometry._Str_713(_arg_4, k, _arg_5, _local_9, _arg_7); - const _local_21 = _arg_2._Str_1016(); + const _local_21 = _arg_2.getPartTypeIds(); for(const _local_17 of _local_21) { @@ -398,7 +398,7 @@ export class AvatarStructure extends EventDispatcher } const _local_28 = _arg_2.getPartSetId(_local_17); - const _local_29 = _arg_2._Str_815(_local_17); + const _local_29 = _arg_2.getPartColorIds(_local_17); const _local_30 = this._figureData._Str_740(_local_17); diff --git a/src/nitro/avatar/IAvatarFigureContainer.ts b/src/nitro/avatar/IAvatarFigureContainer.ts index 4a9cbbb3..6e118061 100644 --- a/src/nitro/avatar/IAvatarFigureContainer.ts +++ b/src/nitro/avatar/IAvatarFigureContainer.ts @@ -1,10 +1,10 @@ export interface IAvatarFigureContainer { - _Str_1016(): IterableIterator; - _Str_744(_arg_1: string): boolean; + getPartTypeIds(): IterableIterator; + hasPartType(_arg_1: string): boolean; getPartSetId(_arg_1: string): number; - _Str_815(_arg_1: string): number[]; - _Str_830(_arg_1: string, _arg_2: number, _arg_3: number[]): void; - _Str_923(_arg_1: string): void; - _Str_1008(): string; -} \ No newline at end of file + getPartColorIds(_arg_1: string): number[]; + updatePart(_arg_1: string, _arg_2: number, _arg_3: number[]): void; + removePart(_arg_1: string): void; + getFigureString(): string; +} diff --git a/src/nitro/utils/FigureDataContainer.ts b/src/nitro/utils/FigureDataContainer.ts index 96f666e8..fb7422b3 100644 --- a/src/nitro/utils/FigureDataContainer.ts +++ b/src/nitro/utils/FigureDataContainer.ts @@ -98,7 +98,7 @@ return []; } - public _Str_1008(): string + public getFigureString(): string { let figure = ''; @@ -238,4 +238,4 @@ { return this._gender; } -} \ No newline at end of file +} From a8f789324805b1ee840941e936476836c4ff0b4a Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 12 May 2021 03:43:45 -0500 Subject: [PATCH 013/155] cleaned AvatarImageBodyPartContainer --- src/nitro/avatar/AvatarImage.ts | 20 +++++++++---------- .../avatar/AvatarImageBodyPartContainer.ts | 16 +++++++-------- src/nitro/avatar/cache/AvatarImageCache.ts | 8 ++++---- src/nitro/avatar/cache/ImageData.ts | 4 ++-- src/nitro/avatar/structure/AvatarCanvas.ts | 4 ++-- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index 75477903..40f6a207 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -358,17 +358,17 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener return null; } - isCachable = ((isCachable) && (part._Str_1807)); + isCachable = ((isCachable) && (part.isCacheable)); - const point = part._Str_1076.clone(); + const point = part.regPoint.clone(); if(point) { point.x += avatarCanvas.offset.x; point.y += avatarCanvas.offset.y; - point.x += avatarCanvas._Str_1076.x; - point.y += avatarCanvas._Str_1076.y; + point.x += avatarCanvas.regPoint.x; + point.y += avatarCanvas.regPoint.y; const partContainer = new Container(); @@ -477,15 +477,15 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener return null; } - const point = part._Str_1076.clone(); + const point = part.regPoint.clone(); if(point) { point.x += avatarCanvas.offset.x; point.y += avatarCanvas.offset.y; - point.x += avatarCanvas._Str_1076.x; - point.y += avatarCanvas._Str_1076.y; + point.x += avatarCanvas.regPoint.x; + point.y += avatarCanvas.regPoint.y; const partContainer = new Container(); @@ -542,15 +542,15 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener return null; } - const point = part._Str_1076.clone(); + const point = part.regPoint.clone(); if(point) { point.x += avatarCanvas.offset.x; point.y += avatarCanvas.offset.y; - point.x += avatarCanvas._Str_1076.x; - point.y += avatarCanvas._Str_1076.y; + point.x += avatarCanvas.regPoint.x; + point.y += avatarCanvas.regPoint.y; const partContainer = new Container(); diff --git a/src/nitro/avatar/AvatarImageBodyPartContainer.ts b/src/nitro/avatar/AvatarImageBodyPartContainer.ts index 941ea6dc..a4efc020 100644 --- a/src/nitro/avatar/AvatarImageBodyPartContainer.ts +++ b/src/nitro/avatar/AvatarImageBodyPartContainer.ts @@ -15,7 +15,7 @@ export class AvatarImageBodyPartContainer this._regPoint = _arg_2; this._isCacheable = _arg_3; - this._Str_1225(); + this.cleanPoints(); } public dispose(): void @@ -32,7 +32,7 @@ export class AvatarImageBodyPartContainer this._offset = null; } - private _Str_1225(): void + private cleanPoints(): void { // this._regPoint.x = this._regPoint.x; // this._regPoint.y = this._regPoint.y; @@ -40,11 +40,11 @@ export class AvatarImageBodyPartContainer // this._offset.y = this._offset.y; } - public _Str_1387(k: Point): void + public setRegPoint(k: Point): void { this._regPoint = k; - this._Str_1225(); + this.cleanPoints(); } public get image(): Container @@ -64,7 +64,7 @@ export class AvatarImageBodyPartContainer this._image = k; } - public get _Str_1076(): Point + public get regPoint(): Point { const clone = this._regPoint.clone(); @@ -78,11 +78,11 @@ export class AvatarImageBodyPartContainer { this._offset = k; - this._Str_1225(); + this.cleanPoints(); } - public get _Str_1807(): boolean + public get isCacheable(): boolean { return this._isCacheable; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index 67222342..61f27e70 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -280,7 +280,7 @@ export class AvatarImageCache if(_local_14 && !_arg_3) { - if(_local_14._Str_1807) _local_13._Str_1924(_local_14, frameCount); + if(_local_14.isCacheable) _local_13._Str_1924(_local_14, frameCount); } else { @@ -443,7 +443,7 @@ export class AvatarImageCache const imageData = this._Str_1236(this._unionImages, isFlipped); const canvasOffset = ((this._scale === AvatarScaleType.LARGE) ? (this._canvas.height - 16) : (this._canvas.height - 8)); - const offset = new Point(-(imageData._Str_1076.x), (canvasOffset - imageData._Str_1076.y)); + const offset = new Point(-(imageData.regPoint.x), (canvasOffset - imageData.regPoint.y)); if(isFlipped && (assetPartDefinition !== 'lay')) offset.x = (offset.x + ((this._scale === AvatarScaleType.LARGE) ? 67 : 31)); @@ -496,8 +496,8 @@ export class AvatarImageCache const flipH = (!(isFlipped && data.flipH) && (isFlipped || data.flipH)); const regPoint = point.clone(); - regPoint.x -= data._Str_1076.x; - regPoint.y -= data._Str_1076.y; + regPoint.x -= data.regPoint.x; + regPoint.y -= data.regPoint.y; if(isFlipped) regPoint.x = (container.width - (regPoint.x + data.rect.width)); diff --git a/src/nitro/avatar/cache/ImageData.ts b/src/nitro/avatar/cache/ImageData.ts index 6f478d5b..6b58e784 100644 --- a/src/nitro/avatar/cache/ImageData.ts +++ b/src/nitro/avatar/cache/ImageData.ts @@ -43,7 +43,7 @@ export class ImageData return this._rect; } - public get _Str_1076(): Point + public get regPoint(): Point { return this._regPoint; } @@ -62,4 +62,4 @@ export class ImageData { return new Rectangle(-(this._regPoint.x), -(this._regPoint.y), this._rect.width, this._rect.height); } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/AvatarCanvas.ts b/src/nitro/avatar/structure/AvatarCanvas.ts index b47a79e9..3e539afa 100644 --- a/src/nitro/avatar/structure/AvatarCanvas.ts +++ b/src/nitro/avatar/structure/AvatarCanvas.ts @@ -40,8 +40,8 @@ export class AvatarCanvas return this._id; } - public get _Str_1076(): Point + public get regPoint(): Point { return this._regPoint; } -} \ No newline at end of file +} From ed6eafb26aca36d7e92650973c79415836971234 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 12 May 2021 03:55:21 -0500 Subject: [PATCH 014/155] cleaned AvatarImagePartContainer --- src/nitro/avatar/AvatarImagePartContainer.ts | 22 +++++++++---------- src/nitro/avatar/AvatarStructure.ts | 2 +- src/nitro/avatar/cache/AvatarImageCache.ts | 14 ++++++------ .../avatar/cache/AvatarImageDirectionCache.ts | 4 ++-- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/nitro/avatar/AvatarImagePartContainer.ts b/src/nitro/avatar/AvatarImagePartContainer.ts index d11eddf0..7dec4bc8 100644 --- a/src/nitro/avatar/AvatarImagePartContainer.ts +++ b/src/nitro/avatar/AvatarImagePartContainer.ts @@ -34,7 +34,7 @@ export class AvatarImagePartContainer if(this._partType === 'ey') this._isColorable = false; } - public _Str_1674(k: number): number + public getFrameIndex(k: number): number { if(!this._frames || !this._frames.length) return 0; @@ -48,7 +48,7 @@ export class AvatarImagePartContainer return frameNumber; } - public _Str_2258(k: number): AvatarAnimationFrame + public getFrameDefinition(k: number): AvatarAnimationFrame { const frameNumber = (k % this._frames.length); @@ -63,7 +63,7 @@ export class AvatarImagePartContainer return null; } - public _Str_1206(k: number): string + public getCacheableKey(k: number): string { const frameNumber = (k % this._frames.length); @@ -73,24 +73,24 @@ export class AvatarImagePartContainer { const frame = this._frames[frameNumber]; - return (this._Str_1502 + ':' + frame._Str_778 + ':' + frame.number); + return (this.partId + ':' + frame._Str_778 + ':' + frame.number); } } - return (this._Str_1502 + ':' + frameNumber); + return (this.partId + ':' + frameNumber); } - public get _Str_1360(): string + public get bodyPartId(): string { return this._bodyPartId; } - public get _Str_1669(): string + public get partType(): string { return this._partType; } - public get _Str_1502(): string + public get partId(): string { return this._partId; } @@ -115,17 +115,17 @@ export class AvatarImagePartContainer this._isColorable = k; } - public get _Str_1406(): number + public get paletteMapId(): number { return this._paletteMapId; } - public get _Str_1666(): string + public get flippedPartType(): string { return this._flippedPartType; } - public get _Str_1184(): boolean + public get isBlendable(): boolean { return this._isBlendable; } diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index 5ace993a..71b11be3 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -474,7 +474,7 @@ export class AvatarStructure extends EventDispatcher for(const _local_23 of _local_11) { - if(_local_23._Str_1669 === _local_12) + if(_local_23.partType === _local_12) { if(_local_40) { diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index 61f27e70..39b1d97e 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -341,14 +341,14 @@ export class AvatarImageCache let color = 16777215; - if(!((direction == 7) && ((container._Str_1669 === 'fc') || (container._Str_1669 === 'ey')))) + if(!((direction == 7) && ((container.partType === 'fc') || (container.partType === 'ey')))) { - if(!((container._Str_1669 === 'ri') && !container._Str_1502)) + if(!((container.partType === 'ri') && !container.partId)) { - const partId = container._Str_1502; - const animationFrame = container._Str_2258(frameCount); + const partId = container.partId; + const animationFrame = container.getFrameDefinition(frameCount); - let partType = container._Str_1669; + let partType = container.partType; let frameNumber = 0; if(animationFrame) @@ -357,7 +357,7 @@ export class AvatarImageCache if((animationFrame._Str_778) && (animationFrame._Str_778 !== '')) assetPartDefinition = animationFrame._Str_778; } - else frameNumber = container._Str_1674(frameCount); + else frameNumber = container.getFrameIndex(frameCount); let assetDirection = direction; let flipH = false; @@ -374,7 +374,7 @@ export class AvatarImageCache else if(direction === 5) assetDirection = 1; else if(direction === 6) assetDirection = 0; - if(container._Str_1666 !== partType) partType = container._Str_1666; + if(container.flippedPartType !== partType) partType = container.flippedPartType; } } diff --git a/src/nitro/avatar/cache/AvatarImageDirectionCache.ts b/src/nitro/avatar/cache/AvatarImageDirectionCache.ts index c78d56aa..36441239 100644 --- a/src/nitro/avatar/cache/AvatarImageDirectionCache.ts +++ b/src/nitro/avatar/cache/AvatarImageDirectionCache.ts @@ -48,7 +48,7 @@ export class AvatarImageDirectionCache { let name = ''; - for(const part of this._partList) name += (part._Str_1206(k) + '/'); + for(const part of this._partList) name += (part.getCacheableKey(k) + '/'); return name; } @@ -56,4 +56,4 @@ export class AvatarImageDirectionCache private _Str_587(k: string): void { } -} \ No newline at end of file +} From 97a2cde086ecf23f5426f6f11917e81854190b82 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 12 May 2021 04:04:13 -0500 Subject: [PATCH 015/155] cleaned SpriteDataContainer --- src/nitro/avatar/animation/ISpriteDataContainer.ts | 12 ++++++------ src/nitro/avatar/animation/SpriteDataContainer.ts | 10 +++++----- .../visualization/avatar/AvatarVisualization.ts | 14 +++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/nitro/avatar/animation/ISpriteDataContainer.ts b/src/nitro/avatar/animation/ISpriteDataContainer.ts index 2dc43444..97df7158 100644 --- a/src/nitro/avatar/animation/ISpriteDataContainer.ts +++ b/src/nitro/avatar/animation/ISpriteDataContainer.ts @@ -6,9 +6,9 @@ export interface ISpriteDataContainer id: string; ink: number; member: string; - _Str_949: boolean; - _Str_767: boolean; - _Str_809(_arg_1: number): number; - _Str_739(_arg_1: number): number; - _Str_839(_arg_1: number): number; -} \ No newline at end of file + hasDirections: boolean; + hasStaticY: boolean; + getDirectionOffsetX(_arg_1: number): number; + getDirectionOffsetY(_arg_1: number): number; + getDirectionOffsetZ(_arg_1: number): number; +} diff --git a/src/nitro/avatar/animation/SpriteDataContainer.ts b/src/nitro/avatar/animation/SpriteDataContainer.ts index eece75bd..c4c03dee 100644 --- a/src/nitro/avatar/animation/SpriteDataContainer.ts +++ b/src/nitro/avatar/animation/SpriteDataContainer.ts @@ -43,21 +43,21 @@ export class SpriteDataContainer implements ISpriteDataContainer } } - public _Str_809(k: number): number + public getDirectionOffsetX(k: number): number { if(k < this._dx.length) return this._dx[k]; return 0; } - public _Str_739(k: number): number + public getDirectionOffsetY(k: number): number { if(k < this._dy.length) return this._dy[k]; return 0; } - public _Str_839(k: number): number + public getDirectionOffsetZ(k: number): number { if(k < this._dz.length) return this._dz[k]; @@ -84,12 +84,12 @@ export class SpriteDataContainer implements ISpriteDataContainer return this._member; } - public get _Str_949(): boolean + public get hasDirections(): boolean { return this._hasDirections; } - public get _Str_767(): boolean + public get hasStaticY(): boolean { return this._hasStaticY; } diff --git a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts index 62efb7d1..76bb3bde 100644 --- a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts +++ b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts @@ -365,8 +365,8 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement { const layerData = this._avatarImage.getLayerData(spriteData); - let offsetX = spriteData._Str_809(direction); - let offsetY = spriteData._Str_739(direction); + let offsetX = spriteData.getDirectionOffsetX(direction); + let offsetY = spriteData.getDirectionOffsetY(direction); if(layerData) { @@ -399,12 +399,12 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement const layerData = this._avatarImage.getLayerData(spriteData); let frameNumber = 0; - let offsetX = spriteData._Str_809(direction); - let offsetY = spriteData._Str_739(direction); - const offsetZ = spriteData._Str_839(direction); + let offsetX = spriteData.getDirectionOffsetX(direction); + let offsetY = spriteData.getDirectionOffsetY(direction); + const offsetZ = spriteData.getDirectionOffsetZ(direction); let dd = 0; - if(spriteData._Str_949) dd = direction; + if(spriteData.hasDirections) dd = direction; if(layerData) { @@ -437,7 +437,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement sprite.offsetY = (asset.offsetY + offsetY); sprite.flipH = asset.flipH; - if(spriteData._Str_767) + if(spriteData.hasStaticY) { sprite.offsetY += ((this._verticalOffset * scale) / (2 * AvatarVisualization._Str_12370)); } From cf80e57cd7ee32d38886766c4a8f833e06cdc68b Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 15 May 2021 03:35:06 -0500 Subject: [PATCH 016/155] cleaned up PartDefinition --- src/nitro/avatar/AvatarStructure.ts | 16 +++++++-------- .../avatar/structure/parts/PartDefinition.ts | 20 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index 71b11be3..bc95c8fa 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -99,8 +99,8 @@ export class AvatarStructure extends EventDispatcher if(this._partSetsData.parse(k)) { - this._partSetsData._Str_1102('ri')._Str_1583 = true; - this._partSetsData._Str_1102('li')._Str_1583 = true; + this._partSetsData._Str_1102('ri').appendToFigure = true; + this._partSetsData._Str_1102('li').appendToFigure = true; return true; } @@ -292,9 +292,9 @@ export class AvatarStructure extends EventDispatcher _local_12.setType = _local_13.id; const _local_10 = this._partSetsData._Str_1520(_local_12); - _local_10._Str_1583 = true; + _local_10.appendToFigure = true; - if(_local_13.base === '') _local_10._Str_1734 = 1; + if(_local_13.base === '') _local_10.staticId = 1; if(_local_4.indexOf(_local_6.id) === -1) _local_4.push(_local_6.id); } @@ -443,7 +443,7 @@ export class AvatarStructure extends EventDispatcher const _local_13 = this._partSetsData._Str_1102(_local_33.type); - let _local_35 = (!_local_13) ? _local_33.type : _local_13._Str_1693; + let _local_35 = (!_local_13) ? _local_33.type : _local_13.flippedSetType; if(!_local_35 || (_local_35 === '')) _local_35 = _local_33.type; @@ -543,7 +543,7 @@ export class AvatarStructure extends EventDispatcher let _local_45 = false; let _local_46 = 1; - if(_local_13._Str_1583) + if(_local_13.appendToFigure) { let _local_47 = '1'; @@ -552,9 +552,9 @@ export class AvatarStructure extends EventDispatcher _local_47 = _arg_3._Str_727; } - if(_local_13._Str_2234()) + if(_local_13.hasStaticId()) { - _local_47 = _local_13._Str_1734.toString(); + _local_47 = _local_13.staticId.toString(); } if(_local_10 != null) diff --git a/src/nitro/avatar/structure/parts/PartDefinition.ts b/src/nitro/avatar/structure/parts/PartDefinition.ts index 305ce47b..607503ec 100644 --- a/src/nitro/avatar/structure/parts/PartDefinition.ts +++ b/src/nitro/avatar/structure/parts/PartDefinition.ts @@ -17,48 +17,48 @@ export class PartDefinition this._staticId = -1; } - public _Str_2234(): boolean + public hasStaticId(): boolean { return this._staticId >= 0; } - public get _Str_1734(): number + public get staticId(): number { return this._staticId; } - public set _Str_1734(k: number) + public set staticId(k: number) { this._staticId = k; } - public get _Str_2174(): string + public get setType(): string { return this._setType; } - public get _Str_1693(): string + public get flippedSetType(): string { return this._flippedSetType; } - public set _Str_1693(type: string) + public set flippedSetType(type: string) { this._flippedSetType = type; } - public get _Str_1209(): string + public get removeSetType(): string { return this._removeSetType; } - public get _Str_1583(): boolean + public get appendToFigure(): boolean { return this._appendToFigure; } - public set _Str_1583(flag: boolean) + public set appendToFigure(flag: boolean) { this._appendToFigure = flag; } -} \ No newline at end of file +} From b9cb3203da4828cbcabb154db0f486350a5bbb3d Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 15 May 2021 03:43:18 -0500 Subject: [PATCH 017/155] cleaned AvatarRenderManager --- src/nitro/avatar/AvatarRenderManager.ts | 6 +++--- src/nitro/avatar/IAvatarRenderManager.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nitro/avatar/AvatarRenderManager.ts b/src/nitro/avatar/AvatarRenderManager.ts index 58c7af97..fa7fc07e 100644 --- a/src/nitro/avatar/AvatarRenderManager.ts +++ b/src/nitro/avatar/AvatarRenderManager.ts @@ -411,7 +411,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa container._Str_2153(k, _arg_2); - const partSets: IFigurePartSet[] = this._Str_1667(_arg_3); + const partSets: IFigurePartSet[] = this.resolveFigureSets(_arg_3); for(const partSet of partSets) { @@ -421,7 +421,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa return container.getFigureString(); } - private _Str_1667(k: number[]): IFigurePartSet[] + private resolveFigureSets(k: number[]): IFigurePartSet[] { const structure = this.structureData; const partSets: IFigurePartSet[] = []; @@ -436,7 +436,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa return partSets; } - public _Str_838(k: string, _arg_2: number): string[] + public getMandatoryAvatarPartSetIds(k: string, _arg_2: number): string[] { if(!this._structure) return null; diff --git a/src/nitro/avatar/IAvatarRenderManager.ts b/src/nitro/avatar/IAvatarRenderManager.ts index ac3f3fed..3bee9b2b 100644 --- a/src/nitro/avatar/IAvatarRenderManager.ts +++ b/src/nitro/avatar/IAvatarRenderManager.ts @@ -18,11 +18,11 @@ export interface IAvatarRenderManager extends INitroManager getFigureClubLevel(container: IAvatarFigureContainer, gender: string, searchParts: string[]): number; isValidFigureSetForGender(setId: number, gender: string): boolean; getFigureStringWithFigureIds(k: string, _arg_2: string, _arg_3: number[]): string; - _Str_838(k: string, _arg_2: number): string[]; + getMandatoryAvatarPartSetIds(k: string, _arg_2: number): string[]; getAssetByName(name: string): IGraphicAsset; assets: IAssetManager; isReady: boolean; structure: AvatarStructure; structureData: IStructureData; downloadManager: AvatarAssetDownloadManager; -} \ No newline at end of file +} From cb983ed7105c618fd1f94f4fb3439683fe429c25 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 15 May 2021 04:50:18 -0500 Subject: [PATCH 018/155] cleaned RoomPlane --- src/nitro/room/object/RoomPlaneData.ts | 6 +- src/nitro/room/object/RoomPlaneParser.ts | 6 +- .../object/visualization/room/RoomPlane.ts | 558 +++++++++--------- .../visualization/room/RoomVisualization.ts | 32 +- .../room/mask/PlaneMaskManager.ts | 4 +- .../room/rasterizer/basic/PlaneRasterizer.ts | 4 +- src/nitro/room/utils/SpriteDataCollector.ts | 8 +- src/room/object/visualization/IRoomPlane.ts | 8 +- 8 files changed, 313 insertions(+), 313 deletions(-) diff --git a/src/nitro/room/object/RoomPlaneData.ts b/src/nitro/room/object/RoomPlaneData.ts index e9f8f4c7..d8d483c6 100644 --- a/src/nitro/room/object/RoomPlaneData.ts +++ b/src/nitro/room/object/RoomPlaneData.ts @@ -104,12 +104,12 @@ export class RoomPlaneData return this._loc; } - public get _Str_5424(): IVector3D + public get leftSide(): IVector3D { return this._leftSide; } - public get _Str_4968(): IVector3D + public get rightSide(): IVector3D { return this._rightSide; } @@ -199,4 +199,4 @@ export class RoomPlaneData } return -1; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/RoomPlaneParser.ts b/src/nitro/room/object/RoomPlaneParser.ts index 827a8a16..e104325c 100644 --- a/src/nitro/room/object/RoomPlaneParser.ts +++ b/src/nitro/room/object/RoomPlaneParser.ts @@ -1385,7 +1385,7 @@ export class RoomPlaneParser if(!planeData) return null; - return planeData._Str_5424; + return planeData.leftSide; } public getPlaneRightSide(k: number): IVector3D @@ -1396,7 +1396,7 @@ export class RoomPlaneParser if(!planeData) return null; - return planeData._Str_4968; + return planeData.rightSide; } public getPlaneNormalDirection(k: number): IVector3D @@ -1697,4 +1697,4 @@ export class RoomPlaneParser { this._restrictedScale = scale; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 95e5626c..e12273a3 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -25,67 +25,67 @@ export class RoomPlane implements IRoomPlane private static _uniqueIdCounter: number = 1; private _disposed: boolean; - private _Str_16308: number; - private _Str_5221: Vector3d; + private _randomSeed: number; + private _origin: Vector3d; private _location: Vector3d; - private _Str_2920: Vector3d; - private _Str_2943: Vector3d; + private _leftSide: Vector3d; + private _rightSide: Vector3d; private _normal: Vector3d; - private _Str_5886: Vector3d[]; - private _Str_3406: number; + private _secondaryNormals: Vector3d[]; + private _geometryUpdateId: number; private _type: number; - private _Str_3816: boolean; - private _Str_1049: Graphics; - private _Str_13946: boolean; + private _isVisible: boolean; + private _bitmapData: Graphics; + private _hasTexture: boolean; private _offset: Point; private _relativeDepth: number; private _color: number; private _rasterizer: IPlaneRasterizer; - private _Str_4795: PlaneMaskManager = null; - private _Str_576: string; + private _maskManager: PlaneMaskManager = null; + private _id: string; private _uniqueId: number; - private _Str_20541: number; - private _Str_19707: number; - private _Str_21079: number; - private _Str_22024: number; - private _Str_2708: Map; - private _Str_5545: PlaneBitmapData; - private _Str_4542: boolean; - private _Str_4047: RoomPlaneBitmapMask[]; - private _Str_5088: RoomPlaneRectangleMask[]; - private _Str_4891: boolean; - private _Str_2730: Graphics; - private _Str_8341: RoomPlaneBitmapMask[]; - private _Str_14495: RoomPlaneRectangleMask[]; - private _Str_2820:Vector3d; - private _Str_2745:Vector3d; - private _Str_2639:Vector3d; - private _Str_2766:Vector3d; - private _Str_1720: number = 0; + private _textureOffsetX: number; + private _textureOffsetY: number; + private _textureMaxX: number; + private _textureMaxY: number; + private _textures: Map; + private _activeTexture: PlaneBitmapData; + private _useMask: boolean; + private _bitmapMasks: RoomPlaneBitmapMask[]; + private _rectangleMasks: RoomPlaneRectangleMask[]; + private _maskChanged: boolean; + private _maskBitmapData: Graphics; + private _bitmapMasksOld: RoomPlaneBitmapMask[]; + private _rectangleMasksOld: RoomPlaneRectangleMask[]; + private _cornerA:Vector3d; + private _cornerB:Vector3d; + private _cornerC:Vector3d; + private _cornerD:Vector3d; + private _width: number = 0; private _height: number = 0; - private _Str_7367: boolean; + private _canBeVisible: boolean; constructor(k: IVector3D, _arg_2: IVector3D, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: number, _arg_6: boolean, _arg_7: IVector3D[], _arg_8: number, _arg_9: number=0, _arg_10: number=0, _arg_11: number=0, _arg_12: number=0) { - this._Str_5886 = []; - this._Str_4047 = []; - this._Str_5088 = []; - this._Str_8341 = []; - this._Str_14495 = []; - this._Str_16308 = _arg_8; - this._Str_1049 = null; - this._Str_2730 = null; - this._Str_4891 = false; - this._Str_5545 = null; - this._Str_5221 = new Vector3d(); - this._Str_5221.assign(k); + this._secondaryNormals = []; + this._bitmapMasks = []; + this._rectangleMasks = []; + this._bitmapMasksOld = []; + this._rectangleMasksOld = []; + this._randomSeed = _arg_8; + this._bitmapData = null; + this._maskBitmapData = null; + this._maskChanged = false; + this._activeTexture = null; + this._origin = new Vector3d(); + this._origin.assign(k); this._location = new Vector3d(); this._location.assign(_arg_2); - this._Str_2920 = new Vector3d(); - this._Str_2920.assign(_arg_3); - this._Str_2943 = new Vector3d(); - this._Str_2943.assign(_arg_4); - this._normal = Vector3d.crossProduct(this._Str_2920, this._Str_2943); + this._leftSide = new Vector3d(); + this._leftSide.assign(_arg_3); + this._rightSide = new Vector3d(); + this._rightSide.assign(_arg_4); + this._normal = Vector3d.crossProduct(this._leftSide, this._rightSide); if(this._normal.length > 0) { this._normal.multiply((1 / this._normal.length)); @@ -100,32 +100,32 @@ export class RoomPlane implements IRoomPlane vector.assign(entry); - this._Str_5886.push(vector); + this._secondaryNormals.push(vector); } } this._disposed = false; - this._Str_3816 = false; - this._Str_576 = null; - this._Str_13946 = true; - this._Str_3406 = -1; + this._isVisible = false; + this._id = null; + this._hasTexture = true; + this._geometryUpdateId = -1; this._offset = new Point(); this._relativeDepth = 0; this._type = _arg_5; this._color = 0; this._rasterizer = null; - this._Str_7367 = true; - this._Str_2708 = new Map(); - this._Str_2820 = new Vector3d(); - this._Str_2745 = new Vector3d(); - this._Str_2639 = new Vector3d(); - this._Str_2766 = new Vector3d(); - this._Str_1720 = 0; + this._canBeVisible = true; + this._textures = new Map(); + this._cornerA = new Vector3d(); + this._cornerB = new Vector3d(); + this._cornerC = new Vector3d(); + this._cornerD = new Vector3d(); + this._width = 0; this._height = 0; - this._Str_20541 = _arg_9; - this._Str_19707 = _arg_10; - this._Str_21079 = _arg_11; - this._Str_22024 = _arg_12; - this._Str_4542 = _arg_6; + this._textureOffsetX = _arg_9; + this._textureOffsetY = _arg_10; + this._textureMaxX = _arg_11; + this._textureMaxY = _arg_12; + this._useMask = _arg_6; this._uniqueId = ++RoomPlane._uniqueIdCounter; } @@ -135,32 +135,32 @@ export class RoomPlane implements IRoomPlane //return Canvas.colorize(_arg_2, (k | 0xFF000000)) & 0xFFFFFF; } - public set _Str_14801(k: boolean) + public set canBeVisible(k: boolean) { - if(k !== this._Str_7367) + if(k !== this._canBeVisible) { - if(!this._Str_7367) this._Str_11000(); + if(!this._canBeVisible) this.resetTextureCache(); - this._Str_7367 = k; + this._canBeVisible = k; } } - public get _Str_14801(): boolean + public get canBeVisible(): boolean { - return this._Str_7367; + return this._canBeVisible; } public get bitmapData(): Texture { - if(!this.visible || !this._Str_1049) return null; + if(!this.visible || !this._bitmapData) return null; - let texture: RenderTexture = RoomVisualization.getTextureCache(this._Str_1049); + let texture: RenderTexture = RoomVisualization.getTextureCache(this._bitmapData); if(!texture) { - texture = TextureUtils.generateTexture(this._Str_1049, new Rectangle(0, 0, this._Str_1720, this._height)); + texture = TextureUtils.generateTexture(this._bitmapData, new Rectangle(0, 0, this._width, this._height)); - RoomVisualization.addTextureCache(this._Str_1049, texture); + RoomVisualization.addTextureCache(this._bitmapData, texture); } return texture; @@ -168,7 +168,7 @@ export class RoomPlane implements IRoomPlane public get visible(): boolean { - return (this._Str_3816 && this._Str_7367); + return (this._isVisible && this._canBeVisible); } public get offset(): Point @@ -196,14 +196,14 @@ export class RoomPlane implements IRoomPlane return this._type; } - public get _Str_5424(): IVector3D + public get leftSide(): IVector3D { - return this._Str_2920; + return this._leftSide; } - public get _Str_4968(): IVector3D + public get rightSide(): IVector3D { - return this._Str_2943; + return this._rightSide; } public get location(): IVector3D @@ -216,14 +216,14 @@ export class RoomPlane implements IRoomPlane return this._normal; } - public get _Str_18448(): boolean + public get hasTexture(): boolean { - return this._Str_13946; + return this._hasTexture; } - public set _Str_18448(k: boolean) + public set hasTexture(k: boolean) { - this._Str_13946 = k; + this._hasTexture = k; } public set rasterizer(k:IPlaneRasterizer) @@ -231,17 +231,17 @@ export class RoomPlane implements IRoomPlane this._rasterizer = k; } - public set _Str_16279(k: PlaneMaskManager) + public set maskManager(k: PlaneMaskManager) { - this._Str_4795 = k; + this._maskManager = k; } public set id(k: string) { - if(k === this._Str_576) return; + if(k === this._id) return; - this._Str_11000(); - this._Str_576 = k; + this.resetTextureCache(); + this._id = k; } public get uniqueId(): number @@ -251,16 +251,16 @@ export class RoomPlane implements IRoomPlane public dispose(): void { - if(this._Str_1049) + if(this._bitmapData) { - this._Str_1049.destroy(); + this._bitmapData.destroy(); - this._Str_1049 = null; + this._bitmapData = null; } - if(this._Str_2708) + if(this._textures) { - for(const bitmap of this._Str_2708.values()) + for(const bitmap of this._textures.values()) { if(!bitmap) continue; @@ -269,75 +269,75 @@ export class RoomPlane implements IRoomPlane bitmap.dispose(); } - this._Str_2708 = null; + this._textures = null; } - this._Str_5545 = null; + this._activeTexture = null; this._location = null; - this._Str_5221 = null; - this._Str_2920 = null; - this._Str_2943 = null; + this._origin = null; + this._leftSide = null; + this._rightSide = null; this._normal = null; this._rasterizer = null; - this._Str_2820 = null; - this._Str_2745 = null; - this._Str_2639 = null; - this._Str_2766 = null; - this._Str_4047 = null; - this._Str_5088 = null; + this._cornerA = null; + this._cornerB = null; + this._cornerC = null; + this._cornerD = null; + this._bitmapMasks = null; + this._rectangleMasks = null; - if(this._Str_2730) + if(this._maskBitmapData) { - this._Str_2730.destroy(); + this._maskBitmapData.destroy(); - this._Str_2730 = null; + this._maskBitmapData = null; } this._disposed = true; } - public _Str_24896(k: Texture): Texture + public copyBitmapData(k: Texture): Texture { - if(!this.visible || !this._Str_1049 || !k) return null; + if(!this.visible || !this._bitmapData || !k) return null; - if((this._Str_1049.width !== k.width) || (this._Str_1049.height !== k.height)) return null; + if((this._bitmapData.width !== k.width) || (this._bitmapData.height !== k.height)) return null; - //k.copyPixels(this._Str_1049, this._Str_1049.rect, RoomPlane.ZERO_POINT); + //k.copyPixels(this._bitmapData, this._bitmapData.rect, RoomPlane.ZERO_POINT); return k; } - private _Str_17642(k: string, _arg_2: PlaneBitmapData): boolean + private cacheTexture(k: string, _arg_2: PlaneBitmapData): boolean { - const existing = this._Str_2708.get(k); + const existing = this._textures.get(k); if(existing) { - this._Str_2708.delete(k); + this._textures.delete(k); existing.dispose(); } - this._Str_5545 = _arg_2; - this._Str_2708.set(k, _arg_2); + this._activeTexture = _arg_2; + this._textures.set(k, _arg_2); return true; } - private _Str_11000(k: Graphics = null): void + private resetTextureCache(k: Graphics = null): void { - if(this._Str_2708 && this._Str_2708.size) + if(this._textures && this._textures.size) { - for(const bitmap of this._Str_2708.values()) + for(const bitmap of this._textures.values()) { if(!bitmap) continue; bitmap.dispose(); } - this._Str_2708.clear(); + this._textures.clear(); } - this._Str_5545 = null; + this._activeTexture = null; } private getTextureIdentifier(k: number): string @@ -347,44 +347,44 @@ export class RoomPlane implements IRoomPlane return k.toString(); } - private _Str_10518(k: IRoomGeometry, _arg_2: number): boolean + private needsNewTexture(k: IRoomGeometry, _arg_2: number): boolean { if(!k) return false; - let planeBitmap = this._Str_5545; + let planeBitmap = this._activeTexture; if(!planeBitmap) { - planeBitmap = this._Str_2708.get(this.getTextureIdentifier(k.scale)); + planeBitmap = this._textures.get(this.getTextureIdentifier(k.scale)); } - this._Str_19336(); + this.updateMaskChangeStatus(); - if(this._Str_7367 && ((!planeBitmap || ((planeBitmap.timeStamp >= 0) && (_arg_2 > planeBitmap.timeStamp))) || this._Str_4891)) return true; + if(this._canBeVisible && ((!planeBitmap || ((planeBitmap.timeStamp >= 0) && (_arg_2 > planeBitmap.timeStamp))) || this._maskChanged)) return true; return false; } - private _Str_10114(k: IRoomGeometry, _arg_2: number): Graphics + private getTexture(k: IRoomGeometry, _arg_2: number): Graphics { if(!k) return null; let _local_3: PlaneBitmapData = null; - if(this._Str_10518(k, _arg_2)) + if(this.needsNewTexture(k, _arg_2)) { const _local_4 = this.getTextureIdentifier(k.scale); - const _local_5 = (this._Str_2920.length * k.scale); - const _local_6 = (this._Str_2943.length * k.scale); + const _local_5 = (this._leftSide.length * k.scale); + const _local_6 = (this._rightSide.length * k.scale); const _local_7 = k.getCoordinatePosition(this._normal); - if(this._Str_5545) + if(this._activeTexture) { - _local_3 = this._Str_5545; + _local_3 = this._activeTexture; } else { - _local_3 = this._Str_2708.get(_local_4); + _local_3 = this._textures.get(_local_4); } let _local_8: Graphics = null; @@ -393,7 +393,7 @@ export class RoomPlane implements IRoomPlane if(this._rasterizer) { - _local_3 = this._rasterizer.render(_local_8, this._Str_576, _local_5, _local_6, k.scale, _local_7, this._Str_13946, this._Str_20541, this._Str_19707, this._Str_21079, this._Str_22024, _arg_2); + _local_3 = this._rasterizer.render(_local_8, this._id, _local_5, _local_6, k.scale, _local_7, this._hasTexture, this._textureOffsetX, this._textureOffsetY, this._textureMaxX, this._textureMaxY, _arg_2); if(_local_3) { @@ -413,25 +413,25 @@ export class RoomPlane implements IRoomPlane if(_local_3) { - this._Str_17859(_local_3.bitmap, k); - this._Str_17642(_local_4, _local_3); + this.updateMask(_local_3.bitmap, k); + this.cacheTexture(_local_4, _local_3); } } else { - if(this._Str_5545) + if(this._activeTexture) { - _local_3 = this._Str_5545; + _local_3 = this._activeTexture; } else { - _local_3 = this._Str_2708.get(this.getTextureIdentifier(k.scale)); + _local_3 = this._textures.get(this.getTextureIdentifier(k.scale)); } } if(_local_3) { - this._Str_5545 = _local_3; + this._activeTexture = _local_3; return _local_3.bitmap; } @@ -439,21 +439,21 @@ export class RoomPlane implements IRoomPlane return null; } - private _Str_23649(k: IRoomGeometry): PlaneDrawingData + private resolveMasks(k: IRoomGeometry): PlaneDrawingData { - if(!this._Str_4542) return null; + if(!this._useMask) return null; const _local_5 = new PlaneDrawingData(); const index = 0; - while(index < this._Str_4047.length) + while(index < this._bitmapMasks.length) { - const mask = this._Str_4047[index]; + const mask = this._bitmapMasks[index]; if(mask) { - const planeMask = this._Str_4795._Str_8361(mask.type); + const planeMask = this._maskManager._Str_8361(mask.type); if(planeMask) { @@ -466,8 +466,8 @@ export class RoomPlane implements IRoomPlane if(asset) { - const _local_3 = (this._Str_2730.width * (1 - (mask._Str_5120 / this._Str_2920.length))); - const _local_4 = (this._Str_2730.height * (1 - (mask._Str_4659 / this._Str_2943.length))); + const _local_3 = (this._maskBitmapData.width * (1 - (mask._Str_5120 / this._leftSide.length))); + const _local_4 = (this._maskBitmapData.height * (1 - (mask._Str_4659 / this._rightSide.length))); const _local_11 = new Point((_local_3 + asset.offsetX), (_local_4 + asset.offsetY)); _local_5.addMask(assetName, _local_11, asset.flipH, asset.flipV); @@ -480,22 +480,22 @@ export class RoomPlane implements IRoomPlane return _local_5; } - private _Str_24802(k: IRoomGeometry): number + private screenWidth(k: IRoomGeometry): number { const _local_2 = k.getScreenPoint(new Vector3d(0, 0, 0)); const _local_3 = k.getScreenPoint(new Vector3d(0, 1, 0)); - return Math.round((this._Str_2920.length * Math.abs((_local_2.x - _local_3.x)))); + return Math.round((this._leftSide.length * Math.abs((_local_2.x - _local_3.x)))); } - public _Str_22136(geometry:IRoomGeometry): PlaneDrawingData[] + public getDrawingDatas(geometry:IRoomGeometry): PlaneDrawingData[] { const drawingDatas: PlaneDrawingData[] = []; - if(this._Str_3816) + if(this._isVisible) { - const maskData = this._Str_23649(geometry); - const layers = this._rasterizer._Str_8988(this._Str_576); + const maskData = this.resolveMasks(geometry); + const layers = this._rasterizer._Str_8988(this._id); let i = 0; @@ -505,16 +505,16 @@ export class RoomPlane implements IRoomPlane if(layer) { - if(this._Str_13946 && layer._Str_8547()) + if(this._hasTexture && layer._Str_8547()) { const normal = geometry.getCoordinatePosition(this._normal); const cm = layer._Str_8547()._Str_21968(normal); //const data = new PlaneDrawingData(maskData, blend(this._color, layer._Str_751()), cm._Str_14945()); const data = new PlaneDrawingData(maskData, this._color, cm._Str_14945()); - Randomizer._Str_17384(this._Str_16308); + Randomizer._Str_17384(this._randomSeed); - for(const column of cm._Str_23721(this._Str_24802(geometry))) + for(const column of cm._Str_23721(this.screenWidth(geometry))) { const assetNames: string[] = []; @@ -563,16 +563,16 @@ export class RoomPlane implements IRoomPlane let geometryChanged = false; - if(this._Str_3406 != geometry.updateId) geometryChanged = true; + if(this._geometryUpdateId != geometry.updateId) geometryChanged = true; - if(!geometryChanged || !this._Str_7367) + if(!geometryChanged || !this._canBeVisible) { if(!this.visible) return false; } if(geometryChanged) { - this._Str_5545 = null; + this._activeTexture = null; let cosAngle = 0; @@ -580,9 +580,9 @@ export class RoomPlane implements IRoomPlane if(cosAngle > -0.001) { - if(this._Str_3816) + if(this._isVisible) { - this._Str_3816 = false; + this._isVisible = false; return true; } @@ -591,15 +591,15 @@ export class RoomPlane implements IRoomPlane let i = 0; - while(i < this._Str_5886.length) + while(i < this._secondaryNormals.length) { - cosAngle = Vector3d.cosAngle(geometry.directionAxis, this._Str_5886[i]); + cosAngle = Vector3d.cosAngle(geometry.directionAxis, this._secondaryNormals[i]); if(cosAngle > -0.001) { - if(this._Str_3816) + if(this._isVisible) { - this._Str_3816 = false; + this._isVisible = false; return true; } @@ -609,16 +609,16 @@ export class RoomPlane implements IRoomPlane i++; } - this._Str_18702(geometry); + this.updateCorners(geometry); - const originPos = geometry.getScreenPosition(this._Str_5221); + const originPos = geometry.getScreenPosition(this._origin); const originZ = originPos.z; - let relativeDepth = (Math.max(this._Str_2820.z, this._Str_2745.z, this._Str_2639.z, this._Str_2766.z) - originZ); + let relativeDepth = (Math.max(this._cornerA.z, this._cornerB.z, this._cornerC.z, this._cornerD.z) - originZ); if(this._type === RoomPlane.TYPE_FLOOR) { - relativeDepth = (relativeDepth - ((this._location.z + Math.min(0, this._Str_2920.z, this._Str_2943.z)) * 8)); + relativeDepth = (relativeDepth - ((this._location.z + Math.min(0, this._leftSide.z, this._rightSide.z)) * 8)); } if(this._type === RoomPlane.TYPE_LANDSCAPE) @@ -627,50 +627,50 @@ export class RoomPlane implements IRoomPlane } this._relativeDepth = relativeDepth; - this._Str_3816 = true; - this._Str_3406 = geometry.updateId; + this._isVisible = true; + this._geometryUpdateId = geometry.updateId; } - if(geometryChanged || this._Str_10518(geometry, timeSinceStartMs)) + if(geometryChanged || this.needsNewTexture(geometry, timeSinceStartMs)) { - if(!this._Str_1049 || (this._Str_1720 !== this._Str_1049.width) || (this._height !== this._Str_1049.height)) + if(!this._bitmapData || (this._width !== this._bitmapData.width) || (this._height !== this._bitmapData.height)) { - if(this._Str_1049) + if(this._bitmapData) { - this._Str_1049.destroy(); + this._bitmapData.destroy(); - this._Str_1049 = null; + this._bitmapData = null; - if((this._Str_1720 < 1) || (this._height < 1)) return true; + if((this._width < 1) || (this._height < 1)) return true; } else { - if((this._Str_1720 < 1) || (this._height < 1)) return false; + if((this._width < 1) || (this._height < 1)) return false; } const graphic = new Graphics(); graphic.beginFill(0xFFFFFF, 0); - graphic.drawRect(0, 0, this._Str_1720, this._height); + graphic.drawRect(0, 0, this._width, this._height); graphic.endFill(); - this._Str_1049 = graphic; + this._bitmapData = graphic; - if(!this._Str_1049) return false; + if(!this._bitmapData) return false; } else { - //this._Str_1049.lock(); - //this._Str_1049.fillRect(this._Str_1049.rect, 0xFFFFFF); + //this._bitmapData.lock(); + //this._bitmapData.fillRect(this._bitmapData.rect, 0xFFFFFF); } - Randomizer._Str_17384(this._Str_16308); + Randomizer._Str_17384(this._randomSeed); - const texture = this._Str_10114(geometry, timeSinceStartMs); + const texture = this.getTexture(geometry, timeSinceStartMs); if(texture) { - this._Str_17000(geometry, texture); + this.renderTexture(geometry, texture); } else { @@ -685,53 +685,53 @@ export class RoomPlane implements IRoomPlane return false; } - private _Str_18702(k: IRoomGeometry): void + private updateCorners(k: IRoomGeometry): void { - this._Str_2820.assign(k.getScreenPosition(this._location)); - this._Str_2745.assign(k.getScreenPosition(Vector3d.sum(this._location, this._Str_2943))); - this._Str_2639.assign(k.getScreenPosition(Vector3d.sum(Vector3d.sum(this._location, this._Str_2920), this._Str_2943))); - this._Str_2766.assign(k.getScreenPosition(Vector3d.sum(this._location, this._Str_2920))); - this._offset = k.getScreenPoint(this._Str_5221); - this._Str_2820.x = Math.round(this._Str_2820.x); - this._Str_2820.y = Math.round(this._Str_2820.y); - this._Str_2745.x = Math.round(this._Str_2745.x); - this._Str_2745.y = Math.round(this._Str_2745.y); - this._Str_2639.x = Math.round(this._Str_2639.x); - this._Str_2639.y = Math.round(this._Str_2639.y); - this._Str_2766.x = Math.round(this._Str_2766.x); - this._Str_2766.y = Math.round(this._Str_2766.y); + this._cornerA.assign(k.getScreenPosition(this._location)); + this._cornerB.assign(k.getScreenPosition(Vector3d.sum(this._location, this._rightSide))); + this._cornerC.assign(k.getScreenPosition(Vector3d.sum(Vector3d.sum(this._location, this._leftSide), this._rightSide))); + this._cornerD.assign(k.getScreenPosition(Vector3d.sum(this._location, this._leftSide))); + this._offset = k.getScreenPoint(this._origin); + this._cornerA.x = Math.round(this._cornerA.x); + this._cornerA.y = Math.round(this._cornerA.y); + this._cornerB.x = Math.round(this._cornerB.x); + this._cornerB.y = Math.round(this._cornerB.y); + this._cornerC.x = Math.round(this._cornerC.x); + this._cornerC.y = Math.round(this._cornerC.y); + this._cornerD.x = Math.round(this._cornerD.x); + this._cornerD.y = Math.round(this._cornerD.y); this._offset.x = Math.round(this._offset.x); this._offset.y = Math.round(this._offset.y); - const _local_2: number = Math.min(this._Str_2820.x, this._Str_2745.x, this._Str_2639.x, this._Str_2766.x); - let _local_3: number = Math.max(this._Str_2820.x, this._Str_2745.x, this._Str_2639.x, this._Str_2766.x); - const _local_4: number = Math.min(this._Str_2820.y, this._Str_2745.y, this._Str_2639.y, this._Str_2766.y); - let _local_5: number = Math.max(this._Str_2820.y, this._Str_2745.y, this._Str_2639.y, this._Str_2766.y); + const _local_2: number = Math.min(this._cornerA.x, this._cornerB.x, this._cornerC.x, this._cornerD.x); + let _local_3: number = Math.max(this._cornerA.x, this._cornerB.x, this._cornerC.x, this._cornerD.x); + const _local_4: number = Math.min(this._cornerA.y, this._cornerB.y, this._cornerC.y, this._cornerD.y); + let _local_5: number = Math.max(this._cornerA.y, this._cornerB.y, this._cornerC.y, this._cornerD.y); _local_3 = (_local_3 - _local_2); this._offset.x = (this._offset.x - _local_2); - this._Str_2820.x = (this._Str_2820.x - _local_2); - this._Str_2745.x = (this._Str_2745.x - _local_2); - this._Str_2639.x = (this._Str_2639.x - _local_2); - this._Str_2766.x = (this._Str_2766.x - _local_2); + this._cornerA.x = (this._cornerA.x - _local_2); + this._cornerB.x = (this._cornerB.x - _local_2); + this._cornerC.x = (this._cornerC.x - _local_2); + this._cornerD.x = (this._cornerD.x - _local_2); _local_5 = (_local_5 - _local_4); this._offset.y = (this._offset.y - _local_4); - this._Str_2820.y = (this._Str_2820.y - _local_4); - this._Str_2745.y = (this._Str_2745.y - _local_4); - this._Str_2639.y = (this._Str_2639.y - _local_4); - this._Str_2766.y = (this._Str_2766.y - _local_4); - this._Str_1720 = _local_3; + this._cornerA.y = (this._cornerA.y - _local_4); + this._cornerB.y = (this._cornerB.y - _local_4); + this._cornerC.y = (this._cornerC.y - _local_4); + this._cornerD.y = (this._cornerD.y - _local_4); + this._width = _local_3; this._height = _local_5; } - private _Str_17000(k: IRoomGeometry, _arg_2: Graphics): void + private renderTexture(k: IRoomGeometry, _arg_2: Graphics): void { - if(((((((this._Str_2820 == null) || (this._Str_2745 == null)) || (this._Str_2639 == null)) || (this._Str_2766 == null)) || (_arg_2 == null)) || (this._Str_1049 == null))) + if(((((((this._cornerA == null) || (this._cornerB == null)) || (this._cornerC == null)) || (this._cornerD == null)) || (_arg_2 == null)) || (this._bitmapData == null))) { return; } - let _local_3: number = (this._Str_2766.x - this._Str_2639.x); - let _local_4: number = (this._Str_2766.y - this._Str_2639.y); - let _local_5: number = (this._Str_2745.x - this._Str_2639.x); - let _local_6: number = (this._Str_2745.y - this._Str_2639.y); + let _local_3: number = (this._cornerD.x - this._cornerC.x); + let _local_4: number = (this._cornerD.y - this._cornerC.y); + let _local_5: number = (this._cornerB.x - this._cornerC.x); + let _local_6: number = (this._cornerB.y - this._cornerC.y); if(((this._type == RoomPlane.TYPE_WALL) || (this._type == RoomPlane.TYPE_LANDSCAPE))) { if(Math.abs((_local_5 - _arg_2.width)) <= 1) @@ -760,7 +760,7 @@ export class RoomPlane implements IRoomPlane _local_11.b = _local_8; _local_11.c = _local_9; _local_11.d = _local_10; - _local_11.translate(this._Str_2639.x, this._Str_2639.y); + _local_11.translate(this._cornerC.x, this._cornerC.y); this.draw(_arg_2, _local_11); } @@ -771,26 +771,26 @@ export class RoomPlane implements IRoomPlane clone.transform.setFromMatrix(matrix); - this._Str_1049 = clone; + this._bitmapData = clone; } - public _Str_25213(): void + public resetBitmapMasks(): void { - if(this._disposed || !this._Str_4542 || !this._Str_4047.length) return; + if(this._disposed || !this._useMask || !this._bitmapMasks.length) return; - this._Str_4891 = true; - this._Str_4047 = []; + this._maskChanged = true; + this._bitmapMasks = []; } - public _Str_24569(k: string, _arg_2: number, _arg_3: number): boolean + public addBitmapMask(k: string, _arg_2: number, _arg_3: number): boolean { - if(!this._Str_4542) return false; + if(!this._useMask) return false; let _local_5 = 0; - while(_local_5 < this._Str_4047.length) + while(_local_5 < this._bitmapMasks.length) { - const mask = this._Str_4047[_local_5]; + const mask = this._bitmapMasks[_local_5]; if(mask) { @@ -802,25 +802,25 @@ export class RoomPlane implements IRoomPlane const mask = new RoomPlaneBitmapMask(k, _arg_2, _arg_3); - this._Str_4047.push(mask); - this._Str_4891 = true; + this._bitmapMasks.push(mask); + this._maskChanged = true; return true; } - public _Str_25934(): void + public resetRectangleMasks(): void { - if(!this._Str_4542 || !this._Str_5088.length) return; + if(!this._useMask || !this._rectangleMasks.length) return; - this._Str_4891 = true; - this._Str_5088 = []; + this._maskChanged = true; + this._rectangleMasks = []; } - public _Str_24758(k: number, _arg_2: number, _arg_3: number, _arg_4: number): boolean + public addRectangleMask(k: number, _arg_2: number, _arg_3: number, _arg_4: number): boolean { - if(this._Str_4542) + if(this._useMask) { - for(const mask of this._Str_5088) + for(const mask of this._rectangleMasks) { if(!mask) continue; @@ -829,8 +829,8 @@ export class RoomPlane implements IRoomPlane const _local_5 = new RoomPlaneRectangleMask(k, _arg_2, _arg_3, _arg_4); - this._Str_5088.push(_local_5); - this._Str_4891 = true; + this._rectangleMasks.push(_local_5); + this._maskChanged = true; return true; } @@ -838,22 +838,22 @@ export class RoomPlane implements IRoomPlane return false; } - private _Str_19336(): void + private updateMaskChangeStatus(): void { - if(!this._Str_4891) return; + if(!this._maskChanged) return; let _local_3 = true; let _local_6: boolean; - if(this._Str_4047.length === this._Str_8341.length) + if(this._bitmapMasks.length === this._bitmapMasksOld.length) { - for(const mask of this._Str_4047) + for(const mask of this._bitmapMasks) { if(!mask) continue; _local_6 = false; - for(const plane of this._Str_8341) + for(const plane of this._bitmapMasksOld) { if(!plane) continue; @@ -878,28 +878,28 @@ export class RoomPlane implements IRoomPlane _local_3 = false; } - if(this._Str_5088.length > this._Str_14495.length) _local_3 = false; + if(this._rectangleMasks.length > this._rectangleMasksOld.length) _local_3 = false; - if(_local_3) this._Str_4891 = false; + if(_local_3) this._maskChanged = false; } - private _Str_17859(texture: Graphics, geometry: IRoomGeometry): void + private updateMask(texture: Graphics, geometry: IRoomGeometry): void { if(!texture || !geometry) return; - if(((!this._Str_4542) || ((!this._Str_4047.length && !this._Str_5088.length) && !this._Str_4891)) || !this._Str_4795) return; + if(((!this._useMask) || ((!this._bitmapMasks.length && !this._rectangleMasks.length) && !this._maskChanged)) || !this._maskManager) return; const width = texture.width; const height = texture.height; - this._Str_19336(); + this.updateMaskChangeStatus(); - if(!this._Str_2730 || (this._Str_2730.width !== width) || (this._Str_2730.height !== height)) + if(!this._maskBitmapData || (this._maskBitmapData.width !== width) || (this._maskBitmapData.height !== height)) { - if(this._Str_2730) + if(this._maskBitmapData) { - this._Str_2730.destroy(); - this._Str_2730 = null; + this._maskBitmapData.destroy(); + this._maskBitmapData = null; } const graphic = new Graphics(); @@ -909,24 +909,24 @@ export class RoomPlane implements IRoomPlane .drawRect(0, 0, width, height) .endFill(); - this._Str_2730 = graphic; - this._Str_4891 = true; + this._maskBitmapData = graphic; + this._maskChanged = true; } - if(this._Str_4891) + if(this._maskChanged) { - this._Str_8341 = []; - this._Str_14495 = []; + this._bitmapMasksOld = []; + this._rectangleMasksOld = []; - if(this._Str_2730) + if(this._maskBitmapData) { - this._Str_2730 + this._maskBitmapData .beginFill(0xFFFFFF, 0) .drawRect(0, 0, width, height) .endFill(); } - this._Str_11000(texture); + this.resetTextureCache(texture); const normal = geometry.getCoordinatePosition(this._normal); @@ -935,18 +935,18 @@ export class RoomPlane implements IRoomPlane let posY = 0; let i = 0; - while(i < this._Str_4047.length) + while(i < this._bitmapMasks.length) { - const mask = this._Str_4047[i]; + const mask = this._bitmapMasks[i]; if(mask) { type = mask.type; - posX = (this._Str_2730.width - ((this._Str_2730.width * mask._Str_5120) / this._Str_2920.length)); - posY = (this._Str_2730.height - ((this._Str_2730.height * mask._Str_4659) / this._Str_2943.length)); + posX = (this._maskBitmapData.width - ((this._maskBitmapData.width * mask._Str_5120) / this._leftSide.length)); + posY = (this._maskBitmapData.height - ((this._maskBitmapData.height * mask._Str_4659) / this._rightSide.length)); - this._Str_4795._Str_17859(this._Str_2730, type, geometry.scale, normal, posX, posY); - this._Str_8341.push(new RoomPlaneBitmapMask(type, mask._Str_5120, mask._Str_4659)); + this._maskManager.updateMask(this._maskBitmapData, type, geometry.scale, normal, posX, posY); + this._bitmapMasksOld.push(new RoomPlaneBitmapMask(type, mask._Str_5120, mask._Str_4659)); } i++; @@ -954,36 +954,36 @@ export class RoomPlane implements IRoomPlane i = 0; - while(i < this._Str_5088.length) + while(i < this._rectangleMasks.length) { - const rectMask = this._Str_5088[i]; + const rectMask = this._rectangleMasks[i]; if(rectMask) { - posX = (this._Str_2730.width - ((this._Str_2730.width * rectMask._Str_5120) / this._Str_2920.length)); - posY = (this._Str_2730.height - ((this._Str_2730.height * rectMask._Str_4659) / this._Str_2943.length)); + posX = (this._maskBitmapData.width - ((this._maskBitmapData.width * rectMask._Str_5120) / this._leftSide.length)); + posY = (this._maskBitmapData.height - ((this._maskBitmapData.height * rectMask._Str_4659) / this._rightSide.length)); - const wd = ((this._Str_2730.width * rectMask._Str_9124) / this._Str_2920.length); - const ht = ((this._Str_2730.height * rectMask._Str_12156) / this._Str_2943.length); + const wd = ((this._maskBitmapData.width * rectMask._Str_9124) / this._leftSide.length); + const ht = ((this._maskBitmapData.height * rectMask._Str_12156) / this._rightSide.length); - this._Str_2730 + this._maskBitmapData .beginFill(0xFF0000) .drawRect((posX - wd), (posY - ht), wd, ht) .endFill(); - this._Str_14495.push(new RoomPlaneRectangleMask(rectMask._Str_9124, rectMask._Str_4659, rectMask._Str_9124, rectMask._Str_12156)); + this._rectangleMasksOld.push(new RoomPlaneRectangleMask(rectMask._Str_9124, rectMask._Str_4659, rectMask._Str_9124, rectMask._Str_12156)); } i++; } - this._Str_4891 = false; + this._maskChanged = false; } - this._Str_24790(texture, this._Str_2730); + this.combineTextureMask(texture, this._maskBitmapData); } - private _Str_24790(texture: Graphics, mask: Graphics): void + private combineTextureMask(texture: Graphics, mask: Graphics): void { if(!texture || !mask) return; diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index 988467d1..9085f6d4 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -507,7 +507,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if((leftSide.length < 1) || (rightSide.length < 1)) { - plane._Str_18448 = false; + plane.hasTexture = false; } if((_local_14.x === 0) && (_local_14.y === 0)) @@ -566,7 +566,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements plane = new RoomPlane(this.object.getLocation(), location, leftSide, rightSide, RoomPlane.TYPE_WALL, true, secondaryNormals, _local_6); if(((leftSide.length < 1) || (rightSide.length < 1))) { - plane._Str_18448 = false; + plane.hasTexture = false; } if(((_local_14.x == 0) && (_local_14.y == 0))) { @@ -599,7 +599,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(plane) { - plane._Str_16279 = this._data.maskManager; + plane.maskManager = this._data.maskManager; let _local_19 = 0; @@ -610,7 +610,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements const _local_22 = this._roomPlaneParser.getPlaneMaskLeftSideLength(index, _local_19); const _local_23 = this._roomPlaneParser.getPlaneMaskRightSideLength(index, _local_19); - plane._Str_24758(_local_20, _local_21, _local_22, _local_23); + plane.addRectangleMask(_local_20, _local_21, _local_22, _local_23); _local_19++; } @@ -643,9 +643,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements const plane = this._Str_2540[planeIndex]; const sprite = this.getSprite(planeIndex); - if(plane && sprite && plane._Str_5424 && plane._Str_4968) + if(plane && sprite && plane.leftSide && plane.rightSide) { - if((plane.type === RoomPlane.TYPE_WALL) && ((plane._Str_5424.length < 1) || (plane._Str_4968.length < 1))) + if((plane.type === RoomPlane.TYPE_WALL) && ((plane.leftSide.length < 1) || (plane.rightSide.length < 1))) { sprite.alphaTolerance = AlphaTolerance._Str_9268; } @@ -825,7 +825,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { depth = ((_local_12.relativeDepth + this._Str_25403) + (_local_10 / 1000)); - if((_local_12._Str_5424.length < 1) || (_local_12._Str_4968.length < 1)) + if((_local_12.leftSide.length < 1) || (_local_12.rightSide.length < 1)) { depth = (depth + (RoomVisualization._Str_8621 * 0.5)); } @@ -885,7 +885,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(plane) { - plane._Str_25213(); + plane.resetBitmapMasks(); if(plane.type === RoomPlane.TYPE_LANDSCAPE) _local_4.push(index); } @@ -916,22 +916,22 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(_local_15 < 0.01) { - if(plane._Str_5424 && plane._Str_4968) + if(plane.leftSide && plane.rightSide) { - const _local_16 = Vector3d.scalarProjection(_local_14, plane._Str_5424); - const _local_17 = Vector3d.scalarProjection(_local_14, plane._Str_4968); + const _local_16 = Vector3d.scalarProjection(_local_14, plane.leftSide); + const _local_17 = Vector3d.scalarProjection(_local_14, plane.rightSide); if((plane.type === RoomPlane.TYPE_WALL) || ((plane.type === RoomPlane.TYPE_LANDSCAPE) && (maskCategory === RoomPlaneBitmapMaskData.HOLE))) { - plane._Str_24569(maskType, _local_16, _local_17); + plane.addBitmapMask(maskType, _local_16, _local_17); } else { if(plane.type === RoomPlane.TYPE_LANDSCAPE) { - if(!plane._Str_14801) _local_6 = true; + if(!plane.canBeVisible) _local_6 = true; - plane._Str_14801 = true; + plane.canBeVisible = true; _local_5.push(i); } @@ -956,7 +956,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { const plane = this._Str_2540[planeIndex]; - plane._Str_14801 = false; + plane.canBeVisible = false; _local_6 = true; } @@ -1012,4 +1012,4 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { return RoomVisualization._Str_8621 + 0.5; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts index 315d9148..8b76b8e5 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts @@ -141,7 +141,7 @@ export class PlaneMaskManager return graphicName; } - public _Str_17859(k: Graphics, _arg_2: string, _arg_3: number, _arg_4: IVector3D, _arg_5: number, _arg_6: number): boolean + public updateMask(k: Graphics, _arg_2: string, _arg_3: number, _arg_4: IVector3D, _arg_5: number, _arg_6: number): boolean { const mask = this._masks.get(_arg_2); @@ -193,4 +193,4 @@ export class PlaneMaskManager return this._masks.get(k) || null; } -} \ No newline at end of file +} 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 ceacb8fc..9af0b805 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -150,7 +150,7 @@ export class PlaneRasterizer implements IPlaneRasterizer this._textures.clear(); } - protected _Str_10114(k: string): PlaneTexture + protected getTexture(k: string): PlaneTexture { return this._textures.get(k); } @@ -446,7 +446,7 @@ export class PlaneRasterizer implements IPlaneRasterizer } } - const texture = this._Str_10114(textureId); + const texture = this.getTexture(textureId); const newCell = new PlaneMaterialCell(texture, graphics, offsetPoints, limit); cells.push(newCell); diff --git a/src/nitro/room/utils/SpriteDataCollector.ts b/src/nitro/room/utils/SpriteDataCollector.ts index e8f2c264..f20de016 100644 --- a/src/nitro/room/utils/SpriteDataCollector.ts +++ b/src/nitro/room/utils/SpriteDataCollector.ts @@ -403,11 +403,11 @@ export class SpriteDataCollector const _local_12 = _local_11.plane; const _local_13: Point[] = []; - const _local_14 = Vector3d.sum(_local_12.location, _local_12._Str_5424); + const _local_14 = Vector3d.sum(_local_12.location, _local_12.leftSide); const _local_15 = _local_8.getScreenPoint(_local_12.location); const _local_16 = _local_8.getScreenPoint(_local_14); - const _local_17 = _local_8.getScreenPoint(Vector3d.sum(_local_12.location, _local_12._Str_4968)); - const _local_18 = _local_8.getScreenPoint(Vector3d.sum(_local_14, _local_12._Str_4968)); + const _local_17 = _local_8.getScreenPoint(Vector3d.sum(_local_12.location, _local_12.rightSide)); + const _local_18 = _local_8.getScreenPoint(Vector3d.sum(_local_14, _local_12.rightSide)); _local_13.push(_local_15, _local_16, _local_17, _local_18); @@ -442,7 +442,7 @@ export class SpriteDataCollector { const _local_22 = SpriteDataCollector._Str_14110(_local_15, _local_16, _local_17, _local_18); - for(const _local_23 of _local_12._Str_22136(_local_8)) + for(const _local_23 of _local_12.getDrawingDatas(_local_8)) { _local_23.cornerPoints = _local_22; _local_23.z = _local_11.z; diff --git a/src/room/object/visualization/IRoomPlane.ts b/src/room/object/visualization/IRoomPlane.ts index 881c2868..476fef77 100644 --- a/src/room/object/visualization/IRoomPlane.ts +++ b/src/room/object/visualization/IRoomPlane.ts @@ -6,8 +6,8 @@ export interface IRoomPlane { uniqueId: number; location: IVector3D; - _Str_5424: IVector3D; - _Str_4968: IVector3D; + leftSide: IVector3D; + rightSide: IVector3D; color: number; - _Str_22136(_arg_1: IRoomGeometry): PlaneDrawingData[]; -} \ No newline at end of file + getDrawingDatas(_arg_1: IRoomGeometry): PlaneDrawingData[]; +} From 1a717cc1aa3b5a677b2812be0be84aa5967f5b13 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 15 May 2021 04:59:04 -0500 Subject: [PATCH 019/155] clean AvatarExpressionEnum --- src/nitro/avatar/geometry/Matrix4x4.ts | 4 ++-- .../ui/widget/enums/AvatarExpressionEnum.ts | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/nitro/avatar/geometry/Matrix4x4.ts b/src/nitro/avatar/geometry/Matrix4x4.ts index c248ea5d..51f30f7c 100644 --- a/src/nitro/avatar/geometry/Matrix4x4.ts +++ b/src/nitro/avatar/geometry/Matrix4x4.ts @@ -121,7 +121,7 @@ export class Matrix4x4 return new Matrix4x4(this._data[0], this._data[3], this._data[6], this._data[1], this._data[4], this._data[7], this._data[2], this._data[5], this._data[8]); } - public _Str_1451(k: Matrix4x4): boolean + public equals(k: Matrix4x4): boolean { return false; } @@ -130,4 +130,4 @@ export class Matrix4x4 { return this._data; } -} \ No newline at end of file +} diff --git a/src/nitro/ui/widget/enums/AvatarExpressionEnum.ts b/src/nitro/ui/widget/enums/AvatarExpressionEnum.ts index 767d05a3..389f8d47 100644 --- a/src/nitro/ui/widget/enums/AvatarExpressionEnum.ts +++ b/src/nitro/ui/widget/enums/AvatarExpressionEnum.ts @@ -1,13 +1,13 @@ export class AvatarExpressionEnum { public static NONE: AvatarExpressionEnum = new AvatarExpressionEnum(0); - public static _Str_6268: AvatarExpressionEnum = new AvatarExpressionEnum(1); - public static _Str_5579: AvatarExpressionEnum = new AvatarExpressionEnum(2); - public static _Str_7336: AvatarExpressionEnum = new AvatarExpressionEnum(3); - public static _Str_10353: AvatarExpressionEnum = new AvatarExpressionEnum(4); - public static _Str_6989: AvatarExpressionEnum = new AvatarExpressionEnum(5); - public static _Str_16682: AvatarExpressionEnum = new AvatarExpressionEnum(6); - public static _Str_6325: AvatarExpressionEnum = new AvatarExpressionEnum(7); + public static WAVE: AvatarExpressionEnum = new AvatarExpressionEnum(1); + public static BLOW: AvatarExpressionEnum = new AvatarExpressionEnum(2); + public static LAUGH: AvatarExpressionEnum = new AvatarExpressionEnum(3); + public static CRY: AvatarExpressionEnum = new AvatarExpressionEnum(4); + public static IDLE: AvatarExpressionEnum = new AvatarExpressionEnum(5); + public static JUMP: AvatarExpressionEnum = new AvatarExpressionEnum(6); + public static RESPECT: AvatarExpressionEnum = new AvatarExpressionEnum(7); private _ordinal: number; @@ -16,13 +16,13 @@ this._ordinal = k; } - public get _Str_6677(): number + public get ordinal(): number { return this._ordinal; } - public _Str_1451(k: AvatarExpressionEnum): boolean + public equals(k: AvatarExpressionEnum): boolean { return (k) && (k._ordinal == this._ordinal); } -} \ No newline at end of file +} From a4121cd78b7066487fa3384499808dfe5c704733 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 15 May 2021 05:17:36 -0500 Subject: [PATCH 020/155] cleaned RoomWallData --- src/nitro/room/object/RoomPlaneParser.ts | 54 ++++++++++++------------ src/nitro/room/object/RoomWallData.ts | 38 ++++++++--------- 2 files changed, 46 insertions(+), 46 deletions(-) diff --git a/src/nitro/room/object/RoomPlaneParser.ts b/src/nitro/room/object/RoomPlaneParser.ts index e104325c..0f802a80 100644 --- a/src/nitro/room/object/RoomPlaneParser.ts +++ b/src/nitro/room/object/RoomPlaneParser.ts @@ -686,7 +686,7 @@ export class RoomPlaneParser _local_5 = ((_local_5 + 1) % _local_4.length); _local_12--; } - _local_3._Str_17862(_local_6, _local_10, _local_12, _local_8, _local_9); + _local_3.addWall(_local_6, _local_10, _local_12, _local_8, _local_9); if((((_local_11.x == k.x) && (_local_11.y == k.y)) && ((!(_local_11.x == _local_6.x)) || (!(_local_11.y == _local_6.y))))) { break; @@ -715,9 +715,9 @@ export class RoomPlaneParser _local_5 = _local_2; _local_6 = 0; _local_7 = false; - while(((!(k._Str_25208(_local_2))) && (_local_2 < _local_3))) + while(((!(k.getBorder(_local_2))) && (_local_2 < _local_3))) { - if(k._Str_17084(_local_2)) + if(k.getLeftTurn(_local_2)) { _local_6++; } @@ -740,7 +740,7 @@ export class RoomPlaneParser _local_8 = _local_4; while(_local_8 <= _local_5) { - k._Str_15901(_local_8, true); + k.setHideWall(_local_8, true); _local_8++; } } @@ -761,11 +761,11 @@ export class RoomPlaneParser let _local_3 = 0; while(_local_3 < _local_2) { - if(!k._Str_10019(_local_3)) + if(!k.getHideWall(_local_3)) { - _local_4 = k._Str_10778(_local_3); + _local_4 = k.getCorner(_local_3); _local_5 = k.getDirection(_local_3); - _local_6 = k._Str_13743(_local_3); + _local_6 = k.getLength(_local_3); _local_7 = RoomWallData.WALL_DIRECTION_VECTORS[_local_5]; _local_8 = RoomWallData.WALL_NORMAL_VECTORS[_local_5]; _local_9 = 0; @@ -776,7 +776,7 @@ export class RoomPlaneParser { if(((_local_10 > 0) && (_local_9 == 0))) { - k._Str_24531(_local_3, _local_10); + k.setLength(_local_3, _local_10); break; } _local_9++; @@ -785,7 +785,7 @@ export class RoomPlaneParser { if(_local_9 > 0) { - k._Str_23976(_local_3, _local_9); + k.moveCorner(_local_3, _local_9); break; } } @@ -793,7 +793,7 @@ export class RoomPlaneParser } if(_local_9 == _local_6) { - k._Str_15901(_local_3, true); + k.setHideWall(_local_3, true); } } _local_3++; @@ -816,8 +816,8 @@ export class RoomPlaneParser let _local_9 = 0; while(_local_9 < _local_8) { - _local_10 = _arg_3._Str_10778(_local_9); - _local_11 = _arg_3._Str_19138(_local_9); + _local_10 = _arg_3.getCorner(_local_9); + _local_11 = _arg_3.getEndPoint(_local_9); if(k.x == _arg_2.x) { if(((_local_10.x == k.x) && (_local_11.x == k.x))) @@ -861,25 +861,25 @@ export class RoomPlaneParser let _local_4 = 0; while(_local_4 < _local_3) { - if(!k._Str_10019(_local_4)) + if(!k.getHideWall(_local_4)) { - _local_5 = k._Str_10778(_local_4); + _local_5 = k.getCorner(_local_4); _local_6 = new Point(_local_5.x, _local_5.y); _local_7 = RoomWallData.WALL_DIRECTION_VECTORS[k.getDirection(_local_4)]; - _local_8 = k._Str_13743(_local_4); + _local_8 = k.getLength(_local_4); _local_6.x = (_local_6.x + (_local_7.x * _local_8)); _local_6.y = (_local_6.y + (_local_7.y * _local_8)); _local_9 = this.resolveOriginalWallIndex(_local_5, _local_6, _arg_2); if(_local_9 >= 0) { - if(_arg_2._Str_10019(_local_9)) + if(_arg_2.getHideWall(_local_9)) { - k._Str_15901(_local_4, true); + k.setHideWall(_local_4, true); } } else { - k._Str_15901(_local_4, true); + k.setHideWall(_local_4, true); } } _local_4++; @@ -901,11 +901,11 @@ export class RoomPlaneParser while(_local_7 < _local_3) { - if(!k._Str_10019(_local_7)) + if(!k.getHideWall(_local_7)) { - const _local_8 = k._Str_10778(_local_7); + const _local_8 = k.getCorner(_local_7); const _local_9 = k.getDirection(_local_7); - const _local_10 = k._Str_13743(_local_7); + const _local_10 = k.getLength(_local_7); const _local_11 = RoomWallData.WALL_DIRECTION_VECTORS[_local_9]; const _local_12 = RoomWallData.WALL_NORMAL_VECTORS[_local_9]; let _local_13 = -1; @@ -935,7 +935,7 @@ export class RoomPlaneParser _local_16 = Vector3d.dif(_local_16, _local_18); - const _local_20 = this.resolveOriginalWallIndex(_local_8, k._Str_19138(_local_7), _arg_2); + const _local_20 = this.resolveOriginalWallIndex(_local_8, k.getEndPoint(_local_7), _arg_2); let _local_5 = 0; let _local_6 = 0; @@ -965,11 +965,11 @@ export class RoomPlaneParser } } - const _local_22 = k._Str_17084(_local_7); - const _local_23 = k._Str_17084((((_local_7 - 1) + _local_3) % _local_3)); - const _local_24 = k._Str_10019(((_local_7 + 1) % _local_3)); - const _local_25 = k._Str_25455(_local_7); - const _local_26 = k._Str_24163(_local_7); + const _local_22 = k.getLeftTurn(_local_7); + const _local_23 = k.getLeftTurn((((_local_7 - 1) + _local_3) % _local_3)); + const _local_24 = k.getHideWall(((_local_7 + 1) % _local_3)); + const _local_25 = k.getManuallyLeftCut(_local_7); + const _local_26 = k.getManuallyRightCut(_local_7); this.addWall(_local_16, _local_18, _local_19, _local_21, ((!(_local_23)) || (_local_25)), ((!(_local_22)) || (_local_26)), (!(_local_24))); } diff --git a/src/nitro/room/object/RoomWallData.ts b/src/nitro/room/object/RoomWallData.ts index 24131ffc..89ba207f 100644 --- a/src/nitro/room/object/RoomWallData.ts +++ b/src/nitro/room/object/RoomWallData.ts @@ -45,9 +45,9 @@ export class RoomWallData this._count = 0; } - public _Str_17862(k: Point, _arg_2: number, _arg_3: number, _arg_4: boolean, _arg_5: boolean): void + public addWall(k: Point, _arg_2: number, _arg_3: number, _arg_4: boolean, _arg_5: boolean): void { - if(((this._addDuplicates) || (this._Str_22484(k, _arg_2, _arg_3, _arg_4, _arg_5)))) + if(((this._addDuplicates) || (this.checkIsNotDuplicate(k, _arg_2, _arg_3, _arg_4, _arg_5)))) { this._corners.push(k); this._directions.push(_arg_2); @@ -61,7 +61,7 @@ export class RoomWallData } } - private _Str_22484(k: Point, _arg_2: number, _arg_3: number, _arg_4: boolean, _arg_5: boolean): boolean + private checkIsNotDuplicate(k: Point, _arg_2: number, _arg_3: number, _arg_4: boolean, _arg_5: boolean): boolean { let _local_6 = 0; @@ -81,18 +81,18 @@ export class RoomWallData return this._count; } - public _Str_10778(k: number): Point + public getCorner(k: number): Point { return this._corners[k]; } - public _Str_19138(k: number): Point + public getEndPoint(k: number): Point { - this._Str_23674(); + this.calculateWallEndPoints(); return this._endPoints[k]; } - public _Str_13743(k: number): number + public getLength(k: number): number { return this._lengths[k]; } @@ -102,37 +102,37 @@ export class RoomWallData return this._directions[k]; } - public _Str_25208(k: number): boolean + public getBorder(k: number): boolean { return this._borders[k]; } - public _Str_10019(k: number): boolean + public getHideWall(k: number): boolean { return this._hideWalls[k]; } - public _Str_17084(k: number): boolean + public getLeftTurn(k: number): boolean { return this._leftTurns[k]; } - public _Str_25455(k: number): boolean + public getManuallyLeftCut(k: number): boolean { return this._manuallyLeftCut[k]; } - public _Str_24163(k: number): boolean + public getManuallyRightCut(k: number): boolean { return this._manuallyRightCut[k]; } - public _Str_15901(k: number, _arg_2: boolean): void + public setHideWall(k: number, _arg_2: boolean): void { this._hideWalls[k] = _arg_2; } - public _Str_24531(k: number, _arg_2: number): void + public setLength(k: number, _arg_2: number): void { if(_arg_2 < this._lengths[k]) { @@ -141,7 +141,7 @@ export class RoomWallData } } - public _Str_23976(k: number, _arg_2: number): void + public moveCorner(k: number, _arg_2: number): void { let _local_3: IVector3D; if(((_arg_2 > 0) && (_arg_2 < this._lengths[k]))) @@ -155,7 +155,7 @@ export class RoomWallData } } - private _Str_23674(): void + private calculateWallEndPoints(): void { let k: number; let _local_2: Point; @@ -168,10 +168,10 @@ export class RoomWallData k = 0; while(k < this.count) { - _local_2 = this._Str_10778(k); + _local_2 = this.getCorner(k); _local_3 = new Point(_local_2.x, _local_2.y); _local_4 = RoomWallData.WALL_DIRECTION_VECTORS[this.getDirection(k)]; - _local_5 = this._Str_13743(k); + _local_5 = this.getLength(k); _local_3.x = (_local_3.x + (_local_4.x * _local_5)); _local_3.y = (_local_3.y + (_local_4.y * _local_5)); this._endPoints.push(_local_3); @@ -179,4 +179,4 @@ export class RoomWallData } } } -} \ No newline at end of file +} From 3584040d7867e4c0218f1610f4684e99eafc9275 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 15 May 2021 05:25:38 -0500 Subject: [PATCH 021/155] cleaned RoomObjectSpriteType --- .../object/visualization/avatar/AvatarVisualization.ts | 4 ++-- .../room/object/visualization/room/RoomVisualization.ts | 2 +- src/room/object/enum/RoomObjectSpriteType.ts | 8 ++++---- src/room/renderer/RoomSpriteCanvas.ts | 8 ++++---- src/room/renderer/cache/RoomObjectCache.ts | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts index 76bb3bde..1e5337a1 100644 --- a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts +++ b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts @@ -334,11 +334,11 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement if(this._ownUser) { sprite.relativeDepth -= AvatarVisualization._Str_17708; - sprite.spriteType = RoomObjectSpriteType._Str_10494; + sprite.spriteType = RoomObjectSpriteType.AVATAR_OWN; } else { - sprite.spriteType = RoomObjectSpriteType._Str_11629; + sprite.spriteType = RoomObjectSpriteType.AVATAR; } } diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index 9085f6d4..db865ca0 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -669,7 +669,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements sprite.tag = 'plane@' + (planeIndex + 1); } - sprite.spriteType = RoomObjectSpriteType._Str_8616; + sprite.spriteType = RoomObjectSpriteType.ROOM_PLANE; } planeIndex++; diff --git a/src/room/object/enum/RoomObjectSpriteType.ts b/src/room/object/enum/RoomObjectSpriteType.ts index 92bbbb1f..eda5e353 100644 --- a/src/room/object/enum/RoomObjectSpriteType.ts +++ b/src/room/object/enum/RoomObjectSpriteType.ts @@ -1,7 +1,7 @@ export class RoomObjectSpriteType { public static DEFAULT: number = 1; - public static _Str_8616: number = 2; - public static _Str_11629: number = 3; - public static _Str_10494: number = 4; -} \ No newline at end of file + public static ROOM_PLANE: number = 2; + public static AVATAR: number = 3; + public static AVATAR_OWN: number = 4; +} diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 4aabceb9..beff1f6e 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -510,7 +510,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas sortableSprite.sprite = sprite; - if((sprite.spriteType === RoomObjectSpriteType._Str_11629) || (sprite.spriteType === RoomObjectSpriteType._Str_10494)) + if((sprite.spriteType === RoomObjectSpriteType.AVATAR) || (sprite.spriteType === RoomObjectSpriteType.AVATAR_OWN)) { sortableSprite.sprite.libraryAssetName = 'avatar_' + object.id; } @@ -724,12 +724,12 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas switch(_arg_2.spriteType) { - case RoomObjectSpriteType._Str_10494: + case RoomObjectSpriteType.AVATAR_OWN: return; - case RoomObjectSpriteType._Str_8616: + case RoomObjectSpriteType.ROOM_PLANE: sprite.alpha = RoomEnterEffect.getDelta(0.9); return; - case RoomObjectSpriteType._Str_11629: + case RoomObjectSpriteType.AVATAR: sprite.alpha = RoomEnterEffect.getDelta(0.5); return; default: diff --git a/src/room/renderer/cache/RoomObjectCache.ts b/src/room/renderer/cache/RoomObjectCache.ts index 8c39578d..ba320ca8 100644 --- a/src/room/renderer/cache/RoomObjectCache.ts +++ b/src/room/renderer/cache/RoomObjectCache.ts @@ -75,7 +75,7 @@ export class RoomObjectCache { if(!sprite) continue; - if((sprite.sprite.spriteType !== RoomObjectSpriteType._Str_8616) && (sprite.sprite.name !== '')) + if((sprite.sprite.spriteType !== RoomObjectSpriteType.ROOM_PLANE) && (sprite.sprite.name !== '')) { const data = new RoomObjectSpriteData(); @@ -139,7 +139,7 @@ export class RoomObjectCache { for(const sprite of item.sprites.sprites) { - if(sprite.sprite.spriteType === RoomObjectSpriteType._Str_8616) sprites.push(sprite); + if(sprite.sprite.spriteType === RoomObjectSpriteType.ROOM_PLANE) sprites.push(sprite); } } From adb974ea87d81f7c5ed921dd6995e0ad84556a48 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 16:56:42 -0500 Subject: [PATCH 022/155] cleaned ActiveActionData --- src/nitro/avatar/AvatarImage.ts | 82 +++++++++---------- src/nitro/avatar/AvatarStructure.ts | 36 ++++---- src/nitro/avatar/actions/ActiveActionData.ts | 18 ++-- .../avatar/actions/AvatarActionManager.ts | 20 ++--- src/nitro/avatar/actions/IActiveActionData.ts | 12 +-- src/nitro/avatar/animation/Animation.ts | 2 +- .../animation/AvatarAnimationLayerData.ts | 2 +- .../avatar/cache/AvatarImageActionCache.ts | 6 +- src/nitro/avatar/cache/AvatarImageCache.ts | 14 ++-- 9 files changed, 96 insertions(+), 96 deletions(-) diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index 40f6a207..22a33451 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -99,7 +99,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener this.setDirection(AvatarImage.DEFAULT_AVATAR_SET, AvatarImage.DEFAULT_DIRECTION); this._actions = []; this._defaultAction = new ActiveActionData(AvatarAction.POSTURE_STAND); - this._defaultAction._Str_742 = this._structure._Str_1675(AvatarImage.DEFAULT_ACTION); + this._defaultAction.definition = this._structure._Str_1675(AvatarImage.DEFAULT_ACTION); this.resetActions(); this._fullImageCache = new AdvancedMap(); this._animationFrameCount = 0; @@ -246,25 +246,25 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { for(const k of this._sortedActions) { - if(((k._Str_695 == 'fx') && ((((k._Str_727 == '33') || (k._Str_727 == '34')) || (k._Str_727 == '35')) || (k._Str_727 == '36')))) + if(((k.actionType == 'fx') && ((((k.actionParameter == '33') || (k.actionParameter == '34')) || (k.actionParameter == '35')) || (k.actionParameter == '36')))) { return (this._mainDirection + this._currentActionsString) + 0; } - if(((k._Str_695 == 'fx') && ((k._Str_727 == '38') || (k._Str_727 == '39')))) + if(((k.actionType == 'fx') && ((k.actionParameter == '38') || (k.actionParameter == '39')))) { return (((this._mainDirection + '_') + this._headDirection) + this._currentActionsString) + (this._frameCounter % 11); } - if((k._Str_695 === 'dance') && ((k._Str_727 === '1') || (k._Str_727 === '2') || (k._Str_727 === '3') || (k._Str_727 === '4'))) + if((k.actionType === 'dance') && ((k.actionParameter === '1') || (k.actionParameter === '2') || (k.actionParameter === '3') || (k.actionParameter === '4'))) { let frame = (this._frameCounter % 8); - if((k._Str_727 === '3')) frame = (this._frameCounter % 10); + if((k.actionParameter === '3')) frame = (this._frameCounter % 10); - if((k._Str_727 === '4')) frame = (this._frameCounter % 16); + if((k.actionParameter === '4')) frame = (this._frameCounter % 16); - return (((this._mainDirection + k._Str_695) + k._Str_727) + frame); + return (((this._mainDirection + k.actionType) + k.actionParameter) + frame); } } } @@ -291,12 +291,12 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { return; } - const _local_2 = this._structure._Str_1664(this._scale, this._mainAction._Str_742._Str_868); + const _local_2 = this._structure._Str_1664(this._scale, this._mainAction.definition._Str_868); if(_local_2 == null) { return; } - const _local_3 = this.getBodyParts(k, this._mainAction._Str_742._Str_868, this._mainDirection); + const _local_3 = this.getBodyParts(k, this._mainAction.definition._Str_868, this._mainDirection); let _local_6 = (_local_3.length - 1); while(_local_6 >= 0) { @@ -314,7 +314,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._actionsSorted) this.endActionAppends(); - const avatarCanvas = this._structure._Str_1664(this._scale, this._mainAction._Str_742._Str_868); + const avatarCanvas = this._structure._Str_1664(this._scale, this._mainAction.definition._Str_868); if(!avatarCanvas) return null; @@ -331,7 +331,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener this._isCachedImage = false; } - const _local_6 = this.getBodyParts(setType, this._mainAction._Str_742._Str_868, this._mainDirection); + const _local_6 = this.getBodyParts(setType, this._mainAction.definition._Str_868, this._mainDirection); this._image = null; @@ -444,11 +444,11 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._actionsSorted) this.endActionAppends(); - const avatarCanvas = this._structure._Str_1664(this._scale, this._mainAction._Str_742._Str_868); + const avatarCanvas = this._structure._Str_1664(this._scale, this._mainAction.definition._Str_868); if(!avatarCanvas) return null; - const setTypes = this.getBodyParts(setType, this._mainAction._Str_742._Str_868, this._mainDirection); + const setTypes = this.getBodyParts(setType, this._mainAction.definition._Str_868, this._mainDirection); const container = new Sprite(); const sprite = new Sprite(Texture.EMPTY); @@ -509,11 +509,11 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._actionsSorted) this.endActionAppends(); - const avatarCanvas = this._structure._Str_1664(this._scale, this._mainAction._Str_742._Str_868); + const avatarCanvas = this._structure._Str_1664(this._scale, this._mainAction.definition._Str_868); if(!avatarCanvas) return null; - const setTypes = this.getBodyParts(setType, this._mainAction._Str_742._Str_868, this._mainDirection); + const setTypes = this.getBodyParts(setType, this._mainAction.definition._Str_868, this._mainDirection); const container = new Container(); const sprite = new Sprite(Texture.EMPTY); @@ -646,9 +646,9 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener for(const k of this._sortedActions) { - if(k._Str_695 === AvatarAction.EFFECT) + if(k.actionType === AvatarAction.EFFECT) { - if(!this._effectManager.isAvatarEffectReady(parseInt(k._Str_727))) this._effectManager.downloadAvatarEffect(parseInt(k._Str_727), this); + if(!this._effectManager.isAvatarEffectReady(parseInt(k.actionParameter))) this._effectManager.downloadAvatarEffect(parseInt(k.actionParameter), this); } } @@ -760,7 +760,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener while(_local_4 < this._actions.length) { _local_3 = this._actions[_local_4]; - if(((_local_3._Str_695 == k) && (_local_3._Str_727 == _arg_2))) + if(((_local_3.actionType == k) && (_local_3.actionParameter == _arg_2))) { return; } @@ -783,7 +783,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener this._directionOffset = 0; this._structure._Str_2101(this); this._mainAction = this._defaultAction; - this._mainAction._Str_742 = this._defaultAction._Str_742; + this._mainAction.definition = this._defaultAction.definition; this.resetBodyPartCache(this._defaultAction); return true; } @@ -799,8 +799,8 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener } for(const _local_3 of this._sortedActions) { - _local_2 = this._structure._Str_2018(_local_3._Str_695); - if(((!(_local_2 == null)) && (_local_2._Str_715(_local_3._Str_727)))) + _local_2 = this._structure._Str_2018(_local_3.actionType); + if(((!(_local_2 == null)) && (_local_2._Str_715(_local_3.actionParameter)))) { k = true; } @@ -837,11 +837,11 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener for(const _local_4 of this._sortedActions) { - this._currentActionsString = (this._currentActionsString + (_local_4._Str_695 + _local_4._Str_727)); + this._currentActionsString = (this._currentActionsString + (_local_4.actionType + _local_4.actionParameter)); - if(_local_4._Str_695 === AvatarAction.EFFECT) + if(_local_4.actionType === AvatarAction.EFFECT) { - const _local_5 = parseInt(_local_4._Str_727); + const _local_5 = parseInt(_local_4.actionParameter); if(this._effectIdInUse !== _local_5) _local_2 = true; @@ -880,13 +880,13 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener const _local_3: number = Nitro.instance.time; const _local_4: string[] = []; - for(const k of this._sortedActions) _local_4.push(k._Str_695); + for(const k of this._sortedActions) _local_4.push(k.actionType); for(const k of this._sortedActions) { - if((k && k._Str_742) && k._Str_742._Str_861) + if((k && k.definition) && k.definition._Str_861) { - const _local_2 = this._structure._Str_720(((k._Str_742.state + '.') + k._Str_727)); + const _local_2 = this._structure._Str_720(((k.definition.state + '.') + k.actionParameter)); if(_local_2 && _local_2._Str_1892()) { @@ -896,7 +896,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { for(const _local_6 of _local_5) { - if(_local_4.indexOf(_local_6) >= 0) k._Str_707 = _local_2._Str_707(_local_6); + if(_local_4.indexOf(_local_6) >= 0) k.overridingAction = _local_2.overridingAction(_local_6); } } } @@ -910,17 +910,17 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener for(const k of this._sortedActions) { - if(!((!(k)) || (!(k._Str_742)))) + if(!((!(k)) || (!(k.definition)))) { - if(k._Str_742._Str_861 && (k._Str_727 === '')) k._Str_727 = '1'; + if(k.definition._Str_861 && (k.actionParameter === '')) k.actionParameter = '1'; this.setActionToParts(k, _local_3); - if(k._Str_742._Str_861) + if(k.definition._Str_861) { - this._isAnimating = k._Str_742._Str_801(k._Str_727); + this._isAnimating = k.definition._Str_801(k.actionParameter); - const _local_2 = this._structure._Str_720(((k._Str_742.state + '.') + k._Str_727)); + const _local_2 = this._structure._Str_720(((k.definition.state + '.') + k.actionParameter)); if(_local_2) { @@ -937,18 +937,18 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener private setActionToParts(k: IActiveActionData, _arg_2: number): void { - if(((k == null) || (k._Str_742 == null))) + if(((k == null) || (k.definition == null))) { return; } - if(k._Str_742._Str_778 == '') + if(k.definition._Str_778 == '') { return; } - if(k._Str_742._Str_779) + if(k.definition._Str_779) { this._mainAction = k; - this._cache._Str_2014(k._Str_742._Str_868); + this._cache._Str_2014(k.definition._Str_868); } this._cache._Str_1565(k, _arg_2); this._changes = true; @@ -958,12 +958,12 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { if(!k) return; - if(k._Str_742._Str_778 === '') return; + if(k.definition._Str_778 === '') return; - if(k._Str_742._Str_779) + if(k.definition._Str_779) { this._mainAction = k; - this._cache._Str_2014(k._Str_742._Str_868); + this._cache._Str_2014(k.definition._Str_868); } this._cache._Str_741(k); @@ -1045,7 +1045,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener public get mainAction(): string { - return this._mainAction._Str_695; + return this._mainAction.actionType; } public resetEffect(effect: number): void diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index bc95c8fa..dc685c6e 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -204,7 +204,7 @@ export class AvatarStructure extends EventDispatcher for(const _local_3 of k) { - _local_2 = Math.max(_local_2, this._animationData._Str_1408(_local_3._Str_742)); + _local_2 = Math.max(_local_2, this._animationData._Str_1408(_local_3.definition)); } return _local_2; } @@ -251,16 +251,16 @@ export class AvatarStructure extends EventDispatcher let _local_3: string[] = []; const _local_4: string[] = []; - const _local_5 = k._Str_742._Str_868; + const _local_5 = k.definition._Str_868; - if(k._Str_742._Str_861) + if(k.definition._Str_861) { - const _local_7 = ((k._Str_742.state + '.') + k._Str_727); + const _local_7 = ((k.definition.state + '.') + k.actionParameter); const _local_8 = this._animationManager._Str_720(_local_7); if(_local_8) { - _local_3 = _local_8._Str_1065(0, k._Str_707); + _local_3 = _local_8._Str_1065(0, k.overridingAction); if(_local_8._Str_706()) { @@ -311,7 +311,7 @@ export class AvatarStructure extends EventDispatcher } else { - _local_3 = this._partSetsData._Str_1795(k._Str_742); + _local_3 = this._partSetsData._Str_1795(k.definition); for(const _local_14 of _local_3) { @@ -338,7 +338,7 @@ export class AvatarStructure extends EventDispatcher public _Str_1888(k:IActiveActionData, _arg_2: number, _arg_3: number, _arg_4: string): Point { - const _local_5 = this._animationData._Str_2244(k._Str_742); + const _local_5 = this._animationData._Str_2244(k.definition); if(_local_5) return _local_5._Str_1888(_arg_2, _arg_3, _arg_4); @@ -355,21 +355,21 @@ export class AvatarStructure extends EventDispatcher if(!_arg_3 == null) return []; - const _local_9 = this._partSetsData._Str_1795(_arg_3._Str_742); + const _local_9 = this._partSetsData._Str_1795(_arg_3.definition); const _local_11: AvatarImagePartContainer[] = []; let _local_14: any[] = [ 0 ]; - const _local_15 = this._animationData._Str_2244(_arg_3._Str_742); + const _local_15 = this._animationData._Str_2244(_arg_3.definition); - if(_arg_3._Str_742._Str_861) + if(_arg_3.definition._Str_861) { - const _local_24 = ((_arg_3._Str_742.state + '.') + _arg_3._Str_727); + const _local_24 = ((_arg_3.definition.state + '.') + _arg_3.actionParameter); const _local_10 = this._animationManager._Str_720(_local_24); if(_local_10) { - _local_14 = this._Str_1768(_local_10._Str_2185(_arg_3._Str_707)); + _local_14 = this._Str_1768(_local_10._Str_2185(_arg_3.overridingAction)); - for(const _local_25 of _local_10._Str_1065(0, _arg_3._Str_707)) + for(const _local_25 of _local_10._Str_1065(0, _arg_3.overridingAction)) { if(_local_25 === k) { @@ -437,7 +437,7 @@ export class AvatarStructure extends EventDispatcher _local_20 = _local_14; } - _local_34 = _arg_3._Str_742; + _local_34 = _arg_3.definition; if(_local_9.indexOf(_local_33.type) === -1) _local_34 = this._defaultAction; @@ -522,7 +522,7 @@ export class AvatarStructure extends EventDispatcher _local_20 = _local_14; } - const _local_18 = new AvatarImagePartContainer(k, _local_12, _local_41, _local_39, _local_20, _arg_3._Str_742, (!(_local_39 == null)), -1, _local_12, false, 1); + const _local_18 = new AvatarImagePartContainer(k, _local_12, _local_41, _local_39, _local_20, _arg_3.definition, (!(_local_39 == null)), -1, _local_12, false, 1); _local_22.push(_local_18); } @@ -547,9 +547,9 @@ export class AvatarStructure extends EventDispatcher { let _local_47 = '1'; - if(_arg_3._Str_727 !== '') + if(_arg_3.actionParameter !== '') { - _local_47 = _arg_3._Str_727; + _local_47 = _arg_3.actionParameter; } if(_local_13.hasStaticId()) @@ -586,7 +586,7 @@ export class AvatarStructure extends EventDispatcher _local_20 = _local_14; } - const _local_18 = new AvatarImagePartContainer(k, _local_12, _local_47, null, _local_20, _arg_3._Str_742, false, -1, _local_12, _local_45, _local_46); + const _local_18 = new AvatarImagePartContainer(k, _local_12, _local_47, null, _local_20, _arg_3.definition, false, -1, _local_12, _local_45, _local_46); _local_22.push(_local_18); } diff --git a/src/nitro/avatar/actions/ActiveActionData.ts b/src/nitro/avatar/actions/ActiveActionData.ts index 7e2ce117..8e259169 100644 --- a/src/nitro/avatar/actions/ActiveActionData.ts +++ b/src/nitro/avatar/actions/ActiveActionData.ts @@ -32,43 +32,43 @@ export class ActiveActionData implements IActiveActionData return this._definition.id + '_' + this._actionParameter; } - public get _Str_695(): string + public get actionType(): string { return this._actionType; } - public get _Str_727(): string + public get actionParameter(): string { return this._actionParameter; } - public set _Str_727(parameter: string) + public set actionParameter(parameter: string) { this._actionParameter = parameter; } - public get _Str_742(): IActionDefinition + public get definition(): IActionDefinition { return this._definition; } - public set _Str_742(definition: IActionDefinition) + public set definition(definition: IActionDefinition) { this._definition = definition; } - public get _Str_664(): number + public get startFrame(): number { return this._startFrame; } - public get _Str_707(): string + public get overridingAction(): string { return this._overridingAction; } - public set _Str_707(action: string) + public set overridingAction(action: string) { this._overridingAction = action; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/actions/AvatarActionManager.ts b/src/nitro/avatar/actions/AvatarActionManager.ts index 6f56586c..4b1cebf7 100644 --- a/src/nitro/avatar/actions/AvatarActionManager.ts +++ b/src/nitro/avatar/actions/AvatarActionManager.ts @@ -106,7 +106,7 @@ export class AvatarActionManager { if(!activeAction) continue; - const action = this._actions.get(activeAction._Str_695); + const action = this._actions.get(activeAction.actionType); const offsets = action && action._Str_805(_arg_2, _arg_3); if(offsets) canvasOffsets = offsets; @@ -127,11 +127,11 @@ export class AvatarActionManager { if(!action) continue; - const definition = this._actions.get(action._Str_695); + const definition = this._actions.get(action.actionType); if(!definition) continue; - action._Str_742 = definition; + action.definition = definition; validatedActions.push(action); } @@ -150,18 +150,18 @@ export class AvatarActionManager { if(!action) continue; - const localAction = this._actions.get(action._Str_695); + const localAction = this._actions.get(action.actionType); - if(localAction) preventions = preventions.concat(localAction._Str_733(action._Str_727)); + if(localAction) preventions = preventions.concat(localAction._Str_733(action.actionParameter)); } for(const action of actions) { if(!action) continue; - let actionType = action._Str_695; + let actionType = action.actionType; - if(action._Str_695 === 'fx') actionType = (actionType + ('.' + action._Str_727)); + if(action.actionType === 'fx') actionType = (actionType + ('.' + action.actionParameter)); if(preventions.indexOf(actionType) >= 0) continue; @@ -175,8 +175,8 @@ export class AvatarActionManager { if(!actionOne || !actionTwo) return 0; - const precedenceOne = actionOne._Str_742.precedence; - const precedenceTwo = actionTwo._Str_742.precedence; + const precedenceOne = actionOne.definition.precedence; + const precedenceTwo = actionTwo.definition.precedence; if(precedenceOne < precedenceTwo) return 1; @@ -184,4 +184,4 @@ export class AvatarActionManager return 0; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/actions/IActiveActionData.ts b/src/nitro/avatar/actions/IActiveActionData.ts index 1e6bacc7..214c64f7 100644 --- a/src/nitro/avatar/actions/IActiveActionData.ts +++ b/src/nitro/avatar/actions/IActiveActionData.ts @@ -3,9 +3,9 @@ import { IActionDefinition } from './IActionDefinition'; export interface IActiveActionData { id: string; - _Str_695: string; - _Str_727: string; - _Str_664: number; - _Str_742: IActionDefinition; - _Str_707: string; -} \ No newline at end of file + actionType: string; + actionParameter: string; + startFrame: number; + definition: IActionDefinition; + overridingAction: string; +} diff --git a/src/nitro/avatar/animation/Animation.ts b/src/nitro/avatar/animation/Animation.ts index 14198bdb..8dddd326 100644 --- a/src/nitro/avatar/animation/Animation.ts +++ b/src/nitro/avatar/animation/Animation.ts @@ -162,7 +162,7 @@ export class Animation implements IAnimation return keys; } - public _Str_707(k: string): string + public overridingAction(k: string): string { if(!this._overriddenActions) return null; diff --git a/src/nitro/avatar/animation/AvatarAnimationLayerData.ts b/src/nitro/avatar/animation/AvatarAnimationLayerData.ts index 8e2d9000..33e70f02 100644 --- a/src/nitro/avatar/animation/AvatarAnimationLayerData.ts +++ b/src/nitro/avatar/animation/AvatarAnimationLayerData.ts @@ -41,7 +41,7 @@ export class AvatarAnimationLayerData implements IAnimationLayerData if(_arg_3) { this._action = new ActiveActionData(_arg_3.state, this.base); - this._action._Str_742 = _arg_3; + this._action.definition = _arg_3; } } diff --git a/src/nitro/avatar/cache/AvatarImageActionCache.ts b/src/nitro/avatar/cache/AvatarImageActionCache.ts index 28a49923..afc4fd52 100644 --- a/src/nitro/avatar/cache/AvatarImageActionCache.ts +++ b/src/nitro/avatar/cache/AvatarImageActionCache.ts @@ -79,18 +79,18 @@ export class AvatarImageActionCache if(!k) k = this._Str_1233; - if(k._Str_707) return this._Str_586.get(k._Str_707); + if(k.overridingAction) return this._Str_586.get(k.overridingAction); return this._Str_586.get(k.id); } public _Str_1765(k: IActiveActionData, _arg_2: AvatarImageBodyPartCache): void { - if(k._Str_707) this._Str_586.set(k._Str_707, _arg_2); + if(k.overridingAction) this._Str_586.set(k.overridingAction, _arg_2); else this._Str_586.set(k.id, _arg_2); } private _Str_587(k: string): void { } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index 39b1d97e..5984ac0f 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -173,25 +173,25 @@ export class AvatarImageCache let _local_7 = _local_4._Str_2244(); let frameCount = frameNumber; - if(_local_7._Str_742._Str_812) frameCount -= _local_7._Str_664; + if(_local_7.definition._Str_812) frameCount -= _local_7.startFrame; let _local_8 = _local_7; let _local_9: string[] = []; let _local_10: Map = new Map(); const _local_11 = new Point(); - if(!((!(_local_7)) || (!(_local_7._Str_742)))) + if(!((!(_local_7)) || (!(_local_7.definition)))) { - if(_local_7._Str_742._Str_861) + if(_local_7.definition._Str_861) { let _local_15 = _local_5; - const _local_16 = this._structure._Str_720(((_local_7._Str_742.state + '.') + _local_7._Str_727)); - const _local_17 = (frameNumber - _local_7._Str_664); + const _local_16 = this._structure._Str_720(((_local_7.definition.state + '.') + _local_7.actionParameter)); + const _local_17 = (frameNumber - _local_7.startFrame); if(_local_16) { - const _local_18 = _local_16._Str_607(_local_17, k, _local_7._Str_707); + const _local_18 = _local_16._Str_607(_local_17, k, _local_7.overridingAction); if(_local_18) { @@ -331,7 +331,7 @@ export class AvatarImageCache } const isFlipped = AvatarDirectionAngle.DIRECTION_IS_FLIPPED[direction] || false; - let assetPartDefinition = _arg_4._Str_742._Str_778; + let assetPartDefinition = _arg_4.definition._Str_778; let isCacheable = true; let containerIndex = (containers.length - 1); From 973240c997f47159aca0abded1e34695587369d2 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 17:15:05 -0500 Subject: [PATCH 023/155] cleaned EaseRate --- src/nitro/window/motion/EaseOut.ts | 4 ++-- src/nitro/window/motion/EaseRate.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/nitro/window/motion/EaseOut.ts b/src/nitro/window/motion/EaseOut.ts index 5294b1d3..d59fb0f0 100644 --- a/src/nitro/window/motion/EaseOut.ts +++ b/src/nitro/window/motion/EaseOut.ts @@ -10,6 +10,6 @@ export class EaseOut extends EaseRate public update(k: number): void { - this._interval.update(Math.pow(k, (1 / this._Str_21638))); + this._interval.update(Math.pow(k, (1 / this._rate))); } -} \ No newline at end of file +} diff --git a/src/nitro/window/motion/EaseRate.ts b/src/nitro/window/motion/EaseRate.ts index e7652064..d5308cca 100644 --- a/src/nitro/window/motion/EaseRate.ts +++ b/src/nitro/window/motion/EaseRate.ts @@ -3,12 +3,12 @@ import { Interval } from './Interval'; export class EaseRate extends Ease { - protected _Str_21638: number; + protected _rate: number; constructor(k: Interval, _arg_2: number) { super(k); - this._Str_21638 = _arg_2; + this._rate = _arg_2; } -} \ No newline at end of file +} From 302212ba5c14e34395325986eb3a91766875bf55 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 17:58:03 -0500 Subject: [PATCH 024/155] cleaned AvatarDataContainer --- src/nitro/avatar/AvatarImage.ts | 4 ++-- src/nitro/avatar/animation/AvatarDataContainer.ts | 6 +++--- src/nitro/avatar/animation/IAvatarDataContainer.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index 22a33451..d7f358a7 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -386,7 +386,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener partCount--; } - if(this._avatarSpriteData && this._avatarSpriteData._Str_832) this.convertToGrayscale(container); + if(this._avatarSpriteData && this._avatarSpriteData.paletteIsGrayscale) this.convertToGrayscale(container); if(!cache) { @@ -404,7 +404,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._reusableTexture) return null; - if(this._avatarSpriteData && this._avatarSpriteData._Str_832) + if(this._avatarSpriteData && this._avatarSpriteData.paletteIsGrayscale) { //this._reusableTexture = this.applyPalette(this._reusableTexture, this._avatarSpriteData.reds); } diff --git a/src/nitro/avatar/animation/AvatarDataContainer.ts b/src/nitro/avatar/animation/AvatarDataContainer.ts index 466b033a..9fef8136 100644 --- a/src/nitro/avatar/animation/AvatarDataContainer.ts +++ b/src/nitro/avatar/animation/AvatarDataContainer.ts @@ -48,7 +48,7 @@ export class AvatarDataContainer implements IAvatarDataContainer this._paletteIsGrayscale = false; } - this._colorMap = this._Str_1181(this._backGround, this._foreGround); + this._colorMap = this.generatePaletteMapForGrayscale(this._backGround, this._foreGround); } public get ink(): number @@ -81,12 +81,12 @@ export class AvatarDataContainer implements IAvatarDataContainer return this._colorMap.get('alphas'); } - public get _Str_832(): boolean + public get paletteIsGrayscale(): boolean { return this._paletteIsGrayscale; } - private _Str_1181(k: number, _arg_2: number): Map + private generatePaletteMapForGrayscale(k: number, _arg_2: number): Map { const _local_3 = ((k >> 24) & 0xFF); const _local_4 = ((k >> 16) & 0xFF); diff --git a/src/nitro/avatar/animation/IAvatarDataContainer.ts b/src/nitro/avatar/animation/IAvatarDataContainer.ts index 7cb2fbb3..1e6ed488 100644 --- a/src/nitro/avatar/animation/IAvatarDataContainer.ts +++ b/src/nitro/avatar/animation/IAvatarDataContainer.ts @@ -4,9 +4,9 @@ export interface IAvatarDataContainer { ink: number; colorTransform: AdjustmentFilter; - _Str_832: boolean; + paletteIsGrayscale: boolean; reds: number[]; greens: number[]; blues: number[]; alphas: number[]; -} \ No newline at end of file +} From 428ae04cf64804f8584cca4ddce7ada2760c5799 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 19:03:54 -0500 Subject: [PATCH 025/155] cleaned AvatarStructure --- src/nitro/avatar/AvatarImage.ts | 34 +++---- src/nitro/avatar/AvatarRenderManager.ts | 22 ++--- src/nitro/avatar/AvatarStructure.ts | 96 +++++++++---------- .../avatar/EffectAssetDownloadManager.ts | 2 +- .../avatar/actions/AvatarActionManager.ts | 12 +-- src/nitro/avatar/animation/Animation.ts | 4 +- .../avatar/animation/AnimationManager.ts | 6 +- .../avatar/animation/IAnimationManager.ts | 4 +- src/nitro/avatar/cache/AvatarImageCache.ts | 12 +-- .../avatar/geometry/AvatarModelGeometry.ts | 14 +-- src/nitro/avatar/geometry/AvatarSet.ts | 6 +- src/nitro/avatar/geometry/GeometryBodyPart.ts | 4 +- src/nitro/avatar/structure/FigureSetData.ts | 8 +- .../structure/animation/AnimationAction.ts | 4 +- src/nitro/avatar/structure/figure/SetType.ts | 4 +- 15 files changed, 116 insertions(+), 116 deletions(-) diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index d7f358a7..545862cb 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -99,7 +99,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener this.setDirection(AvatarImage.DEFAULT_AVATAR_SET, AvatarImage.DEFAULT_DIRECTION); this._actions = []; this._defaultAction = new ActiveActionData(AvatarAction.POSTURE_STAND); - this._defaultAction.definition = this._structure._Str_1675(AvatarImage.DEFAULT_ACTION); + this._defaultAction.definition = this._structure.getActionDefinition(AvatarImage.DEFAULT_ACTION); this.resetActions(); this._fullImageCache = new AdvancedMap(); this._animationFrameCount = 0; @@ -165,7 +165,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener public getPartColor(k: string): IPartColor { - return this._structure._Str_867(this._figure, k); + return this._structure.getPartColor(this._figure, k); } public setDirection(k: string, _arg_2: number): void @@ -182,7 +182,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener _arg_2 = (_arg_2 - (AvatarDirectionAngle.MAX_DIRECTION + 1)); } - if(this._structure._Str_1939(k)) + if(this._structure.isMainAvatarSet(k)) { this._mainDirection = _arg_2; } @@ -218,7 +218,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener public getLayerData(k: ISpriteDataContainer): IAnimationLayerData { - return this._structure._Str_1881(k.animation.id, this._frameCounter, k.id); + return this._structure.getBodyPartData(k.animation.id, this._frameCounter, k.id); } public updateAnimationByFrames(k: number = 1): void @@ -279,7 +279,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener this._cachedBodyPartsDirection = _arg_3; this._cachedBodyPartsGeometryType = _arg_2; this._cachedBodyPartsAvatarSet = k; - this._cachedBodyParts = this._structure._Str_755(k, _arg_2, _arg_3); + this._cachedBodyParts = this._structure.getBodyParts(k, _arg_2, _arg_3); } return this._cachedBodyParts; } @@ -291,7 +291,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { return; } - const _local_2 = this._structure._Str_1664(this._scale, this._mainAction.definition._Str_868); + const _local_2 = this._structure.getCanvas(this._scale, this._mainAction.definition._Str_868); if(_local_2 == null) { return; @@ -314,7 +314,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._actionsSorted) this.endActionAppends(); - const avatarCanvas = this._structure._Str_1664(this._scale, this._mainAction.definition._Str_868); + const avatarCanvas = this._structure.getCanvas(this._scale, this._mainAction.definition._Str_868); if(!avatarCanvas) return null; @@ -444,7 +444,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._actionsSorted) this.endActionAppends(); - const avatarCanvas = this._structure._Str_1664(this._scale, this._mainAction.definition._Str_868); + const avatarCanvas = this._structure.getCanvas(this._scale, this._mainAction.definition._Str_868); if(!avatarCanvas) return null; @@ -509,7 +509,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._actionsSorted) this.endActionAppends(); - const avatarCanvas = this._structure._Str_1664(this._scale, this._mainAction.definition._Str_868); + const avatarCanvas = this._structure.getCanvas(this._scale, this._mainAction.definition._Str_868); if(!avatarCanvas) return null; @@ -741,7 +741,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener break; case AvatarAction.CARRY_OBJECT: case AvatarAction.USE_OBJECT: { - const _local_4 = this._structure._Str_2018(k); + const _local_4 = this._structure.getActionDefinitionWithState(k); if(_local_4) _local_3 = _local_4._Str_1350(_local_3); this.addActionData(k, _local_3); break; @@ -781,7 +781,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener this._sprites = []; this._avatarSpriteData = null; this._directionOffset = 0; - this._structure._Str_2101(this); + this._structure.removeDynamicItems(this); this._mainAction = this._defaultAction; this._mainAction.definition = this._defaultAction.definition; this.resetBodyPartCache(this._defaultAction); @@ -799,7 +799,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener } for(const _local_3 of this._sortedActions) { - _local_2 = this._structure._Str_2018(_local_3.actionType); + _local_2 = this._structure.getActionDefinitionWithState(_local_3.actionType); if(((!(_local_2 == null)) && (_local_2._Str_715(_local_3.actionParameter)))) { k = true; @@ -817,8 +817,8 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener let k: boolean; this._currentActionsString = ''; - this._sortedActions = this._structure._Str_711(this._actions); - this._animationFrameCount = this._structure._Str_1936(this._sortedActions); + this._sortedActions = this._structure.sortActions(this._actions); + this._animationFrameCount = this._structure.maxFrames(this._sortedActions); if(!this._sortedActions) { @@ -833,7 +833,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener } else { - this._canvasOffsets = this._structure._Str_781(this._sortedActions, this._scale, this._mainDirection); + this._canvasOffsets = this._structure.getCanvasOffsets(this._sortedActions, this._scale, this._mainDirection); for(const _local_4 of this._sortedActions) { @@ -886,7 +886,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { if((k && k.definition) && k.definition._Str_861) { - const _local_2 = this._structure._Str_720(((k.definition.state + '.') + k.actionParameter)); + const _local_2 = this._structure.getAnimation(((k.definition.state + '.') + k.actionParameter)); if(_local_2 && _local_2._Str_1892()) { @@ -920,7 +920,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { this._isAnimating = k.definition._Str_801(k.actionParameter); - const _local_2 = this._structure._Str_720(((k.definition.state + '.') + k.actionParameter)); + const _local_2 = this._structure.getAnimation(((k.definition.state + '.') + k.actionParameter)); if(_local_2) { diff --git a/src/nitro/avatar/AvatarRenderManager.ts b/src/nitro/avatar/AvatarRenderManager.ts index fa7fc07e..d72a7179 100644 --- a/src/nitro/avatar/AvatarRenderManager.ts +++ b/src/nitro/avatar/AvatarRenderManager.ts @@ -126,7 +126,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { if(!this._structure) return; - this._structure._Str_1825(HabboAvatarGeometry.geometry); + this._structure.initGeometry(HabboAvatarGeometry.geometry); this._geometryReady = true; @@ -137,7 +137,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { if(!this._structure) return; - this._structure._Str_1296(HabboAvatarPartSets.partSets); + this._structure.initPartSets(HabboAvatarPartSets.partSets); this._partSetsReady = true; @@ -148,7 +148,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { const defaultActions = Nitro.instance.getConfiguration('avatar.default.actions'); - if(defaultActions) this._structure._Str_1060(Nitro.instance.core.asset, defaultActions); + if(defaultActions) this._structure.initActions(Nitro.instance.core.asset, defaultActions); const request = new XMLHttpRequest(); @@ -162,7 +162,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { if(!this._structure) return; - this._structure._Str_1620(JSON.parse(request.responseText)); + this._structure.updateActions(JSON.parse(request.responseText)); this._actionsReady = true; @@ -185,7 +185,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { if(!this._structure) return; - this._structure._Str_2229(HabboAvatarAnimations.animations); + this._structure.initAnimation(HabboAvatarAnimations.animations); this._animationsReady = true; @@ -204,7 +204,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { if(err || !results || !results.figuredata) throw new Error('invalid_default_figure_data'); - if(this._structure) this._structure._Str_1569(results.figuredata); + if(this._structure) this._structure.initFigureData(results.figuredata); }); } @@ -308,7 +308,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { let isValid = false; - const typeIds = this._structure._Str_1733(gender, 2); + const typeIds = this._structure.getMandatorySetTypeIds(gender, 2); if(typeIds) { @@ -318,7 +318,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { if(!container.hasPartType(id)) { - const figurePartSet = this._structure._Str_2264(id, gender); + const figurePartSet = this._structure.getDefaultPartSet(id, gender); if(figurePartSet) { @@ -337,7 +337,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa if(!figurePartSet) { - const partSet = this._structure._Str_2264(id, gender); + const partSet = this._structure.getDefaultPartSet(id, gender); if(partSet) { @@ -385,7 +385,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa } } - if(!searchParts) searchParts = this._structure._Str_1695(AvatarSetType.FULL); + if(!searchParts) searchParts = this._structure.getBodyPartsUnordered(AvatarSetType.FULL); for(const part of searchParts) { @@ -440,7 +440,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { if(!this._structure) return null; - return this._structure._Str_1733(k, _arg_2); + return this._structure.getMandatorySetTypeIds(k, _arg_2); } public getAssetByName(name: string): IGraphicAsset diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index dc685c6e..8bd40563 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -71,14 +71,14 @@ export class AvatarStructure extends EventDispatcher this._mandatorySetTypeIds = null; } - public _Str_1825(k: any): void + public initGeometry(k: any): void { if(!k) return; this._geometry = new AvatarModelGeometry(k); } - public _Str_1060(k: IAssetManager, _arg_2: any): void + public initActions(k: IAssetManager, _arg_2: any): void { if(!_arg_2) return; @@ -86,14 +86,14 @@ export class AvatarStructure extends EventDispatcher this._defaultAction = this._actionManager._Str_1027(); } - public _Str_1620(data: any): void + public updateActions(data: any): void { - this._actionManager._Str_1620(data); + this._actionManager.updateActions(data); this._defaultAction = this._actionManager._Str_1027(); } - public _Str_1296(k: any): boolean + public initPartSets(k: any): boolean { if(!k) return false; @@ -108,26 +108,26 @@ export class AvatarStructure extends EventDispatcher return false; } - public _Str_2229(k: any): boolean + public initAnimation(k: any): boolean { if(!k) return false; return this._animationData.parse(k); } - public _Str_1569(k: any): boolean + public initFigureData(k: any): boolean { if(!k) return false; return this._figureData.parse(k); } - public _Str_882(data: any): void + public injectFigureData(data: any): void { this._figureData._Str_1133(data); } - public _Str_1849(k: IAssetManager, _arg_2: string = 'fx', _arg_3: number = 200): void + public registerAnimations(k: IAssetManager, _arg_2: string = 'fx', _arg_3: number = 200): void { let index = 0; @@ -139,19 +139,19 @@ export class AvatarStructure extends EventDispatcher { const animationData = collection.data; - this._animationManager._Str_2061(this, animationData.animations); + this._animationManager.registerAnimation(this, animationData.animations); } index++; } } - public _Str_2061(data: { [index: string]: IAssetAnimation }): void + public registerAnimation(data: { [index: string]: IAssetAnimation }): void { - this._animationManager._Str_2061(this, data); + this._animationManager.registerAnimation(this, data); } - public _Str_867(k: IAvatarFigureContainer, _arg_2: string, _arg_3: number = 0): IPartColor + public getPartColor(k: IAvatarFigureContainer, _arg_2: string, _arg_3: number = 0): IPartColor { const _local_4 = k.getPartColorIds(_arg_2); @@ -168,37 +168,37 @@ export class AvatarStructure extends EventDispatcher return _local_6._Str_751(_local_4[_arg_3]); } - public _Str_1881(animation: string, frameCount: number, spriteId: string): AvatarAnimationLayerData + public getBodyPartData(animation: string, frameCount: number, spriteId: string): AvatarAnimationLayerData { return this._animationManager._Str_607(animation, frameCount, spriteId) as AvatarAnimationLayerData; } - public _Str_720(k: string): Animation + public getAnimation(k: string): Animation { - return this._animationManager._Str_720(k) as Animation; + return this._animationManager.getAnimation(k) as Animation; } - public _Str_1675(k: string): ActionDefinition + public getActionDefinition(k: string): ActionDefinition { - return this._actionManager._Str_1675(k); + return this._actionManager.getActionDefinition(k); } - public _Str_2018(k: string): ActionDefinition + public getActionDefinitionWithState(k: string): ActionDefinition { - return this._actionManager._Str_2018(k); + return this._actionManager.getActionDefinitionWithState(k); } - public _Str_1939(k: string): boolean + public isMainAvatarSet(k: string): boolean { - return this._geometry._Str_1939(k); + return this._geometry.isMainAvatarSet(k); } - public _Str_711(k: IActiveActionData[]): IActiveActionData[] + public sortActions(k: IActiveActionData[]): IActiveActionData[] { - return this._actionManager._Str_711(k); + return this._actionManager.sortActions(k); } - public _Str_1936(k: IActiveActionData[]): number + public maxFrames(k: IActiveActionData[]): number { let _local_2 = 0; @@ -209,7 +209,7 @@ export class AvatarStructure extends EventDispatcher return _local_2; } - public _Str_1733(k: string, _arg_2: number): string[] + public getMandatorySetTypeIds(k: string, _arg_2: number): string[] { if(!this._mandatorySetTypeIds[k]) { @@ -221,32 +221,32 @@ export class AvatarStructure extends EventDispatcher return this._mandatorySetTypeIds[k][_arg_2]; } - this._mandatorySetTypeIds[k][_arg_2] = this._figureData._Str_1733(k, _arg_2); + this._mandatorySetTypeIds[k][_arg_2] = this._figureData.getMandatorySetTypeIds(k, _arg_2); return this._mandatorySetTypeIds[k][_arg_2]; } - public _Str_2264(k: string, _arg_2: string): IFigurePartSet + public getDefaultPartSet(k: string, _arg_2: string): IFigurePartSet { - return this._figureData._Str_2264(k, _arg_2); + return this._figureData.getDefaultPartSet(k, _arg_2); } - public _Str_781(k: IActiveActionData[], _arg_2: string, _arg_3: number): number[] + public getCanvasOffsets(k: IActiveActionData[], _arg_2: string, _arg_3: number): number[] { - return this._actionManager._Str_781(k, _arg_2, _arg_3); + return this._actionManager.getCanvasOffsets(k, _arg_2, _arg_3); } - public _Str_1664(k: string, _arg_2: string): AvatarCanvas + public getCanvas(k: string, _arg_2: string): AvatarCanvas { - return this._geometry._Str_1664(k, _arg_2); + return this._geometry.getCanvas(k, _arg_2); } - public _Str_2101(k: IAvatarImage): void + public removeDynamicItems(k: IAvatarImage): void { - this._geometry._Str_2101(k); + this._geometry.removeDynamicItems(k); } - public _Str_2021(k: IActiveActionData, _arg_2: IAvatarImage): string[] + public getActiveBodyPartIds(k: IActiveActionData, _arg_2: IAvatarImage): string[] { let _local_3: string[] = []; @@ -256,7 +256,7 @@ export class AvatarStructure extends EventDispatcher if(k.definition._Str_861) { const _local_7 = ((k.definition.state + '.') + k.actionParameter); - const _local_8 = this._animationManager._Str_720(_local_7); + const _local_8 = this._animationManager.getAnimation(_local_7); if(_local_8) { @@ -324,28 +324,28 @@ export class AvatarStructure extends EventDispatcher return _local_4; } - public _Str_1695(k: string): string[] + public getBodyPartsUnordered(k: string): string[] { return this._geometry._Str_1307(k); } - public _Str_755(k: string, _arg_2: string, _arg_3: number): string[] + public getBodyParts(k: string, _arg_2: string, _arg_3: number): string[] { const _local_4 = AvatarDirectionAngle.DIRECTION_TO_ANGLE[_arg_3]; return this._geometry._Str_2250(k, _local_4, _arg_2); } - public _Str_1888(k:IActiveActionData, _arg_2: number, _arg_3: number, _arg_4: string): Point + public getFrameBodyPartOffset(k:IActiveActionData, _arg_2: number, _arg_3: number, _arg_4: string): Point { const _local_5 = this._animationData._Str_2244(k.definition); - if(_local_5) return _local_5._Str_1888(_arg_2, _arg_3, _arg_4); + if(_local_5) return _local_5.getFrameBodyPartOffset(_arg_2, _arg_3, _arg_4); return AnimationAction._Str_1934; } - public _Str_713(k: string, _arg_2:IAvatarFigureContainer, _arg_3:IActiveActionData, _arg_4: string, _arg_5: number, removes: string[], _arg_7: IAvatarImage, _arg_8: Map = null): AvatarImagePartContainer[] + public getParts(k: string, _arg_2:IAvatarFigureContainer, _arg_3:IActiveActionData, _arg_4: string, _arg_5: number, removes: string[], _arg_7: IAvatarImage, _arg_8: Map = null): AvatarImagePartContainer[] { const _local_10: Animation = null; let _local_34: IActionDefinition = null; @@ -363,11 +363,11 @@ export class AvatarStructure extends EventDispatcher if(_arg_3.definition._Str_861) { const _local_24 = ((_arg_3.definition.state + '.') + _arg_3.actionParameter); - const _local_10 = this._animationManager._Str_720(_local_24); + const _local_10 = this._animationManager.getAnimation(_local_24); if(_local_10) { - _local_14 = this._Str_1768(_local_10._Str_2185(_arg_3.overridingAction)); + _local_14 = this.getPopulatedArray(_local_10._Str_2185(_arg_3.overridingAction)); for(const _local_25 of _local_10._Str_1065(0, _arg_3.overridingAction)) { @@ -387,7 +387,7 @@ export class AvatarStructure extends EventDispatcher } } - const _local_16 = this._geometry._Str_713(_arg_4, k, _arg_5, _local_9, _arg_7); + const _local_16 = this._geometry.getParts(_arg_4, k, _arg_5, _local_9, _arg_7); const _local_21 = _arg_2.getPartTypeIds(); for(const _local_17 of _local_21) @@ -599,7 +599,7 @@ export class AvatarStructure extends EventDispatcher return _local_22; } - private _Str_1768(k: number): number[] + private getPopulatedArray(k: number): number[] { const _local_2: number[] = []; @@ -615,11 +615,11 @@ export class AvatarStructure extends EventDispatcher return _local_2; } - public _Str_672(): string[] + public getItemIds(): string[] { if(this._actionManager) { - const k = this._actionManager._Str_1675('CarryItem').params; + const k = this._actionManager.getActionDefinition('CarryItem').params; const _local_2 = []; diff --git a/src/nitro/avatar/EffectAssetDownloadManager.ts b/src/nitro/avatar/EffectAssetDownloadManager.ts index c34c03fd..08d74fb6 100644 --- a/src/nitro/avatar/EffectAssetDownloadManager.ts +++ b/src/nitro/avatar/EffectAssetDownloadManager.ts @@ -179,7 +179,7 @@ export class EffectAssetDownloadManager extends EventDispatcher const loadedEffects: string[] = []; - this._structure._Str_2061(event.library.animation); + this._structure.registerAnimation(event.library.animation); for(const [ id, libraries ] of this._incompleteEffects.entries()) { diff --git a/src/nitro/avatar/actions/AvatarActionManager.ts b/src/nitro/avatar/actions/AvatarActionManager.ts index 4b1cebf7..90a375e8 100644 --- a/src/nitro/avatar/actions/AvatarActionManager.ts +++ b/src/nitro/avatar/actions/AvatarActionManager.ts @@ -14,10 +14,10 @@ export class AvatarActionManager this._actions = new Map(); this._defaultAction = null; - this._Str_1620(data); + this.updateActions(data); } - public _Str_1620(data: any): void + public updateActions(data: any): void { if(!data) return; @@ -59,7 +59,7 @@ export class AvatarActionManager } } - public _Str_1675(id: string): ActionDefinition + public getActionDefinition(id: string): ActionDefinition { if(!id) return null; @@ -73,7 +73,7 @@ export class AvatarActionManager return null; } - public _Str_2018(state: string): ActionDefinition + public getActionDefinitionWithState(state: string): ActionDefinition { const existing = this._actions.get(state); @@ -98,7 +98,7 @@ export class AvatarActionManager return null; } - public _Str_781(k: IActiveActionData[], _arg_2: string, _arg_3: number): number[] + public getCanvasOffsets(k: IActiveActionData[], _arg_2: string, _arg_3: number): number[] { let canvasOffsets: number[] = []; @@ -115,7 +115,7 @@ export class AvatarActionManager return canvasOffsets; } - public _Str_711(actions: IActiveActionData[]): IActiveActionData[] + public sortActions(actions: IActiveActionData[]): IActiveActionData[] { if(!actions) return null; diff --git a/src/nitro/avatar/animation/Animation.ts b/src/nitro/avatar/animation/Animation.ts index 8dddd326..60a8d67e 100644 --- a/src/nitro/avatar/animation/Animation.ts +++ b/src/nitro/avatar/animation/Animation.ts @@ -105,7 +105,7 @@ export class Animation implements IAnimation { for(const bodyPart of frame.bodyparts) { - const definition = _arg_3._Str_1675(bodyPart.action); + const definition = _arg_3.getActionDefinition(bodyPart.action); const layer = new AvatarAnimationLayerData(bodyPart, AvatarAnimationLayerData.BODYPART, definition); layers.push(layer); @@ -116,7 +116,7 @@ export class Animation implements IAnimation { for(const fx of frame.fxs) { - const definition = _arg_3._Str_1675(fx.action); + const definition = _arg_3.getActionDefinition(fx.action); const layer = new AvatarAnimationLayerData(fx, AvatarAnimationLayerData.FX, definition); layers.push(layer); diff --git a/src/nitro/avatar/animation/AnimationManager.ts b/src/nitro/avatar/animation/AnimationManager.ts index f1204c3a..348d6281 100644 --- a/src/nitro/avatar/animation/AnimationManager.ts +++ b/src/nitro/avatar/animation/AnimationManager.ts @@ -14,7 +14,7 @@ export class AnimationManager implements IAnimationManager this._animations = new Map(); } - public _Str_2061(structure: AvatarStructure, _arg_2: { [index: string]: IAssetAnimation }): boolean + public registerAnimation(structure: AvatarStructure, _arg_2: { [index: string]: IAssetAnimation }): boolean { const animationData = _arg_2[Object.keys(_arg_2)[0]]; @@ -25,7 +25,7 @@ export class AnimationManager implements IAnimationManager return true; } - public _Str_720(animation: string): Animation + public getAnimation(animation: string): Animation { const existing = this._animations.get(animation); @@ -36,7 +36,7 @@ export class AnimationManager implements IAnimationManager public _Str_607(animation: string, frameCount: number, spriteId: string): IAnimationLayerData { - const existing = this._Str_720(animation); + const existing = this.getAnimation(animation); if(!existing) return null; diff --git a/src/nitro/avatar/animation/IAnimationManager.ts b/src/nitro/avatar/animation/IAnimationManager.ts index 31ce0d06..c8ba8d2d 100644 --- a/src/nitro/avatar/animation/IAnimationManager.ts +++ b/src/nitro/avatar/animation/IAnimationManager.ts @@ -4,6 +4,6 @@ import { IAnimationLayerData } from './IAnimationLayerData'; export interface IAnimationManager { animations: Map; - _Str_720(_arg_1: string): IAnimation; + getAnimation(_arg_1: string): IAnimation; _Str_607(_arg_1: string, _arg_2: number, _arg_3: string): IAnimationLayerData; -} \ No newline at end of file +} diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index 5984ac0f..4762766f 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -113,7 +113,7 @@ export class AvatarImageCache public setDirection(k: string, _arg_2: number): void { - const parts = this._structure._Str_1695(k); + const parts = this._structure.getBodyPartsUnordered(k); if(parts) { @@ -130,7 +130,7 @@ export class AvatarImageCache public _Str_1565(k: IActiveActionData, _arg_2: number): void { - const _local_3 = this._structure._Str_2021(k, this._avatar); + const _local_3 = this._structure.getActiveBodyPartIds(k, this._avatar); for(const _local_4 of _local_3) { @@ -186,7 +186,7 @@ export class AvatarImageCache { let _local_15 = _local_5; - const _local_16 = this._structure._Str_720(((_local_7.definition.state + '.') + _local_7.actionParameter)); + const _local_16 = this._structure.getAnimation(((_local_7.definition.state + '.') + _local_7.actionParameter)); const _local_17 = (frameNumber - _local_7.startFrame); if(_local_16) @@ -263,7 +263,7 @@ export class AvatarImageCache if(!_local_13 || _arg_3) { - const _local_19 = this._structure._Str_713(k, this._avatar.getFigure(), _local_8, this._geometryType, _local_5, _local_9, this._avatar, _local_10); + const _local_19 = this._structure.getParts(k, this._avatar.getFigure(), _local_8, this._geometryType, _local_5, _local_9, this._avatar, _local_10); _local_13 = new AvatarImageDirectionCache(_local_19); @@ -288,7 +288,7 @@ export class AvatarImageCache } } - const offset = this._structure._Str_1888(_local_8, _local_5, frameCount, k); + const offset = this._structure.getFrameBodyPartOffset(_local_8, _local_5, frameCount, k); _local_11.x += offset.x; _local_11.y += offset.y; @@ -325,7 +325,7 @@ export class AvatarImageCache if(!this._canvas) { - this._canvas = this._structure._Str_1664(this._scale, this._geometryType); + this._canvas = this._structure.getCanvas(this._scale, this._geometryType); if(!this._canvas) return null; } diff --git a/src/nitro/avatar/geometry/AvatarModelGeometry.ts b/src/nitro/avatar/geometry/AvatarModelGeometry.ts index 621209c5..b2780d14 100644 --- a/src/nitro/avatar/geometry/AvatarModelGeometry.ts +++ b/src/nitro/avatar/geometry/AvatarModelGeometry.ts @@ -89,7 +89,7 @@ export class AvatarModelGeometry } } - public _Str_2101(k: IAvatarImage): void + public removeDynamicItems(k: IAvatarImage): void { for(const geometry of this._geometryTypes.values()) { @@ -110,10 +110,10 @@ export class AvatarModelGeometry if(!avatarSet) return []; - return avatarSet._Str_755(); + return avatarSet.getBodyParts(); } - public _Str_1939(k: string): boolean + public isMainAvatarSet(k: string): boolean { const avatarSet = this._avatarSet._Str_1498(k); @@ -122,7 +122,7 @@ export class AvatarModelGeometry return avatarSet._Str_779; } - public _Str_1664(k: string, _arg_2: string): AvatarCanvas + public getCanvas(k: string, _arg_2: string): AvatarCanvas { const canvas = this._canvases.get(k); @@ -271,7 +271,7 @@ export class AvatarModelGeometry return ids; } - public _Str_713(k: string, _arg_2: string, _arg_3: number, _arg_4: any[], _arg_5:IAvatarImage): string[] + public getParts(k: string, _arg_2: string, _arg_3: number, _arg_4: any[], _arg_5:IAvatarImage): string[] { if(this._Str_1332(k, _arg_2)) { @@ -279,9 +279,9 @@ export class AvatarModelGeometry this._transformation = Matrix4x4._Str_1560(_arg_3); - return part._Str_713(this._transformation, this._camera, _arg_4, _arg_5); + return part.getParts(this._transformation, this._camera, _arg_4, _arg_5); } return []; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/geometry/AvatarSet.ts b/src/nitro/avatar/geometry/AvatarSet.ts index f22c2702..6807755a 100644 --- a/src/nitro/avatar/geometry/AvatarSet.ts +++ b/src/nitro/avatar/geometry/AvatarSet.ts @@ -42,7 +42,7 @@ { if(!avatarSet) continue; - bodyParts = bodyParts.concat(avatarSet._Str_755()); + bodyParts = bodyParts.concat(avatarSet.getBodyParts()); } this._allBodyParts = bodyParts; @@ -64,7 +64,7 @@ return null; } - public _Str_755(): string[] + public getBodyParts(): string[] { return this._allBodyParts.concat(); } @@ -89,4 +89,4 @@ return false; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/geometry/GeometryBodyPart.ts b/src/nitro/avatar/geometry/GeometryBodyPart.ts index ef82d5d2..70c9a07f 100644 --- a/src/nitro/avatar/geometry/GeometryBodyPart.ts +++ b/src/nitro/avatar/geometry/GeometryBodyPart.ts @@ -121,7 +121,7 @@ export class GeometryBodyPart extends Node3D return (existingPart !== null); } - public _Str_713(k: Matrix4x4, _arg_2: Vector3D, _arg_3: any[], _arg_4: IAvatarImage): string[] + public getParts(k: Matrix4x4, _arg_2: Vector3D, _arg_3: any[], _arg_4: IAvatarImage): string[] { const parts: [ number, GeometryItem ][] = []; @@ -191,4 +191,4 @@ export class GeometryBodyPart extends Node3D { return this._radius; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/FigureSetData.ts b/src/nitro/avatar/structure/FigureSetData.ts index 6a40a993..556e4728 100644 --- a/src/nitro/avatar/structure/FigureSetData.ts +++ b/src/nitro/avatar/structure/FigureSetData.ts @@ -103,7 +103,7 @@ export class FigureSetData implements IFigureSetData, IStructureData return false; } - public _Str_1733(k: string, _arg_2: number): string[] + public getMandatorySetTypeIds(k: string, _arg_2: number): string[] { const types: string[] = []; @@ -117,13 +117,13 @@ export class FigureSetData implements IFigureSetData, IStructureData return types; } - public _Str_2264(k: string, _arg_2: string): IFigurePartSet + public getDefaultPartSet(k: string, _arg_2: string): IFigurePartSet { const setType = this._setTypes.get(k); if(!setType) return null; - return setType._Str_2264(_arg_2); + return setType.getDefaultPartSet(_arg_2); } public _Str_740(k: string): ISetType @@ -149,4 +149,4 @@ export class FigureSetData implements IFigureSetData, IStructureData return null; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/animation/AnimationAction.ts b/src/nitro/avatar/structure/animation/AnimationAction.ts index 462d54a2..534caf38 100644 --- a/src/nitro/avatar/structure/animation/AnimationAction.ts +++ b/src/nitro/avatar/structure/animation/AnimationAction.ts @@ -102,7 +102,7 @@ export class AnimationAction return existing; } - public _Str_1888(frameId: number, frameCount: number, partId: string): Point + public getFrameBodyPartOffset(frameId: number, frameCount: number, partId: string): Point { const frameIndex = (frameCount % this._frameIndexes.length); const frameNumber = this._frameIndexes[frameIndex]; @@ -135,4 +135,4 @@ export class AnimationAction { return this._frameCount; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/figure/SetType.ts b/src/nitro/avatar/structure/figure/SetType.ts index 618cb143..52f54634 100644 --- a/src/nitro/avatar/structure/figure/SetType.ts +++ b/src/nitro/avatar/structure/figure/SetType.ts @@ -59,7 +59,7 @@ export class SetType implements ISetType for(const set of k.set) this._partSets.add(set['$'].id, new FigurePartSet(this._type, set)); } - public _Str_2264(k: string): IFigurePartSet + public getDefaultPartSet(k: string): IFigurePartSet { for(const set of this._partSets.getValues()) { @@ -102,4 +102,4 @@ export class SetType implements ISetType { return this._partSets; } -} \ No newline at end of file +} From 96737416efed25dd817a083c516cd430ccc3cadb Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 19:07:07 -0500 Subject: [PATCH 026/155] cleaned AvatarAnimationFrame --- src/nitro/avatar/AvatarImage.ts | 4 ++-- src/nitro/avatar/AvatarImagePartContainer.ts | 2 +- src/nitro/avatar/actions/ActionDefinition.ts | 4 ++-- src/nitro/avatar/actions/IActionDefinition.ts | 4 ++-- src/nitro/avatar/cache/AvatarImageCache.ts | 4 ++-- src/nitro/avatar/structure/animation/AvatarAnimationFrame.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index 545862cb..49a9932f 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -941,7 +941,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { return; } - if(k.definition._Str_778 == '') + if(k.definition.assetPartDefinition == '') { return; } @@ -958,7 +958,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { if(!k) return; - if(k.definition._Str_778 === '') return; + if(k.definition.assetPartDefinition === '') return; if(k.definition._Str_779) { diff --git a/src/nitro/avatar/AvatarImagePartContainer.ts b/src/nitro/avatar/AvatarImagePartContainer.ts index 7dec4bc8..c8604851 100644 --- a/src/nitro/avatar/AvatarImagePartContainer.ts +++ b/src/nitro/avatar/AvatarImagePartContainer.ts @@ -73,7 +73,7 @@ export class AvatarImagePartContainer { const frame = this._frames[frameNumber]; - return (this.partId + ':' + frame._Str_778 + ':' + frame.number); + return (this.partId + ':' + frame.assetPartDefinition + ':' + frame.number); } } diff --git a/src/nitro/avatar/actions/ActionDefinition.ts b/src/nitro/avatar/actions/ActionDefinition.ts index df5b4b52..8f74ce43 100644 --- a/src/nitro/avatar/actions/ActionDefinition.ts +++ b/src/nitro/avatar/actions/ActionDefinition.ts @@ -172,7 +172,7 @@ export class ActionDefinition implements IActionDefinition return this._activePartSet; } - public get _Str_778(): string + public get assetPartDefinition(): string { return this._assetPartDefinition; } @@ -221,4 +221,4 @@ export class ActionDefinition implements IActionDefinition { return this._params; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/actions/IActionDefinition.ts b/src/nitro/avatar/actions/IActionDefinition.ts index a2edafb0..a11a6d49 100644 --- a/src/nitro/avatar/actions/IActionDefinition.ts +++ b/src/nitro/avatar/actions/IActionDefinition.ts @@ -7,7 +7,7 @@ export interface IActionDefinition activePartSet: string; _Str_779: boolean; _Str_804: boolean; - _Str_778: string; + assetPartDefinition: string; lay: string; _Str_868: string; _Str_861: boolean; @@ -17,4 +17,4 @@ export interface IActionDefinition _Str_715(_arg_1: string): boolean; _Str_772(_arg_1: string, _arg_2: number, _arg_3: []): void; _Str_805(_arg_1: string, _arg_2: number): number[]; -} \ No newline at end of file +} diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index 4762766f..0b667847 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -331,7 +331,7 @@ export class AvatarImageCache } const isFlipped = AvatarDirectionAngle.DIRECTION_IS_FLIPPED[direction] || false; - let assetPartDefinition = _arg_4.definition._Str_778; + let assetPartDefinition = _arg_4.definition.assetPartDefinition; let isCacheable = true; let containerIndex = (containers.length - 1); @@ -355,7 +355,7 @@ export class AvatarImageCache { frameNumber = animationFrame.number; - if((animationFrame._Str_778) && (animationFrame._Str_778 !== '')) assetPartDefinition = animationFrame._Str_778; + if((animationFrame.assetPartDefinition) && (animationFrame.assetPartDefinition !== '')) assetPartDefinition = animationFrame.assetPartDefinition; } else frameNumber = container.getFrameIndex(frameCount); diff --git a/src/nitro/avatar/structure/animation/AvatarAnimationFrame.ts b/src/nitro/avatar/structure/animation/AvatarAnimationFrame.ts index f86273fe..ba1a18ff 100644 --- a/src/nitro/avatar/structure/animation/AvatarAnimationFrame.ts +++ b/src/nitro/avatar/structure/animation/AvatarAnimationFrame.ts @@ -14,7 +14,7 @@ export class AvatarAnimationFrame return this._number; } - public get _Str_778(): string + public get assetPartDefinition(): string { return this._assetPartDefinition; } From fc31d68ef3059ae3111d4a96b58a3b7726f47b47 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 19:45:13 -0500 Subject: [PATCH 027/155] cleaned ActionDefinition --- src/nitro/avatar/AvatarImage.ts | 36 +++++++++---------- src/nitro/avatar/AvatarStructure.ts | 6 ++-- src/nitro/avatar/actions/ActionDefinition.ts | 30 ++++++++-------- src/nitro/avatar/actions/ActionType.ts | 6 ++-- .../avatar/actions/AvatarActionManager.ts | 8 ++--- src/nitro/avatar/actions/IActionDefinition.ts | 20 +++++------ src/nitro/avatar/cache/AvatarImageCache.ts | 4 +-- .../avatar/geometry/AvatarModelGeometry.ts | 2 +- src/nitro/avatar/geometry/AvatarSet.ts | 4 +-- 9 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index 49a9932f..3ad5ed03 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -291,12 +291,12 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { return; } - const _local_2 = this._structure.getCanvas(this._scale, this._mainAction.definition._Str_868); + const _local_2 = this._structure.getCanvas(this._scale, this._mainAction.definition.geometryType); if(_local_2 == null) { return; } - const _local_3 = this.getBodyParts(k, this._mainAction.definition._Str_868, this._mainDirection); + const _local_3 = this.getBodyParts(k, this._mainAction.definition.geometryType, this._mainDirection); let _local_6 = (_local_3.length - 1); while(_local_6 >= 0) { @@ -314,7 +314,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._actionsSorted) this.endActionAppends(); - const avatarCanvas = this._structure.getCanvas(this._scale, this._mainAction.definition._Str_868); + const avatarCanvas = this._structure.getCanvas(this._scale, this._mainAction.definition.geometryType); if(!avatarCanvas) return null; @@ -331,7 +331,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener this._isCachedImage = false; } - const _local_6 = this.getBodyParts(setType, this._mainAction.definition._Str_868, this._mainDirection); + const _local_6 = this.getBodyParts(setType, this._mainAction.definition.geometryType, this._mainDirection); this._image = null; @@ -444,11 +444,11 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._actionsSorted) this.endActionAppends(); - const avatarCanvas = this._structure.getCanvas(this._scale, this._mainAction.definition._Str_868); + const avatarCanvas = this._structure.getCanvas(this._scale, this._mainAction.definition.geometryType); if(!avatarCanvas) return null; - const setTypes = this.getBodyParts(setType, this._mainAction.definition._Str_868, this._mainDirection); + const setTypes = this.getBodyParts(setType, this._mainAction.definition.geometryType, this._mainDirection); const container = new Sprite(); const sprite = new Sprite(Texture.EMPTY); @@ -509,11 +509,11 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._actionsSorted) this.endActionAppends(); - const avatarCanvas = this._structure.getCanvas(this._scale, this._mainAction.definition._Str_868); + const avatarCanvas = this._structure.getCanvas(this._scale, this._mainAction.definition.geometryType); if(!avatarCanvas) return null; - const setTypes = this.getBodyParts(setType, this._mainAction.definition._Str_868, this._mainDirection); + const setTypes = this.getBodyParts(setType, this._mainAction.definition.geometryType, this._mainDirection); const container = new Container(); const sprite = new Sprite(Texture.EMPTY); @@ -742,7 +742,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener case AvatarAction.CARRY_OBJECT: case AvatarAction.USE_OBJECT: { const _local_4 = this._structure.getActionDefinitionWithState(k); - if(_local_4) _local_3 = _local_4._Str_1350(_local_3); + if(_local_4) _local_3 = _local_4.getParameterValue(_local_3); this.addActionData(k, _local_3); break; } @@ -800,7 +800,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener for(const _local_3 of this._sortedActions) { _local_2 = this._structure.getActionDefinitionWithState(_local_3.actionType); - if(((!(_local_2 == null)) && (_local_2._Str_715(_local_3.actionParameter)))) + if(((!(_local_2 == null)) && (_local_2.getPreventHeadTurn(_local_3.actionParameter)))) { k = true; } @@ -884,7 +884,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener for(const k of this._sortedActions) { - if((k && k.definition) && k.definition._Str_861) + if((k && k.definition) && k.definition.isAnimation) { const _local_2 = this._structure.getAnimation(((k.definition.state + '.') + k.actionParameter)); @@ -912,13 +912,13 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { if(!((!(k)) || (!(k.definition)))) { - if(k.definition._Str_861 && (k.actionParameter === '')) k.actionParameter = '1'; + if(k.definition.isAnimation && (k.actionParameter === '')) k.actionParameter = '1'; this.setActionToParts(k, _local_3); - if(k.definition._Str_861) + if(k.definition.isAnimation) { - this._isAnimating = k.definition._Str_801(k.actionParameter); + this._isAnimating = k.definition.isAnimated(k.actionParameter); const _local_2 = this._structure.getAnimation(((k.definition.state + '.') + k.actionParameter)); @@ -945,10 +945,10 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { return; } - if(k.definition._Str_779) + if(k.definition.isMain) { this._mainAction = k; - this._cache._Str_2014(k.definition._Str_868); + this._cache._Str_2014(k.definition.geometryType); } this._cache._Str_1565(k, _arg_2); this._changes = true; @@ -960,10 +960,10 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(k.definition.assetPartDefinition === '') return; - if(k.definition._Str_779) + if(k.definition.isMain) { this._mainAction = k; - this._cache._Str_2014(k.definition._Str_868); + this._cache._Str_2014(k.definition.geometryType); } this._cache._Str_741(k); diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index 8bd40563..e373e0cd 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -251,9 +251,9 @@ export class AvatarStructure extends EventDispatcher let _local_3: string[] = []; const _local_4: string[] = []; - const _local_5 = k.definition._Str_868; + const _local_5 = k.definition.geometryType; - if(k.definition._Str_861) + if(k.definition.isAnimation) { const _local_7 = ((k.definition.state + '.') + k.actionParameter); const _local_8 = this._animationManager.getAnimation(_local_7); @@ -360,7 +360,7 @@ export class AvatarStructure extends EventDispatcher let _local_14: any[] = [ 0 ]; const _local_15 = this._animationData._Str_2244(_arg_3.definition); - if(_arg_3.definition._Str_861) + if(_arg_3.definition.isAnimation) { const _local_24 = ((_arg_3.definition.state + '.') + _arg_3.actionParameter); const _local_10 = this._animationManager.getAnimation(_local_24); diff --git a/src/nitro/avatar/actions/ActionDefinition.ts b/src/nitro/avatar/actions/ActionDefinition.ts index 8f74ce43..331d4f13 100644 --- a/src/nitro/avatar/actions/ActionDefinition.ts +++ b/src/nitro/avatar/actions/ActionDefinition.ts @@ -65,7 +65,7 @@ export class ActionDefinition implements IActionDefinition } } - public _Str_772(k: string, _arg_2: number, _arg_3: number[]): void + public setOffsets(k: string, _arg_2: number, _arg_3: number[]): void { if(!this._canvasOffsets) this._canvasOffsets = new Map(); @@ -81,7 +81,7 @@ export class ActionDefinition implements IActionDefinition existing.set(_arg_2, _arg_3); } - public _Str_805(k: string, _arg_2: number): number[] + public getOffsets(k: string, _arg_2: number): number[] { if(!this._canvasOffsets) return null; @@ -103,7 +103,7 @@ export class ActionDefinition implements IActionDefinition return existing; } - public _Str_1350(id: string): string + public getParameterValue(id: string): string { if(!id) return ''; @@ -114,12 +114,12 @@ export class ActionDefinition implements IActionDefinition return existing; } - public _Str_733(type: string): string[] + public getPrevents(type: string): string[] { - return this._prevents.concat(this._Str_1889(type)); + return this._prevents.concat(this.getTypePrevents(type)); } - private _Str_1889(type: string): string[] + private getTypePrevents(type: string): string[] { if(!type) return []; @@ -130,7 +130,7 @@ export class ActionDefinition implements IActionDefinition return existing.prevents; } - public _Str_715(k: string): boolean + public getPreventHeadTurn(k: string): boolean { if(!k) return this._preventHeadTurn; @@ -138,10 +138,10 @@ export class ActionDefinition implements IActionDefinition if(!type) return this._preventHeadTurn; - return type._Str_1891; + return type.preventHeadTurn; } - public _Str_801(k: string): boolean + public isAnimated(k: string): boolean { if(!k) return true; @@ -149,7 +149,7 @@ export class ActionDefinition implements IActionDefinition if(!type) return true; - return type._Str_801; + return type.isAnimated; } public get id(): string @@ -182,27 +182,27 @@ export class ActionDefinition implements IActionDefinition return this._lay; } - public get _Str_868(): string + public get geometryType(): string { return this._geometryType; } - public get _Str_779(): boolean + public get isMain(): boolean { return this._isMain; } - public get _Str_804(): boolean + public get isDefault(): boolean { return this._isDefault; } - public get _Str_861(): boolean + public get isAnimation(): boolean { return this._isAnimation; } - public get _Str_812(): boolean + public get startFromFrameZero(): boolean { return this._startFromFrameZero; } diff --git a/src/nitro/avatar/actions/ActionType.ts b/src/nitro/avatar/actions/ActionType.ts index 5694bb1f..e90ec689 100644 --- a/src/nitro/avatar/actions/ActionType.ts +++ b/src/nitro/avatar/actions/ActionType.ts @@ -32,13 +32,13 @@ export class ActionType return this._prevents; } - public get _Str_1891(): boolean + public get preventHeadTurn(): boolean { return this._preventHeadTurn; } - public get _Str_801(): boolean + public get isAnimated(): boolean { return this._isAnimated; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/actions/AvatarActionManager.ts b/src/nitro/avatar/actions/AvatarActionManager.ts index 90a375e8..bf4a1e29 100644 --- a/src/nitro/avatar/actions/AvatarActionManager.ts +++ b/src/nitro/avatar/actions/AvatarActionManager.ts @@ -54,7 +54,7 @@ export class AvatarActionManager const y = (canvasOffset.y || 0); const z = (canvasOffset.z || 0); - action._Str_772(size, direction, [ x, y, z ]); + action.setOffsets(size, direction, [ x, y, z ]); } } } @@ -88,7 +88,7 @@ export class AvatarActionManager for(const action of this._actions.values()) { - if(!action || !action._Str_804) continue; + if(!action || !action.isDefault) continue; this._defaultAction = action; @@ -107,7 +107,7 @@ export class AvatarActionManager if(!activeAction) continue; const action = this._actions.get(activeAction.actionType); - const offsets = action && action._Str_805(_arg_2, _arg_3); + const offsets = action && action.getOffsets(_arg_2, _arg_3); if(offsets) canvasOffsets = offsets; } @@ -152,7 +152,7 @@ export class AvatarActionManager const localAction = this._actions.get(action.actionType); - if(localAction) preventions = preventions.concat(localAction._Str_733(action.actionParameter)); + if(localAction) preventions = preventions.concat(localAction.getPrevents(action.actionParameter)); } for(const action of actions) diff --git a/src/nitro/avatar/actions/IActionDefinition.ts b/src/nitro/avatar/actions/IActionDefinition.ts index a11a6d49..8227c376 100644 --- a/src/nitro/avatar/actions/IActionDefinition.ts +++ b/src/nitro/avatar/actions/IActionDefinition.ts @@ -5,16 +5,16 @@ export interface IActionDefinition state: string; precedence: number; activePartSet: string; - _Str_779: boolean; - _Str_804: boolean; + isMain: boolean; + isDefault: boolean; assetPartDefinition: string; lay: string; - _Str_868: string; - _Str_861: boolean; - _Str_812: boolean; - _Str_801(_arg_1: string): boolean; - _Str_733(_arg_1: string): string[]; - _Str_715(_arg_1: string): boolean; - _Str_772(_arg_1: string, _arg_2: number, _arg_3: []): void; - _Str_805(_arg_1: string, _arg_2: number): number[]; + geometryType: string; + isAnimation: boolean; + startFromFrameZero: boolean; + isAnimated(_arg_1: string): boolean; + getPrevents(_arg_1: string): string[]; + getPreventHeadTurn(_arg_1: string): boolean; + setOffsets(_arg_1: string, _arg_2: number, _arg_3: []): void; + getOffsets(_arg_1: string, _arg_2: number): number[]; } diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index 0b667847..44f3cf66 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -173,7 +173,7 @@ export class AvatarImageCache let _local_7 = _local_4._Str_2244(); let frameCount = frameNumber; - if(_local_7.definition._Str_812) frameCount -= _local_7.startFrame; + if(_local_7.definition.startFromFrameZero) frameCount -= _local_7.startFrame; let _local_8 = _local_7; let _local_9: string[] = []; @@ -182,7 +182,7 @@ export class AvatarImageCache if(!((!(_local_7)) || (!(_local_7.definition)))) { - if(_local_7.definition._Str_861) + if(_local_7.definition.isAnimation) { let _local_15 = _local_5; diff --git a/src/nitro/avatar/geometry/AvatarModelGeometry.ts b/src/nitro/avatar/geometry/AvatarModelGeometry.ts index b2780d14..8fdff310 100644 --- a/src/nitro/avatar/geometry/AvatarModelGeometry.ts +++ b/src/nitro/avatar/geometry/AvatarModelGeometry.ts @@ -119,7 +119,7 @@ export class AvatarModelGeometry if(!avatarSet) return false; - return avatarSet._Str_779; + return avatarSet.isMain; } public getCanvas(k: string, _arg_2: string): AvatarCanvas diff --git a/src/nitro/avatar/geometry/AvatarSet.ts b/src/nitro/avatar/geometry/AvatarSet.ts index 6807755a..e11d0ce6 100644 --- a/src/nitro/avatar/geometry/AvatarSet.ts +++ b/src/nitro/avatar/geometry/AvatarSet.ts @@ -74,7 +74,7 @@ return this._id; } - public get _Str_779(): boolean + public get isMain(): boolean { if(this._isMain) return true; @@ -82,7 +82,7 @@ { if(!avatarSet) continue; - if(!avatarSet._Str_779) continue; + if(!avatarSet.isMain) continue; return true; } From 986c55fee204b818b3509c7cce62c1b8a790731e Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 19:49:40 -0500 Subject: [PATCH 028/155] cleaned AvatarActionManager --- src/nitro/avatar/AvatarStructure.ts | 4 ++-- src/nitro/avatar/actions/AvatarActionManager.ts | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index e373e0cd..c742d298 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -83,14 +83,14 @@ export class AvatarStructure extends EventDispatcher if(!_arg_2) return; this._actionManager = new AvatarActionManager(k, _arg_2); - this._defaultAction = this._actionManager._Str_1027(); + this._defaultAction = this._actionManager.getDefaultAction(); } public updateActions(data: any): void { this._actionManager.updateActions(data); - this._defaultAction = this._actionManager._Str_1027(); + this._defaultAction = this._actionManager.getDefaultAction(); } public initPartSets(k: any): boolean diff --git a/src/nitro/avatar/actions/AvatarActionManager.ts b/src/nitro/avatar/actions/AvatarActionManager.ts index bf4a1e29..fbc2395a 100644 --- a/src/nitro/avatar/actions/AvatarActionManager.ts +++ b/src/nitro/avatar/actions/AvatarActionManager.ts @@ -30,10 +30,10 @@ export class AvatarActionManager this._actions.set(definition.state, definition); } - if(data.actionOffsets) this._Str_1767(data.actionOffsets); + if(data.actionOffsets) this.parseActionOffsets(data.actionOffsets); } - private _Str_1767(offsets: any): void + private parseActionOffsets(offsets: any): void { if(!offsets || !offsets.length) return; @@ -82,7 +82,7 @@ export class AvatarActionManager return existing; } - public _Str_1027(): ActionDefinition + public getDefaultAction(): ActionDefinition { if(this._defaultAction) return this._defaultAction; @@ -119,7 +119,7 @@ export class AvatarActionManager { if(!actions) return null; - actions = this._Str_1247(actions); + actions = this.filterActions(actions); const validatedActions: IActiveActionData[] = []; @@ -141,7 +141,7 @@ export class AvatarActionManager return validatedActions; } - private _Str_1247(actions: IActiveActionData[]): IActiveActionData[] + private filterActions(actions: IActiveActionData[]): IActiveActionData[] { let preventions: string[] = []; const activeActions: IActiveActionData[] = []; From c4b8d64d758205b7ef01e33d09335efda3131876 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 19:54:44 -0500 Subject: [PATCH 029/155] cleaned AnimationAction --- src/nitro/avatar/AvatarAssetDownloadManager.ts | 2 +- src/nitro/avatar/AvatarStructure.ts | 12 ++++++------ src/nitro/avatar/animation/Animation.ts | 2 +- src/nitro/avatar/structure/AvatarAnimationData.ts | 2 +- src/nitro/avatar/structure/PartSetsData.ts | 6 +++--- .../avatar/structure/animation/AnimationAction.ts | 14 +++++++------- src/nitro/avatar/structure/figure/FigurePartSet.ts | 6 +++--- .../avatar/structure/figure/IFigurePartSet.ts | 6 +++--- src/nitro/avatar/structure/parts/ActivePartSet.ts | 4 ++-- .../rasterizer/animated/LandscapeRasterizer.ts | 2 +- .../room/rasterizer/basic/PlaneRasterizer.ts | 2 +- .../rasterizer/basic/PlaneVisualizationLayer.ts | 4 ++-- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/nitro/avatar/AvatarAssetDownloadManager.ts b/src/nitro/avatar/AvatarAssetDownloadManager.ts index 0e865672..087e80fd 100644 --- a/src/nitro/avatar/AvatarAssetDownloadManager.ts +++ b/src/nitro/avatar/AvatarAssetDownloadManager.ts @@ -252,7 +252,7 @@ export class AvatarAssetDownloadManager extends EventDispatcher if(!figurePartSet) continue; - for(const part of figurePartSet._Str_806) + for(const part of figurePartSet.parts) { if(!part) continue; diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index c742d298..8bec4d2d 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -342,7 +342,7 @@ export class AvatarStructure extends EventDispatcher if(_local_5) return _local_5.getFrameBodyPartOffset(_arg_2, _arg_3, _arg_4); - return AnimationAction._Str_1934; + return AnimationAction.DEFAULT_OFFSET; } public getParts(k: string, _arg_2:IAvatarFigureContainer, _arg_3:IActiveActionData, _arg_4: string, _arg_5: number, removes: string[], _arg_7: IAvatarImage, _arg_8: Map = null): AvatarImagePartContainer[] @@ -367,7 +367,7 @@ export class AvatarStructure extends EventDispatcher if(_local_10) { - _local_14 = this.getPopulatedArray(_local_10._Str_2185(_arg_3.overridingAction)); + _local_14 = this.getPopulatedArray(_local_10.frameCount(_arg_3.overridingAction)); for(const _local_25 of _local_10._Str_1065(0, _arg_3.overridingAction)) { @@ -415,13 +415,13 @@ export class AvatarStructure extends EventDispatcher { removes = removes.concat(_local_32._Str_790); - for(const _local_33 of _local_32._Str_806) + for(const _local_33 of _local_32.parts) { if(_local_16.indexOf(_local_33.type) > -1) { if(_local_15) { - const _local_19 = _local_15._Str_989(_local_33.type); + const _local_19 = _local_15.getPart(_local_33.type); if(_local_19) { @@ -506,7 +506,7 @@ export class AvatarStructure extends EventDispatcher if(_local_15) { - const _local_19 = _local_15._Str_989(_local_12); + const _local_19 = _local_15.getPart(_local_12); if(_local_19) { @@ -570,7 +570,7 @@ export class AvatarStructure extends EventDispatcher if(_local_15) { - const _local_19 = _local_15._Str_989(_local_12); + const _local_19 = _local_15.getPart(_local_12); if(_local_19) { diff --git a/src/nitro/avatar/animation/Animation.ts b/src/nitro/avatar/animation/Animation.ts index 60a8d67e..c317ed25 100644 --- a/src/nitro/avatar/animation/Animation.ts +++ b/src/nitro/avatar/animation/Animation.ts @@ -130,7 +130,7 @@ export class Animation implements IAnimation } } - public _Str_2185(k: string = null): number + public frameCount(k: string = null): number { if(!k) return this._frames.length; diff --git a/src/nitro/avatar/structure/AvatarAnimationData.ts b/src/nitro/avatar/structure/AvatarAnimationData.ts index bbfce8f8..e5bec4fd 100644 --- a/src/nitro/avatar/structure/AvatarAnimationData.ts +++ b/src/nitro/avatar/structure/AvatarAnimationData.ts @@ -53,6 +53,6 @@ export class AvatarAnimationData implements IFigureSetData if(!animationAction) return 0; - return animationAction._Str_2185; + return animationAction.frameCount; } } diff --git a/src/nitro/avatar/structure/PartSetsData.ts b/src/nitro/avatar/structure/PartSetsData.ts index 99236c7a..6d8173dd 100644 --- a/src/nitro/avatar/structure/PartSetsData.ts +++ b/src/nitro/avatar/structure/PartSetsData.ts @@ -71,7 +71,7 @@ export class PartSetsData implements IFigureSetData if(!activePartSet) return []; - return activePartSet._Str_806; + return activePartSet.parts; } public _Str_1102(part: string): PartDefinition @@ -108,7 +108,7 @@ export class PartSetsData implements IFigureSetData return existing; } - public get _Str_806(): Map + public get parts(): Map { return this._parts; } @@ -117,4 +117,4 @@ export class PartSetsData implements IFigureSetData { return this._activePartSets; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/animation/AnimationAction.ts b/src/nitro/avatar/structure/animation/AnimationAction.ts index 534caf38..c635f7fb 100644 --- a/src/nitro/avatar/structure/animation/AnimationAction.ts +++ b/src/nitro/avatar/structure/animation/AnimationAction.ts @@ -3,7 +3,7 @@ import { AnimationActionPart } from './AnimationActionPart'; export class AnimationAction { - public static _Str_1934: Point = new Point(0, 0); + public static DEFAULT_OFFSET: Point = new Point(0, 0); private _id: string; private _actionParts: Map; @@ -91,7 +91,7 @@ export class AnimationAction } } - public _Str_989(type: string): AnimationActionPart + public getPart(type: string): AnimationActionPart { if(!type) return null; @@ -108,15 +108,15 @@ export class AnimationAction const frameNumber = this._frameIndexes[frameIndex]; const offsets = this._bodyPartOffsets.get(frameNumber); - if(!offsets) return AnimationAction._Str_1934; + if(!offsets) return AnimationAction.DEFAULT_OFFSET; const frameOffset = offsets.get(frameId); - if(!frameOffset) return AnimationAction._Str_1934; + if(!frameOffset) return AnimationAction.DEFAULT_OFFSET; const offset = frameOffset.get(partId); - if(!offset) return AnimationAction._Str_1934; + if(!offset) return AnimationAction.DEFAULT_OFFSET; return offset; } @@ -126,12 +126,12 @@ export class AnimationAction return this._id; } - public get _Str_806(): Map + public get parts(): Map { return this._actionParts; } - public get _Str_2185(): number + public get frameCount(): number { return this._frameCount; } diff --git a/src/nitro/avatar/structure/figure/FigurePartSet.ts b/src/nitro/avatar/structure/figure/FigurePartSet.ts index 6d9163e8..d85f499e 100644 --- a/src/nitro/avatar/structure/figure/FigurePartSet.ts +++ b/src/nitro/avatar/structure/figure/FigurePartSet.ts @@ -80,7 +80,7 @@ export class FigurePartSet implements IFigurePartSet return -1; } - public _Str_989(k: string, _arg_2: number): IFigurePart + public getPart(k: string, _arg_2: number): IFigurePart { for(const part of this._parts) { @@ -122,7 +122,7 @@ export class FigurePartSet implements IFigurePartSet return this._isSelectable; } - public get _Str_806(): IFigurePart[] + public get parts(): IFigurePart[] { return this._parts; } @@ -141,4 +141,4 @@ export class FigurePartSet implements IFigurePartSet { return this._isSellable; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/figure/IFigurePartSet.ts b/src/nitro/avatar/structure/figure/IFigurePartSet.ts index 1b08de5d..8c9f9a13 100644 --- a/src/nitro/avatar/structure/figure/IFigurePartSet.ts +++ b/src/nitro/avatar/structure/figure/IFigurePartSet.ts @@ -2,15 +2,15 @@ import { IFigurePart } from './IFigurePart'; export interface IFigurePartSet { - _Str_989(_arg_1: string, _arg_2: number): IFigurePart; + getPart(_arg_1: string, _arg_2: number): IFigurePart; id: number; type: string; gender: string; clubLevel: number; isColorable: boolean; _Str_608: boolean; - _Str_806: IFigurePart[]; + parts: IFigurePart[]; _Str_790: string[]; _Str_653: boolean; _Str_651: boolean; -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/parts/ActivePartSet.ts b/src/nitro/avatar/structure/parts/ActivePartSet.ts index 9e3ac69d..63eb6e48 100644 --- a/src/nitro/avatar/structure/parts/ActivePartSet.ts +++ b/src/nitro/avatar/structure/parts/ActivePartSet.ts @@ -19,8 +19,8 @@ export class ActivePartSet } } - public get _Str_806(): string[] + public get parts(): string[] { return this._parts; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts index a92909d7..5252191f 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts @@ -90,7 +90,7 @@ export class LandscapeRasterizer extends PlaneRasterizer let material: PlaneMaterial = null; let align: number = PlaneVisualizationLayer._Str_6914; let color: number = LandscapePlane._Str_2531; - let offset: number = PlaneVisualizationLayer._Str_1934; + let offset: number = PlaneVisualizationLayer.DEFAULT_OFFSET; if(layer.materialId) material = this._Str_8547(layer.materialId); 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 9af0b805..22542c64 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -563,7 +563,7 @@ export class PlaneRasterizer implements IPlaneRasterizer let material: PlaneMaterial = null; let align: number = PlaneVisualizationLayer._Str_6914; let color: number = FloorPlane._Str_2531; - let offset: number = PlaneVisualizationLayer._Str_1934; + let offset: number = PlaneVisualizationLayer.DEFAULT_OFFSET; if(layer.materialId) material = this._Str_8547(layer.materialId); diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts index 7ebe4650..411b1a29 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts @@ -6,7 +6,7 @@ import { PlaneMaterial } from './PlaneMaterial'; export class PlaneVisualizationLayer { - public static _Str_1934: number = 0; + public static DEFAULT_OFFSET: number = 0; public static ALIGN_TOP: number = 1; public static _Str_3606: number = 2; public static _Str_6914: number = PlaneVisualizationLayer.ALIGN_TOP; @@ -144,4 +144,4 @@ export class PlaneVisualizationLayer { return this._color; } -} \ No newline at end of file +} From 8f6559be3ae841a07be42de48b4f30f30d5473a9 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 20:09:46 -0500 Subject: [PATCH 030/155] cleaned up avatar/structure/figure --- src/nitro/avatar/AvatarAssetDownloadManager.ts | 2 +- src/nitro/avatar/AvatarRenderManager.ts | 10 +++++----- src/nitro/avatar/AvatarStructure.ts | 16 ++++++++-------- src/nitro/avatar/cache/AvatarImageCache.ts | 2 +- src/nitro/avatar/structure/FigureSetData.ts | 10 +++++----- src/nitro/avatar/structure/figure/FigurePart.ts | 4 ++-- .../avatar/structure/figure/FigurePartSet.ts | 8 ++++---- src/nitro/avatar/structure/figure/IFigurePart.ts | 4 ++-- .../avatar/structure/figure/IFigurePartSet.ts | 8 ++++---- src/nitro/avatar/structure/figure/IPalette.ts | 4 ++-- src/nitro/avatar/structure/figure/IPartColor.ts | 4 ++-- src/nitro/avatar/structure/figure/ISetType.ts | 12 ++++++------ src/nitro/avatar/structure/figure/Palette.ts | 8 ++++---- src/nitro/avatar/structure/figure/PartColor.ts | 4 ++-- src/nitro/avatar/structure/figure/SetType.ts | 16 ++++++++-------- .../room/object/visualization/room/RoomPlane.ts | 4 ++-- .../rasterizer/basic/PlaneVisualizationLayer.ts | 2 +- 17 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/nitro/avatar/AvatarAssetDownloadManager.ts b/src/nitro/avatar/AvatarAssetDownloadManager.ts index 087e80fd..47911ada 100644 --- a/src/nitro/avatar/AvatarAssetDownloadManager.ts +++ b/src/nitro/avatar/AvatarAssetDownloadManager.ts @@ -248,7 +248,7 @@ export class AvatarAssetDownloadManager extends EventDispatcher if(!set) continue; - const figurePartSet = set._Str_1020(container.getPartSetId(key)); + const figurePartSet = set.getPartSet(container.getPartSetId(key)); if(!figurePartSet) continue; diff --git a/src/nitro/avatar/AvatarRenderManager.ts b/src/nitro/avatar/AvatarRenderManager.ts index d72a7179..a0f182dd 100644 --- a/src/nitro/avatar/AvatarRenderManager.ts +++ b/src/nitro/avatar/AvatarRenderManager.ts @@ -333,7 +333,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa if(setType) { - const figurePartSet = setType._Str_1020(container.getPartSetId(id)); + const figurePartSet = setType.getPartSet(container.getPartSetId(id)); if(!figurePartSet) { @@ -367,18 +367,18 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { const set = figureData._Str_740(part); const setId = container.getPartSetId(part); - const partSet = set._Str_1020(setId); + const partSet = set.getPartSet(setId); if(partSet) { clubLevel = Math.max(partSet.clubLevel, clubLevel); - const palette = figureData._Str_783(set._Str_734); + const palette = figureData._Str_783(set.paletteID); const colors = container.getPartColorIds(part); for(const colorId of colors) { - const color = palette._Str_751(colorId); + const color = palette.getColor(colorId); clubLevel = Math.max(color.clubLevel, clubLevel); } @@ -391,7 +391,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { const set = figureData._Str_740(part); - if(parts.indexOf(part) === -1) clubLevel = Math.max(set._Str_1002(gender), clubLevel); + if(parts.indexOf(part) === -1) clubLevel = Math.max(set.optionalFromClubLevel(gender), clubLevel); } return clubLevel; diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index 8bec4d2d..6ff6cde9 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -161,11 +161,11 @@ export class AvatarStructure extends EventDispatcher if(_local_5 == null) return null; - const _local_6 = this._figureData._Str_783(_local_5._Str_734); + const _local_6 = this._figureData._Str_783(_local_5.paletteID); if(!_local_6) return null; - return _local_6._Str_751(_local_4[_arg_3]); + return _local_6.getColor(_local_4[_arg_3]); } public getBodyPartData(animation: string, frameCount: number, spriteId: string): AvatarAnimationLayerData @@ -405,15 +405,15 @@ export class AvatarStructure extends EventDispatcher if(_local_30) { - const _local_31 = this._figureData._Str_783(_local_30._Str_734); + const _local_31 = this._figureData._Str_783(_local_30.paletteID); if(_local_31) { - const _local_32 = _local_30._Str_1020(_local_28); + const _local_32 = _local_30.getPartSet(_local_28); if(_local_32) { - removes = removes.concat(_local_32._Str_790); + removes = removes.concat(_local_32.hiddenLayers); for(const _local_33 of _local_32.parts) { @@ -447,12 +447,12 @@ export class AvatarStructure extends EventDispatcher if(!_local_35 || (_local_35 === '')) _local_35 = _local_33.type; - if(_local_29 && (_local_29.length > (_local_33._Str_827 - 1))) + if(_local_29 && (_local_29.length > (_local_33.colorLayerIndex - 1))) { - _local_36 = _local_31._Str_751(_local_29[(_local_33._Str_827 - 1)]); + _local_36 = _local_31.getColor(_local_29[(_local_33.colorLayerIndex - 1)]); } - const _local_37 = (_local_33._Str_827 > 0); + const _local_37 = (_local_33.colorLayerIndex > 0); const _local_18 = new AvatarImagePartContainer(k, _local_33.type, _local_33.id.toString(), _local_36, _local_20, _local_34, _local_37, _local_33.paletteMap, _local_35); _local_11.push(_local_18); diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index 44f3cf66..8917ce84 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -397,7 +397,7 @@ export class AvatarImageCache } else { - if(container.isColorable && container.color) color = container.color._Str_915; + if(container.isColorable && container.color) color = container.color.rgb; const offset = new Point(-(asset.x), -(asset.y)); diff --git a/src/nitro/avatar/structure/FigureSetData.ts b/src/nitro/avatar/structure/FigureSetData.ts index 556e4728..2cc19b53 100644 --- a/src/nitro/avatar/structure/FigureSetData.ts +++ b/src/nitro/avatar/structure/FigureSetData.ts @@ -55,7 +55,7 @@ export class FigureSetData implements IFigureSetData, IStructureData if(setType) { - setType._Str_1874(_local_2); + setType.cleanUp(_local_2); } else { @@ -81,7 +81,7 @@ export class FigureSetData implements IFigureSetData, IStructureData } else { - _local_4._Str_2015(_local_2); + _local_4.append(_local_2); } } @@ -96,7 +96,7 @@ export class FigureSetData implements IFigureSetData, IStructureData } else { - _local_5._Str_2015(_local_3); + _local_5.append(_local_3); } } @@ -109,7 +109,7 @@ export class FigureSetData implements IFigureSetData, IStructureData for(const set of this._setTypes.values()) { - if(!set || !set._Str_895(k, _arg_2)) continue; + if(!set || !set.isMandatory(k, _arg_2)) continue; types.push(set.type); } @@ -140,7 +140,7 @@ export class FigureSetData implements IFigureSetData, IStructureData { for(const set of this._setTypes.values()) { - const partSet = set._Str_1020(k); + const partSet = set.getPartSet(k); if(!partSet) continue; diff --git a/src/nitro/avatar/structure/figure/FigurePart.ts b/src/nitro/avatar/structure/figure/FigurePart.ts index 93455739..f94df787 100644 --- a/src/nitro/avatar/structure/figure/FigurePart.ts +++ b/src/nitro/avatar/structure/figure/FigurePart.ts @@ -54,7 +54,7 @@ export class FigurePart implements IFigurePart return this._index; } - public get _Str_827(): number + public get colorLayerIndex(): number { return this._colorLayerIndex; } @@ -63,4 +63,4 @@ export class FigurePart implements IFigurePart { return this._paletteMapId; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/figure/FigurePartSet.ts b/src/nitro/avatar/structure/figure/FigurePartSet.ts index d85f499e..bb7392b0 100644 --- a/src/nitro/avatar/structure/figure/FigurePartSet.ts +++ b/src/nitro/avatar/structure/figure/FigurePartSet.ts @@ -117,7 +117,7 @@ export class FigurePartSet implements IFigurePartSet return this._isColorable; } - public get _Str_608(): boolean + public get isSelectable(): boolean { return this._isSelectable; } @@ -127,17 +127,17 @@ export class FigurePartSet implements IFigurePartSet return this._parts; } - public get _Str_790(): string[] + public get hiddenLayers(): string[] { return this._hiddenLayers; } - public get _Str_653(): boolean + public get isPreSelectable(): boolean { return this._isPreSelectable; } - public get _Str_651(): boolean + public get isSellable(): boolean { return this._isSellable; } diff --git a/src/nitro/avatar/structure/figure/IFigurePart.ts b/src/nitro/avatar/structure/figure/IFigurePart.ts index 882e178f..578725b9 100644 --- a/src/nitro/avatar/structure/figure/IFigurePart.ts +++ b/src/nitro/avatar/structure/figure/IFigurePart.ts @@ -4,6 +4,6 @@ export interface IFigurePart type: string; breed: number; index: number; - _Str_827: number; + colorLayerIndex: number; paletteMap: number; -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/figure/IFigurePartSet.ts b/src/nitro/avatar/structure/figure/IFigurePartSet.ts index 8c9f9a13..7e1653e0 100644 --- a/src/nitro/avatar/structure/figure/IFigurePartSet.ts +++ b/src/nitro/avatar/structure/figure/IFigurePartSet.ts @@ -8,9 +8,9 @@ export interface IFigurePartSet gender: string; clubLevel: number; isColorable: boolean; - _Str_608: boolean; + isSelectable: boolean; parts: IFigurePart[]; - _Str_790: string[]; - _Str_653: boolean; - _Str_651: boolean; + hiddenLayers: string[]; + isPreSelectable: boolean; + isSellable: boolean; } diff --git a/src/nitro/avatar/structure/figure/IPalette.ts b/src/nitro/avatar/structure/figure/IPalette.ts index dd5233e7..74b2e82f 100644 --- a/src/nitro/avatar/structure/figure/IPalette.ts +++ b/src/nitro/avatar/structure/figure/IPalette.ts @@ -2,7 +2,7 @@ import { IPartColor } from './IPartColor'; export interface IPalette { - _Str_751(id: number): IPartColor; + getColor(id: number): IPartColor; id: number; colors: Map; -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/figure/IPartColor.ts b/src/nitro/avatar/structure/figure/IPartColor.ts index 2630b71f..69785287 100644 --- a/src/nitro/avatar/structure/figure/IPartColor.ts +++ b/src/nitro/avatar/structure/figure/IPartColor.ts @@ -4,5 +4,5 @@ export interface IPartColor index: number; clubLevel: number; isSelectable: boolean; - _Str_915: number; -} \ No newline at end of file + rgb: number; +} diff --git a/src/nitro/avatar/structure/figure/ISetType.ts b/src/nitro/avatar/structure/figure/ISetType.ts index 29f2c5dd..23a1f659 100644 --- a/src/nitro/avatar/structure/figure/ISetType.ts +++ b/src/nitro/avatar/structure/figure/ISetType.ts @@ -3,10 +3,10 @@ import { IFigurePartSet } from './IFigurePartSet'; export interface ISetType { - _Str_1020(_arg_1: number): IFigurePartSet; - _Str_895(_arg_1: string, _arg_2: number): boolean; - _Str_1002(_arg_1: string): number; + getPartSet(_arg_1: number): IFigurePartSet; + isMandatory(_arg_1: string, _arg_2: number): boolean; + optionalFromClubLevel(_arg_1: string): number; type: string; - _Str_734: number; - _Str_710: AdvancedMap; -} \ No newline at end of file + paletteID: number; + partSets: AdvancedMap; +} diff --git a/src/nitro/avatar/structure/figure/Palette.ts b/src/nitro/avatar/structure/figure/Palette.ts index 5e15d1f2..d461e2a5 100644 --- a/src/nitro/avatar/structure/figure/Palette.ts +++ b/src/nitro/avatar/structure/figure/Palette.ts @@ -14,10 +14,10 @@ export class Palette implements IPalette this._id = parseInt(data['$'].id); this._colors = new Map(); - this._Str_2015(data); + this.append(data); } - public _Str_2015(data: any): void + public append(data: any): void { for(const color of data.color) { @@ -27,7 +27,7 @@ export class Palette implements IPalette } } - public _Str_751(id: number): IPartColor + public getColor(id: number): IPartColor { if((id === undefined) || id < 0) return null; @@ -43,4 +43,4 @@ export class Palette implements IPalette { return this._colors; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/figure/PartColor.ts b/src/nitro/avatar/structure/figure/PartColor.ts index 24c34367..9102d025 100644 --- a/src/nitro/avatar/structure/figure/PartColor.ts +++ b/src/nitro/avatar/structure/figure/PartColor.ts @@ -39,8 +39,8 @@ export class PartColor implements IPartColor return this._isSelectable; } - public get _Str_915(): number + public get rgb(): number { return this._rgb; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/figure/SetType.ts b/src/nitro/avatar/structure/figure/SetType.ts index 52f54634..21ce8e56 100644 --- a/src/nitro/avatar/structure/figure/SetType.ts +++ b/src/nitro/avatar/structure/figure/SetType.ts @@ -21,7 +21,7 @@ export class SetType implements ISetType this._isMandatory['M'] = [ (parseInt(data['$'].mand_m_0) === 1), (parseInt(data['$'].mand_m_1) === 1) ]; this._partSets = new AdvancedMap(); - this._Str_2015(data); + this.append(data); } public dispose(): void @@ -36,7 +36,7 @@ export class SetType implements ISetType this._partSets = null; } - public _Str_1874(k: any): void + public cleanUp(k: any): void { for(const _local_2 of k) { @@ -52,7 +52,7 @@ export class SetType implements ISetType } } - public _Str_2015(k: any): void + public append(k: any): void { if(!k || !k.set) return; @@ -71,7 +71,7 @@ export class SetType implements ISetType return null; } - public _Str_1020(k: number): IFigurePartSet + public getPartSet(k: number): IFigurePartSet { return this._partSets.getValue(k.toString()); } @@ -81,24 +81,24 @@ export class SetType implements ISetType return this._type; } - public get _Str_734(): number + public get paletteID(): number { return this._paletteId; } - public _Str_895(k: string, _arg_2: number): boolean + public isMandatory(k: string, _arg_2: number): boolean { return this._isMandatory[k.toUpperCase()][Math.min(_arg_2, 1)]; } - public _Str_1002(k: string): number + public optionalFromClubLevel(k: string): number { const _local_2 = this._isMandatory[k.toUpperCase()]; return _local_2.indexOf(false); } - public get _Str_710(): AdvancedMap + public get partSets(): AdvancedMap { return this._partSets; } diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index e12273a3..2e2c3f1e 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -509,7 +509,7 @@ export class RoomPlane implements IRoomPlane { const normal = geometry.getCoordinatePosition(this._normal); const cm = layer._Str_8547()._Str_21968(normal); - //const data = new PlaneDrawingData(maskData, blend(this._color, layer._Str_751()), cm._Str_14945()); + //const data = new PlaneDrawingData(maskData, blend(this._color, layer.getColor()), cm._Str_14945()); const data = new PlaneDrawingData(maskData, this._color, cm._Str_14945()); Randomizer._Str_17384(this._randomSeed); @@ -537,7 +537,7 @@ export class RoomPlane implements IRoomPlane } else { - //data = new PlaneDrawingData(maskData, blend(this._color, layer._Str_751())); + //data = new PlaneDrawingData(maskData, blend(this._color, layer.getColor())); const data = new PlaneDrawingData(maskData, this._color); drawingDatas.push(data); diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts index 411b1a29..ed0d3917 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts @@ -140,7 +140,7 @@ export class PlaneVisualizationLayer return this._material; } - public _Str_751(): number + public getColor(): number { return this._color; } From 45f88bf30b4d46eeb117b0e8f83c7700efdd8d8c Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 20:40:49 -0500 Subject: [PATCH 031/155] cleaned FigureSetData --- .../avatar/AvatarAssetDownloadManager.ts | 2 +- src/nitro/avatar/AvatarRenderManager.ts | 12 ++++---- src/nitro/avatar/AvatarStructure.ts | 30 +++++++++---------- .../avatar/cache/AvatarImageActionCache.ts | 2 +- src/nitro/avatar/cache/AvatarImageCache.ts | 2 +- .../avatar/structure/AvatarAnimationData.ts | 8 ++--- .../structure/AvatarStructureDownload.ts | 4 +-- src/nitro/avatar/structure/FigureSetData.ts | 12 ++++---- src/nitro/avatar/structure/IFigureSetData.ts | 4 +-- src/nitro/avatar/structure/IStructureData.ts | 10 +++---- src/nitro/avatar/structure/PartSetsData.ts | 12 ++++---- 11 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/nitro/avatar/AvatarAssetDownloadManager.ts b/src/nitro/avatar/AvatarAssetDownloadManager.ts index 47911ada..8b5c0280 100644 --- a/src/nitro/avatar/AvatarAssetDownloadManager.ts +++ b/src/nitro/avatar/AvatarAssetDownloadManager.ts @@ -244,7 +244,7 @@ export class AvatarAssetDownloadManager extends EventDispatcher for(const key of setKeys) { - const set = figureData._Str_740(key); + const set = figureData.getSetType(key); if(!set) continue; diff --git a/src/nitro/avatar/AvatarRenderManager.ts b/src/nitro/avatar/AvatarRenderManager.ts index a0f182dd..e90bf0c1 100644 --- a/src/nitro/avatar/AvatarRenderManager.ts +++ b/src/nitro/avatar/AvatarRenderManager.ts @@ -329,7 +329,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa } else { - const setType = figureData._Str_740(id); + const setType = figureData.getSetType(id); if(setType) { @@ -365,7 +365,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa for(const part of parts) { - const set = figureData._Str_740(part); + const set = figureData.getSetType(part); const setId = container.getPartSetId(part); const partSet = set.getPartSet(setId); @@ -373,7 +373,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { clubLevel = Math.max(partSet.clubLevel, clubLevel); - const palette = figureData._Str_783(set.paletteID); + const palette = figureData.getPalette(set.paletteID); const colors = container.getPartColorIds(part); for(const colorId of colors) @@ -389,7 +389,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa for(const part of searchParts) { - const set = figureData._Str_740(part); + const set = figureData.getSetType(part); if(parts.indexOf(part) === -1) clubLevel = Math.max(set.optionalFromClubLevel(gender), clubLevel); } @@ -400,7 +400,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa public isValidFigureSetForGender(setId: number, gender: string): boolean { const structure = this.structureData; - const partSet = structure._Str_938(setId); + const partSet = structure.getFigurePartSet(setId); return !!(partSet && ((partSet.gender.toUpperCase() === 'U') || (partSet.gender.toUpperCase() === gender.toUpperCase()))); } @@ -428,7 +428,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa for(const _local_4 of k) { - const partSet = structure._Str_938(_local_4); + const partSet = structure.getFigurePartSet(_local_4); if(partSet) partSets.push(partSet); } diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index 6ff6cde9..d9f6191f 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -99,8 +99,8 @@ export class AvatarStructure extends EventDispatcher if(this._partSetsData.parse(k)) { - this._partSetsData._Str_1102('ri').appendToFigure = true; - this._partSetsData._Str_1102('li').appendToFigure = true; + this._partSetsData.getPartDefinition('ri').appendToFigure = true; + this._partSetsData.getPartDefinition('li').appendToFigure = true; return true; } @@ -124,7 +124,7 @@ export class AvatarStructure extends EventDispatcher public injectFigureData(data: any): void { - this._figureData._Str_1133(data); + this._figureData.injectXML(data); } public registerAnimations(k: IAssetManager, _arg_2: string = 'fx', _arg_3: number = 200): void @@ -157,11 +157,11 @@ export class AvatarStructure extends EventDispatcher if((!(_local_4)) || (_local_4.length < _arg_3)) return null; - const _local_5 = this._figureData._Str_740(_arg_2); + const _local_5 = this._figureData.getSetType(_arg_2); if(_local_5 == null) return null; - const _local_6 = this._figureData._Str_783(_local_5.paletteID); + const _local_6 = this._figureData.getPalette(_local_5.paletteID); if(!_local_6) return null; @@ -204,7 +204,7 @@ export class AvatarStructure extends EventDispatcher for(const _local_3 of k) { - _local_2 = Math.max(_local_2, this._animationData._Str_1408(_local_3.definition)); + _local_2 = Math.max(_local_2, this._animationData.getFrameCount(_local_3.definition)); } return _local_2; } @@ -291,7 +291,7 @@ export class AvatarStructure extends EventDispatcher _local_12.setType = _local_13.id; - const _local_10 = this._partSetsData._Str_1520(_local_12); + const _local_10 = this._partSetsData.addPartDefinition(_local_12); _local_10.appendToFigure = true; if(_local_13.base === '') _local_10.staticId = 1; @@ -311,7 +311,7 @@ export class AvatarStructure extends EventDispatcher } else { - _local_3 = this._partSetsData._Str_1795(k.definition); + _local_3 = this._partSetsData.getActiveParts(k.definition); for(const _local_14 of _local_3) { @@ -338,7 +338,7 @@ export class AvatarStructure extends EventDispatcher public getFrameBodyPartOffset(k:IActiveActionData, _arg_2: number, _arg_3: number, _arg_4: string): Point { - const _local_5 = this._animationData._Str_2244(k.definition); + const _local_5 = this._animationData.getAction(k.definition); if(_local_5) return _local_5.getFrameBodyPartOffset(_arg_2, _arg_3, _arg_4); @@ -355,10 +355,10 @@ export class AvatarStructure extends EventDispatcher if(!_arg_3 == null) return []; - const _local_9 = this._partSetsData._Str_1795(_arg_3.definition); + const _local_9 = this._partSetsData.getActiveParts(_arg_3.definition); const _local_11: AvatarImagePartContainer[] = []; let _local_14: any[] = [ 0 ]; - const _local_15 = this._animationData._Str_2244(_arg_3.definition); + const _local_15 = this._animationData.getAction(_arg_3.definition); if(_arg_3.definition.isAnimation) { @@ -399,13 +399,13 @@ export class AvatarStructure extends EventDispatcher const _local_28 = _arg_2.getPartSetId(_local_17); const _local_29 = _arg_2.getPartColorIds(_local_17); - const _local_30 = this._figureData._Str_740(_local_17); + const _local_30 = this._figureData.getSetType(_local_17); if(_local_30) { - const _local_31 = this._figureData._Str_783(_local_30.paletteID); + const _local_31 = this._figureData.getPalette(_local_30.paletteID); if(_local_31) { @@ -441,7 +441,7 @@ export class AvatarStructure extends EventDispatcher if(_local_9.indexOf(_local_33.type) === -1) _local_34 = this._defaultAction; - const _local_13 = this._partSetsData._Str_1102(_local_33.type); + const _local_13 = this._partSetsData.getPartDefinition(_local_33.type); let _local_35 = (!_local_13) ? _local_33.type : _local_13.flippedSetType; @@ -538,7 +538,7 @@ export class AvatarStructure extends EventDispatcher } else { - const _local_13 = this._partSetsData._Str_1102(_local_12); + const _local_13 = this._partSetsData.getPartDefinition(_local_12); let _local_45 = false; let _local_46 = 1; diff --git a/src/nitro/avatar/cache/AvatarImageActionCache.ts b/src/nitro/avatar/cache/AvatarImageActionCache.ts index afc4fd52..313809ed 100644 --- a/src/nitro/avatar/cache/AvatarImageActionCache.ts +++ b/src/nitro/avatar/cache/AvatarImageActionCache.ts @@ -58,7 +58,7 @@ export class AvatarImageActionCache } } - public _Str_2244():IActiveActionData + public getAction():IActiveActionData { return this._Str_1233; } diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index 8917ce84..4a15db80 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -170,7 +170,7 @@ export class AvatarImageCache } let _local_5 = _local_4.getDirection(); - let _local_7 = _local_4._Str_2244(); + let _local_7 = _local_4.getAction(); let frameCount = frameNumber; if(_local_7.definition.startFromFrameZero) frameCount -= _local_7.startFrame; diff --git a/src/nitro/avatar/structure/AvatarAnimationData.ts b/src/nitro/avatar/structure/AvatarAnimationData.ts index e5bec4fd..433b4f3b 100644 --- a/src/nitro/avatar/structure/AvatarAnimationData.ts +++ b/src/nitro/avatar/structure/AvatarAnimationData.ts @@ -28,7 +28,7 @@ export class AvatarAnimationData implements IFigureSetData return true; } - public _Str_1017(k: any): boolean + public appendXML(k: any): boolean { for(const _local_2 of k.action) { @@ -38,7 +38,7 @@ export class AvatarAnimationData implements IFigureSetData return true; } - public _Str_2244(action: IActionDefinition): AnimationAction + public getAction(action: IActionDefinition): AnimationAction { const existing = this._actions.get(action.id); @@ -47,9 +47,9 @@ export class AvatarAnimationData implements IFigureSetData return existing; } - public _Str_1408(k: IActionDefinition): number + public getFrameCount(k: IActionDefinition): number { - const animationAction = this._Str_2244(k); + const animationAction = this.getAction(k); if(!animationAction) return 0; diff --git a/src/nitro/avatar/structure/AvatarStructureDownload.ts b/src/nitro/avatar/structure/AvatarStructureDownload.ts index 215c0597..6adb935b 100644 --- a/src/nitro/avatar/structure/AvatarStructureDownload.ts +++ b/src/nitro/avatar/structure/AvatarStructureDownload.ts @@ -37,7 +37,7 @@ export class AvatarStructureDownload extends EventDispatcher { if(err || !results || !results.figuredata) throw new Error('invalid_figure_data'); - if(this._dataReceiver) this._dataReceiver._Str_1017(results.figuredata); + if(this._dataReceiver) this._dataReceiver.appendXML(results.figuredata); this.dispatchEvent(new NitroEvent(AvatarStructureDownload.AVATAR_STRUCTURE_DONE)); }); @@ -54,4 +54,4 @@ export class AvatarStructureDownload extends EventDispatcher NitroLogger.log(e); } } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/structure/FigureSetData.ts b/src/nitro/avatar/structure/FigureSetData.ts index 2cc19b53..90328880 100644 --- a/src/nitro/avatar/structure/FigureSetData.ts +++ b/src/nitro/avatar/structure/FigureSetData.ts @@ -47,7 +47,7 @@ export class FigureSetData implements IFigureSetData, IStructureData return true; } - public _Str_1133(k: any): void + public injectXML(k: any): void { for(const _local_2 of k.sets[0].settype) { @@ -63,10 +63,10 @@ export class FigureSetData implements IFigureSetData, IStructureData } } - this._Str_1017(k); + this.appendXML(k); } - public _Str_1017(k: any): boolean + public appendXML(k: any): boolean { if(!k) return false; @@ -126,17 +126,17 @@ export class FigureSetData implements IFigureSetData, IStructureData return setType.getDefaultPartSet(_arg_2); } - public _Str_740(k: string): ISetType + public getSetType(k: string): ISetType { return (this._setTypes.get(k) || null); } - public _Str_783(k: number): IPalette + public getPalette(k: number): IPalette { return (this._palettes.get(k.toString()) || null); } - public _Str_938(k: number): IFigurePartSet + public getFigurePartSet(k: number): IFigurePartSet { for(const set of this._setTypes.values()) { diff --git a/src/nitro/avatar/structure/IFigureSetData.ts b/src/nitro/avatar/structure/IFigureSetData.ts index 444911f3..5c0f6492 100644 --- a/src/nitro/avatar/structure/IFigureSetData.ts +++ b/src/nitro/avatar/structure/IFigureSetData.ts @@ -1,5 +1,5 @@ export interface IFigureSetData { parse(data: any): boolean; - _Str_1017(data: any): boolean; -} \ No newline at end of file + appendXML(data: any): boolean; +} diff --git a/src/nitro/avatar/structure/IStructureData.ts b/src/nitro/avatar/structure/IStructureData.ts index 05dac860..44ab14f1 100644 --- a/src/nitro/avatar/structure/IStructureData.ts +++ b/src/nitro/avatar/structure/IStructureData.ts @@ -5,8 +5,8 @@ import { ISetType } from './figure/ISetType'; export interface IStructureData { parse(data: any): boolean; - _Str_1017(k: any): boolean; - _Str_740(_arg_1: string): ISetType; - _Str_783(_arg_1: number): IPalette; - _Str_938(_arg_1: number): IFigurePartSet; -} \ No newline at end of file + appendXML(k: any): boolean; + getSetType(_arg_1: string): ISetType; + getPalette(_arg_1: number): IPalette; + getFigurePartSet(_arg_1: number): IFigurePartSet; +} diff --git a/src/nitro/avatar/structure/PartSetsData.ts b/src/nitro/avatar/structure/PartSetsData.ts index 6d8173dd..dbd5971e 100644 --- a/src/nitro/avatar/structure/PartSetsData.ts +++ b/src/nitro/avatar/structure/PartSetsData.ts @@ -40,7 +40,7 @@ export class PartSetsData implements IFigureSetData return true; } - public _Str_1017(data: any): boolean + public appendXML(data: any): boolean { if(data.partSet && (data.partSet.length > 0)) { @@ -65,7 +65,7 @@ export class PartSetsData implements IFigureSetData return false; } - public _Str_1795(k:IActionDefinition): string[] + public getActiveParts(k:IActionDefinition): string[] { const activePartSet = this._activePartSets.get(k.activePartSet); @@ -74,7 +74,7 @@ export class PartSetsData implements IFigureSetData return activePartSet.parts; } - public _Str_1102(part: string): PartDefinition + public getPartDefinition(part: string): PartDefinition { const existing = this._parts.get(part); @@ -83,7 +83,7 @@ export class PartSetsData implements IFigureSetData return existing; } - public _Str_1520(k: any): PartDefinition + public addPartDefinition(k: any): PartDefinition { const _local_2 = k.setType as string; @@ -99,7 +99,7 @@ export class PartSetsData implements IFigureSetData return existing; } - public _Str_1113(k: ActionDefinition): ActivePartSet + public getActivePartSet(k: ActionDefinition): ActivePartSet { const existing = this._activePartSets.get(k.activePartSet); @@ -113,7 +113,7 @@ export class PartSetsData implements IFigureSetData return this._parts; } - public get _Str_1979(): Map + public get activePartSets(): Map { return this._activePartSets; } From 2197d5c88a845caa1cbcccae105c0f49c7136dee Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 21:00:09 -0500 Subject: [PATCH 032/155] cleaned Animation --- src/nitro/avatar/AvatarImage.ts | 10 ++-- src/nitro/avatar/AvatarStructure.ts | 14 +++--- .../avatar/animation/AddDataContainer.ts | 2 +- src/nitro/avatar/animation/Animation.ts | 46 +++++++++---------- .../avatar/animation/AnimationManager.ts | 4 +- src/nitro/avatar/animation/IAnimation.ts | 14 +++--- .../avatar/animation/IAnimationManager.ts | 2 +- src/nitro/avatar/cache/AvatarImageCache.ts | 4 +- 8 files changed, 48 insertions(+), 48 deletions(-) diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index 3ad5ed03..9254fff3 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -888,9 +888,9 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { const _local_2 = this._structure.getAnimation(((k.definition.state + '.') + k.actionParameter)); - if(_local_2 && _local_2._Str_1892()) + if(_local_2 && _local_2.hasOverriddenActions()) { - const _local_5 = _local_2._Str_1571(); + const _local_5 = _local_2.overriddenActionNames(); if(_local_5) { @@ -924,11 +924,11 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(_local_2) { - this._sprites = this._sprites.concat(_local_2._Str_786); + this._sprites = this._sprites.concat(_local_2.spriteData); - if(_local_2._Str_776()) this._directionOffset = _local_2._Str_1493.offset; + if(_local_2.hasDirectionData()) this._directionOffset = _local_2.directionData.offset; - if(_local_2._Str_872()) this._avatarSpriteData = _local_2._Str_1475; + if(_local_2.hasAvatarData()) this._avatarSpriteData = _local_2.avatarData; } } } diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index d9f6191f..cb6f8f51 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -170,7 +170,7 @@ export class AvatarStructure extends EventDispatcher public getBodyPartData(animation: string, frameCount: number, spriteId: string): AvatarAnimationLayerData { - return this._animationManager._Str_607(animation, frameCount, spriteId) as AvatarAnimationLayerData; + return this._animationManager.getLayerData(animation, frameCount, spriteId) as AvatarAnimationLayerData; } public getAnimation(k: string): Animation @@ -260,9 +260,9 @@ export class AvatarStructure extends EventDispatcher if(_local_8) { - _local_3 = _local_8._Str_1065(0, k.overridingAction); + _local_3 = _local_8.getAnimatedBodyPartIds(0, k.overridingAction); - if(_local_8._Str_706()) + if(_local_8.hasAddData()) { const _local_11 = { id: '', @@ -280,7 +280,7 @@ export class AvatarStructure extends EventDispatcher setType: '' }; - for(const _local_13 of _local_8._Str_687) + for(const _local_13 of _local_8.addData) { const _local_6 = this._geometry._Str_1919(_local_5, _local_13.align); @@ -369,7 +369,7 @@ export class AvatarStructure extends EventDispatcher { _local_14 = this.getPopulatedArray(_local_10.frameCount(_arg_3.overridingAction)); - for(const _local_25 of _local_10._Str_1065(0, _arg_3.overridingAction)) + for(const _local_25 of _local_10.getAnimatedBodyPartIds(0, _arg_3.overridingAction)) { if(_local_25 === k) { @@ -559,11 +559,11 @@ export class AvatarStructure extends EventDispatcher if(_local_10 != null) { - const _local_48 = _local_10._Str_1550(_local_12); + const _local_48 = _local_10.getAddData(_local_12); if(_local_48) { - _local_45 = _local_48._Str_1096; + _local_45 = _local_48.isBlended; _local_46 = _local_48.blend; } } diff --git a/src/nitro/avatar/animation/AddDataContainer.ts b/src/nitro/avatar/animation/AddDataContainer.ts index 5320b45b..1b8af5a3 100644 --- a/src/nitro/avatar/animation/AddDataContainer.ts +++ b/src/nitro/avatar/animation/AddDataContainer.ts @@ -54,7 +54,7 @@ export class AddDataContainer return this._blend; } - public get _Str_1096(): boolean + public get isBlended(): boolean { return this._blend !== 1; } diff --git a/src/nitro/avatar/animation/Animation.ts b/src/nitro/avatar/animation/Animation.ts index c317ed25..2c741366 100644 --- a/src/nitro/avatar/animation/Animation.ts +++ b/src/nitro/avatar/animation/Animation.ts @@ -9,7 +9,7 @@ import { SpriteDataContainer } from './SpriteDataContainer'; export class Animation implements IAnimation { - private static _Str_2211: any[] = []; + private static EMPTY_ARRAY: any[] = []; private _id: string; private _description: string; @@ -76,16 +76,16 @@ export class Animation implements IAnimation const frames: AvatarAnimationLayerData[][] = []; - this._Str_1031(frames, override.frames, k); + this.parseFrames(frames, override.frames, k); this._overrideFrames.set(name, frames); } } - this._Str_1031(this._frames, _arg_2.frames, k); + this.parseFrames(this._frames, _arg_2.frames, k); } - private _Str_1031(frames: AvatarAnimationLayerData[][], _arg_2: IAssetAnimationFrame[], _arg_3: AvatarStructure): void + private parseFrames(frames: AvatarAnimationLayerData[][], _arg_2: IAssetAnimationFrame[], _arg_3: AvatarStructure): void { if(!_arg_2 || !_arg_2.length) return; @@ -144,14 +144,14 @@ export class Animation implements IAnimation return 0; } - public _Str_1892(): boolean + public hasOverriddenActions(): boolean { if(!this._overriddenActions) return false; return (this._overriddenActions.size > 0); } - public _Str_1571(): string[] + public overriddenActionNames(): string[] { if(!this._overriddenActions) return null; @@ -169,7 +169,7 @@ export class Animation implements IAnimation return this._overriddenActions.get(k); } - private _Str_2259(frameCount: number, _arg_2: string = null): AvatarAnimationLayerData[] + private getFrame(frameCount: number, _arg_2: string = null): AvatarAnimationLayerData[] { if(frameCount < 0) frameCount = 0; @@ -195,11 +195,11 @@ export class Animation implements IAnimation return layers; } - public _Str_1065(k: number, _arg_2: string=null): string[] + public getAnimatedBodyPartIds(k: number, _arg_2: string=null): string[] { const _local_3: string[] = []; - for(const layer of this._Str_2259(k, _arg_2)) + for(const layer of this.getFrame(k, _arg_2)) { if(layer.type === AvatarAnimationLayerData.BODYPART) { @@ -221,9 +221,9 @@ export class Animation implements IAnimation return _local_3; } - public _Str_607(frameCount: number, spriteId: string, _arg_3: string = null): AvatarAnimationLayerData + public getLayerData(frameCount: number, spriteId: string, _arg_3: string = null): AvatarAnimationLayerData { - for(const layer of this._Str_2259(frameCount, _arg_3)) + for(const layer of this.getFrame(frameCount, _arg_3)) { if(layer.id === spriteId) return layer; @@ -242,22 +242,22 @@ export class Animation implements IAnimation return null; } - public _Str_872(): boolean + public hasAvatarData(): boolean { return this._avatarData !== null; } - public _Str_776(): boolean + public hasDirectionData(): boolean { return this._directionData !== null; } - public _Str_706(): boolean + public hasAddData(): boolean { return this._addData !== null; } - public _Str_1550(k: string): AddDataContainer + public getAddData(k: string): AddDataContainer { if(this._addData) { @@ -275,29 +275,29 @@ export class Animation implements IAnimation return this._id; } - public get _Str_786(): SpriteDataContainer[] + public get spriteData(): SpriteDataContainer[] { - return this._spriteData || Animation._Str_2211; + return this._spriteData || Animation.EMPTY_ARRAY; } - public get _Str_1475(): AvatarDataContainer + public get avatarData(): AvatarDataContainer { return this._avatarData; } - public get _Str_1493(): DirectionDataContainer + public get directionData(): DirectionDataContainer { return this._directionData; } - public get _Str_652(): string[] + public get removeData(): string[] { - return this._removeData || Animation._Str_2211; + return this._removeData || Animation.EMPTY_ARRAY; } - public get _Str_687(): AddDataContainer[] + public get addData(): AddDataContainer[] { - return this._addData || Animation._Str_2211; + return this._addData || Animation.EMPTY_ARRAY; } public toString(): string diff --git a/src/nitro/avatar/animation/AnimationManager.ts b/src/nitro/avatar/animation/AnimationManager.ts index 348d6281..0f76b210 100644 --- a/src/nitro/avatar/animation/AnimationManager.ts +++ b/src/nitro/avatar/animation/AnimationManager.ts @@ -34,13 +34,13 @@ export class AnimationManager implements IAnimationManager return existing; } - public _Str_607(animation: string, frameCount: number, spriteId: string): IAnimationLayerData + public getLayerData(animation: string, frameCount: number, spriteId: string): IAnimationLayerData { const existing = this.getAnimation(animation); if(!existing) return null; - return existing._Str_607(frameCount, spriteId); + return existing.getLayerData(frameCount, spriteId); } public get animations(): Map diff --git a/src/nitro/avatar/animation/IAnimation.ts b/src/nitro/avatar/animation/IAnimation.ts index 9cadcf60..2f53b72e 100644 --- a/src/nitro/avatar/animation/IAnimation.ts +++ b/src/nitro/avatar/animation/IAnimation.ts @@ -1,11 +1,11 @@ export interface IAnimation { - _Str_872(): boolean; - _Str_776(): boolean; - _Str_706(): boolean; + hasAvatarData(): boolean; + hasDirectionData(): boolean; + hasAddData(): boolean; id: string; - _Str_786: any; - _Str_652: any; - _Str_687: any; + spriteData: any; + removeData: any; + addData: any; resetOnToggle: boolean; -} \ No newline at end of file +} diff --git a/src/nitro/avatar/animation/IAnimationManager.ts b/src/nitro/avatar/animation/IAnimationManager.ts index c8ba8d2d..2fff676f 100644 --- a/src/nitro/avatar/animation/IAnimationManager.ts +++ b/src/nitro/avatar/animation/IAnimationManager.ts @@ -5,5 +5,5 @@ export interface IAnimationManager { animations: Map; getAnimation(_arg_1: string): IAnimation; - _Str_607(_arg_1: string, _arg_2: number, _arg_3: string): IAnimationLayerData; + getLayerData(_arg_1: string, _arg_2: number, _arg_3: string): IAnimationLayerData; } diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index 4a15db80..ed70fc9c 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -191,7 +191,7 @@ export class AvatarImageCache if(_local_16) { - const _local_18 = _local_16._Str_607(_local_17, k, _local_7.overridingAction); + const _local_18 = _local_16.getLayerData(_local_17, k, _local_7.overridingAction); if(_local_18) { @@ -246,7 +246,7 @@ export class AvatarImageCache _local_10 = _local_18.items; } - _local_9 = _local_16._Str_652; + _local_9 = _local_16.removeData; } } } From c30d5f219447f1c303ed7e61401dde30bf6c0c81 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 1 Jun 2021 02:39:02 -0500 Subject: [PATCH 033/155] cleaned PlaneTexture --- src/nitro/avatar/alias/AssetAliasCollection.ts | 10 +++++----- src/nitro/avatar/cache/AvatarImageCache.ts | 2 +- .../object/visualization/room/RoomPlane.ts | 4 ++-- .../visualization/room/mask/PlaneMask.ts | 4 ++-- .../visualization/room/mask/PlaneMaskBitmap.ts | 6 +++--- .../room/mask/PlaneMaskManager.ts | 10 +++++----- .../room/mask/PlaneMaskVisualization.ts | 10 +++++----- .../room/rasterizer/basic/PlaneMaterial.ts | 6 +++--- .../room/rasterizer/basic/PlaneMaterialCell.ts | 10 +++++----- .../basic/PlaneMaterialCellMatrix.ts | 6 +++--- .../room/rasterizer/basic/PlaneRasterizer.ts | 18 +++++++++--------- .../room/rasterizer/basic/PlaneTexture.ts | 18 +++++++++--------- .../rasterizer/basic/PlaneTextureBitmap.ts | 8 ++++---- 13 files changed, 56 insertions(+), 56 deletions(-) diff --git a/src/nitro/avatar/alias/AssetAliasCollection.ts b/src/nitro/avatar/alias/AssetAliasCollection.ts index 85b2f009..7f73d496 100644 --- a/src/nitro/avatar/alias/AssetAliasCollection.ts +++ b/src/nitro/avatar/alias/AssetAliasCollection.ts @@ -50,7 +50,7 @@ export class AssetAliasCollection } } - public _Str_1044(k: string): boolean + public hasAlias(k: string): boolean { const alias = this._aliases.get(k); @@ -59,12 +59,12 @@ export class AssetAliasCollection return false; } - public _Str_2125(k: string): string + public getAssetName(k: string): string { let _local_2 = k; let _local_3 = 5; - while(this._Str_1044(_local_2) && (_local_3 >= 0)) + while(this.hasAlias(_local_2) && (_local_3 >= 0)) { const _local_4 = this._aliases.get(_local_2); @@ -79,7 +79,7 @@ export class AssetAliasCollection { if(!this._assets) return null; - name = this._Str_2125(name); + name = this.getAssetName(name); const asset = this._assets.getAsset(name); @@ -87,4 +87,4 @@ export class AssetAliasCollection return asset; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index ed70fc9c..c8086b08 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -407,7 +407,7 @@ export class AvatarImageCache { const spriteData = new RoomObjectSpriteData(); - spriteData.name = this._assets._Str_2125(assetName); + spriteData.name = this._assets.getAssetName(assetName); spriteData.x = (-(offset.x) - 33); spriteData.y = -(offset.y); spriteData.z = (this._serverRenderData.length * -0.0001); diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 2e2c3f1e..50e703ee 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -457,7 +457,7 @@ export class RoomPlane implements IRoomPlane if(planeMask) { - const assetName = planeMask._Str_2125(k.scale); + const assetName = planeMask.getAssetName(k.scale); if(assetName) { @@ -520,7 +520,7 @@ export class RoomPlane implements IRoomPlane for(const cell of column._Str_22299()) { - const name = cell._Str_2125(normal); + const name = cell.getAssetName(normal); if(name) assetNames.push(name); } diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMask.ts b/src/nitro/room/object/visualization/room/mask/PlaneMask.ts index 877850ca..048050bc 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMask.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMask.ts @@ -102,7 +102,7 @@ export class PlaneMask return visualization.getAsset(_arg_2); } - public _Str_2125(k: number): string + public getAssetName(k: number): string { if(!this._assetNames) return null; @@ -115,4 +115,4 @@ export class PlaneMask this._assetNames.set(k, _arg_2); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMaskBitmap.ts b/src/nitro/room/object/visualization/room/mask/PlaneMaskBitmap.ts index bb7d496b..2432408b 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMaskBitmap.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMaskBitmap.ts @@ -2,8 +2,8 @@ export class PlaneMaskBitmap { - public static _Str_3268: number = -1; - public static _Str_3271: number = 1; + public static MIN_NORMAL_COORDINATE_VALUE: number = -1; + public static MAX_NORMAL_COORDINATE_VALUE: number = 1; private _asset: IGraphicAsset; private _normalMinX: number; @@ -49,4 +49,4 @@ export class PlaneMaskBitmap { this._asset = null; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts index 8b76b8e5..b16b50d9 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts @@ -123,10 +123,10 @@ export class PlaneMaskManager if(!asset) continue; - let normalMinX = PlaneMaskVisualization._Str_3268; - let normalMaxX = PlaneMaskVisualization._Str_3271; - let normalMinY = PlaneMaskVisualization._Str_3268; - let normalMaxY = PlaneMaskVisualization._Str_3271; + let normalMinX = PlaneMaskVisualization.MIN_NORMAL_COORDINATE_VALUE; + let normalMaxX = PlaneMaskVisualization.MAX_NORMAL_COORDINATE_VALUE; + let normalMinY = PlaneMaskVisualization.MIN_NORMAL_COORDINATE_VALUE; + let normalMaxY = PlaneMaskVisualization.MAX_NORMAL_COORDINATE_VALUE; if(bitmap.normalMinX !== undefined) normalMinX = bitmap.normalMinX; if(bitmap.normalMaxX !== undefined) normalMaxX = bitmap.normalMaxX; @@ -135,7 +135,7 @@ export class PlaneMaskManager if(!asset.flipH) graphicName = assetName; - _arg_2._Str_16790(asset, normalMinX, normalMaxX, normalMinY, normalMaxY); + _arg_2.addBitmap(asset, normalMinX, normalMaxX, normalMinY, normalMaxY); } return graphicName; diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMaskVisualization.ts b/src/nitro/room/object/visualization/room/mask/PlaneMaskVisualization.ts index 84068357..5e770c89 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMaskVisualization.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMaskVisualization.ts @@ -1,11 +1,11 @@ -import { IGraphicAsset } from '../../../../../../room/object/visualization/utils/IGraphicAsset'; +import { IGraphicAsset } from '../../../../../../room/object/visualization/utils/IGraphicAsset'; import { IVector3D } from '../../../../../../room/utils/IVector3D'; import { PlaneMaskBitmap } from './PlaneMaskBitmap'; export class PlaneMaskVisualization { - public static _Str_3268: number = -1; - public static _Str_3271: number = 1; + public static MIN_NORMAL_COORDINATE_VALUE: number = -1; + public static MAX_NORMAL_COORDINATE_VALUE: number = 1; private _bitmaps: PlaneMaskBitmap[]; @@ -26,7 +26,7 @@ export class PlaneMaskVisualization this._bitmaps = null; } - public _Str_16790(k: IGraphicAsset, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1): void + public addBitmap(k: IGraphicAsset, _arg_2: number = -1, _arg_3: number = 1, _arg_4: number = -1, _arg_5: number = 1): void { this._bitmaps.push(new PlaneMaskBitmap(k, _arg_2, _arg_3, _arg_4, _arg_5)); } @@ -47,4 +47,4 @@ export class PlaneMaskVisualization return null; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts index 5a62c7ce..2991902a 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts @@ -4,8 +4,8 @@ import { PlaneMaterialCellMatrix } from './PlaneMaterialCellMatrix'; export class PlaneMaterial { - public static _Str_3268: number = -1; - public static _Str_3271: number = 1; + public static MIN_NORMAL_COORDINATE_VALUE: number = -1; + public static MAX_NORMAL_COORDINATE_VALUE: number = 1; private _planeMaterialItems: PlaneMaterialCellMatrix[]; private _isCached: boolean; @@ -90,4 +90,4 @@ export class PlaneMaterial return cellMatrix.render(k, _arg_2, _arg_3, _arg_4, _arg_5, _arg_6, _arg_7, _arg_8); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts index 02538e3b..9d0d65bf 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts @@ -93,7 +93,7 @@ export class PlaneMaterialCell { if(this._texture) { - const texture = this._texture._Str_4913(k); + const texture = this._texture.getBitmap(k); if(texture) return texture.height; } @@ -105,7 +105,7 @@ export class PlaneMaterialCell { if(!this._texture) return null; - const texture = this._texture._Str_4913(normal); + const texture = this._texture.getBitmap(normal); if(!texture) return null; @@ -235,8 +235,8 @@ export class PlaneMaterialCell return null; } - public _Str_2125(k:IVector3D): string + public getAssetName(k:IVector3D): string { - return (this._texture == null) ? null : this._texture._Str_2125(k); + return (this._texture == null) ? null : this._texture.getAssetName(k); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts index 7843c00f..107c98ca 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts @@ -16,8 +16,8 @@ export class PlaneMaterialCellMatrix public static _Str_6063: number = 5; public static _Str_9127: number = 6; public static _Str_18632: number = PlaneMaterialCellMatrix._Str_7916;//1 - public static _Str_3268: number = -1; - public static _Str_3271: number = 1; + public static MIN_NORMAL_COORDINATE_VALUE: number = -1; + public static MAX_NORMAL_COORDINATE_VALUE: number = 1; public static ALIGN_TOP: number = 1; public static _Str_3606: number = 2; public static _Str_6914: number = PlaneMaterialCellMatrix.ALIGN_TOP;//1 @@ -720,4 +720,4 @@ export class PlaneMaterialCellMatrix return this._columns; } -} \ No newline at end of file +} 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 22542c64..973177d2 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -234,10 +234,10 @@ export class PlaneRasterizer implements IPlaneRasterizer const assetName = bitmap.assetName; - let normalMinX = PlaneTexture._Str_3268; - let normalMaxX = PlaneTexture._Str_3271; - let normalMinY = PlaneTexture._Str_3268; - let normalMaxY = PlaneTexture._Str_3271; + let normalMinX = PlaneTexture.MIN_NORMAL_COORDINATE_VALUE; + let normalMaxX = PlaneTexture.MAX_NORMAL_COORDINATE_VALUE; + let normalMinY = PlaneTexture.MIN_NORMAL_COORDINATE_VALUE; + let normalMaxY = PlaneTexture.MAX_NORMAL_COORDINATE_VALUE; if(bitmap.normalMinX !== undefined) normalMinX = bitmap.normalMinX; if(bitmap.normalMaxX !== undefined) normalMaxX = bitmap.normalMaxX; @@ -259,7 +259,7 @@ export class PlaneRasterizer implements IPlaneRasterizer newTexture = Rasterizer.getFlipHBitmapData(texture); } - plane._Str_16790(newTexture, normalMinX, normalMaxX, normalMinY, normalMaxY, assetName); + plane.addBitmap(newTexture, normalMinX, normalMaxX, normalMinY, normalMaxY, assetName); } } } @@ -290,10 +290,10 @@ export class PlaneRasterizer implements IPlaneRasterizer let repeatMode = matrix.repeatMode; let align = matrix.align; - const normalMinX = PlaneMaterialCellMatrix._Str_3268; - const normalMaxX = PlaneMaterialCellMatrix._Str_3271; - const normalMinY = PlaneMaterialCellMatrix._Str_3268; - const normalMaxY = PlaneMaterialCellMatrix._Str_3271; + const normalMinX = PlaneMaterialCellMatrix.MIN_NORMAL_COORDINATE_VALUE; + const normalMaxX = PlaneMaterialCellMatrix.MAX_NORMAL_COORDINATE_VALUE; + const normalMinY = PlaneMaterialCellMatrix.MIN_NORMAL_COORDINATE_VALUE; + const normalMaxY = PlaneMaterialCellMatrix.MAX_NORMAL_COORDINATE_VALUE; switch(repeatMode) { 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 0e7a38a6..e6655d58 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTexture.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTexture.ts @@ -4,8 +4,8 @@ import { PlaneTextureBitmap } from './PlaneTextureBitmap'; export class PlaneTexture { - public static _Str_3268: number = -1; - public static _Str_3271: number = 1; + public static MIN_NORMAL_COORDINATE_VALUE: number = -1; + public static MAX_NORMAL_COORDINATE_VALUE: number = 1; private _bitmaps: PlaneTextureBitmap[]; @@ -29,21 +29,21 @@ export class PlaneTexture } } - public _Str_16790(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 _Str_4913(k: IVector3D): Texture + public getBitmap(k: IVector3D): Texture { - const _local_2 = this._Str_21702(k); + const _local_2 = this.getPlaneTextureBitmap(k); if(!_local_2) return null; return _local_2.bitmap; } - public _Str_21702(k: IVector3D): PlaneTextureBitmap + public getPlaneTextureBitmap(k: IVector3D): PlaneTextureBitmap { if(!k) return null; @@ -57,10 +57,10 @@ export class PlaneTexture return null; } - public _Str_2125(k: IVector3D): string + public getAssetName(k: IVector3D): string { - const _local_2 = this._Str_21702(k); + const _local_2 = this.getPlaneTextureBitmap(k); return (!_local_2) ? null : _local_2.assetName; } -} \ No newline at end of file +} 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 ca0be442..9adfdc53 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTextureBitmap.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneTextureBitmap.ts @@ -1,9 +1,9 @@ -import { Texture } from 'pixi.js'; +import { Texture } from 'pixi.js'; export class PlaneTextureBitmap { - public static _Str_3268: number = -1; - public static _Str_3271: number = 1; + public static MIN_NORMAL_COORDINATE_VALUE: number = -1; + public static MAX_NORMAL_COORDINATE_VALUE: number = 1; private _bitmap: Texture; private _normalMinX: number; @@ -56,4 +56,4 @@ export class PlaneTextureBitmap { this._bitmap = null; } -} \ No newline at end of file +} From 83c823222fa78c9f51d1856e0c372b59e685dc45 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 1 Jun 2021 02:51:12 -0500 Subject: [PATCH 034/155] cleaned Plane --- .../object/visualization/room/RoomPlane.ts | 2 +- .../visualization/room/RoomVisualization.ts | 2 +- .../room/RoomVisualizationData.ts | 10 +++++----- .../visualization/room/mask/PlaneMask.ts | 4 ++-- .../room/rasterizer/IPlaneRasterizer.ts | 2 +- .../room/rasterizer/animated/LandscapePlane.ts | 6 +++--- .../rasterizer/animated/LandscapeRasterizer.ts | 4 ++-- .../PlaneVisualizationAnimationLayer.ts | 4 ++-- .../room/rasterizer/basic/FloorPlane.ts | 4 ++-- .../room/rasterizer/basic/Plane.ts | 18 +++++++++--------- .../room/rasterizer/basic/PlaneMaterial.ts | 4 ++-- .../room/rasterizer/basic/PlaneMaterialCell.ts | 2 +- .../basic/PlaneMaterialCellColumn.ts | 6 +++--- .../basic/PlaneMaterialCellMatrix.ts | 4 ++-- .../room/rasterizer/basic/PlaneRasterizer.ts | 16 ++++++++-------- .../rasterizer/basic/PlaneVisualization.ts | 8 ++++---- .../basic/PlaneVisualizationLayer.ts | 4 ++-- .../room/rasterizer/basic/WallPlane.ts | 4 ++-- 18 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 50e703ee..62f9b826 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -495,7 +495,7 @@ export class RoomPlane implements IRoomPlane if(this._isVisible) { const maskData = this.resolveMasks(geometry); - const layers = this._rasterizer._Str_8988(this._id); + const layers = this._rasterizer.getLayers(this._id); let i = 0; diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index db865ca0..91da3e89 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -175,7 +175,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(this._data) { - this._data._Str_3355(); + this._data.clearCache(); this._data = null; } diff --git a/src/nitro/room/object/visualization/room/RoomVisualizationData.ts b/src/nitro/room/object/visualization/room/RoomVisualizationData.ts index 3e94b1b1..4639d178 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualizationData.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualizationData.ts @@ -96,13 +96,13 @@ export class RoomVisualizationData extends Disposable implements IObjectVisualiz this._initialized = true; } - public _Str_3355(): void + public clearCache(): void { - if(this._wallRasterizer) this._wallRasterizer._Str_3355(); + if(this._wallRasterizer) this._wallRasterizer.clearCache(); - if(this._floorRasterizer) this._floorRasterizer._Str_3355(); + if(this._floorRasterizer) this._floorRasterizer.clearCache(); - if(this._landscapeRasterizer) this._landscapeRasterizer._Str_3355(); + if(this._landscapeRasterizer) this._landscapeRasterizer.clearCache(); } public get wallRasterizer(): WallRasterizer @@ -124,4 +124,4 @@ export class RoomVisualizationData extends Disposable implements IObjectVisualiz { return this._maskManager; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMask.ts b/src/nitro/room/object/visualization/room/mask/PlaneMask.ts index 048050bc..7e6ba4e5 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMask.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMask.ts @@ -53,7 +53,7 @@ export class PlaneMask return visualization; } - private _Str_8560(k: number): number + private getSizeIndex(k: number): number { let sizeIndex = 0; const index = 1; @@ -77,7 +77,7 @@ export class PlaneMask { if(k === this._lastSize) return this._lastMaskVisualization; - const sizeIndex = this._Str_8560(k); + const sizeIndex = this.getSizeIndex(k); if(sizeIndex < this._sizes.length) { diff --git a/src/nitro/room/object/visualization/room/rasterizer/IPlaneRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/IPlaneRasterizer.ts index 16007f64..3f72c158 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/IPlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/IPlaneRasterizer.ts @@ -8,6 +8,6 @@ export interface IPlaneRasterizer initializeDimensions(_arg_1: number, _arg_2: number): boolean; render(_arg_1: Graphics, _arg_2: string, _arg_3: number, _arg_4: number, _arg_5: number, _arg_6: IVector3D, _arg_7: boolean, _arg_8?: number, _arg_9?: number, _arg_10?: number, _arg_11?: number, _arg_12?: number): PlaneBitmapData; getTextureIdentifier(_arg_1: number, _arg_2: IVector3D): string; - _Str_8988(_arg_1: string): PlaneVisualizationLayer[]; + getLayers(_arg_1: string): PlaneVisualizationLayer[]; _Str_24005(): void; } diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts index 26871fc6..a42c576f 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts @@ -14,7 +14,7 @@ export class LandscapePlane extends Plane public isStatic(k: number): boolean { - const _local_2 = this._Str_6009(k); + const _local_2 = this.getPlaneVisualization(k); if(_local_2) return !(_local_2._Str_20530); @@ -36,7 +36,7 @@ export class LandscapePlane extends Plane public render(k: Graphics, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: IVector3D, _arg_6: boolean, _arg_7: number, _arg_8: number, _arg_9: number, _arg_10: number, _arg_11: number): Graphics { - const visualization = this._Str_6009(_arg_4); + const visualization = this.getPlaneVisualization(_arg_4); if(!visualization || !visualization.geometry) return null; @@ -59,4 +59,4 @@ export class LandscapePlane extends Plane return null; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts index 5252191f..2a0cc2c7 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts @@ -71,7 +71,7 @@ export class LandscapeRasterizer extends PlaneRasterizer const totalAnimatedLayers = ((animatedLayers && animatedLayers.length) || 0); const totalLayers = (totalBasicLayers + totalAnimatedLayers); - const planeVisualization = plane._Str_20305(size, (totalLayers || 0), this._Str_17204(size, horizontalAngle, verticalAngle)); + const planeVisualization = plane.createPlaneVisualization(size, (totalLayers || 0), this._Str_17204(size, horizontalAngle, verticalAngle)); if(planeVisualization) { @@ -157,7 +157,7 @@ export class LandscapeRasterizer extends PlaneRasterizer layerId++; } - planeVisualization._Str_23489(layerId, animationItems, this._Str_2697); + planeVisualization._Str_23489(layerId, animationItems, this.assetCollection); } } } diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts index 7d1efdb8..9c4455a1 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts @@ -60,7 +60,7 @@ export class PlaneVisualizationAnimationLayer implements IDisposable } } - public _Str_3355(): void + public clearCache(): void { if(this._bitmapData) { @@ -148,4 +148,4 @@ export class PlaneVisualizationAnimationLayer implements IDisposable return k; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts index edc11a0e..568bcd1d 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts @@ -11,7 +11,7 @@ export class FloorPlane extends Plane public render(k: Graphics, _arg_2: number, _arg_3: number, size: number, _arg_5: IVector3D, _arg_6: boolean, _arg_7: number, _arg_8: number): Graphics { - const visualization = this._Str_6009(size); + const visualization = this.getPlaneVisualization(size); if(!visualization || !visualization.geometry) return null; @@ -35,4 +35,4 @@ export class FloorPlane extends Plane return visualization.render(k, _arg_2, _arg_3, _arg_5, _arg_6, _local_13, _local_14); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/Plane.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/Plane.ts index 57ea6726..dd0b36a7 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/Plane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/Plane.ts @@ -37,17 +37,17 @@ export class Plane this._lastSize = -1; } - public _Str_3355(): void + public clearCache(): void { for(const visualization of this._planeVisualizations.values()) { if(!visualization) continue; - visualization._Str_3355(); + visualization.clearCache(); } } - public _Str_20305(k: number, _arg_2: number, _arg_3: IRoomGeometry): PlaneVisualization + public createPlaneVisualization(k: number, _arg_2: number, _arg_3: IRoomGeometry): PlaneVisualization { const existing = this._planeVisualizations.get(k.toString()); @@ -63,7 +63,7 @@ export class Plane return plane; } - private _Str_8560(k: number): number + private getSizeIndex(k: number): number { let size = 0; let index = 1; @@ -85,11 +85,11 @@ export class Plane return size; } - protected _Str_6009(k: number): PlaneVisualization + protected getPlaneVisualization(k: number): PlaneVisualization { if(k === this._lastSize) return this._lastPlaneVisualization; - const sizeIndex = this._Str_8560(k); + const sizeIndex = this.getSizeIndex(k); if(sizeIndex < this._sizes.length) { @@ -105,8 +105,8 @@ export class Plane return this._lastPlaneVisualization; } - public _Str_8988(): PlaneVisualizationLayer[] + public getLayers(): PlaneVisualizationLayer[] { - return this._Str_6009(this._lastSize)._Str_8988(); + return this.getPlaneVisualization(this._lastSize).getLayers(); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts index 2991902a..76ae6a0d 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts @@ -33,7 +33,7 @@ export class PlaneMaterial this._isCached = false; } - public _Str_3355(): void + public clearCache(): void { if(!this._isCached) return; @@ -43,7 +43,7 @@ export class PlaneMaterial { if(!item) continue; - item._Str_3355(); + item.clearCache(); } } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts index 9d0d65bf..99eadbf9 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts @@ -79,7 +79,7 @@ export class PlaneMaterialCell this._extraItemCount = 0; } - public _Str_3355(): void + public clearCache(): void { if(this._cachedBitmapData) { diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts index aeddf409..46036900 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts @@ -93,7 +93,7 @@ export class PlaneMaterialCellColumn if(this._cachedBitmapNormal) this._cachedBitmapNormal = null; } - public _Str_3355(): void + public clearCache(): void { if(!this._isCached) return; @@ -117,7 +117,7 @@ export class PlaneMaterialCellColumn { if(!cell) continue; - cell._Str_3355(); + cell.clearCache(); } } @@ -487,4 +487,4 @@ export class PlaneMaterialCellColumn { return this._cells; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts index 107c98ca..238ddddf 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts @@ -107,7 +107,7 @@ export class PlaneMaterialCellMatrix if(this._cachedBitmapNormal) this._cachedBitmapNormal = null; } - public _Str_3355(): void + public clearCache(): void { if(!this._isCached) return; @@ -131,7 +131,7 @@ export class PlaneMaterialCellMatrix { if(!column) continue; - column._Str_3355(); + column.clearCache(); } } 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 973177d2..daa6e87e 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -43,7 +43,7 @@ export class PlaneRasterizer implements IPlaneRasterizer return this._data; } - protected get _Str_2697(): IGraphicAssetCollection + protected get assetCollection(): IGraphicAssetCollection { return this._assetCollection; } @@ -97,20 +97,20 @@ export class PlaneRasterizer implements IPlaneRasterizer this._assetCollection = null; } - public _Str_3355(): void + public clearCache(): void { for(const plane of this._planes.values()) { if(!plane) continue; - plane._Str_3355(); + plane.clearCache(); } for(const material of this._materials.values()) { if(!material) continue; - material._Str_3355(); + material.clearCache(); } } @@ -201,7 +201,7 @@ export class PlaneRasterizer implements IPlaneRasterizer private _Str_25281(): void { - if(this._data.textures && this._data.textures.length) this._Str_24250(this._data.textures, this._Str_2697); + if(this._data.textures && this._data.textures.length) this._Str_24250(this._data.textures, this.assetCollection); if(this._data.materials && this._data.materials.length) this._Str_22388(this._data.materials); } @@ -548,7 +548,7 @@ export class PlaneRasterizer implements IPlaneRasterizer const layers = visualization.layers; - const planeVisualization = k._Str_20305(size, ((layers && layers.length) || 0), this._Str_17204(size, horizontalAngle, verticalAngle)); + const planeVisualization = k.createPlaneVisualization(size, ((layers && layers.length) || 0), this._Str_17204(size, horizontalAngle, verticalAngle)); if(planeVisualization && (layers && layers.length)) { @@ -598,12 +598,12 @@ export class PlaneRasterizer implements IPlaneRasterizer return k.toString(); } - public _Str_8988(k: string): PlaneVisualizationLayer[] + public getLayers(k: string): PlaneVisualizationLayer[] { let planes = this._Str_3491(k); if(!planes) planes = this._Str_3491(PlaneRasterizer.DEFAULT); - return planes._Str_8988(); + return planes.getLayers(); } } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts index 44caaa5a..23aa9088 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts @@ -75,7 +75,7 @@ export class PlaneVisualization if(this._cachedBitmapNormal) this._cachedBitmapNormal = null; } - public _Str_3355(): void + public clearCache(): void { if(!this._isCached) return; @@ -99,7 +99,7 @@ export class PlaneVisualization const planeLayer = layer as PlaneVisualizationLayer; - planeLayer._Str_3355(); + planeLayer.clearCache(); } } @@ -137,7 +137,7 @@ export class PlaneVisualization return true; } - public _Str_8988(): PlaneVisualizationLayer[] + public getLayers(): PlaneVisualizationLayer[] { return this._layers as PlaneVisualizationLayer[]; } @@ -237,4 +237,4 @@ export class PlaneVisualization return this._cachedBitmapData; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts index ed0d3917..ba7a7a42 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts @@ -48,10 +48,10 @@ export class PlaneVisualizationLayer this._isDisposed = true; this._material = null; - this._Str_3355(); + this.clearCache(); } - public _Str_3355(): void + public clearCache(): void { if(this._bitmapData) { diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts index dd6e13c3..a2bebded 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts @@ -11,7 +11,7 @@ export class WallPlane extends Plane public render(k: Graphics, _arg_2: number, _arg_3: number, size: number, _arg_5: IVector3D, _arg_6: boolean): Graphics { - const visualization = this._Str_6009(size); + const visualization = this.getPlaneVisualization(size); if(!visualization || !visualization.geometry) return null; @@ -27,4 +27,4 @@ export class WallPlane extends Plane return visualization.render(k, _arg_2, _arg_3, _arg_5, _arg_6); } -} \ No newline at end of file +} From c38c2df6bc917f2d403904dd4620dde82efcaac1 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 1 Jun 2021 03:03:36 -0500 Subject: [PATCH 035/155] cleaned PlaneRasterizer --- .../object/visualization/room/RoomPlane.ts | 4 +- .../room/RoomVisualizationData.ts | 8 +-- .../room/mask/PlaneMaskManager.ts | 2 +- .../room/rasterizer/IPlaneRasterizer.ts | 2 +- .../animated/LandscapeRasterizer.ts | 10 +-- .../room/rasterizer/basic/FloorRasterizer.ts | 10 +-- .../room/rasterizer/basic/PlaneRasterizer.ts | 68 +++++++++---------- .../basic/PlaneVisualizationLayer.ts | 2 +- .../room/rasterizer/basic/WallRasterizer.ts | 8 +-- 9 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 62f9b826..8937ef93 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -505,10 +505,10 @@ export class RoomPlane implements IRoomPlane if(layer) { - if(this._hasTexture && layer._Str_8547()) + if(this._hasTexture && layer.getMaterial()) { const normal = geometry.getCoordinatePosition(this._normal); - const cm = layer._Str_8547()._Str_21968(normal); + const cm = layer.getMaterial()._Str_21968(normal); //const data = new PlaneDrawingData(maskData, blend(this._color, layer.getColor()), cm._Str_14945()); const data = new PlaneDrawingData(maskData, this._color, cm._Str_14945()); diff --git a/src/nitro/room/object/visualization/room/RoomVisualizationData.ts b/src/nitro/room/object/visualization/room/RoomVisualizationData.ts index 4639d178..e4bf9cbd 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualizationData.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualizationData.ts @@ -88,10 +88,10 @@ export class RoomVisualizationData extends Disposable implements IObjectVisualiz { if(this._initialized) return; - this._wallRasterizer._Str_6703(collection); - this._floorRasterizer._Str_6703(collection); - this._landscapeRasterizer._Str_6703(collection); - this._maskManager._Str_6703(collection); + this._wallRasterizer.initializeAssetCollection(collection); + this._floorRasterizer.initializeAssetCollection(collection); + this._landscapeRasterizer.initializeAssetCollection(collection); + this._maskManager.initializeAssetCollection(collection); this._initialized = true; } diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts index b16b50d9..63c9329f 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts @@ -45,7 +45,7 @@ export class PlaneMaskManager this._data = k; } - public _Str_6703(k: IGraphicAssetCollection): void + public initializeAssetCollection(k: IGraphicAssetCollection): void { if(!this.data) return; diff --git a/src/nitro/room/object/visualization/room/rasterizer/IPlaneRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/IPlaneRasterizer.ts index 3f72c158..fd3b4cde 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/IPlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/IPlaneRasterizer.ts @@ -9,5 +9,5 @@ export interface IPlaneRasterizer render(_arg_1: Graphics, _arg_2: string, _arg_3: number, _arg_4: number, _arg_5: number, _arg_6: IVector3D, _arg_7: boolean, _arg_8?: number, _arg_9?: number, _arg_10?: number, _arg_11?: number, _arg_12?: number): PlaneBitmapData; getTextureIdentifier(_arg_1: number, _arg_2: IVector3D): string; getLayers(_arg_1: string): PlaneVisualizationLayer[]; - _Str_24005(): void; + reinitialize(): void; } diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts index 2a0cc2c7..9910fdbd 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts @@ -71,7 +71,7 @@ export class LandscapeRasterizer extends PlaneRasterizer const totalAnimatedLayers = ((animatedLayers && animatedLayers.length) || 0); const totalLayers = (totalBasicLayers + totalAnimatedLayers); - const planeVisualization = plane.createPlaneVisualization(size, (totalLayers || 0), this._Str_17204(size, horizontalAngle, verticalAngle)); + const planeVisualization = plane.createPlaneVisualization(size, (totalLayers || 0), this.getGeometry(size, horizontalAngle, verticalAngle)); if(planeVisualization) { @@ -92,7 +92,7 @@ export class LandscapeRasterizer extends PlaneRasterizer let color: number = LandscapePlane._Str_2531; let offset: number = PlaneVisualizationLayer.DEFAULT_OFFSET; - if(layer.materialId) material = this._Str_8547(layer.materialId); + if(layer.materialId) material = this.getMaterial(layer.materialId); if(layer.color) color = layer.color; @@ -162,7 +162,7 @@ export class LandscapeRasterizer extends PlaneRasterizer } } - if(!this._Str_3453(id, plane)) plane.dispose(); + if(!this.addPlane(id, plane)) plane.dispose(); } } @@ -199,9 +199,9 @@ export class LandscapeRasterizer extends PlaneRasterizer public render(canvas: Graphics, id: string, width: number, height: number, scale: number, normal: IVector3D, useTexture: boolean, offsetX: number = 0, offsetY: number = 0, maxX: number = 0, maxY: number = 0, timeSinceStartMs: number = 0): PlaneBitmapData { - let plane = this._Str_3491(id) as LandscapePlane; + let plane = this.getPlane(id) as LandscapePlane; - if(!plane) plane = this._Str_3491(LandscapeRasterizer.DEFAULT) as LandscapePlane; + if(!plane) plane = this.getPlane(LandscapeRasterizer.DEFAULT) as LandscapePlane; if(!plane) return null; diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts index b0731265..d5b30e16 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts @@ -29,17 +29,17 @@ export class FloorRasterizer extends PlaneRasterizer const visualization = floor.visualizations; const plane = new FloorPlane(); - this._Str_9137(plane, visualization); + this.parseVisualizations(plane, visualization); - if(!this._Str_3453(id, plane)) plane.dispose(); + if(!this.addPlane(id, plane)) plane.dispose(); } } public render(canvas: Graphics, id: string, width: number, height: number, scale: number, normal: IVector3D, useTexture: boolean, offsetX: number = 0, offsetY: number = 0, maxX: number = 0, maxY: number = 0, timeSinceStartMs: number = 0): PlaneBitmapData { - let plane = this._Str_3491(id) as FloorPlane; + let plane = this.getPlane(id) as FloorPlane; - if(!plane) plane = this._Str_3491(PlaneRasterizer.DEFAULT) as FloorPlane; + if(!plane) plane = this.getPlane(PlaneRasterizer.DEFAULT) as FloorPlane; if(!plane) return null; @@ -62,4 +62,4 @@ export class FloorRasterizer extends PlaneRasterizer return new PlaneBitmapData(graphic, -1); } -} \ No newline at end of file +} 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 daa6e87e..f6cec42c 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -69,14 +69,14 @@ export class PlaneRasterizer implements IPlaneRasterizer if(this._materials) { - this._Str_21781(); + this.resetMaterials(); this._materials = null; } if(this._textures) { - this._Str_21447(); + this.resetTextures(); this._textures = null; } @@ -119,14 +119,14 @@ export class PlaneRasterizer implements IPlaneRasterizer this._data = data; } - public _Str_24005(): void + public reinitialize(): void { - this._Str_21447(); - this._Str_21781(); - this._Str_22054(); + this.resetTextures(); + this.resetMaterials(); + this.initializeAll(); } - private _Str_21781(): void + private resetMaterials(): void { for(const material of this._materials.values()) { @@ -138,7 +138,7 @@ export class PlaneRasterizer implements IPlaneRasterizer this._materials.clear(); } - private _Str_21447(): void + private resetTextures(): void { for(const texture of this._textures.values()) { @@ -155,17 +155,17 @@ export class PlaneRasterizer implements IPlaneRasterizer return this._textures.get(k); } - protected _Str_8547(k: string): PlaneMaterial + protected getMaterial(k: string): PlaneMaterial { return this._materials.get(k); } - protected _Str_3491(k: string): Plane + protected getPlane(k: string): Plane { return this._planes.get(k); } - protected _Str_3453(k: string, _arg_2: Plane): boolean + protected addPlane(k: string, _arg_2: Plane): boolean { if(!_arg_2) return false; @@ -181,36 +181,36 @@ export class PlaneRasterizer implements IPlaneRasterizer return false; } - public _Str_6703(k: IGraphicAssetCollection): void + public initializeAssetCollection(k: IGraphicAssetCollection): void { if(!this._data) return; this._assetCollection = k; - this._Str_22054(); + this.initializeAll(); } - private _Str_22054(): void + private initializeAll(): void { if(!this._data) return; - this._Str_25281(); + this.initializeTexturesAndMaterials(); this.initializePlanes(); } - private _Str_25281(): void + private initializeTexturesAndMaterials(): void { - if(this._data.textures && this._data.textures.length) this._Str_24250(this._data.textures, this.assetCollection); + if(this._data.textures && this._data.textures.length) this.parseTextures(this._data.textures, this.assetCollection); - if(this._data.materials && this._data.materials.length) this._Str_22388(this._data.materials); + if(this._data.materials && this._data.materials.length) this.parsePlaneMaterials(this._data.materials); } protected initializePlanes(): void { } - private _Str_24250(k: any, _arg_2: IGraphicAssetCollection): void + private parseTextures(k: any, _arg_2: IGraphicAssetCollection): void { if(!k || !_arg_2) return; @@ -271,7 +271,7 @@ export class PlaneRasterizer implements IPlaneRasterizer } } - private _Str_22388(k: any): void + private parsePlaneMaterials(k: any): void { if(!k || !k.length) return; @@ -340,7 +340,7 @@ export class PlaneRasterizer implements IPlaneRasterizer { const column = matrix.columns[index]; - if(column) this._Str_24431(column, cellMatrix, index); + if(column) this.parsePlaneMaterialCellColumn(column, cellMatrix, index); index++; } @@ -352,7 +352,7 @@ export class PlaneRasterizer implements IPlaneRasterizer } } - private _Str_24431(k: { repeatMode: string, width: number }, _arg_2: PlaneMaterialCellMatrix, _arg_3: number): void + private parsePlaneMaterialCellColumn(k: { repeatMode: string, width: number }, _arg_2: PlaneMaterialCellMatrix, _arg_3: number): void { if(!k || !_arg_2) return; @@ -360,7 +360,7 @@ export class PlaneRasterizer implements IPlaneRasterizer const width = k.width; - const cells = this._Str_25217(k); + const cells = this.parsePlaneMaterialCells(k); switch(k.repeatMode) { @@ -387,7 +387,7 @@ export class PlaneRasterizer implements IPlaneRasterizer _arg_2._Str_22372(_arg_3, width, cells, repeatMode); } - private _Str_25217(k: any): PlaneMaterialCell[] + private parsePlaneMaterialCells(k: any): PlaneMaterialCell[] { if(!k || !k.cells || !k.cells.length) return null; @@ -421,8 +421,8 @@ export class PlaneRasterizer implements IPlaneRasterizer const type = types[0]; const offset = offsets[0]; - assetNames = this._Str_25465(type); - offsetPoints = this._Str_24448(offset); + assetNames = this.parseExtraItemTypes(type); + offsetPoints = this.parseExtraItemOffsets(offset); limit = offsetPoints.length; if(extra.limitMax) limit = extra.limitMax; @@ -460,7 +460,7 @@ export class PlaneRasterizer implements IPlaneRasterizer return cells; } - private _Str_25465(k: any): string[] + private parseExtraItemTypes(k: any): string[] { const assetNames: string[] = []; @@ -483,7 +483,7 @@ export class PlaneRasterizer implements IPlaneRasterizer return assetNames; } - private _Str_24448(k: any): Point[] + private parseExtraItemOffsets(k: any): Point[] { const offsets: Point[] = []; @@ -507,7 +507,7 @@ export class PlaneRasterizer implements IPlaneRasterizer return offsets; } - protected _Str_17204(k: number, _arg_2: number, _arg_3: number): IRoomGeometry + protected getGeometry(k: number, _arg_2: number, _arg_3: number): IRoomGeometry { _arg_2 = Math.abs(_arg_2); if(_arg_2 > 90) _arg_2 = 90; @@ -528,7 +528,7 @@ export class PlaneRasterizer implements IPlaneRasterizer return geometry; } - protected _Str_9137(k: Plane, _arg_2: any): void + protected parseVisualizations(k: Plane, _arg_2: any): void { if(!k || !_arg_2) return; @@ -548,7 +548,7 @@ export class PlaneRasterizer implements IPlaneRasterizer const layers = visualization.layers; - const planeVisualization = k.createPlaneVisualization(size, ((layers && layers.length) || 0), this._Str_17204(size, horizontalAngle, verticalAngle)); + const planeVisualization = k.createPlaneVisualization(size, ((layers && layers.length) || 0), this.getGeometry(size, horizontalAngle, verticalAngle)); if(planeVisualization && (layers && layers.length)) { @@ -565,7 +565,7 @@ export class PlaneRasterizer implements IPlaneRasterizer let color: number = FloorPlane._Str_2531; let offset: number = PlaneVisualizationLayer.DEFAULT_OFFSET; - if(layer.materialId) material = this._Str_8547(layer.materialId); + if(layer.materialId) material = this.getMaterial(layer.materialId); if(layer.color) color = layer.color; @@ -600,9 +600,9 @@ export class PlaneRasterizer implements IPlaneRasterizer public getLayers(k: string): PlaneVisualizationLayer[] { - let planes = this._Str_3491(k); + let planes = this.getPlane(k); - if(!planes) planes = this._Str_3491(PlaneRasterizer.DEFAULT); + if(!planes) planes = this.getPlane(PlaneRasterizer.DEFAULT); return planes.getLayers(); } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts index ba7a7a42..3b284b3a 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts @@ -135,7 +135,7 @@ export class PlaneVisualizationLayer return bitmapData; } - public _Str_8547(): PlaneMaterial + public getMaterial(): PlaneMaterial { return this._material; } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts index 38c0e5a5..4cea3fdf 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts @@ -29,17 +29,17 @@ export class WallRasterizer extends PlaneRasterizer const visualization = wall.visualizations; const plane = new WallPlane(); - this._Str_9137(plane, visualization); + this.parseVisualizations(plane, visualization); - if(!this._Str_3453(id, plane)) plane.dispose(); + if(!this.addPlane(id, plane)) plane.dispose(); } } public render(canvas: Graphics, id: string, width: number, height: number, scale: number, normal: IVector3D, useTexture: boolean, offsetX: number = 0, offsetY: number = 0, maxX: number = 0, maxY: number = 0, timeSinceStartMs: number = 0): PlaneBitmapData { - let plane = this._Str_3491(id) as WallPlane; + let plane = this.getPlane(id) as WallPlane; - if(!plane) plane = this._Str_3491(PlaneRasterizer.DEFAULT) as WallPlane; + if(!plane) plane = this.getPlane(PlaneRasterizer.DEFAULT) as WallPlane; if(!plane) return null; From 145f51e4071fcfb54b2da9c3f5b9732e9b5d3a57 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 1 Jun 2021 03:24:29 -0500 Subject: [PATCH 036/155] cleaned roomLogic --- src/nitro/room/object/logic/room/RoomLogic.ts | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/nitro/room/object/logic/room/RoomLogic.ts b/src/nitro/room/object/logic/room/RoomLogic.ts index 0add56a8..f8082915 100644 --- a/src/nitro/room/object/logic/room/RoomLogic.ts +++ b/src/nitro/room/object/logic/room/RoomLogic.ts @@ -30,13 +30,13 @@ export class RoomLogic extends RoomObjectLogicBase private _planeParser: RoomPlaneParser; private _planeBitmapMaskParser: RoomPlaneBitmapMaskParser; private _color: number; - private _Str_3576: number; - private _Str_14932: number; - private _Str_17003: number; - private _Str_11287: number; - private _Str_16460: number; - private _Str_9785: number; - private _Str_17191: number; + private _light: number; + private _originalColor: number; + private _originalLight: number; + private _targetColor: number; + private _targetLight: number; + private _colorChangedTime: number; + private _colorTransitionLength: number; private _lastHoleUpdate: number; private _needsMapUpdate: boolean; @@ -47,13 +47,13 @@ export class RoomLogic extends RoomObjectLogicBase this._planeParser = new RoomPlaneParser(); this._planeBitmapMaskParser = new RoomPlaneBitmapMaskParser(); this._color = 0xFFFFFF; - this._Str_3576 = 0xFF; - this._Str_14932 = 0xFFFFFF; - this._Str_17003 = 0xFF; - this._Str_11287 = 0xFFFFFF; - this._Str_16460 = 0xFF; - this._Str_9785 = 0; - this._Str_17191 = 1500; + this._light = 0xFF; + this._originalColor = 0xFFFFFF; + this._originalLight = 0xFF; + this._targetColor = 0xFFFFFF; + this._targetLight = 0xFF; + this._colorChangedTime = 0; + this._colorTransitionLength = 1500; this._lastHoleUpdate = 0; this._needsMapUpdate = false; } @@ -103,7 +103,7 @@ export class RoomLogic extends RoomObjectLogicBase { super.update(time); - this._Str_24703(time); + this.updateBackgroundColor(time); if(this._needsMapUpdate) { @@ -127,40 +127,40 @@ export class RoomLogic extends RoomObjectLogicBase } - private _Str_24703(k: number): void + private updateBackgroundColor(k: number): void { - if(!this.object || !this._Str_9785) return; + if(!this.object || !this._colorChangedTime) return; let color = this._color; - let newColor = this._Str_3576; + let newColor = this._light; - if((k - this._Str_9785) >= this._Str_17191) + if((k - this._colorChangedTime) >= this._colorTransitionLength) { - color = this._Str_11287; - newColor = this._Str_16460; + color = this._targetColor; + newColor = this._targetLight; - this._Str_9785 = 0; + this._colorChangedTime = 0; } else { - let _local_7 = ((this._Str_14932 >> 16) & 0xFF); - let _local_8 = ((this._Str_14932 >> 8) & 0xFF); - let _local_9 = (this._Str_14932 & 0xFF); + let _local_7 = ((this._originalColor >> 16) & 0xFF); + let _local_8 = ((this._originalColor >> 8) & 0xFF); + let _local_9 = (this._originalColor & 0xFF); - const _local_10 = ((this._Str_11287 >> 16) & 0xFF); - const _local_11 = ((this._Str_11287 >> 8) & 0xFF); - const _local_12 = (this._Str_11287 & 0xFF); - const _local_13 = ((k - this._Str_9785) / this._Str_17191); + const _local_10 = ((this._targetColor >> 16) & 0xFF); + const _local_11 = ((this._targetColor >> 8) & 0xFF); + const _local_12 = (this._targetColor & 0xFF); + const _local_13 = ((k - this._colorChangedTime) / this._colorTransitionLength); _local_7 = (_local_7 + ((_local_10 - _local_7) * _local_13)); _local_8 = (_local_8 + ((_local_11 - _local_8) * _local_13)); _local_9 = (_local_9 + ((_local_12 - _local_9) * _local_13)); color = (((_local_7 << 16) + (_local_8 << 8)) + _local_9); - newColor = (this._Str_17003 + ((this._Str_16460 - this._Str_17003) * _local_13)); + newColor = (this._originalLight + ((this._targetLight - this._originalLight) * _local_13)); this._color = color; - this._Str_3576 = newColor; + this._light = newColor; } let _local_5 = ColorConverter.rgbToHSL(color); @@ -320,12 +320,12 @@ export class RoomLogic extends RoomObjectLogicBase { if(!message || !model) return; - this._Str_14932 = this._color; - this._Str_17003 = this._Str_3576; - this._Str_11287 = message.color; - this._Str_16460 = message.light; - this._Str_9785 = this.time; - this._Str_17191 = 1500; + this._originalColor = this._color; + this._originalLight = this._light; + this._targetColor = message.color; + this._targetLight = message.light; + this._colorChangedTime = this.time; + this._colorTransitionLength = 1500; model.setValue(RoomObjectVariable.ROOM_COLORIZE_BG_ONLY, message.backgroundOnly); } From f561b91e2fc17120d75b37bdc93f9fb6966186d0 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 5 Jun 2021 23:48:44 -0400 Subject: [PATCH 037/155] Update packets --- src/nitro/communication/NitroMessages.ts | 3 +- .../messages/incoming/IncomingHeader.ts | 1 + .../incoming/room/engine/ObjectData.ts | 30 ++++++++++++++ .../room/engine/ObjectsDataUpdateEvent.ts | 16 ++++++++ .../messages/incoming/room/engine/index.ts | 2 + .../room/engine/ObjectsDataUpdateParser.ts | 41 +++++++++++++++++++ .../room/engine/ObjectsRollingParser.ts | 4 +- .../parser/room/engine/RoomCreatedParser.ts | 4 +- .../messages/parser/room/engine/index.ts | 1 + .../subscription/UserSubscriptionParser.ts | 23 ++++++----- src/nitro/room/RoomMessageHandler.ts | 16 ++++++++ 11 files changed, 125 insertions(+), 16 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/room/engine/ObjectData.ts create mode 100644 src/nitro/communication/messages/incoming/room/engine/ObjectsDataUpdateEvent.ts create mode 100644 src/nitro/communication/messages/parser/room/engine/ObjectsDataUpdateParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 54ad2d5e..0d71f390 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, SellablePetPalettesEvent } from './messages'; +import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, ObjectsDataUpdateEvent, SellablePetPalettesEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { ChangeNameUpdateEvent } from './messages/incoming/avatar/ChangeNameUpdateEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; @@ -593,6 +593,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.LOVELOCK_FURNI_FINISHED, LoveLockFurniFinishedEvent); this._events.set(IncomingHeader.LOVELOCK_FURNI_FRIEND_COMFIRMED, LoveLockFurniFriendConfirmedEvent); this._events.set(IncomingHeader.LOVELOCK_FURNI_START, LoveLockFurniStartEvent); + this._events.set(IncomingHeader.OBJECTS_DATA_UPDATE, ObjectsDataUpdateEvent); // FLOOR this._events.set(IncomingHeader.FURNITURE_FLOOR_ADD, FurnitureFloorAddEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 35522812..fac838bb 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -247,4 +247,5 @@ export class IncomingHeader public static MARKETPLACE_AFTER_ORDER_STATUS = 2032; public static CATALOG_RECEIVE_PET_BREEDS = 3331; public static CATALOG_APPROVE_NAME_RESULT = 1503; + public static OBJECTS_DATA_UPDATE = 1453; } diff --git a/src/nitro/communication/messages/incoming/room/engine/ObjectData.ts b/src/nitro/communication/messages/incoming/room/engine/ObjectData.ts new file mode 100644 index 00000000..64a6fe46 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/engine/ObjectData.ts @@ -0,0 +1,30 @@ +import { IObjectData } from '../../../../../room'; + +export class ObjectData +{ + private _id: number = 0; + private _state: number = 0; + private _data: IObjectData; + + constructor(id: number, state: number, objectData: IObjectData) + { + this._id = id; + this._state = state; + this._data = objectData; + } + + public get id(): number + { + return this._id; + } + + public get state(): number + { + return this._state; + } + + public get data(): IObjectData + { + return this._data; + } +} diff --git a/src/nitro/communication/messages/incoming/room/engine/ObjectsDataUpdateEvent.ts b/src/nitro/communication/messages/incoming/room/engine/ObjectsDataUpdateEvent.ts new file mode 100644 index 00000000..2a6035a2 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/engine/ObjectsDataUpdateEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { ObjectsDataUpdateParser } from '../../../parser/room/engine/ObjectsDataUpdateParser'; + +export class ObjectsDataUpdateEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ObjectsDataUpdateParser); + } + + public getParser(): ObjectsDataUpdateParser + { + return this.parser as ObjectsDataUpdateParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/engine/index.ts b/src/nitro/communication/messages/incoming/room/engine/index.ts index efa236d4..efc44418 100644 --- a/src/nitro/communication/messages/incoming/room/engine/index.ts +++ b/src/nitro/communication/messages/incoming/room/engine/index.ts @@ -1,2 +1,4 @@ +export * from './ObjectData'; +export * from './ObjectsDataUpdateEvent'; export * from './ObjectsRollingEvent'; export * from './RoomCreatedEvent'; diff --git a/src/nitro/communication/messages/parser/room/engine/ObjectsDataUpdateParser.ts b/src/nitro/communication/messages/parser/room/engine/ObjectsDataUpdateParser.ts new file mode 100644 index 00000000..2fc9ce0c --- /dev/null +++ b/src/nitro/communication/messages/parser/room/engine/ObjectsDataUpdateParser.ts @@ -0,0 +1,41 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; +import { ObjectData } from '../../../incoming/room/engine/ObjectData'; +import { FurnitureDataParser } from '../furniture/FurnitureDataParser'; + +export class ObjectsDataUpdateParser implements IMessageParser +{ + private _objects: ObjectData[]; + + public flush(): boolean + { + this._objects = []; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + let totalObjects = wrapper.readInt(); + + while(totalObjects > 0) + { + const id = wrapper.readInt(); + const stuffData = FurnitureDataParser.parseObjectData(wrapper); + const state = parseFloat(stuffData.getLegacyString()); + + this._objects.push(new ObjectData(id, state, stuffData)); + + totalObjects--; + } + + return true; + } + + public get objects(): ObjectData[] + { + return this._objects; + } +} diff --git a/src/nitro/communication/messages/parser/room/engine/ObjectsRollingParser.ts b/src/nitro/communication/messages/parser/room/engine/ObjectsRollingParser.ts index 4e971c31..925b4f95 100644 --- a/src/nitro/communication/messages/parser/room/engine/ObjectsRollingParser.ts +++ b/src/nitro/communication/messages/parser/room/engine/ObjectsRollingParser.ts @@ -21,7 +21,7 @@ export class ObjectsRollingParser implements IMessageParser public parse(wrapper: IMessageDataWrapper): boolean { - if(!wrapper) return; + if(!wrapper) return false; const x = wrapper.readInt(); const y = wrapper.readInt(); @@ -79,4 +79,4 @@ export class ObjectsRollingParser implements IMessageParser { return this._unitRolling; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/room/engine/RoomCreatedParser.ts b/src/nitro/communication/messages/parser/room/engine/RoomCreatedParser.ts index 4e14ece8..7b524d74 100644 --- a/src/nitro/communication/messages/parser/room/engine/RoomCreatedParser.ts +++ b/src/nitro/communication/messages/parser/room/engine/RoomCreatedParser.ts @@ -16,7 +16,7 @@ export class RoomCreatedParser implements IMessageParser public parse(wrapper: IMessageDataWrapper): boolean { - if(!wrapper) return; + if(!wrapper) return false; this._roomId = wrapper.readInt(); this._roomName = wrapper.readString(); @@ -33,4 +33,4 @@ export class RoomCreatedParser implements IMessageParser { return this._roomName; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/room/engine/index.ts b/src/nitro/communication/messages/parser/room/engine/index.ts index faa96179..775700d3 100644 --- a/src/nitro/communication/messages/parser/room/engine/index.ts +++ b/src/nitro/communication/messages/parser/room/engine/index.ts @@ -1,2 +1,3 @@ +export * from './ObjectsDataUpdateParser'; export * from './ObjectsRollingParser'; export * from './RoomCreatedParser'; diff --git a/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts b/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts index 9d9cdcf2..f47ab7af 100644 --- a/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts +++ b/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts @@ -18,16 +18,16 @@ export class UserSubscriptionParser implements IMessageParser public flush(): boolean { - this._name = null; - this._days = 0; - this._int1 = 0; - this._months = 0; - this._years = 0; - this._hasEverBeenMember = false; - this._isVip = false; - this._pastClubDays = 0; - this._pastVIPDays = 0; - this._totalSeconds = 0; + this._name = null; + this._days = 0; + this._int1 = 0; + this._months = 0; + this._years = 0; + this._hasEverBeenMember = false; + this._isVip = false; + this._pastClubDays = 0; + this._pastVIPDays = 0; + this._totalSeconds = 0; return true; } @@ -45,7 +45,8 @@ export class UserSubscriptionParser implements IMessageParser this._isVip = wrapper.readBoolean(); this._pastClubDays = wrapper.readInt(); this._pastVIPDays = wrapper.readInt(); - this._totalSeconds = wrapper.readInt(); + + if(wrapper.bytesAvailable) this._totalSeconds = wrapper.readInt(); return true; } diff --git a/src/nitro/room/RoomMessageHandler.ts b/src/nitro/room/RoomMessageHandler.ts index f04469aa..8cc609dd 100644 --- a/src/nitro/room/RoomMessageHandler.ts +++ b/src/nitro/room/RoomMessageHandler.ts @@ -3,6 +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 { 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'; @@ -113,6 +114,7 @@ export class RoomMessageHandler extends Disposable this._connection.addMessageEvent(new RoomThicknessEvent(this.onRoomThicknessEvent.bind(this))); this._connection.addMessageEvent(new RoomDoorEvent(this.onRoomDoorEvent.bind(this))); this._connection.addMessageEvent(new ObjectsRollingEvent(this.onRoomRollingEvent.bind(this))); + this._connection.addMessageEvent(new ObjectsDataUpdateEvent(this.onObjectsDataUpdateEvent.bind(this))); this._connection.addMessageEvent(new FurnitureAliasesEvent(this.onFurnitureAliasesEvent.bind(this))); this._connection.addMessageEvent(new FurnitureFloorAddEvent(this.onFurnitureFloorAddEvent.bind(this))); this._connection.addMessageEvent(new FurnitureFloorEvent(this.onFurnitureFloorEvent.bind(this))); @@ -459,6 +461,20 @@ export class RoomMessageHandler extends Disposable } } + private onObjectsDataUpdateEvent(event: ObjectsDataUpdateEvent): void + { + if(!(event instanceof ObjectsDataUpdateEvent) || !event.connection || !this._roomCreator) return; + + const parser = event.getParser(); + + if(!parser) return; + + for(const object of parser.objects) + { + this._roomCreator.updateRoomObjectFloor(this._currentRoomId, object.id, null, null, object.state, object.data); + } + } + private onFurnitureAliasesEvent(event: FurnitureAliasesEvent): void { if(!(event instanceof FurnitureAliasesEvent) || !event.connection || !this._roomCreator) return; From 56ef76361bf15130a6a14148e9b5cb2f7adbe4e6 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 5 Jun 2021 23:48:53 -0400 Subject: [PATCH 038/155] Update localization --- .../localization/NitroLocalizationManager.ts | 43 ++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/nitro/localization/NitroLocalizationManager.ts b/src/nitro/localization/NitroLocalizationManager.ts index 848d8db1..5af66058 100644 --- a/src/nitro/localization/NitroLocalizationManager.ts +++ b/src/nitro/localization/NitroLocalizationManager.ts @@ -153,7 +153,48 @@ export class NitroLocalizationManager extends NitroManager implements INitroLoca { for(let i = 0; i < parameters.length; i++) { - value = value.replace('%' + parameters[i] + '%', replacements[i]); + const parameter = parameters[i]; + const replacement = replacements[i]; + + value = value.replace('%' + parameter + '%', replacement); + + if(value.startsWith('%{')) + { + const regex = new RegExp('%{' + parameter.toUpperCase() + '\\|([^|]*)\\|([^|]*)\\|([^|]*)}'); + const result = value.match(regex); + + if(!result) continue; + + const replacementAsNumber = parseInt(replacement); + + let indexKey = -1; + let replace = false; + + switch(replacementAsNumber) + { + case 0: + indexKey = 1; + break; + case 1: + indexKey = 2; + break; + case 2: + default: + indexKey = 3; + replace = true; + break; + } + + + if((indexKey === -1) || (typeof result[indexKey] === 'undefined')) continue; + + const valueFromResults = result[indexKey]; + + if(valueFromResults) + { + value = valueFromResults.replace('%%', replacement); + } + } } } From 26136d6d29181e3b0900b8fbbbe5f15f487d0862 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 6 Jun 2021 19:03:05 -0500 Subject: [PATCH 039/155] cleaned RoomSpriteCanvas --- src/nitro/room/RoomEngine.ts | 6 +-- src/nitro/room/utils/SpriteDataCollector.ts | 2 +- src/room/renderer/IRoomRenderingCanvas.ts | 10 ++-- src/room/renderer/RoomSpriteCanvas.ts | 54 ++++++++++----------- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 9b27a9bd..5d4ad70f 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2456,7 +2456,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!this._Str_25871(canvas, x, y, type, altKey, ctrlKey, shiftKey)) { - if(!canvas._Str_21232(x, y, type, altKey, ctrlKey, shiftKey, buttonDown)) + if(!canvas.handleMouseEvent(x, y, type, altKey, ctrlKey, shiftKey, buttonDown)) { let eventType: string = null; @@ -3411,7 +3411,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(_arg_5) { - canvas._Str_20787(); + canvas.skipSpriteVisibilityChecking(); } let _local_8 = -1; @@ -3426,7 +3426,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato const _local_11 = _local_9._Str_24177(this); const _local_12 = _local_9._Str_22985(k, canvas, this, _arg_2); - if(_arg_5) canvas._Str_22174(); + if(_arg_5) canvas.resumeSpriteVisibilityChecking(); if(_arg_3) { diff --git a/src/nitro/room/utils/SpriteDataCollector.ts b/src/nitro/room/utils/SpriteDataCollector.ts index f20de016..39a56000 100644 --- a/src/nitro/room/utils/SpriteDataCollector.ts +++ b/src/nitro/room/utils/SpriteDataCollector.ts @@ -350,7 +350,7 @@ export class SpriteDataCollector _local_4.set(_local_6.uniqueId, _local_10); } - const sprites = _arg_2._Str_14588(); + const sprites = _arg_2.getPlaneSortableSprites(); sprites.sort((a, b) => { diff --git a/src/room/renderer/IRoomRenderingCanvas.ts b/src/room/renderer/IRoomRenderingCanvas.ts index fbc5a729..cef930d4 100644 --- a/src/room/renderer/IRoomRenderingCanvas.ts +++ b/src/room/renderer/IRoomRenderingCanvas.ts @@ -13,10 +13,10 @@ export interface IRoomRenderingCanvas render(time: number, update?: boolean): void; update(): void; setMouseListener(listener: IRoomCanvasMouseListener): void; - _Str_20787(): void; - _Str_22174(): void; - _Str_14588(): SortableSprite[]; - _Str_21232(k: number, _arg_2: number, _arg_3: string, _arg_4: boolean, _arg_5: boolean, _arg_6: boolean, _arg_7: boolean): boolean; + skipSpriteVisibilityChecking(): void; + resumeSpriteVisibilityChecking(): void; + getPlaneSortableSprites(): SortableSprite[]; + handleMouseEvent(k: number, _arg_2: number, _arg_3: string, _arg_4: boolean, _arg_5: boolean, _arg_6: boolean, _arg_7: boolean): boolean; getSortableSpriteList(): RoomObjectSpriteData[]; getDisplayAsTexture(): RenderTexture; id: number; @@ -30,4 +30,4 @@ export interface IRoomRenderingCanvas height: number; restrictsScaling: boolean; canvasUpdated: boolean; -} \ No newline at end of file +} diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index beff1f6e..09d54d65 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -137,7 +137,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas public dispose(): void { - this._Str_20677(0, true); + this.cleanSprites(0, true); if(this._geometry) { @@ -185,7 +185,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas { for(const sprite of this._spritePool) { - this._Str_21974(sprite, true); + this.cleanSprite(sprite, true); } this._spritePool = []; @@ -379,7 +379,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas iterator++; } - this._Str_20677(spriteCount); + this.cleanSprites(spriteCount); if(update) this._canvasUpdated = true; @@ -388,14 +388,14 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas this._renderedHeight = this._height; } - public _Str_20787(): void + public skipSpriteVisibilityChecking(): void { this._noSpriteVisibilityChecking = true; this.render(-1, true); } - public _Str_22174(): void + public resumeSpriteVisibilityChecking(): void { this._noSpriteVisibilityChecking = false; } @@ -405,7 +405,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas return this._objectCache.getSortableSpriteList(); } - public _Str_14588(): SortableSprite[] + public getPlaneSortableSprites(): SortableSprite[] { return this._objectCache.getPlaneSortableSprites(); } @@ -628,7 +628,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if(extendedSprite.scale.y !== 1) extendedSprite.scale.y = 1; } - this._Str_21914(extendedSprite, objectSprite); + this.updateEnterRoomEffect(extendedSprite, objectSprite); } if(extendedSprite.x !== sprite.x) extendedSprite.x = sprite.x; @@ -681,7 +681,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if(sprite.flipV) extendedSprite.scale.y = -1; - this._Str_21914(extendedSprite, sprite); + this.updateEnterRoomEffect(extendedSprite, sprite); if((index < 0) || (index >= this._spriteCount)) { @@ -697,7 +697,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas this._activeSpriteCount++; } - private _Str_20677(spriteCount: number, _arg_2: boolean = false): void + private cleanSprites(spriteCount: number, _arg_2: boolean = false): void { if(!this._display) return; @@ -709,7 +709,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas while(iterator >= spriteCount) { - this._Str_21974(this.getExtendedSprite(iterator), _arg_2); + this.cleanSprite(this.getExtendedSprite(iterator), _arg_2); iterator--; } @@ -718,7 +718,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas this._activeSpriteCount = spriteCount; } - private _Str_21914(sprite: ExtendedSprite, _arg_2: IRoomObjectSprite): void + private updateEnterRoomEffect(sprite: ExtendedSprite, _arg_2: IRoomObjectSprite): void { if(!RoomEnterEffect.isVisualizationOn() || !_arg_2) return; @@ -737,7 +737,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas } } - private _Str_21974(sprite: ExtendedSprite, _arg_2: boolean): void + private cleanSprite(sprite: ExtendedSprite, _arg_2: boolean): void { if(!sprite) return; @@ -759,7 +759,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas { if(!this._mouseCheckCount) { - //this._Str_19207(this._mouseLocation.x, this._mouseLocation.y, MouseEventType.MOUSE_MOVE); + //this.checkMouseHits(this._mouseLocation.x, this._mouseLocation.y, MouseEventType.MOUSE_MOVE); } this._mouseCheckCount = 0; @@ -794,7 +794,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas return false; } - public _Str_21232(x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): boolean + public handleMouseEvent(x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): boolean { x = (x - this._screenOffsetX); y = (y - this._screenOffsetY); @@ -804,14 +804,14 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if((this._mouseCheckCount > 0) && (type == MouseEventType.MOUSE_MOVE)) return this._mouseSpriteWasHit; - this._mouseSpriteWasHit = this._Str_19207(Math.trunc(x / this._scale), Math.trunc(y / this._scale), type, altKey, ctrlKey, shiftKey, buttonDown); + this._mouseSpriteWasHit = this.checkMouseHits(Math.trunc(x / this._scale), Math.trunc(y / this._scale), type, altKey, ctrlKey, shiftKey, buttonDown); this._mouseCheckCount++; return this._mouseSpriteWasHit; } - private _Str_19207(x: number, y: number, type: string, altKey: boolean = false, ctrlKey: boolean = false, shiftKey: boolean = false, buttonDown: boolean = false): boolean + private checkMouseHits(x: number, y: number, type: string, altKey: boolean = false, ctrlKey: boolean = false, shiftKey: boolean = false, buttonDown: boolean = false): boolean { const checkedSprites: string[] = []; @@ -843,19 +843,19 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas { if(mouseData.spriteTag !== tag) { - mouseEvent = this._Str_11609(0, 0, 0, 0, MouseEventType.ROLL_OUT, mouseData.spriteTag, altKey, ctrlKey, shiftKey, buttonDown); + mouseEvent = this.createMouseEvent(0, 0, 0, 0, MouseEventType.ROLL_OUT, mouseData.spriteTag, altKey, ctrlKey, shiftKey, buttonDown); - this._Str_14715(mouseEvent, identifier); + this.bufferMouseEvent(mouseEvent, identifier); } } if((type === MouseEventType.MOUSE_MOVE) && (!mouseData || (mouseData.spriteTag !== tag))) { - mouseEvent = this._Str_11609(x, y, (x - extendedSprite.x), (y - extendedSprite.y), MouseEventType.ROLL_OVER, tag, altKey, ctrlKey, shiftKey, buttonDown); + mouseEvent = this.createMouseEvent(x, y, (x - extendedSprite.x), (y - extendedSprite.y), MouseEventType.ROLL_OVER, tag, altKey, ctrlKey, shiftKey, buttonDown); } else { - mouseEvent = this._Str_11609(x, y, (x - extendedSprite.x), (y - extendedSprite.y), type, tag, altKey, ctrlKey, shiftKey, buttonDown); + mouseEvent = this.createMouseEvent(x, y, (x - extendedSprite.x), (y - extendedSprite.y), type, tag, altKey, ctrlKey, shiftKey, buttonDown); mouseEvent.spriteOffsetX = extendedSprite.offsetX; mouseEvent.spriteOffsetY = extendedSprite.offsetY; @@ -873,7 +873,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if(((type !== MouseEventType.MOUSE_MOVE) || (x !== this._mouseOldX)) || (y !== this._mouseOldY)) { - this._Str_14715(mouseEvent, identifier); + this.bufferMouseEvent(mouseEvent, identifier); } checkedSprites.push(identifier); @@ -913,22 +913,22 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if(existing) this._mouseActiveObjects.delete(key); - const mouseEvent = this._Str_11609(0, 0, 0, 0, MouseEventType.ROLL_OUT, existing.spriteTag, altKey, ctrlKey, shiftKey, buttonDown); + const mouseEvent = this.createMouseEvent(0, 0, 0, 0, MouseEventType.ROLL_OUT, existing.spriteTag, altKey, ctrlKey, shiftKey, buttonDown); - this._Str_14715(mouseEvent, key); + this.bufferMouseEvent(mouseEvent, key); } index++; } - this._Str_20604(); + this.processMouseEvents(); this._mouseOldX = x; this._mouseOldY = y; return didHitSprite; } - protected _Str_11609(x: number, y: number, _arg_3: number, _arg_4: number, type: string, _arg_6: string, _arg_7: boolean, _arg_8: boolean, _arg_9: boolean, _arg_10: boolean): RoomSpriteMouseEvent + protected createMouseEvent(x: number, y: number, _arg_3: number, _arg_4: number, type: string, _arg_6: string, _arg_7: boolean, _arg_8: boolean, _arg_9: boolean, _arg_10: boolean): RoomSpriteMouseEvent { const screenX: number = (x - (this._width / 2)); const screenY: number = (y - (this._height / 2)); @@ -937,7 +937,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas return new RoomSpriteMouseEvent(type, ((canvasName + '_') + this._eventId), canvasName, _arg_6, screenX, screenY, _arg_3, _arg_4, _arg_8, _arg_7, _arg_9, _arg_10); } - protected _Str_14715(k: RoomSpriteMouseEvent, _arg_2: string): void + protected bufferMouseEvent(k: RoomSpriteMouseEvent, _arg_2: string): void { if(!k || !this._eventCache) return; @@ -945,7 +945,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas this._eventCache.set(_arg_2, k); } - protected _Str_20604(): void + protected processMouseEvents(): void { if(!this._container || !this._eventCache) return; From 10e6e8ed7cc7d2589fa57361582a0a6d1b0c6a56 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 6 Jun 2021 20:10:57 -0500 Subject: [PATCH 040/155] cleaned ModeratorUserInfoData --- .../animation/AvatarAnimationLayerData.ts | 6 +- .../avatar/animation/IAnimationLayerData.ts | 4 +- src/nitro/avatar/cache/AvatarImageCache.ts | 2 +- src/nitro/avatar/enum/AvatarFigurePartType.ts | 4 +- .../parser/modtool/ModtoolUserInfoParser.ts | 10 +- .../modtool/utils/ModeratorUserInfoData.ts | 145 ++++++++++++++++++ .../parser/modtool/utils/_Str_5467.ts | 145 ------------------ .../messages/parser/modtool/utils/index.ts | 2 +- src/nitro/room/RoomEngine.ts | 4 +- .../avatar/AvatarVisualization.ts | 2 +- src/nitro/utils/FixedSizeStack.ts | 8 +- 11 files changed, 165 insertions(+), 167 deletions(-) create mode 100644 src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts delete mode 100644 src/nitro/communication/messages/parser/modtool/utils/_Str_5467.ts diff --git a/src/nitro/avatar/animation/AvatarAnimationLayerData.ts b/src/nitro/avatar/animation/AvatarAnimationLayerData.ts index 33e70f02..7bbaf972 100644 --- a/src/nitro/avatar/animation/AvatarAnimationLayerData.ts +++ b/src/nitro/avatar/animation/AvatarAnimationLayerData.ts @@ -36,7 +36,7 @@ export class AvatarAnimationLayerData implements IAnimationLayerData let _local_5 = ''; - if(this._base !== '') _local_5 = this._Str_2108().toString(); + if(this._base !== '') _local_5 = this.baseAsInt().toString(); if(_arg_3) { @@ -50,7 +50,7 @@ export class AvatarAnimationLayerData implements IAnimationLayerData return this._items; } - private _Str_2108(): number + private baseAsInt(): number { let k = 0; let index = 0; @@ -70,7 +70,7 @@ export class AvatarAnimationLayerData implements IAnimationLayerData return this._id; } - public get _Str_891(): number + public get animationFrame(): number { return this._animationFrame; } diff --git a/src/nitro/avatar/animation/IAnimationLayerData.ts b/src/nitro/avatar/animation/IAnimationLayerData.ts index 4c5b8449..673e7ad7 100644 --- a/src/nitro/avatar/animation/IAnimationLayerData.ts +++ b/src/nitro/avatar/animation/IAnimationLayerData.ts @@ -4,9 +4,9 @@ export interface IAnimationLayerData { id: string; action: IActiveActionData; - _Str_891: number; + animationFrame: number; dx: number; dy: number; dz: number; dd: number; -} \ No newline at end of file +} diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index c8086b08..fc075fb5 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -225,7 +225,7 @@ export class AvatarImageCache _local_11.y = (_local_18.dy / 2); } - frameCount = _local_18._Str_891; + frameCount = _local_18.animationFrame; if(_local_18.action) { diff --git a/src/nitro/avatar/enum/AvatarFigurePartType.ts b/src/nitro/avatar/enum/AvatarFigurePartType.ts index 9ac466ed..23ecb286 100644 --- a/src/nitro/avatar/enum/AvatarFigurePartType.ts +++ b/src/nitro/avatar/enum/AvatarFigurePartType.ts @@ -25,5 +25,5 @@ public static RIGHT_HAND_ITEM: string = 'ri'; public static LEFT_COAT_SLEEVE: string = 'lc'; public static RIGHT_COAT_SLEEVE: string = 'rc'; - public static _Str_1286: string[] = [ AvatarFigurePartType.SHOES, AvatarFigurePartType.LEGS, AvatarFigurePartType.CHEST, AvatarFigurePartType.WAIST_ACCESSORY, AvatarFigurePartType.CHEST_ACCESSORY, AvatarFigurePartType.HEAD, AvatarFigurePartType.HAIR, AvatarFigurePartType.FACE_ACCESSORY, AvatarFigurePartType.EYE_ACCESSORY, AvatarFigurePartType.HEAD_ACCESSORY, AvatarFigurePartType.HEAD_ACCESSORY_EXTRA, AvatarFigurePartType.COAT_CHEST, AvatarFigurePartType.CHEST_PRINT ]; -} \ No newline at end of file + public static FIGURE_SETS: string[] = [ AvatarFigurePartType.SHOES, AvatarFigurePartType.LEGS, AvatarFigurePartType.CHEST, AvatarFigurePartType.WAIST_ACCESSORY, AvatarFigurePartType.CHEST_ACCESSORY, AvatarFigurePartType.HEAD, AvatarFigurePartType.HAIR, AvatarFigurePartType.FACE_ACCESSORY, AvatarFigurePartType.EYE_ACCESSORY, AvatarFigurePartType.HEAD_ACCESSORY, AvatarFigurePartType.HEAD_ACCESSORY_EXTRA, AvatarFigurePartType.COAT_CHEST, AvatarFigurePartType.CHEST_PRINT ]; +} diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts b/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts index b0ec5ddd..265c6c30 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts @@ -1,12 +1,10 @@ +import { ModeratorUserInfoData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData'; import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; -import { ModtoolUserChatlogParserVisit } from './utils/ModtoolUserChatlogParserVisit'; -import { ModtoolUserChatlogParserChatlog } from './utils/ModtoolUserChatlogParserChatlog'; -import { _Str_5467 } from './utils/_Str_5467'; export class ModtoolUserInfoParser implements IMessageParser { - private _data: _Str_5467; + private _data: ModeratorUserInfoData; public flush(): boolean { @@ -19,12 +17,12 @@ export class ModtoolUserInfoParser implements IMessageParser { if(!wrapper) return false; - this._data = new _Str_5467(wrapper); + this._data = new ModeratorUserInfoData(wrapper); return true; } - public get data(): _Str_5467 + public get data(): ModeratorUserInfoData { return this._data; } diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts b/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts new file mode 100644 index 00000000..2c96f7c1 --- /dev/null +++ b/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts @@ -0,0 +1,145 @@ +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; + +export class ModeratorUserInfoData +{ + private _userId:number; + private _userName:string; + private _registrationAgeInMinutes:number; + private _minutesSinceLastLogin:number; + private _online:boolean; + private _cfhCount:number; + private _abusiveCfhCount:number; + private _cautionCount:number; + private _banCount:number; + private _tradingLockCount:number; + private _tradingExpiryDate:string; + private _lastPurchaseDate:string; + private _identityId:number; + private _identityRelatedBanCount:number; + private _primaryEmailAddress:string; + private _figure:string; + private _userClassification:string; + private _lastSanctionTime:string = ''; + private _sanctionAgeHours:number = 0; + + constructor(wrapper: IMessageDataWrapper) + { + this._userId = wrapper.readInt(); + this._userName = wrapper.readString(); + this._figure = wrapper.readString(); + this._registrationAgeInMinutes = wrapper.readInt(); + this._minutesSinceLastLogin = wrapper.readInt(); + this._online = wrapper.readBoolean(); + this._cfhCount = wrapper.readInt(); + this._abusiveCfhCount = wrapper.readInt(); + this._cautionCount = wrapper.readInt(); + this._banCount = wrapper.readInt(); + this._tradingLockCount = wrapper.readInt(); + this._tradingExpiryDate = wrapper.readString(); + this._lastPurchaseDate = wrapper.readString(); + this._identityId = wrapper.readInt(); + this._identityRelatedBanCount = wrapper.readInt(); + this._primaryEmailAddress = wrapper.readString(); + this._userClassification = wrapper.readString(); + if(wrapper.bytesAvailable) + { + this._lastSanctionTime = wrapper.readString(); + this._sanctionAgeHours = wrapper.readInt(); + } + } + + public get userId():number + { + return this._userId; + } + + public get userName():string + { + return this._userName; + } + + public get figure():string + { + return this._figure; + } + + public get registrationAgeInMinutes():number + { + return this._registrationAgeInMinutes; + } + + public get minutesSinceLastLogin():number + { + return this._minutesSinceLastLogin; + } + + public get online():boolean + { + return this._online; + } + + public get cfhCount():number + { + return this._cfhCount; + } + + public get abusiveCfhCount():number + { + return this._abusiveCfhCount; + } + + public get cautionCount():number + { + return this._cautionCount; + } + + public get banCount():number + { + return this._banCount; + } + + public get tradingLockCount():number + { + return this._tradingLockCount; + } + + public get tradingExpiryDate():string + { + return this._tradingExpiryDate; + } + + public get lastPurchaseDate():string + { + return this._lastPurchaseDate; + } + + public get identityId():number + { + return this._identityId; + } + + public get identityRelatedBanCount():number + { + return this._identityRelatedBanCount; + } + + public get primaryEmailAddress():string + { + return this._primaryEmailAddress; + } + + public get userClassification():string + { + return this._userClassification; + } + + public get lastSanctionTime():string + { + return this._lastSanctionTime; + } + + public get sanctionAgeHours():number + { + return this._sanctionAgeHours; + } +} diff --git a/src/nitro/communication/messages/parser/modtool/utils/_Str_5467.ts b/src/nitro/communication/messages/parser/modtool/utils/_Str_5467.ts deleted file mode 100644 index 93ef6361..00000000 --- a/src/nitro/communication/messages/parser/modtool/utils/_Str_5467.ts +++ /dev/null @@ -1,145 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; - -export class _Str_5467 -{ - private _userId:number; - private _userName:string; - private _Str_19258:number; - private _Str_20876:number; - private _online:boolean; - private _Str_21621:number; - private _Str_20013:number; - private _Str_20917:number; - private _Str_20349:number; - private _Str_21386:number; - private _Str_20848:string; - private _Str_21819:string; - private _Str_20982:number; - private _Str_19460:number; - private _Str_22254:string; - private _figure:string; - private _Str_20625:string; - private _Str_19116:string = ''; - private _Str_20729:number = 0; - - constructor(wrapper: IMessageDataWrapper) - { - this._userId = wrapper.readInt(); - this._userName = wrapper.readString(); - this._figure = wrapper.readString(); - this._Str_19258 = wrapper.readInt(); - this._Str_20876 = wrapper.readInt(); - this._online = wrapper.readBoolean(); - this._Str_21621 = wrapper.readInt(); - this._Str_20013 = wrapper.readInt(); - this._Str_20917 = wrapper.readInt(); - this._Str_20349 = wrapper.readInt(); - this._Str_21386 = wrapper.readInt(); - this._Str_20848 = wrapper.readString(); - this._Str_21819 = wrapper.readString(); - this._Str_20982 = wrapper.readInt(); - this._Str_19460 = wrapper.readInt(); - this._Str_22254 = wrapper.readString(); - this._Str_20625 = wrapper.readString(); - if(wrapper.bytesAvailable) - { - this._Str_19116 = wrapper.readString(); - this._Str_20729 = wrapper.readInt(); - } - } - - public get userId():number - { - return this._userId; - } - - public get userName():string - { - return this._userName; - } - - public get figure():string - { - return this._figure; - } - - public get _Str_24334():number - { - return this._Str_19258; - } - - public get _Str_23276():number - { - return this._Str_20876; - } - - public get online():boolean - { - return this._online; - } - - public get _Str_24656():number - { - return this._Str_21621; - } - - public get _Str_22987():number - { - return this._Str_20013; - } - - public get _Str_16987():number - { - return this._Str_20917; - } - - public get _Str_20373():number - { - return this._Str_20349; - } - - public get _Str_24526():number - { - return this._Str_21386; - } - - public get _Str_23969():string - { - return this._Str_20848; - } - - public get _Str_22786():string - { - return this._Str_21819; - } - - public get _Str_25657():number - { - return this._Str_20982; - } - - public get _Str_22700():number - { - return this._Str_19460; - } - - public get _Str_20219():string - { - return this._Str_22254; - } - - public get _Str_22262():string - { - return this._Str_20625; - } - - public get _Str_24447():string - { - return this._Str_19116; - } - - public get _Str_19137():number - { - return this._Str_20729; - } -} diff --git a/src/nitro/communication/messages/parser/modtool/utils/index.ts b/src/nitro/communication/messages/parser/modtool/utils/index.ts index 24b28857..27549d06 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/index.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/index.ts @@ -1,5 +1,6 @@ export * from './CallForHelpCategoryData'; export * from './IChatlog'; +export * from './ModeratorUserInfoData'; export * from './ModtoolRoomChatlogLine'; export * from './ModtoolRoomVisitedData'; export * from './ModtoolUserChatlogParserChatlog'; @@ -8,5 +9,4 @@ export * from './ModtoolUserVisitedRoomsRoom'; export * from './_Str_2484'; export * from './_Str_5018'; export * from './_Str_5460'; -export * from './_Str_5467'; export * from './_Str_8176'; diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 5d4ad70f..d305d973 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2454,7 +2454,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato sprite.y = (y - (rectangle.height / 2)); } - if(!this._Str_25871(canvas, x, y, type, altKey, ctrlKey, shiftKey)) + if(!this.handleRoomDragging(canvas, x, y, type, altKey, ctrlKey, shiftKey)) { if(!canvas.handleMouseEvent(x, y, type, altKey, ctrlKey, shiftKey, buttonDown)) { @@ -2487,7 +2487,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._activeRoomActiveCanvasMouseY = y; } - private _Str_25871(canvas: IRoomRenderingCanvas, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean): boolean + private handleRoomDragging(canvas: IRoomRenderingCanvas, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean): boolean { let offsetX = (x - this._activeRoomActiveCanvasMouseX); let offsetY = (y - this._activeRoomActiveCanvasMouseY); diff --git a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts index 1e5337a1..79ae4390 100644 --- a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts +++ b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts @@ -408,7 +408,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement if(layerData) { - frameNumber = layerData._Str_891; + frameNumber = layerData.animationFrame; offsetX += layerData.dx; offsetY += layerData.dy; dd += layerData.dd; diff --git a/src/nitro/utils/FixedSizeStack.ts b/src/nitro/utils/FixedSizeStack.ts index 034a5040..a52b7d07 100644 --- a/src/nitro/utils/FixedSizeStack.ts +++ b/src/nitro/utils/FixedSizeStack.ts @@ -17,7 +17,7 @@ this._index = 0; } - public _Str_22775(k: number): void + public addValue(k: number): void { if(this._data.length < this._maxSize) { @@ -31,7 +31,7 @@ this._index = ((this._index + 1) % this._maxSize); } - public _Str_25797(): number + public getMax(): number { let k = Number.MIN_VALUE; @@ -47,7 +47,7 @@ return k; } - public _Str_26219(): number + public getMin(): number { let k = Number.MAX_VALUE; @@ -62,4 +62,4 @@ return k; } -} \ No newline at end of file +} From a7182c863b524b3a3eb6340dfd04d1625b14fb6b Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 6 Jun 2021 21:30:32 -0500 Subject: [PATCH 041/155] fixed moderation parser variables --- .../parser/modtool/ModtoolMainParser.ts | 11 +- ..._Str_5460.ts => IssueInfoMessageParser.ts} | 24 +-- .../parser/modtool/utils/IssueMessageData.ts | 159 ++++++++++++++++++ .../parser/modtool/utils/ModeratorInitData.ts | 138 +++++++++++++++ .../{_Str_8176.ts => PatternMatchData.ts} | 6 +- .../parser/modtool/utils/_Str_2484.ts | 159 ------------------ .../parser/modtool/utils/_Str_5018.ts | 138 --------------- .../messages/parser/modtool/utils/index.ts | 8 +- 8 files changed, 321 insertions(+), 322 deletions(-) rename src/nitro/communication/messages/parser/modtool/utils/{_Str_5460.ts => IssueInfoMessageParser.ts} (50%) create mode 100644 src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts create mode 100644 src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData.ts rename src/nitro/communication/messages/parser/modtool/utils/{_Str_8176.ts => PatternMatchData.ts} (76%) delete mode 100644 src/nitro/communication/messages/parser/modtool/utils/_Str_2484.ts delete mode 100644 src/nitro/communication/messages/parser/modtool/utils/_Str_5018.ts diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts b/src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts index 9d744542..2ac50285 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts @@ -1,11 +1,10 @@ -import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; +import { ModeratorInitData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData'; import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; -import { CallForHelpCategoryData } from './utils/CallForHelpCategoryData'; -import { _Str_5018 } from './utils/_Str_5018'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; export class ModtoolMainParser implements IMessageParser { - private _data: _Str_5018 = null; + private _data: ModeratorInitData = null; public flush(): boolean { this._data = null; @@ -14,11 +13,11 @@ export class ModtoolMainParser implements IMessageParser public parse(wrapper: IMessageDataWrapper): boolean { - this._data = new _Str_5018(wrapper); + this._data = new ModeratorInitData(wrapper); return true; } - public get data(): _Str_5018 + public get data(): ModeratorInitData { return this._data; } diff --git a/src/nitro/communication/messages/parser/modtool/utils/_Str_5460.ts b/src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser.ts similarity index 50% rename from src/nitro/communication/messages/parser/modtool/utils/_Str_5460.ts rename to src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser.ts index 7b706a61..4150d496 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/_Str_5460.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser.ts @@ -1,21 +1,21 @@ -import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { _Str_2484 } from './_Str_2484'; -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { _Str_8176 } from './_Str_8176'; +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from 'nitro-renderer/src/core/communication/messages/IMessageParser'; +import { IssueMessageData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData'; +import { PatternMatchData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData'; -export class _Str_5460 implements IMessageParser +export class IssueInfoMessageParser implements IMessageParser { - private _Str_13730:_Str_2484; + private _issueData:IssueMessageData; - public get _Str_22192():_Str_2484 + public get issueData():IssueMessageData { - return this._Str_13730; + return this._issueData; } public flush():boolean { - this._Str_13730 = null; + this._issueData = null; return true; } @@ -37,14 +37,14 @@ export class _Str_5460 implements IMessageParser const _local_15:string = k.readString(); const _local_16:number = k.readInt(); const _local_17:number = k.readInt(); - const _local_18:_Str_8176[] = []; + const _local_18:PatternMatchData[] = []; let _local_19 = 0; while(_local_19 < _local_17) { - _local_18.push(new _Str_8176(k)); + _local_18.push(new PatternMatchData(k)); _local_19++; } - this._Str_13730 = new _Str_2484(_local_2, _local_3, _local_4, _local_5, _local_6, _local_7, _local_8, _local_9, _local_10, _local_11, _local_12, _local_13, _local_14, _local_15, _local_16, _local_18); + this._issueData = new IssueMessageData(_local_2, _local_3, _local_4, _local_5, _local_6, _local_7, _local_8, _local_9, _local_10, _local_11, _local_12, _local_13, _local_14, _local_15, _local_16, _local_18); return true; } } diff --git a/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts b/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts new file mode 100644 index 00000000..79ea7b58 --- /dev/null +++ b/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts @@ -0,0 +1,159 @@ +import { PatternMatchData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData'; + +export class IssueMessageData +{ + public static STATE_OPEN: number = 1; + public static STATE_PICKED: number = 2; + public static STATE_CLOSED: number = 3; + + private _issueId: number; + private _state: number; + private _categoryId: number; + private _reportedCategoryId: number; + private _issueAgeInMilliseconds: number; + private _priority: number; + private _groupingId: number; + private _reporterUserId: number; + private _reporterUserName: string; + private _reportedUserId: number; + private _reportedUserName: string; + private _pickerUserId: number; + private _pickerUserName: string; + private _message: string; + private _chatRecordId: number; + private _patterns: PatternMatchData[]; + private _disposed: boolean = false; + private _creationTimeInMilliseconds: number; + + constructor(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number, _arg_6: number, _arg_7: number, _arg_8: number, _arg_9: string, _arg_10: number, _arg_11: string, _arg_12: number, _arg_13: string, _arg_14: string, _arg_15: number, _arg_16:PatternMatchData[]) + { + this._issueId = k; + this._state = _arg_2; + this._categoryId = _arg_3; + this._reportedCategoryId = _arg_4; + this._issueAgeInMilliseconds = _arg_5; + this._priority = _arg_6; + this._groupingId = _arg_7; + this._reporterUserId = _arg_8; + this._reporterUserName = _arg_9; + this._reportedUserId = _arg_10; + this._reportedUserName = _arg_11; + this._pickerUserId = _arg_12; + this._pickerUserName = _arg_13; + this._message = _arg_14; + this._chatRecordId = _arg_15; + this._patterns = _arg_16; + this._creationTimeInMilliseconds = 0; //getTimer(); + } + + public get issueId(): number + { + return this._issueId; + } + + public get state(): number + { + return this._state; + } + + public get categoryId(): number + { + return this._categoryId; + } + + public get reportedCategoryId(): number + { + return this._reportedCategoryId; + } + + public get issueAgeInMilliseconds(): number + { + return this._issueAgeInMilliseconds; + } + + public get priority(): number + { + return this._priority; + } + + public get groupingId(): number + { + return this._groupingId; + } + + public get reporterUserId(): number + { + return this._reporterUserId; + } + + public get reporterUserName(): string + { + return this._reporterUserName; + } + + public get reportedUserId(): number + { + return this._reportedUserId; + } + + public get reportedUserName(): string + { + return this._reportedUserName; + } + + public get pickerUserId(): number + { + return this._pickerUserId; + } + + public get pickerUserName(): string + { + return this._pickerUserName; + } + + public get message(): string + { + return this._message; + } + + public get chatRecordId(): number + { + return this._chatRecordId; + } + + public get patterns(): PatternMatchData[] + { + return this._patterns; + } + + public dispose(): void + { + + if(this.disposed) + { + return; + } + for(const k of this._patterns) + { + k.dispose(); + } + this._patterns = []; + this._disposed = true; + } + + public get disposed(): boolean + { + return this._disposed; + } + + public getOpenTime(k: number): string + { + const _local_2: number = (((this._issueAgeInMilliseconds + k) - this._creationTimeInMilliseconds) / 1000); + const _local_3: number = (_local_2 / 60); + const _local_4: number = (_local_3 % 60); + const _local_5: number = (_local_3 / 60); + const _local_6: string = (((_local_4 < 10) ? '0' : '') + _local_4); + const _local_7: string = (((_local_5 < 10) ? '0' : '') + _local_5); + return (_local_7 + ':') + _local_6; + } +} diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData.ts b/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData.ts new file mode 100644 index 00000000..3c5dc73c --- /dev/null +++ b/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData.ts @@ -0,0 +1,138 @@ +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; +import { IssueInfoMessageParser } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser'; +import { IssueMessageData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData'; + +export class ModeratorInitData +{ + private _messageTemplates:string[]; + private _roomMessageTemplates:string[]; + private _issues:IssueMessageData[]; + private _cfhPermission:boolean; + private _chatlogsPermission:boolean; + private _alertPermission:boolean; + private _kickPermission:boolean; + private _banPermission:boolean; + private _roomAlertPermission:boolean; + private _roomKickPermission:boolean; + + private _disposed: boolean = false; + + constructor(wrapper: IMessageDataWrapper) + { + const local2 = new IssueInfoMessageParser(); + this._issues = []; + this._messageTemplates = []; + this._roomMessageTemplates= []; + + let local3 = wrapper.readInt(); + let i = 0; + while(i < local3) + { + if(local2.parse(wrapper)) + { + this._issues.push(local2.issueData); + } + i++; + } + + local3 = wrapper.readInt(); + i = 0; + while(i < local3) + { + this._messageTemplates.push(wrapper.readString()); + i++; + } + + local3 = wrapper.readInt(); + i = 0; + while(i < local3) + { + wrapper.readString(); + i++; + } + + this._cfhPermission = wrapper.readBoolean(); + this._chatlogsPermission = wrapper.readBoolean(); + this._alertPermission = wrapper.readBoolean(); + this._kickPermission = wrapper.readBoolean(); + this._banPermission = wrapper.readBoolean(); + this._roomAlertPermission = wrapper.readBoolean(); + this._roomKickPermission = wrapper.readBoolean(); + local3 = wrapper.readInt(); + i = 0; + while(i < local3) + { + this._roomMessageTemplates.push(wrapper.readString()); + i++; + } + + + } + public dispose():void + { + if(this._disposed) + { + return; + } + this._disposed = true; + this._messageTemplates = null; + this._roomMessageTemplates = null; + this._issues = null; + } + + public get disposed():boolean + { + return this._disposed; + } + + public get messageTemplates():string[] + { + return this._messageTemplates; + } + + public get roomMessageTemplates():string[] + { + return this._roomMessageTemplates; + } + + public get issues():IssueMessageData[] + { + return this._issues; + } + + public get cfhPermission():boolean + { + return this._cfhPermission; + } + + public get chatlogsPermission():boolean + { + return this._chatlogsPermission; + } + + public get alertPermission():boolean + { + return this._alertPermission; + } + + public get kickPermission():boolean + { + return this._kickPermission; + } + + public get banPermission():boolean + { + return this._banPermission; + } + + public get roomAlertPermission():boolean + { + return this._roomAlertPermission; + } + + public get roomKickPermission():boolean + { + return this._roomKickPermission; + } + +} diff --git a/src/nitro/communication/messages/parser/modtool/utils/_Str_8176.ts b/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData.ts similarity index 76% rename from src/nitro/communication/messages/parser/modtool/utils/_Str_8176.ts rename to src/nitro/communication/messages/parser/modtool/utils/PatternMatchData.ts index 925970bc..d3463dea 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/_Str_8176.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData.ts @@ -1,7 +1,7 @@ -import { IDisposable } from '../../../../../../core/common/disposable/IDisposable'; -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IDisposable } from 'nitro-renderer/src/core/common/disposable/IDisposable'; +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; -export class _Str_8176 implements IDisposable +export class PatternMatchData implements IDisposable { private _pattern:string; private _startIndex:number; diff --git a/src/nitro/communication/messages/parser/modtool/utils/_Str_2484.ts b/src/nitro/communication/messages/parser/modtool/utils/_Str_2484.ts deleted file mode 100644 index 3fa44fd8..00000000 --- a/src/nitro/communication/messages/parser/modtool/utils/_Str_2484.ts +++ /dev/null @@ -1,159 +0,0 @@ -import { _Str_8176 } from './_Str_8176'; - -export class _Str_2484 -{ - public static _Str_5035: number = 1; - public static _Str_8056: number = 2; - public static _Str_17136: number = 3; - - private _Str_6036: number; - private _state: number; - private _Str_2629: number; - private _Str_21044: number; - private _issueAgeInMilliseconds: number; - private _priority: number; - private _Str_9559: number; - private _Str_21130: number; - private _Str_19722: string; - private _Str_2797: number; - private _Str_5502: string; - private _Str_9859: number; - private _Str_21393: string; - private _message: string; - private _Str_10679: number; - private _Str_15205: _Str_8176[]; - private _disposed: boolean = false; - private _Str_19084: number; - - constructor(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number, _arg_6: number, _arg_7: number, _arg_8: number, _arg_9: string, _arg_10: number, _arg_11: string, _arg_12: number, _arg_13: string, _arg_14: string, _arg_15: number, _arg_16:_Str_8176[]) - { - this._Str_6036 = k; - this._state = _arg_2; - this._Str_2629 = _arg_3; - this._Str_21044 = _arg_4; - this._issueAgeInMilliseconds = _arg_5; - this._priority = _arg_6; - this._Str_9559 = _arg_7; - this._Str_21130 = _arg_8; - this._Str_19722 = _arg_9; - this._Str_2797 = _arg_10; - this._Str_5502 = _arg_11; - this._Str_9859 = _arg_12; - this._Str_21393 = _arg_13; - this._message = _arg_14; - this._Str_10679 = _arg_15; - this._Str_15205 = _arg_16; - this._Str_19084 = 0; //getTimer(); - } - - public get _Str_2869(): number - { - return this._Str_6036; - } - - public get state(): number - { - return this._state; - } - - public get _Str_2712(): number - { - return this._Str_2629; - } - - public get _Str_7437(): number - { - return this._Str_21044; - } - - public get issueAgeInMilliseconds(): number - { - return this._issueAgeInMilliseconds; - } - - public get priority(): number - { - return this._priority; - } - - public get _Str_16842(): number - { - return this._Str_9559; - } - - public get _Str_19929(): number - { - return this._Str_21130; - } - - public get _Str_19615(): string - { - return this._Str_19722; - } - - public get _Str_2662(): number - { - return this._Str_2797; - } - - public get _Str_5842(): string - { - return this._Str_5502; - } - - public get _Str_5547(): number - { - return this._Str_9859; - } - - public get _Str_22164(): string - { - return this._Str_21393; - } - - public get message(): string - { - return this._message; - } - - public get _Str_20325(): number - { - return this._Str_10679; - } - - public get _Str_26050(): _Str_8176[] - { - return this._Str_15205; - } - - public dispose(): void - { - - if(this.disposed) - { - return; - } - for(const k of this._Str_15205) - { - k.dispose(); - } - this._Str_15205 = []; - this._disposed = true; - } - - public get disposed(): boolean - { - return this._disposed; - } - - public _Str_15885(k: number): string - { - const _local_2: number = (((this._issueAgeInMilliseconds + k) - this._Str_19084) / 1000); - const _local_3: number = (_local_2 / 60); - const _local_4: number = (_local_3 % 60); - const _local_5: number = (_local_3 / 60); - const _local_6: string = (((_local_4 < 10) ? '0' : '') + _local_4); - const _local_7: string = (((_local_5 < 10) ? '0' : '') + _local_5); - return (_local_7 + ':') + _local_6; - } -} diff --git a/src/nitro/communication/messages/parser/modtool/utils/_Str_5018.ts b/src/nitro/communication/messages/parser/modtool/utils/_Str_5018.ts deleted file mode 100644 index 9eaa1806..00000000 --- a/src/nitro/communication/messages/parser/modtool/utils/_Str_5018.ts +++ /dev/null @@ -1,138 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { _Str_5460 } from './_Str_5460'; -import { _Str_2484 } from './_Str_2484'; - -export class _Str_5018 -{ - private _Str_12818:string[]; - private _Str_14428:string[]; - private _issues:_Str_2484[]; - private _Str_21327:boolean; - private _Str_20034:boolean; - private _Str_21542:boolean; - private _Str_22205:boolean; - private _Str_22169:boolean; - private _Str_19231:boolean; - private _Str_19156:boolean; - - private _disposed: boolean = false; - - constructor(wrapper: IMessageDataWrapper) - { - const local2 = new _Str_5460(); - this._issues = []; - this._Str_12818 = []; - this._Str_14428= []; - - let local3 = wrapper.readInt(); - let i = 0; - while(i < local3) - { - if(local2.parse(wrapper)) - { - this._issues.push(local2._Str_22192); - } - i++; - } - - local3 = wrapper.readInt(); - i = 0; - while(i < local3) - { - this._Str_12818.push(wrapper.readString()); - i++; - } - - local3 = wrapper.readInt(); - i = 0; - while(i < local3) - { - wrapper.readString(); - i++; - } - - this._Str_21327 = wrapper.readBoolean(); - this._Str_20034 = wrapper.readBoolean(); - this._Str_21542 = wrapper.readBoolean(); - this._Str_22205 = wrapper.readBoolean(); - this._Str_22169 = wrapper.readBoolean(); - this._Str_19231 = wrapper.readBoolean(); - this._Str_19156 = wrapper.readBoolean(); - local3 = wrapper.readInt(); - i = 0; - while(i < local3) - { - this._Str_14428.push(wrapper.readString()); - i++; - } - - - } - public dispose():void - { - if(this._disposed) - { - return; - } - this._disposed = true; - this._Str_12818 = null; - this._Str_14428 = null; - this._issues = null; - } - - public get disposed():boolean - { - return this._disposed; - } - - public get _Str_15690():string[] - { - return this._Str_12818; - } - - public get _Str_18336():string[] - { - return this._Str_14428; - } - - public get issues():_Str_2484[] - { - return this._issues; - } - - public get _Str_24070():boolean - { - return this._Str_21327; - } - - public get _Str_12765():boolean - { - return this._Str_20034; - } - - public get _Str_18465():boolean - { - return this._Str_21542; - } - - public get _Str_20397():boolean - { - return this._Str_22205; - } - - public get _Str_21242():boolean - { - return this._Str_22169; - } - - public get _Str_24851():boolean - { - return this._Str_19231; - } - - public get _Str_24333():boolean - { - return this._Str_19156; - } - -} diff --git a/src/nitro/communication/messages/parser/modtool/utils/index.ts b/src/nitro/communication/messages/parser/modtool/utils/index.ts index 27549d06..9b7176cc 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/index.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/index.ts @@ -1,12 +1,12 @@ export * from './CallForHelpCategoryData'; export * from './IChatlog'; +export * from './IssueInfoMessageParser'; +export * from './IssueMessageData'; +export * from './ModeratorInitData'; export * from './ModeratorUserInfoData'; export * from './ModtoolRoomChatlogLine'; export * from './ModtoolRoomVisitedData'; export * from './ModtoolUserChatlogParserChatlog'; export * from './ModtoolUserChatlogParserVisit'; export * from './ModtoolUserVisitedRoomsRoom'; -export * from './_Str_2484'; -export * from './_Str_5018'; -export * from './_Str_5460'; -export * from './_Str_8176'; +export * from './PatternMatchData'; From ed772306a31987bd76b9b7f2de1aed0656c5b4a3 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 6 Jun 2021 22:08:56 -0500 Subject: [PATCH 042/155] cleaned AvatarImageActionCache --- src/nitro/avatar/AvatarImage.ts | 20 ++--- .../avatar/cache/AvatarImageActionCache.ts | 89 ++++++------------- .../avatar/cache/AvatarImageBodyPartCache.ts | 89 +++++++++++++------ src/nitro/avatar/cache/AvatarImageCache.ts | 70 +++++++-------- .../avatar/cache/AvatarImageDirectionCache.ts | 14 +-- src/nitro/avatar/cache/ImageData.ts | 12 +-- 6 files changed, 147 insertions(+), 147 deletions(-) diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index 9254fff3..79f12228 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -109,7 +109,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener { this.getAvatarPartsForCamera(AvatarSetType.FULL); - return this._cache._Str_1009(); + return this._cache.getServerRenderData(); } public dispose(): void @@ -301,7 +301,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener while(_local_6 >= 0) { _local_4 = _local_3[_local_6]; - const _local_5 = this._cache._Str_1629(_local_4, this._frameCounter, true); + const _local_5 = this._cache.getImageContainer(_local_4, this._frameCounter, true); _local_6--; } } @@ -343,7 +343,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener while(partCount >= 0) { const set = _local_6[partCount]; - const part = this._cache._Str_1629(set, this._frameCounter); + const part = this._cache.getImageContainer(set, this._frameCounter); if(part) { @@ -462,7 +462,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener while(partCount >= 0) { const set = setTypes[partCount]; - const part = this._cache._Str_1629(set, this._frameCounter); + const part = this._cache.getImageContainer(set, this._frameCounter); if(part) { @@ -527,7 +527,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener while(partCount >= 0) { const set = setTypes[partCount]; - const part = this._cache._Str_1629(set, this._frameCounter); + const part = this._cache.getImageContainer(set, this._frameCounter); if(part) { @@ -858,7 +858,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener this._effectIdInUse = -1; } - if(_local_2) this._cache._Str_1086(0); + if(_local_2) this._cache.disposeInactiveActions(0); if(this._lastActionsString != this._currentActionsString) { @@ -948,9 +948,9 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(k.definition.isMain) { this._mainAction = k; - this._cache._Str_2014(k.definition.geometryType); + this._cache.setGeometryType(k.definition.geometryType); } - this._cache._Str_1565(k, _arg_2); + this._cache.setAction(k, _arg_2); this._changes = true; } @@ -963,10 +963,10 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(k.definition.isMain) { this._mainAction = k; - this._cache._Str_2014(k.definition.geometryType); + this._cache.setGeometryType(k.definition.geometryType); } - this._cache._Str_741(k); + this._cache.resetBodyPartCache(k); this._changes = true; } diff --git a/src/nitro/avatar/cache/AvatarImageActionCache.ts b/src/nitro/avatar/cache/AvatarImageActionCache.ts index 313809ed..c8bc0d55 100644 --- a/src/nitro/avatar/cache/AvatarImageActionCache.ts +++ b/src/nitro/avatar/cache/AvatarImageActionCache.ts @@ -1,96 +1,57 @@ -import { IActiveActionData } from '../actions/IActiveActionData'; -import { AvatarImageBodyPartCache } from './AvatarImageBodyPartCache'; +import { AvatarImageDirectionCache } from 'nitro-renderer/src/nitro/avatar/cache/AvatarImageDirectionCache'; +import { Nitro } from 'nitro-renderer/src/nitro/Nitro'; export class AvatarImageActionCache { - private _Str_586: Map; - private _Str_1233: IActiveActionData; - private _Str_1188: number; - private _disposed: boolean; + private _cache: Map; + private _lastAccessTime: number; constructor() { - this._Str_586 = new Map(); - } + this._cache = new Map(); - public _Str_1565(k: IActiveActionData, _arg_2: number): void - { - if(!this._Str_1233) this._Str_1233 = k; - - const _local_3 = this._Str_1961(this._Str_1233); - - if(_local_3) _local_3._Str_1108(_arg_2); - - this._Str_1233 = k; + this.setLastAccessTime(Nitro.instance.time); } public dispose(): void { - if(!this._disposed) + this.debugInfo('[dispose]'); + + if(!this._cache) return; + + for(const direction of this._cache.values()) { - if(!this._Str_586) return; - - this._Str_2089(0, 2147483647); - - this._Str_586.clear(); - - this._Str_586 = null; - this._disposed = true; + if(direction) direction.dispose(); } + + this._cache.clear(); } - public _Str_2089(k: number, _arg_2: number): void + public getDirectionCache(k: number): AvatarImageDirectionCache { - if(!this._Str_586 || this._disposed) return; + const existing = this._cache.get(k.toString()); - for(const [ key, cache ] of this._Str_586.entries()) - { - if(!cache) continue; + if(!existing) return null; - const _local_3 = cache._Str_1815(); - - if((_arg_2 - _local_3) >= k) - { - cache.dispose(); - - this._Str_586.delete(key); - } - } + return existing; } - public getAction():IActiveActionData + public updateDirectionCache(k: number, _arg_2: AvatarImageDirectionCache): void { - return this._Str_1233; + this._cache.set(k.toString(), _arg_2); } - public setDirection(k: number): void + public setLastAccessTime(k: number): void { - this._Str_1188 = k; + this._lastAccessTime = k; } - public getDirection(): number + public getLastAccessTime(): number { - return this._Str_1188; + return this._lastAccessTime; } - public _Str_1961(k: IActiveActionData=null): AvatarImageBodyPartCache - { - if(!this._Str_1233) return null; - - if(!k) k = this._Str_1233; - - if(k.overridingAction) return this._Str_586.get(k.overridingAction); - - return this._Str_586.get(k.id); - } - - public _Str_1765(k: IActiveActionData, _arg_2: AvatarImageBodyPartCache): void - { - if(k.overridingAction) this._Str_586.set(k.overridingAction, _arg_2); - else this._Str_586.set(k.id, _arg_2); - } - - private _Str_587(k: string): void + private debugInfo(k: string): void { } } diff --git a/src/nitro/avatar/cache/AvatarImageBodyPartCache.ts b/src/nitro/avatar/cache/AvatarImageBodyPartCache.ts index dc331e8f..e98862a4 100644 --- a/src/nitro/avatar/cache/AvatarImageBodyPartCache.ts +++ b/src/nitro/avatar/cache/AvatarImageBodyPartCache.ts @@ -1,57 +1,96 @@ -import { Nitro } from '../../Nitro'; -import { AvatarImageDirectionCache } from './AvatarImageDirectionCache'; +import { IActiveActionData } from 'nitro-renderer/src/nitro/avatar/actions/IActiveActionData'; +import { AvatarImageActionCache } from 'nitro-renderer/src/nitro/avatar/cache/AvatarImageActionCache'; export class AvatarImageBodyPartCache { - private _Str_586: Map; - private _Str_1509: number; + private _cache: Map; + private _currentAction: IActiveActionData; + private _currentDirection: number; + private _disposed: boolean; constructor() { - this._Str_586 = new Map(); + this._cache = new Map(); + } - this._Str_1108(Nitro.instance.time); + public setAction(k: IActiveActionData, _arg_2: number): void + { + if(!this._currentAction) this._currentAction = k; + + const _local_3 = this.getActionCache(this._currentAction); + + if(_local_3) _local_3.setLastAccessTime(_arg_2); + + this._currentAction = k; } public dispose(): void { - this._Str_587('[dispose]'); - - if(!this._Str_586) return; - - for(const direction of this._Str_586.values()) + if(!this._disposed) { - if(direction) direction.dispose(); + if(!this._cache) return; + + this.disposeActions(0, 2147483647); + + this._cache.clear(); + + this._cache = null; + this._disposed = true; } - - this._Str_586.clear(); } - public _Str_2070(k: number): AvatarImageDirectionCache + public disposeActions(k: number, _arg_2: number): void { - const existing = this._Str_586.get(k.toString()); + if(!this._cache || this._disposed) return; - if(!existing) return null; + for(const [ key, cache ] of this._cache.entries()) + { + if(!cache) continue; - return existing; + const _local_3 = cache.getLastAccessTime(); + + if((_arg_2 - _local_3) >= k) + { + cache.dispose(); + + this._cache.delete(key); + } + } } - public _Str_2168(k: number, _arg_2: AvatarImageDirectionCache): void + public getAction():IActiveActionData { - this._Str_586.set(k.toString(), _arg_2); + return this._currentAction; } - public _Str_1108(k: number): void + public setDirection(k: number): void { - this._Str_1509 = k; + this._currentDirection = k; } - public _Str_1815(): number + public getDirection(): number { - return this._Str_1509; + return this._currentDirection; } - private _Str_587(k: string): void + public getActionCache(k: IActiveActionData=null): AvatarImageActionCache + { + if(!this._currentAction) return null; + + if(!k) k = this._currentAction; + + if(k.overridingAction) return this._cache.get(k.overridingAction); + + return this._cache.get(k.id); + } + + public updateActionCache(k: IActiveActionData, _arg_2: AvatarImageActionCache): void + { + if(k.overridingAction) this._cache.set(k.overridingAction, _arg_2); + else this._cache.set(k.id, _arg_2); + } + + private debugInfo(k: string): void { } } diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index fc075fb5..4c6a76f1 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -1,3 +1,5 @@ +import { AvatarImageActionCache } from 'nitro-renderer/src/nitro/avatar/cache/AvatarImageActionCache'; +import { AvatarImageBodyPartCache } from 'nitro-renderer/src/nitro/avatar/cache/AvatarImageBodyPartCache'; import { Container, Matrix, Point, Rectangle, Sprite, Texture } from 'pixi.js'; import { RoomObjectSpriteData } from '../../../room/data/RoomObjectSpriteData'; import { Nitro } from '../../Nitro'; @@ -13,20 +15,18 @@ import { AvatarScaleType } from '../enum/AvatarScaleType'; import { GeometryType } from '../enum/GeometryType'; import { IAvatarImage } from '../IAvatarImage'; import { AvatarCanvas } from '../structure/AvatarCanvas'; -import { AvatarImageActionCache } from './AvatarImageActionCache'; -import { AvatarImageBodyPartCache } from './AvatarImageBodyPartCache'; import { AvatarImageDirectionCache } from './AvatarImageDirectionCache'; import { ImageData } from './ImageData'; export class AvatarImageCache { - private static _Str_2189: number = 60000; + private static DEFAULT_MAX_CACHE_STORAGE_TIME_MS: number = 60000; private _structure: AvatarStructure; private _avatar: IAvatarImage; private _assets: AssetAliasCollection; private _scale: string; - private _cache: Map; + private _cache: Map; private _canvas: AvatarCanvas; private _disposed: boolean; private _geometryType: string; @@ -83,7 +83,7 @@ export class AvatarImageCache } } - public _Str_1086(k: number = 60000): void + public disposeInactiveActions(k: number = 60000): void { const time = Nitro.instance.time; @@ -93,12 +93,12 @@ export class AvatarImageCache { if(!cache) continue; - cache._Str_2089(k, time); + cache.disposeActions(k, time); } } } - public _Str_741(k: IActiveActionData): void + public resetBodyPartCache(k: IActiveActionData): void { if(this._cache) { @@ -106,7 +106,7 @@ export class AvatarImageCache { if(!cache) continue; - cache._Str_1565(k, 0); + cache.setAction(k, 0); } } } @@ -119,7 +119,7 @@ export class AvatarImageCache { for(const part of parts) { - const actionCache = this._Str_1050(part); + const actionCache = this.getBodyPartCache(part); if(!actionCache) continue; @@ -128,19 +128,19 @@ export class AvatarImageCache } } - public _Str_1565(k: IActiveActionData, _arg_2: number): void + public setAction(k: IActiveActionData, _arg_2: number): void { const _local_3 = this._structure.getActiveBodyPartIds(k, this._avatar); for(const _local_4 of _local_3) { - const _local_5 = this._Str_1050(_local_4); + const _local_5 = this.getBodyPartCache(_local_4); - if(_local_5) _local_5._Str_1565(k, _arg_2); + if(_local_5) _local_5.setAction(k, _arg_2); } } - public _Str_2014(k: string): void + public setGeometryType(k: string): void { if(this._geometryType === k) return; @@ -152,19 +152,19 @@ export class AvatarImageCache return; } - this._Str_1086(0); + this.disposeInactiveActions(0); this._geometryType = k; this._canvas = null; } - public _Str_1629(k: string, frameNumber: number, _arg_3: boolean = false): AvatarImageBodyPartContainer + public getImageContainer(k: string, frameNumber: number, _arg_3: boolean = false): AvatarImageBodyPartContainer { - let _local_4 = this._Str_1050(k); + let _local_4 = this.getBodyPartCache(k); if(!_local_4) { - _local_4 = new AvatarImageActionCache(); + _local_4 = new AvatarImageBodyPartCache(); this._cache.set(k, _local_4); } @@ -251,15 +251,15 @@ export class AvatarImageCache } } - let _local_12 = _local_4._Str_1961(_local_8); + let _local_12 = _local_4.getActionCache(_local_8); if(!_local_12 || _arg_3) { - _local_12 = new AvatarImageBodyPartCache(); - _local_4._Str_1765(_local_8, _local_12); + _local_12 = new AvatarImageActionCache(); + _local_4.updateActionCache(_local_8, _local_12); } - let _local_13 = _local_12._Str_2070(_local_5); + let _local_13 = _local_12.getDirectionCache(_local_5); if(!_local_13 || _arg_3) { @@ -267,20 +267,20 @@ export class AvatarImageCache _local_13 = new AvatarImageDirectionCache(_local_19); - _local_12._Str_2168(_local_5, _local_13); + _local_12.updateDirectionCache(_local_5, _local_13); } - let _local_14 = _local_13._Str_1629(frameCount); + let _local_14 = _local_13.getImageContainer(frameCount); if(!_local_14 || _arg_3) { - const _local_20 = _local_13._Str_1699(); + const _local_20 = _local_13.getPartList(); - _local_14 = this._Str_1834(_local_5, _local_20, frameCount, _local_7, _arg_3); + _local_14 = this.renderBodyPart(_local_5, _local_20, frameCount, _local_7, _arg_3); if(_local_14 && !_arg_3) { - if(_local_14.isCacheable) _local_13._Str_1924(_local_14, frameCount); + if(_local_14.isCacheable) _local_13.updateImageContainer(_local_14, frameCount); } else { @@ -298,20 +298,20 @@ export class AvatarImageCache return _local_14; } - public _Str_1009(): any[] + public getServerRenderData(): any[] { this._serverRenderData = []; return this._serverRenderData; } - public _Str_1050(k: string): AvatarImageActionCache + public getBodyPartCache(k: string): AvatarImageBodyPartCache { let existing = this._cache.get(k); if(!existing) { - existing = new AvatarImageActionCache(); + existing = new AvatarImageBodyPartCache(); this._cache.set(k, existing); } @@ -319,7 +319,7 @@ export class AvatarImageCache return existing; } - private _Str_1834(direction: number, containers: AvatarImagePartContainer[], frameCount: number, _arg_4: IActiveActionData, renderServerData: boolean = false): AvatarImageBodyPartContainer + private renderBodyPart(direction: number, containers: AvatarImagePartContainer[], frameCount: number, _arg_4: IActiveActionData, renderServerData: boolean = false): AvatarImageBodyPartContainer { if(!containers || !containers.length) return null; @@ -441,7 +441,7 @@ export class AvatarImageCache if(!this._unionImages.length) return null; - const imageData = this._Str_1236(this._unionImages, isFlipped); + const imageData = this.createUnionImage(this._unionImages, isFlipped); const canvasOffset = ((this._scale === AvatarScaleType.LARGE) ? (this._canvas.height - 16) : (this._canvas.height - 8)); const offset = new Point(-(imageData.regPoint.x), (canvasOffset - imageData.regPoint.y)); @@ -461,7 +461,7 @@ export class AvatarImageCache return new AvatarImageBodyPartContainer(imageData.container, offset, isCacheable); } - private _Str_1652(k: number): string + private convertColorToHex(k: number): string { let _local_2: string = (k * 0xFF).toString(16); if(_local_2.length < 2) @@ -471,11 +471,11 @@ export class AvatarImageCache return _local_2; } - private _Str_1236(k: ImageData[], isFlipped: boolean): ImageData + private createUnionImage(k: ImageData[], isFlipped: boolean): ImageData { const bounds = new Rectangle(); - for(const data of k) data && bounds.enlarge(data._Str_1567); + for(const data of k) data && bounds.enlarge(data.offsetRect); const point = new Point(-(bounds.x), -(bounds.y)); const container = new Container(); @@ -492,7 +492,7 @@ export class AvatarImageCache if(!data) continue; const texture = data.texture; - const color = data.color; + const color = data.colorTransform; const flipH = (!(isFlipped && data.flipH) && (isFlipped || data.flipH)); const regPoint = point.clone(); diff --git a/src/nitro/avatar/cache/AvatarImageDirectionCache.ts b/src/nitro/avatar/cache/AvatarImageDirectionCache.ts index 36441239..1182ca3a 100644 --- a/src/nitro/avatar/cache/AvatarImageDirectionCache.ts +++ b/src/nitro/avatar/cache/AvatarImageDirectionCache.ts @@ -19,23 +19,23 @@ export class AvatarImageDirectionCache this._images = null; } - public _Str_1699(): AvatarImagePartContainer[] + public getPartList(): AvatarImagePartContainer[] { return this._partList; } - public _Str_1629(k: number): AvatarImageBodyPartContainer + public getImageContainer(k: number): AvatarImageBodyPartContainer { - const existing = this._images.get(this._Str_2219(k)); + const existing = this._images.get(this.getCacheKey(k)); if(!existing) return null; return existing; } - public _Str_1924(k: AvatarImageBodyPartContainer, _arg_2: number): void + public updateImageContainer(k: AvatarImageBodyPartContainer, _arg_2: number): void { - const name = this._Str_2219(_arg_2); + const name = this.getCacheKey(_arg_2); const existing = this._images.get(name); @@ -44,7 +44,7 @@ export class AvatarImageDirectionCache this._images.set(name, k); } - private _Str_2219(k: number): string + private getCacheKey(k: number): string { let name = ''; @@ -53,7 +53,7 @@ export class AvatarImageDirectionCache return name; } - private _Str_587(k: string): void + private debugInfo(k: string): void { } } diff --git a/src/nitro/avatar/cache/ImageData.ts b/src/nitro/avatar/cache/ImageData.ts index 6b58e784..ce28dbec 100644 --- a/src/nitro/avatar/cache/ImageData.ts +++ b/src/nitro/avatar/cache/ImageData.ts @@ -7,7 +7,7 @@ export class ImageData private _rect: Rectangle; private _regPoint: Point; private _flipH: boolean; - private _color: number; + private _colorTransform: number; constructor(texture: Texture, rectangle: Rectangle, _arg_3: Point, flipH: boolean, color: number, container: Container = null) { @@ -16,7 +16,7 @@ export class ImageData this._rect = rectangle; this._regPoint = _arg_3; this._flipH = flipH; - this._color = color; + this._colorTransform = color; if(flipH) this._regPoint.x = (-(this._regPoint.x) + rectangle.width); } @@ -25,7 +25,7 @@ export class ImageData { this._texture = null; this._regPoint = null; - this._color = null; + this._colorTransform = null; } public get texture(): Texture @@ -53,12 +53,12 @@ export class ImageData return this._flipH; } - public get color(): number + public get colorTransform(): number { - return this._color; + return this._colorTransform; } - public get _Str_1567(): Rectangle + public get offsetRect(): Rectangle { return new Rectangle(-(this._regPoint.x), -(this._regPoint.y), this._rect.width, this._rect.height); } From 413ba368a8313bede4ca7005c2d9f3a2da5f9ca8 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 6 Jun 2021 22:36:03 -0500 Subject: [PATCH 043/155] cleaned FigureDataContainer --- src/nitro/avatar/AvatarRenderManager.ts | 4 +- .../avatar/enum/AvatarEditorInstanceId.ts | 10 +- src/nitro/avatar/figuredata/FigureData.ts | 72 ++++++------- src/nitro/utils/FigureDataContainer.ts | 102 +++++++++--------- src/room/RoomManager.ts | 28 ++--- 5 files changed, 108 insertions(+), 108 deletions(-) diff --git a/src/nitro/avatar/AvatarRenderManager.ts b/src/nitro/avatar/AvatarRenderManager.ts index e90bf0c1..f99c19b8 100644 --- a/src/nitro/avatar/AvatarRenderManager.ts +++ b/src/nitro/avatar/AvatarRenderManager.ts @@ -409,13 +409,13 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa { const container = new FigureDataContainer(); - container._Str_2153(k, _arg_2); + container.loadAvatarData(k, _arg_2); const partSets: IFigurePartSet[] = this.resolveFigureSets(_arg_3); for(const partSet of partSets) { - container._Str_2088(partSet.type, partSet.id, container.getColourIds(partSet.type)); + container.savePartData(partSet.type, partSet.id, container.getColourIds(partSet.type)); } return container.getFigureString(); diff --git a/src/nitro/avatar/enum/AvatarEditorInstanceId.ts b/src/nitro/avatar/enum/AvatarEditorInstanceId.ts index d4c8ace3..c4177f16 100644 --- a/src/nitro/avatar/enum/AvatarEditorInstanceId.ts +++ b/src/nitro/avatar/enum/AvatarEditorInstanceId.ts @@ -1,7 +1,7 @@ export class AvatarEditorInstanceId { - public static _Str_3350: number = 0; - public static _Str_7195: number = 1; - public static _Str_17909: number = 2; - public static _Str_16370: number = 3; -} \ No newline at end of file + public static OWN_AVATAR_EDITOR: number = 0; + public static FURNITURE_AVATAR_EDITOR: number = 1; + public static BOT_EDITOR: number = 2; + public static DEV_TOOL_EDITOR: number = 3; +} diff --git a/src/nitro/avatar/figuredata/FigureData.ts b/src/nitro/avatar/figuredata/FigureData.ts index 4586660e..7a06b017 100644 --- a/src/nitro/avatar/figuredata/FigureData.ts +++ b/src/nitro/avatar/figuredata/FigureData.ts @@ -3,25 +3,25 @@ import { FigureDataView } from './FigureDataView'; export class FigureData implements IAvatarImageListener { - public static M: string = 'M'; - public static F: string = 'F'; - public static U: string = 'U'; - public static H: string = 'h'; + public static MALE: string = 'M'; + public static FEMALE: string = 'F'; + public static UNISEX: string = 'U'; + public static SCALE: string = 'h'; public static STD: string = 'std'; - public static _Str_2028: string = '0'; + public static DEFAULT_FRAME: string = '0'; public static FACE: string = 'hd'; - public static HR: string = 'hr'; - public static HA: string = 'ha'; - public static HE: string = 'he'; - public static EA: string = 'ea'; - public static FA: string = 'fa'; - public static CC: string = 'cc'; - public static CH: string = 'ch'; + public static HAIR: string = 'hr'; + public static HAT: string = 'ha'; + public static HEAD_ACCESSORIES: string = 'he'; + public static EYE_ACCESSORIES: string = 'ea'; + public static FACE_ACCESSORIES: string = 'fa'; + public static JACKET: string = 'cc'; + public static SHIRT: string = 'ch'; public static CHEST_ACCESSORIES: string = 'ca'; public static CHEST_PRINTS: string = 'cp'; - public static LG: string = 'lg'; - public static SH: string = 'sh'; - public static WA: string = 'wa'; + public static TROUSERS: string = 'lg'; + public static SHOES: string = 'sh'; + public static TROUSER_ACCESSORIES: string = 'wa'; private _view: FigureDataView; private _data: Map; @@ -170,18 +170,18 @@ export class FigureData implements IAvatarImageListener switch(k) { case FigureData.FACE: - case FigureData.HR: - case FigureData.HA: - case FigureData.HE: - case FigureData.EA: - case FigureData.FA: - case FigureData.CH: - case FigureData.CC: + case FigureData.HAIR: + case FigureData.HAT: + case FigureData.HEAD_ACCESSORIES: + case FigureData.EYE_ACCESSORIES: + case FigureData.FACE_ACCESSORIES: + case FigureData.SHIRT: + case FigureData.JACKET: case FigureData.CHEST_ACCESSORIES: case FigureData.CHEST_PRINTS: - case FigureData.LG: - case FigureData.SH: - case FigureData.WA: + case FigureData.TROUSERS: + case FigureData.SHOES: + case FigureData.TROUSER_ACCESSORIES: if(_arg_2 >= 0) { this._data.set(k, _arg_2); @@ -201,18 +201,18 @@ export class FigureData implements IAvatarImageListener switch(k) { case FigureData.FACE: - case FigureData.HR: - case FigureData.HA: - case FigureData.HE: - case FigureData.EA: - case FigureData.FA: - case FigureData.CH: - case FigureData.CC: + case FigureData.HAIR: + case FigureData.HAT: + case FigureData.HEAD_ACCESSORIES: + case FigureData.EYE_ACCESSORIES: + case FigureData.FACE_ACCESSORIES: + case FigureData.SHIRT: + case FigureData.JACKET: case FigureData.CHEST_ACCESSORIES: case FigureData.CHEST_PRINTS: - case FigureData.LG: - case FigureData.SH: - case FigureData.WA: + case FigureData.TROUSERS: + case FigureData.SHOES: + case FigureData.TROUSER_ACCESSORIES: this._colors.set(k, _arg_2); break; } @@ -308,4 +308,4 @@ export class FigureData implements IAvatarImageListener this._direction = k; this.updateView(); } -} \ No newline at end of file +} diff --git a/src/nitro/utils/FigureDataContainer.ts b/src/nitro/utils/FigureDataContainer.ts index fb7422b3..d45641e5 100644 --- a/src/nitro/utils/FigureDataContainer.ts +++ b/src/nitro/utils/FigureDataContainer.ts @@ -1,25 +1,25 @@ export class FigureDataContainer { - private static M: string = 'M'; - private static F: string = 'F'; - private static U: string = 'U'; - private static H: string = 'h'; + private static MALE: string = 'M'; + private static FEMALE: string = 'F'; + private static UNISEX: string = 'U'; + private static SCALE: string = 'h'; private static STD: string = 'std'; - private static _Str_2028: string = '0'; + private static DEFAULT_FRAME: string = '0'; private static HD: string = 'hd'; - private static HR: string = 'hr'; - private static HA: string = 'ha'; - private static HE: string = 'he'; - private static EA: string = 'ea'; - private static FA: string = 'fa'; - private static CC: string = 'cc'; - private static CH: string = 'ch'; - private static CA: string = 'ca'; - private static CP: string = 'cp'; - private static LG: string = 'lg'; - private static SH: string = 'sh'; - private static WA: string = 'wa'; - private static _Str_1329: number[] = [28, 29, 30, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 68]; + private static HAIR: string = 'hr'; + private static HAT: string = 'ha'; + private static HEAD_ACCESSORIES: string = 'he'; + private static EYE_ACCESSORIES: string = 'ea'; + private static FACE_ACCESSORIES: string = 'fa'; + private static JACKET: string = 'cc'; + private static SHIRT: string = 'ch'; + private static CHEST_ACCESSORIES: string = 'ca'; + private static CHEST_PRINTS: string = 'cp'; + private static TROUSERS: string = 'lg'; + private static SHOES: string = 'sh'; + private static TROUSER_ACCESSORIES: string = 'wa'; + private static BLOCKED_FX_TYPES: number[] = [28, 29, 30, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 68]; private _data: Map; private _colors: Map; @@ -27,13 +27,13 @@ private _isDisposed: boolean; private _avatarEffectType: number = -1; - public _Str_2153(k: string, _arg_2: string): void + public loadAvatarData(k: string, _arg_2: string): void { this._data = new Map(); this._colors = new Map(); this._gender = _arg_2; - this._Str_958(k); + this.parseFigureString(k); } public dispose(): void @@ -48,7 +48,7 @@ return this._isDisposed; } - private _Str_958(k: string): void + private parseFigureString(k: string): void { if(!k) return; @@ -73,20 +73,20 @@ if(!colors.length) colors.push(0); - this._Str_1876(part, setId, false); + this.savePartSetId(part, setId, false); this.savePartSetColourId(part, colors, false); } } } - public _Str_2131(k: string): boolean + public hasSetType(k: string): boolean { return !!this._data.get(k); } public getPartSetId(k: string): number { - if(this._Str_2131(k)) return this._data.get(k); + if(this.hasSetType(k)) return this._data.get(k); return -1; } @@ -129,29 +129,29 @@ return figure; } - public _Str_2088(k: string, _arg_2: number, _arg_3: number[], _arg_4: boolean = false): void + public savePartData(k: string, _arg_2: number, _arg_3: number[], _arg_4: boolean = false): void { - this._Str_1876(k, _arg_2, _arg_4); + this.savePartSetId(k, _arg_2, _arg_4); this.savePartSetColourId(k, _arg_3, _arg_4); } - private _Str_1876(k: string, _arg_2: number, _arg_3: boolean = true): void + private savePartSetId(k: string, _arg_2: number, _arg_3: boolean = true): void { switch(k) { case FigureDataContainer.HD: - case FigureDataContainer.HR: - case FigureDataContainer.HA: - case FigureDataContainer.HE: - case FigureDataContainer.EA: - case FigureDataContainer.FA: - case FigureDataContainer.CH: - case FigureDataContainer.CC: - case FigureDataContainer.CA: - case FigureDataContainer.CP: - case FigureDataContainer.LG: - case FigureDataContainer.SH: - case FigureDataContainer.WA: + case FigureDataContainer.HAIR: + case FigureDataContainer.HAT: + case FigureDataContainer.HEAD_ACCESSORIES: + case FigureDataContainer.EYE_ACCESSORIES: + case FigureDataContainer.FACE_ACCESSORIES: + case FigureDataContainer.SHIRT: + case FigureDataContainer.JACKET: + case FigureDataContainer.CHEST_ACCESSORIES: + case FigureDataContainer.CHEST_PRINTS: + case FigureDataContainer.TROUSERS: + case FigureDataContainer.SHOES: + case FigureDataContainer.TROUSER_ACCESSORIES: if(_arg_2 >= 0) { this._data.set(k, _arg_2); @@ -168,18 +168,18 @@ switch(k) { case FigureDataContainer.HD: - case FigureDataContainer.HR: - case FigureDataContainer.HA: - case FigureDataContainer.HE: - case FigureDataContainer.EA: - case FigureDataContainer.FA: - case FigureDataContainer.CH: - case FigureDataContainer.CC: - case FigureDataContainer.CA: - case FigureDataContainer.CP: - case FigureDataContainer.LG: - case FigureDataContainer.SH: - case FigureDataContainer.WA: + case FigureDataContainer.HAIR: + case FigureDataContainer.HAT: + case FigureDataContainer.HEAD_ACCESSORIES: + case FigureDataContainer.EYE_ACCESSORIES: + case FigureDataContainer.FACE_ACCESSORIES: + case FigureDataContainer.SHIRT: + case FigureDataContainer.JACKET: + case FigureDataContainer.CHEST_ACCESSORIES: + case FigureDataContainer.CHEST_PRINTS: + case FigureDataContainer.TROUSERS: + case FigureDataContainer.SHOES: + case FigureDataContainer.TROUSER_ACCESSORIES: this._colors.set(k, _arg_2); return; } diff --git a/src/room/RoomManager.ts b/src/room/RoomManager.ts index 65449995..1363bf1e 100644 --- a/src/room/RoomManager.ts +++ b/src/room/RoomManager.ts @@ -16,12 +16,12 @@ import { RoomObjectManager } from './RoomObjectManager'; export class RoomManager extends NitroManager implements IRoomManager, IRoomInstanceContainer { - public static _Str_9994: number = -1; - public static _Str_16337: number = 0; - public static _Str_16443: number = 1; - public static _Str_13904: number = 2; - public static _Str_9846: number = 3; - private static _Str_18280: number = 40; + public static ROOM_MANAGER_ERROR: number = -1; + public static ROOM_MANAGER_LOADING: number = 0; + public static ROOM_MANAGER_LOADED: number = 1; + public static ROOM_MANAGER_INITIALIZING: number = 2; + public static ROOM_MANAGER_INITIALIZED: number = 3; + private static CONTENT_PROCESSING_TIME_LIMIT_MILLISECONDS: number = 40; private _state: number; private _rooms: Map; @@ -42,7 +42,7 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst { super(); - this._state = RoomManager._Str_16443; + this._state = RoomManager.ROOM_MANAGER_LOADED; this._rooms = new Map(); this._contentLoader = null; this._updateCategories = []; @@ -66,7 +66,7 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst public onInit(): void { - if(this._state >= RoomManager._Str_13904 || !this._contentLoader) return; + if(this._state >= RoomManager.ROOM_MANAGER_INITIALIZING || !this._contentLoader) return; const mandatoryLibraries = RoomContentLoader.MANDATORY_LIBRARIES; @@ -82,7 +82,7 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst } } - this._state = RoomManager._Str_13904; + this._state = RoomManager.ROOM_MANAGER_INITIALIZING; } public getRoomInstance(roomId: string): IRoomInstance @@ -347,9 +347,9 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst private removeFromInitialLoad(type: string): void { - if(!type || this._state === RoomManager._Str_9994) return; + if(!type || this._state === RoomManager.ROOM_MANAGER_ERROR) return; - if(!this._contentLoader) this._state = RoomManager._Str_9994; + if(!this._contentLoader) this._state = RoomManager.ROOM_MANAGER_ERROR; if(this._contentLoader.getCollection(type)) { @@ -359,7 +359,7 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst if(!this._initialLoadList.length) { - this._state = RoomManager._Str_9846; + this._state = RoomManager.ROOM_MANAGER_INITIALIZED; if(this._listener) { @@ -369,7 +369,7 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst } else { - this._state = RoomManager._Str_9994; + this._state = RoomManager.ROOM_MANAGER_ERROR; if(this._listener) this._listener.onRoomEngineInitalized(false); } @@ -409,4 +409,4 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst { return this._disposed; } -} \ No newline at end of file +} From 69b550c98237ff9abfce79a7e66f4302456942f4 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 6 Jun 2021 22:41:02 -0500 Subject: [PATCH 044/155] cleaned AlphaTolerance --- .../object/visualization/avatar/AvatarVisualization.ts | 2 +- .../visualization/furniture/FurnitureVisualization.ts | 4 ++-- .../room/object/visualization/room/RoomVisualization.ts | 4 ++-- src/room/object/enum/AlphaTolerance.ts | 8 ++++---- src/room/object/visualization/RoomObjectSprite.ts | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts index 79ae4390..2b6eaaa1 100644 --- a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts +++ b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts @@ -393,7 +393,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement if(sprite) { - sprite.alphaTolerance = AlphaTolerance._Str_9268; + sprite.alphaTolerance = AlphaTolerance.MATCH_NOTHING; sprite.visible = true; const layerData = this._avatarImage.getLayerData(spriteData); diff --git a/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts index 6cdecc42..dce042f7 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts @@ -301,7 +301,7 @@ export class FurnitureVisualization extends RoomObjectSpriteVisualization sprite.offsetX = (assetData.offsetX + this.getLayerXOffset(scale, this._direction, layerId)); sprite.offsetY = (assetData.offsetY + this.getLayerYOffset(scale, this._direction, layerId)); sprite.blendMode = this.getLayerInk(scale, this._direction, layerId); - sprite.alphaTolerance = (this.getLayerIgnoreMouse(scale, this._direction, layerId) ? AlphaTolerance._Str_9268 : AlphaTolerance._Str_9735); + sprite.alphaTolerance = (this.getLayerIgnoreMouse(scale, this._direction, layerId) ? AlphaTolerance.MATCH_NOTHING : AlphaTolerance.MATCH_OPAQUE_PIXELS); relativeDepth = this.getLayerZOffset(scale, this._direction, layerId); relativeDepth = (relativeDepth - (layerId * 0.001)); @@ -311,7 +311,7 @@ export class FurnitureVisualization extends RoomObjectSpriteVisualization sprite.offsetX = assetData.offsetX; sprite.offsetY = (assetData.offsetY + this.getLayerYOffset(scale, this._direction, layerId)); sprite.alpha = (48 * this._alphaMultiplier); - sprite.alphaTolerance = AlphaTolerance._Str_9268; + sprite.alphaTolerance = AlphaTolerance.MATCH_NOTHING; relativeDepth = 1; } diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index 91da3e89..23ace882 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -647,11 +647,11 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { if((plane.type === RoomPlane.TYPE_WALL) && ((plane.leftSide.length < 1) || (plane.rightSide.length < 1))) { - sprite.alphaTolerance = AlphaTolerance._Str_9268; + sprite.alphaTolerance = AlphaTolerance.MATCH_NOTHING; } else { - sprite.alphaTolerance = AlphaTolerance._Str_9735; + sprite.alphaTolerance = AlphaTolerance.MATCH_OPAQUE_PIXELS; } if(plane.type === RoomPlane.TYPE_WALL) diff --git a/src/room/object/enum/AlphaTolerance.ts b/src/room/object/enum/AlphaTolerance.ts index a65d6fd2..3f41a289 100644 --- a/src/room/object/enum/AlphaTolerance.ts +++ b/src/room/object/enum/AlphaTolerance.ts @@ -1,6 +1,6 @@ export class AlphaTolerance { - public static _Str_16646: number = -1; - public static _Str_9735: number = 128; - public static _Str_9268: number = 256; -} \ No newline at end of file + public static MATCH_ALL_PIXELS: number = -1; + public static MATCH_OPAQUE_PIXELS: number = 128; + public static MATCH_NOTHING: number = 256; +} diff --git a/src/room/object/visualization/RoomObjectSprite.ts b/src/room/object/visualization/RoomObjectSprite.ts index 0777cd6b..62ef73b0 100644 --- a/src/room/object/visualization/RoomObjectSprite.ts +++ b/src/room/object/visualization/RoomObjectSprite.ts @@ -65,7 +65,7 @@ export class RoomObjectSprite implements IRoomObjectSprite this._visible = true; this._tag = ''; this._posture = null; - this._alphaTolerance = AlphaTolerance._Str_9735; + this._alphaTolerance = AlphaTolerance.MATCH_OPAQUE_PIXELS; this._filters = []; this._updateCounter = 0; From 2719fad043bf0aa18902bd61134e0dcf5969cc91 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 6 Jun 2021 23:18:29 -0500 Subject: [PATCH 045/155] cleaned Matrix4x4 --- .../avatar/geometry/AvatarModelGeometry.ts | 6 ++--- src/nitro/avatar/geometry/GeometryBodyPart.ts | 8 +++--- src/nitro/avatar/geometry/GeometryItem.ts | 8 +++--- src/nitro/avatar/geometry/Matrix4x4.ts | 26 +++++++++---------- src/nitro/avatar/geometry/Node3D.ts | 8 +++--- 5 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/nitro/avatar/geometry/AvatarModelGeometry.ts b/src/nitro/avatar/geometry/AvatarModelGeometry.ts index 8fdff310..11d044d8 100644 --- a/src/nitro/avatar/geometry/AvatarModelGeometry.ts +++ b/src/nitro/avatar/geometry/AvatarModelGeometry.ts @@ -238,13 +238,13 @@ export class AvatarModelGeometry const sets: [ number, GeometryBodyPart ][] = []; const ids: string[] = []; - this._transformation = Matrix4x4._Str_1560(_arg_2); + this._transformation = Matrix4x4.getYRotationMatrix(_arg_2); for(const part of parts.values()) { if(!part) continue; - part._Str_1101(this._transformation); + part.applyTransform(this._transformation); sets.push([ part._Str_1522(this._camera), part ]); } @@ -277,7 +277,7 @@ export class AvatarModelGeometry { const part = this._Str_1280(k).get(_arg_2); - this._transformation = Matrix4x4._Str_1560(_arg_3); + this._transformation = Matrix4x4.getYRotationMatrix(_arg_3); return part.getParts(this._transformation, this._camera, _arg_4, _arg_5); } diff --git a/src/nitro/avatar/geometry/GeometryBodyPart.ts b/src/nitro/avatar/geometry/GeometryBodyPart.ts index 70c9a07f..8b09ab22 100644 --- a/src/nitro/avatar/geometry/GeometryBodyPart.ts +++ b/src/nitro/avatar/geometry/GeometryBodyPart.ts @@ -129,7 +129,7 @@ export class GeometryBodyPart extends Node3D { if(!part) continue; - part._Str_1101(k); + part.applyTransform(k); parts.push([ part._Str_1522(_arg_2), part ]); } @@ -144,7 +144,7 @@ export class GeometryBodyPart extends Node3D if(!part) continue; - part._Str_1101(k); + part.applyTransform(k); parts.push([ part._Str_1522(_arg_2), part ]); } @@ -176,8 +176,8 @@ export class GeometryBodyPart extends Node3D public _Str_1522(k: Vector3D): number { - const _local_2 = Math.abs(((k.z - this._Str_1604.z) - this._radius)); - const _local_3 = Math.abs(((k.z - this._Str_1604.z) + this._radius)); + const _local_2 = Math.abs(((k.z - this.transformedLocation.z) - this._radius)); + const _local_3 = Math.abs(((k.z - this.transformedLocation.z) + this._radius)); return Math.min(_local_2, _local_3); } diff --git a/src/nitro/avatar/geometry/GeometryItem.ts b/src/nitro/avatar/geometry/GeometryItem.ts index ee2b6e54..744950d4 100644 --- a/src/nitro/avatar/geometry/GeometryItem.ts +++ b/src/nitro/avatar/geometry/GeometryItem.ts @@ -22,8 +22,8 @@ export class GeometryItem extends Node3D public _Str_1522(k: Vector3D): number { - const _local_2 = Math.abs(((k.z - this._Str_1604.z) - this._radius)); - const _local_3 = Math.abs(((k.z - this._Str_1604.z) + this._radius)); + const _local_2 = Math.abs(((k.z - this.transformedLocation.z) - this._radius)); + const _local_3 = Math.abs(((k.z - this.transformedLocation.z) + this._radius)); return Math.min(_local_2, _local_3); } @@ -45,11 +45,11 @@ export class GeometryItem extends Node3D public toString(): string { - return ((((this._id + ': ') + this.location) + ' - ') + this._Str_1604); + return ((((this._id + ': ') + this.location) + ' - ') + this.transformedLocation); } public get _Str_1457(): boolean { return this._isDynamic; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/geometry/Matrix4x4.ts b/src/nitro/avatar/geometry/Matrix4x4.ts index 51f30f7c..d0914a20 100644 --- a/src/nitro/avatar/geometry/Matrix4x4.ts +++ b/src/nitro/avatar/geometry/Matrix4x4.ts @@ -12,7 +12,7 @@ export class Matrix4x4 this._data = [k, _arg_2, _arg_3, _arg_4, _arg_5, _arg_6, _arg_7, _arg_8, _arg_9]; } - public static _Str_1869(k: number): Matrix4x4 + public static getXRotationMatrix(k: number): Matrix4x4 { const _local_2 = ((k * Math.PI) / 180); const _local_3 = Math.cos(_local_2); @@ -21,7 +21,7 @@ export class Matrix4x4 return new Matrix4x4(1, 0, 0, 0, _local_3, -(_local_4), 0, _local_4, _local_3); } - public static _Str_1560(k: number): Matrix4x4 + public static getYRotationMatrix(k: number): Matrix4x4 { const _local_2 = ((k * Math.PI) / 180); const _local_3 = Math.cos(_local_2); @@ -30,7 +30,7 @@ export class Matrix4x4 return new Matrix4x4(_local_3, 0, _local_4, 0, 1, 0, -(_local_4), 0, _local_3); } - public static _Str_1368(k: number): Matrix4x4 + public static getZRotationMatrix(k: number): Matrix4x4 { const _local_2 = ((k * Math.PI) / 180); const _local_3 = Math.cos(_local_2); @@ -46,7 +46,7 @@ export class Matrix4x4 return this; } - public _Str_2186(k: Vector3D): Vector3D + public vectorMultiplication(k: Vector3D): Vector3D { const _local_2 = (((k.x * this._data[0]) + (k.y * this._data[3])) + (k.z * this._data[6])); const _local_3 = (((k.x * this._data[1]) + (k.y * this._data[4])) + (k.z * this._data[7])); @@ -55,7 +55,7 @@ export class Matrix4x4 return new Vector3D(_local_2, _local_3, _local_4); } - public _Str_1186(k:Matrix4x4): Matrix4x4 + public multiply(k:Matrix4x4): Matrix4x4 { const _local_2 = (((this._data[0] * k.data[0]) + (this._data[1] * k.data[3])) + (this._data[2] * k.data[6])); const _local_3 = (((this._data[0] * k.data[1]) + (this._data[1] * k.data[4])) + (this._data[2] * k.data[7])); @@ -70,7 +70,7 @@ export class Matrix4x4 return new Matrix4x4(_local_2, _local_3, _local_4, _local_5, _local_6, _local_7, _local_8, _local_9, _local_10); } - public _Str_1157(k: number): void + public scalarMultiply(k: number): void { let index = 0; @@ -82,41 +82,41 @@ export class Matrix4x4 } } - public _Str_1089(k: number): Matrix4x4 + public rotateX(k: number): Matrix4x4 { const _local_2 = ((k * Math.PI) / 180); const _local_3 = Math.cos(_local_2); const _local_4 = Math.sin(_local_2); const _local_5 = new Matrix4x4(1, 0, 0, 0, _local_3, -(_local_4), 0, _local_4, _local_3); - return _local_5._Str_1186(this); + return _local_5.multiply(this); } - public _Str_2123(k: number): Matrix4x4 + public rotateY(k: number): Matrix4x4 { const _local_2 = ((k * Math.PI) / 180); const _local_3 = Math.cos(_local_2); const _local_4 = Math.sin(_local_2); const _local_5 = new Matrix4x4(_local_3, 0, _local_4, 0, 1, 0, -(_local_4), 0, _local_3); - return _local_5._Str_1186(this); + return _local_5.multiply(this); } - public _Str_2232(k: number): Matrix4x4 + public rotateZ(k: number): Matrix4x4 { const _local_2 = ((k * Math.PI) / 180); const _local_3 = Math.cos(_local_2); const _local_4 = Math.sin(_local_2); const _local_5 = new Matrix4x4(_local_3, -(_local_4), 0, _local_4, _local_3, 0, 0, 0, 1); - return _local_5._Str_1186(this); + return _local_5.multiply(this); } public skew(): void { } - public _Str_1779(): Matrix4x4 + public transpose(): Matrix4x4 { return new Matrix4x4(this._data[0], this._data[3], this._data[6], this._data[1], this._data[4], this._data[7], this._data[2], this._data[5], this._data[8]); } diff --git a/src/nitro/avatar/geometry/Node3D.ts b/src/nitro/avatar/geometry/Node3D.ts index 1f52e5ac..7cbcf49c 100644 --- a/src/nitro/avatar/geometry/Node3D.ts +++ b/src/nitro/avatar/geometry/Node3D.ts @@ -21,13 +21,13 @@ export class Node3D return this._location; } - public get _Str_1604(): Vector3D + public get transformedLocation(): Vector3D { return this._transformedLocation; } - public _Str_1101(k: Matrix4x4): void + public applyTransform(k: Matrix4x4): void { - if(this._needsTransformation) this._transformedLocation = k._Str_2186(this._location); + if(this._needsTransformation) this._transformedLocation = k.vectorMultiplication(this._location); } -} \ No newline at end of file +} From c23d4a5a5573a51eb613b1e4c61af74de0cec7d9 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 6 Jun 2021 23:33:01 -0500 Subject: [PATCH 046/155] cleaned Motions --- src/nitro/window/motion/Motions.ts | 104 ++++++++++++++--------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/src/nitro/window/motion/Motions.ts b/src/nitro/window/motion/Motions.ts index 7514076c..cbb2c773 100644 --- a/src/nitro/window/motion/Motions.ts +++ b/src/nitro/window/motion/Motions.ts @@ -3,75 +3,75 @@ import { Motion } from './Motion'; export class Motions { - private static _Str_5358: Motion[] = []; - private static _Str_3932: Motion[] = []; - private static _Str_10731: Motion[] = []; - private static _Str_5307: ReturnType = null; - private static _Str_7507: boolean = false; + private static _QUEUED_MOTIONS: Motion[] = []; + private static _RUNNING_MOTIONS: Motion[] = []; + private static _REMOVED_MOTIONS: Motion[] = []; + private static _TIMER: ReturnType = null; + private static _IS_UPDATING: boolean = false; public static get TIMER_TIME(): number { return (1000 / Nitro.instance.ticker.FPS); } - public static _Str_4598(k: Motion): Motion + public static runMotion(k: Motion): Motion { - if(((Motions._Str_3932.indexOf(k) === -1) && (Motions._Str_5358.indexOf(k) === -1))) + if(((Motions._RUNNING_MOTIONS.indexOf(k) === -1) && (Motions._QUEUED_MOTIONS.indexOf(k) === -1))) { - if(Motions._Str_7507) + if(Motions._IS_UPDATING) { - Motions._Str_5358.push(k); + Motions._QUEUED_MOTIONS.push(k); } else { - Motions._Str_3932.push(k); + Motions._RUNNING_MOTIONS.push(k); k.start(); } - Motions._Str_12757(); + Motions.startTimer(); } return k; } - public static _Str_15790(k:Motion): void + public static removeMotion(k:Motion): void { - let _local_2: number = Motions._Str_3932.indexOf(k); + let _local_2: number = Motions._RUNNING_MOTIONS.indexOf(k); if(_local_2 > -1) { - if(Motions._Str_7507) + if(Motions._IS_UPDATING) { - _local_2 = Motions._Str_10731.indexOf(k); + _local_2 = Motions._REMOVED_MOTIONS.indexOf(k); - if(_local_2 == -1) Motions._Str_10731.push(k); + if(_local_2 == -1) Motions._REMOVED_MOTIONS.push(k); } else { - Motions._Str_3932.splice(_local_2, 1); + Motions._RUNNING_MOTIONS.splice(_local_2, 1); if(k.running) k.stop(); - if(!Motions._Str_3932.length) Motions._Str_7465(); + if(!Motions._RUNNING_MOTIONS.length) Motions.stopTimer(); } } else { - _local_2 = Motions._Str_5358.indexOf(k); + _local_2 = Motions._QUEUED_MOTIONS.indexOf(k); - if(_local_2 > -1) Motions._Str_5358.splice(_local_2, 1); + if(_local_2 > -1) Motions._QUEUED_MOTIONS.splice(_local_2, 1); } } - public static _Str_19320(k: string):Motion + public static getMotionByTag(k: string):Motion { - for(const _local_2 of Motions._Str_3932) + for(const _local_2 of Motions._RUNNING_MOTIONS) { if(_local_2.tag == k) return _local_2; } - for(const _local_2 of Motions._Str_5358) + for(const _local_2 of Motions._QUEUED_MOTIONS) { if(_local_2.tag == k) return _local_2; } @@ -79,14 +79,14 @@ export class Motions return null; } - public static _Str_9810(k: HTMLElement):Motion + public static getMotionByTarget(k: HTMLElement):Motion { - for(const _local_2 of Motions._Str_3932) + for(const _local_2 of Motions._RUNNING_MOTIONS) { if(_local_2.target == k) return _local_2; } - for(const _local_2 of Motions._Str_5358) + for(const _local_2 of Motions._QUEUED_MOTIONS) { if(_local_2.target == k) return _local_2; } @@ -94,14 +94,14 @@ export class Motions return null; } - public static _Str_26365(k: string, _arg_2: HTMLElement):Motion + public static getMotionByTagAndTarget(k: string, _arg_2: HTMLElement):Motion { - for(const _local_3 of Motions._Str_3932) + for(const _local_3 of Motions._RUNNING_MOTIONS) { if(((_local_3.tag == k) && (_local_3.target == _arg_2))) return _local_3; } - for(const _local_3 of Motions._Str_5358) + for(const _local_3 of Motions._QUEUED_MOTIONS) { if(((_local_3.tag == k) && (_local_3.target == _arg_2))) return _local_3; } @@ -109,36 +109,36 @@ export class Motions return null; } - public static get _Str_1349(): boolean + public static get isRunning(): boolean { - return !!Motions._Str_5307; + return !!Motions._TIMER; } - public static get _Str_26314(): boolean + public static get isUpdating(): boolean { - return Motions._Str_7507; + return Motions._IS_UPDATING; } - private static _Str_21055(): void + private static onTick(): void { - Motions._Str_7507 = true; + Motions._IS_UPDATING = true; const _local_2: number = Nitro.instance.time; let _local_3: Motion = null; // eslint-disable-next-line no-cond-assign - while(_local_3 = Motions._Str_5358.pop()) Motions._Str_3932.push(_local_3); + while(_local_3 = Motions._QUEUED_MOTIONS.pop()) Motions._RUNNING_MOTIONS.push(_local_3); // eslint-disable-next-line no-cond-assign - while(_local_3 = Motions._Str_10731.pop()) + while(_local_3 = Motions._REMOVED_MOTIONS.pop()) { - Motions._Str_3932.splice(Motions._Str_3932.indexOf(_local_3), 1); + Motions._RUNNING_MOTIONS.splice(Motions._RUNNING_MOTIONS.indexOf(_local_3), 1); if(_local_3.running) _local_3.stop(); } - for(_local_3 of Motions._Str_3932) + for(_local_3 of Motions._RUNNING_MOTIONS) { if(_local_3.running) { @@ -146,44 +146,44 @@ export class Motions if(_local_3.complete) { - Motions._Str_15790(_local_3); + Motions.removeMotion(_local_3); } } else { - Motions._Str_15790(_local_3); + Motions.removeMotion(_local_3); } } - if(!Motions._Str_3932.length) Motions._Str_7465(); + if(!Motions._RUNNING_MOTIONS.length) Motions.stopTimer(); - Motions._Str_7507 = false; + Motions._IS_UPDATING = false; } - private static _Str_12757(): void + private static startTimer(): void { - if(!Motions._Str_5307) + if(!Motions._TIMER) { - Motions._Str_5307 = setInterval(Motions._Str_21055, Motions.TIMER_TIME); + Motions._TIMER = setInterval(Motions.onTick, Motions.TIMER_TIME); } } - private static _Str_7465(): void + private static stopTimer(): void { - if(Motions._Str_5307) + if(Motions._TIMER) { - clearInterval(Motions._Str_5307); + clearInterval(Motions._TIMER); - Motions._Str_5307 = null; + Motions._TIMER = null; } } - public _Str_25883(k: HTMLElement): number + public getNumRunningMotions(k: HTMLElement): number { let _local_2 = 0; - for(const _local_3 of Motions._Str_3932) + for(const _local_3 of Motions._RUNNING_MOTIONS) { if(_local_3.target === k) _local_2++; } From c88cca1bf7df41903cc5b30680bd0d983b9db64f Mon Sep 17 00:00:00 2001 From: Dank074 Date: Mon, 7 Jun 2021 00:01:12 -0500 Subject: [PATCH 047/155] cleaned RoomSessionPollEvent --- src/nitro/avatar/geometry/Vector3D.ts | 10 +- src/nitro/room/PetColorResult.ts | 14 +-- .../furniture/FurnitureFloorHoleLogic.ts | 22 ++-- .../session/events/RoomSessionPollEvent.ts | 109 +++++++++++++----- .../session/events/RoomSessionVoteEvent.ts | 49 ++++++++ src/nitro/session/events/_Str_3051.ts | 100 ---------------- src/nitro/session/events/index.ts | 2 +- 7 files changed, 153 insertions(+), 153 deletions(-) create mode 100644 src/nitro/session/events/RoomSessionVoteEvent.ts delete mode 100644 src/nitro/session/events/_Str_3051.ts diff --git a/src/nitro/avatar/geometry/Vector3D.ts b/src/nitro/avatar/geometry/Vector3D.ts index 1f9cfb39..4bdc821d 100644 --- a/src/nitro/avatar/geometry/Vector3D.ts +++ b/src/nitro/avatar/geometry/Vector3D.ts @@ -11,12 +11,12 @@ this._z = _arg_3; } - public static _Str_2224(k: Vector3D, _arg_2: Vector3D): number + public static dot(k: Vector3D, _arg_2: Vector3D): number { return ((k.x * _arg_2.x) + (k.y * _arg_2.y)) + (k.z * _arg_2.z); } - public static _Str_1645(k: Vector3D, _arg_2: Vector3D): Vector3D + public static cross(k: Vector3D, _arg_2: Vector3D): Vector3D { const _local_3 = new Vector3D(); @@ -32,12 +32,12 @@ return new Vector3D((k.x - _arg_2.x), (k.y - _arg_2.y), (k.z - _arg_2.z)); } - public _Str_2224(k: Vector3D): number + public dot(k: Vector3D): number { return ((this._x * k.x) + (this._y * k.y)) + (this._z * k.z); } - public _Str_1645(k: Vector3D): Vector3D + public cross(k: Vector3D): Vector3D { const _local_2 = new Vector3D(); @@ -110,4 +110,4 @@ { this._z = k; } -} \ No newline at end of file +} diff --git a/src/nitro/room/PetColorResult.ts b/src/nitro/room/PetColorResult.ts index 6a471b26..71710a02 100644 --- a/src/nitro/room/PetColorResult.ts +++ b/src/nitro/room/PetColorResult.ts @@ -1,6 +1,6 @@ export class PetColorResult { - private static _Str_12950: string[] = ['Null', 'Black', 'White', 'Grey', 'Red', 'Orange', 'Pink', 'Green', 'Lime', 'Blue', 'Light-Blue', 'Dark-Blue', 'Yellow', 'Brown', 'Dark-Brown', 'Beige', 'Cyan', 'Purple', 'Gold']; + private static COLOR_TAGS: string[] = ['Null', 'Black', 'White', 'Grey', 'Red', 'Orange', 'Pink', 'Green', 'Lime', 'Blue', 'Light-Blue', 'Dark-Blue', 'Yellow', 'Brown', 'Dark-Brown', 'Beige', 'Cyan', 'Purple', 'Gold']; private _breed: number; private _tag: string; @@ -16,18 +16,18 @@ export class PetColorResult this._primaryColor = (k & 0xFFFFFF); this._secondaryColor = (_arg_2 & 0xFFFFFF); this._breed = _arg_3; - this._tag = (((_arg_4 > -1) && (_arg_4 < PetColorResult._Str_12950.length)) ? PetColorResult._Str_12950[_arg_4] : ''); + this._tag = (((_arg_4 > -1) && (_arg_4 < PetColorResult.COLOR_TAGS.length)) ? PetColorResult.COLOR_TAGS[_arg_4] : ''); this._id = _arg_5; this._isMaster = _arg_6; this._layerTags = _arg_7; } - public get _Str_5845(): number + public get primaryColor(): number { return this._primaryColor; } - public get _Str_6659(): number + public get secondaryColor(): number { return this._secondaryColor; } @@ -47,13 +47,13 @@ export class PetColorResult return this._id; } - public get _Str_11964(): boolean + public get isMaster(): boolean { return this._isMaster; } - public get _Str_24801(): string[] + public get layerTags(): string[] { return this._layerTags; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureFloorHoleLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureFloorHoleLogic.ts index 1da4f465..7ed86b9c 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureFloorHoleLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureFloorHoleLogic.ts @@ -7,7 +7,7 @@ import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; export class FurnitureFloorHoleLogic extends FurnitureMultiStateLogic { - private static _Str_9306: number = 0; + private static STATE_HOLE: number = 0; private _currentState: number; private _currentLocation: Vector3d; @@ -29,7 +29,7 @@ export class FurnitureFloorHoleLogic extends FurnitureMultiStateLogic public dispose(): void { - if(this._currentState === FurnitureFloorHoleLogic._Str_9306) + if(this._currentState === FurnitureFloorHoleLogic.STATE_HOLE) { this.eventDispatcher.dispatchEvent(new RoomObjectFloorHoleEvent(RoomObjectFloorHoleEvent.REMOVE_HOLE, this.object)); } @@ -41,7 +41,7 @@ export class FurnitureFloorHoleLogic extends FurnitureMultiStateLogic { super.update(time); - this._Str_25016(); + this.handleAutomaticStateUpdate(); } public processUpdateMessage(message: RoomObjectUpdateMessage): void @@ -52,7 +52,7 @@ export class FurnitureFloorHoleLogic extends FurnitureMultiStateLogic if(message instanceof ObjectDataUpdateMessage) { - this._Str_21445(this.object.getState(0)); + this.handleStateUpdate(this.object.getState(0)); } const location = this.object.getLocation(); @@ -65,7 +65,7 @@ export class FurnitureFloorHoleLogic extends FurnitureMultiStateLogic { if((location.x !== this._currentLocation.x) || (location.y !== this._currentLocation.y)) { - if(this._currentState === FurnitureFloorHoleLogic._Str_9306) + if(this._currentState === FurnitureFloorHoleLogic.STATE_HOLE) { if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectFloorHoleEvent(RoomObjectFloorHoleEvent.ADD_HOLE, this.object)); } @@ -75,18 +75,18 @@ export class FurnitureFloorHoleLogic extends FurnitureMultiStateLogic this._currentLocation.assign(location); } - private _Str_21445(state: number): void + private handleStateUpdate(state: number): void { if(state === this._currentState) return; if(this.eventDispatcher) { - if(state === FurnitureFloorHoleLogic._Str_9306) + if(state === FurnitureFloorHoleLogic.STATE_HOLE) { this.eventDispatcher.dispatchEvent(new RoomObjectFloorHoleEvent(RoomObjectFloorHoleEvent.ADD_HOLE, this.object)); } - else if(this._currentState === FurnitureFloorHoleLogic._Str_9306) + else if(this._currentState === FurnitureFloorHoleLogic.STATE_HOLE) { this.eventDispatcher.dispatchEvent(new RoomObjectFloorHoleEvent(RoomObjectFloorHoleEvent.REMOVE_HOLE, this.object)); } @@ -95,7 +95,7 @@ export class FurnitureFloorHoleLogic extends FurnitureMultiStateLogic this._currentState = state; } - private _Str_25016(): void + private handleAutomaticStateUpdate(): void { if(!this.object) return; @@ -105,6 +105,6 @@ export class FurnitureFloorHoleLogic extends FurnitureMultiStateLogic const stateIndex = model.getValue(RoomObjectVariable.FURNITURE_AUTOMATIC_STATE_INDEX); - if(!isNaN(stateIndex)) this._Str_21445((stateIndex % 2)); + if(!isNaN(stateIndex)) this.handleStateUpdate((stateIndex % 2)); } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionPollEvent.ts b/src/nitro/session/events/RoomSessionPollEvent.ts index 87ea2e98..704af576 100644 --- a/src/nitro/session/events/RoomSessionPollEvent.ts +++ b/src/nitro/session/events/RoomSessionPollEvent.ts @@ -1,49 +1,100 @@ -import { IRoomSession } from '../IRoomSession'; -import { RoomSessionEvent } from './RoomSessionEvent'; +import { RoomSessionEvent } from 'nitro-renderer/src/nitro/session/events/RoomSessionEvent'; +import { IRoomSession } from 'nitro-renderer/src/nitro/session/IRoomSession'; export class RoomSessionPollEvent extends RoomSessionEvent { - public static VOTE_QUESTION: string = 'RSPE_VOTE_QUESTION'; - public static VOTE_RESULT: string = 'RSPE_VOTE_RESULT'; + public static OFFER: string = 'RSPE_POLL_OFFER'; + public static ERROR: string = 'RSPE_POLL_ERROR'; + public static CONTENT: string = 'RSPE_POLL_CONTENT'; - private _question: string = ''; - private _choices: string[]; - private _SafeStr_7651: string[]; - private _SafeStr_7654: number = 0; + private _id: number = -1; + private _headline: string; + private _summary: string; + private _numQuestions: number = 0; + private _startMessage: string = ''; + private _endMessage: string = ''; + private _questionArray: string[] = null; + private _npsPoll: boolean = false; - constructor(_arg_1: string, _arg_2: IRoomSession, _arg_3: string, _arg_4: string[], _arg_5: string[]=null, _arg_6: number=0) + constructor(k: string, _arg_2: IRoomSession, _arg_3: number) { - super(_arg_1, _arg_2); + super(k, _arg_2); - this._choices = []; - this._SafeStr_7651 = []; - this._question = _arg_3; - this._choices = _arg_4; - this._SafeStr_7651 = _arg_5; - if(this._SafeStr_7651 == null) - { - this._SafeStr_7651 = []; - } - this._SafeStr_7654 = _arg_6; + this._id = _arg_3; } - public get question(): string + public get id(): number { - return this._question; + return this._id; } - public get choices(): string[] + public get headline(): string { - return this._choices.slice(); + return this._headline; } - public get _SafeStr_4173(): string[] + public set headline(k: string) { - return this._SafeStr_7651.slice(); + this._headline = k; } - public get _SafeStr_4174(): number + public get summary(): string { - return this._SafeStr_7654; + return this._summary; } -} \ No newline at end of file + + public set summary(k: string) + { + this._summary = k; + } + + public get numQuestions(): number + { + return this._numQuestions; + } + + public set numQuestions(k: number) + { + this._numQuestions = k; + } + + public get startMessage(): string + { + return this._startMessage; + } + + public set startMessage(k: string) + { + this._startMessage = k; + } + + public get endMessage(): string + { + return this._endMessage; + } + + public set endMessage(k: string) + { + this._endMessage = k; + } + + public get questionArray(): string[] + { + return this._questionArray; + } + + public set questionArray(k: string[]) + { + this._questionArray = k; + } + + public get npsPoll(): boolean + { + return this._npsPoll; + } + + public set npsPoll(k: boolean) + { + this._npsPoll = k; + } +} diff --git a/src/nitro/session/events/RoomSessionVoteEvent.ts b/src/nitro/session/events/RoomSessionVoteEvent.ts new file mode 100644 index 00000000..c0f59bc1 --- /dev/null +++ b/src/nitro/session/events/RoomSessionVoteEvent.ts @@ -0,0 +1,49 @@ +import { RoomSessionEvent } from 'nitro-renderer/src/nitro/session/events/RoomSessionEvent'; +import { IRoomSession } from 'nitro-renderer/src/nitro/session/IRoomSession'; + +export class RoomSessionVoteEvent extends RoomSessionEvent +{ + public static VOTE_QUESTION: string = 'RSPE_VOTE_QUESTION'; + public static VOTE_RESULT: string = 'RSPE_VOTE_RESULT'; + + private _question: string = ''; + private _choices: string[]; + private _SafeStr_7651: string[]; + private _SafeStr_7654: number = 0; + + constructor(_arg_1: string, _arg_2: IRoomSession, _arg_3: string, _arg_4: string[], _arg_5: string[]=null, _arg_6: number=0) + { + super(_arg_1, _arg_2); + + this._choices = []; + this._SafeStr_7651 = []; + this._question = _arg_3; + this._choices = _arg_4; + this._SafeStr_7651 = _arg_5; + if(this._SafeStr_7651 == null) + { + this._SafeStr_7651 = []; + } + this._SafeStr_7654 = _arg_6; + } + + public get question(): string + { + return this._question; + } + + public get choices(): string[] + { + return this._choices.slice(); + } + + public get _SafeStr_4173(): string[] + { + return this._SafeStr_7651.slice(); + } + + public get _SafeStr_4174(): number + { + return this._SafeStr_7654; + } +} diff --git a/src/nitro/session/events/_Str_3051.ts b/src/nitro/session/events/_Str_3051.ts deleted file mode 100644 index 673870b8..00000000 --- a/src/nitro/session/events/_Str_3051.ts +++ /dev/null @@ -1,100 +0,0 @@ -import { IRoomSession } from '../IRoomSession'; -import { RoomSessionEvent } from './RoomSessionEvent'; - -export class _Str_3051 extends RoomSessionEvent -{ - public static RSPE_POLL_OFFER: string = 'RSPE_POLL_OFFER'; - public static ERROR: string = 'RSPE_POLL_ERROR'; - public static RSPE_POLL_CONTENT: string = 'RSPE_POLL_CONTENT'; - - private _id: number = -1; - private _headline: string; - private _summary: string; - private _Str_5366: number = 0; - private _Str_5879: string = ''; - private _Str_4781: string = ''; - private _Str_5432: string[] = null; - private _Str_4353: boolean = false; - - constructor(k: string, _arg_2: IRoomSession, _arg_3: number) - { - super(k, _arg_2); - - this._id = _arg_3; - } - - public get id(): number - { - return this._id; - } - - public get headline(): string - { - return this._headline; - } - - public set headline(k: string) - { - this._headline = k; - } - - public get summary(): string - { - return this._summary; - } - - public set summary(k: string) - { - this._summary = k; - } - - public get _Str_6760(): number - { - return this._Str_5366; - } - - public set _Str_6760(k: number) - { - this._Str_5366 = k; - } - - public get _Str_6013(): string - { - return this._Str_5879; - } - - public set _Str_6013(k: string) - { - this._Str_5879 = k; - } - - public get _Str_5838(): string - { - return this._Str_4781; - } - - public set _Str_5838(k: string) - { - this._Str_4781 = k; - } - - public get _Str_5643(): string[] - { - return this._Str_5432; - } - - public set _Str_5643(k: string[]) - { - this._Str_5432 = k; - } - - public get _Str_6196(): boolean - { - return this._Str_4353; - } - - public set _Str_6196(k: boolean) - { - this._Str_4353 = k; - } -} \ No newline at end of file diff --git a/src/nitro/session/events/index.ts b/src/nitro/session/events/index.ts index 913d6040..304e2245 100644 --- a/src/nitro/session/events/index.ts +++ b/src/nitro/session/events/index.ts @@ -29,7 +29,7 @@ export * from './RoomSessionUserBadgesEvent'; export * from './RoomSessionUserDataUpdateEvent'; export * from './RoomSessionUserFigureUpdateEvent'; export * from './RoomSessionUserTagsEvent'; +export * from './RoomSessionVoteEvent'; export * from './RoomSessionWordQuizEvent'; export * from './SessionDataPreferencesEvent'; export * from './UserNameUpdateEvent'; -export * from './_Str_3051'; From 8ef477ea806350502d42a8c3482bcbc249cd1a2f Mon Sep 17 00:00:00 2001 From: Dank074 Date: Mon, 7 Jun 2021 01:10:53 -0500 Subject: [PATCH 048/155] cleaned Randomizer --- .../FurnitureParticleSystemEmitter.ts | 78 +++++++++---------- .../FurnitureParticleSystemParticle.ts | 20 ++--- .../object/visualization/room/RoomPlane.ts | 4 +- .../rasterizer/animated/LandscapePlane.ts | 2 +- .../animated/LandscapeRasterizer.ts | 8 +- .../rasterizer/basic/PlaneMaterialCell.ts | 2 +- .../basic/PlaneMaterialCellMatrix.ts | 2 +- .../room/rasterizer/basic/PlaneRasterizer.ts | 2 +- .../rasterizer/basic/PlaneVisualization.ts | 8 +- .../visualization/room/utils/Randomizer.ts | 70 ++++++++--------- 10 files changed, 98 insertions(+), 98 deletions(-) diff --git a/src/nitro/room/object/visualization/furniture/FurnitureParticleSystemEmitter.ts b/src/nitro/room/object/visualization/furniture/FurnitureParticleSystemEmitter.ts index 01b9505f..32d33419 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureParticleSystemEmitter.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureParticleSystemEmitter.ts @@ -72,7 +72,7 @@ export class FurnitureParticleSystemEmitter extends FurnitureParticleSystemParti this.init(0, 0, 0, this._direction, this._force, this._timeStep, this._fuseTime, true); } - public _Str_17988(k:FurnitureParticleSystemEmitter, _arg_2: number): void + public copyStateFrom(k:FurnitureParticleSystemEmitter, _arg_2: number): void { super.copy(k, _arg_2); this._force = k._force; @@ -87,7 +87,7 @@ export class FurnitureParticleSystemEmitter extends FurnitureParticleSystemParti this._hasIgnited = k._hasIgnited; } - public _Str_24892(k: number, _arg_2: boolean, _arg_3: GraphicAsset[], _arg_4: boolean): void + public configureParticle(k: number, _arg_2: boolean, _arg_3: GraphicAsset[], _arg_4: boolean): void { const _local_5 = []; _local_5['lifeTime'] = k; @@ -104,17 +104,17 @@ export class FurnitureParticleSystemEmitter extends FurnitureParticleSystemParti { if(this.age > 1) { - this._Str_19068(this, this.direction); + this.releaseParticles(this, this.direction); } } } - private _Str_19068(k:FurnitureParticleSystemParticle, _arg_2: Vector3D = null): void + private releaseParticles(k:FurnitureParticleSystemParticle, _arg_2: Vector3D = null): void { if(!_arg_2) _arg_2 = new Vector3D(); const _local_3 = new Vector3D(); - const _local_5 = this._Str_23904(); + const _local_5 = this.getRandomParticleConfiguration(); let _local_10 = 0; @@ -123,19 +123,19 @@ export class FurnitureParticleSystemEmitter extends FurnitureParticleSystemParti switch(this._explosionShape) { case FurnitureParticleSystemEmitter.CONE: - _local_3.x = ((this._Str_7471(0.5)) ? Math.random() : -(Math.random())); + _local_3.x = ((this.randomBoolean(0.5)) ? Math.random() : -(Math.random())); _local_3.y = -(Math.random() + 1); - _local_3.z = ((this._Str_7471(0.5)) ? Math.random() : -(Math.random())); + _local_3.z = ((this.randomBoolean(0.5)) ? Math.random() : -(Math.random())); break; case FurnitureParticleSystemEmitter.PLANE: - _local_3.x = ((this._Str_7471(0.5)) ? Math.random() : -(Math.random())); + _local_3.x = ((this.randomBoolean(0.5)) ? Math.random() : -(Math.random())); _local_3.y = 0; - _local_3.z = ((this._Str_7471(0.5)) ? Math.random() : -(Math.random())); + _local_3.z = ((this.randomBoolean(0.5)) ? Math.random() : -(Math.random())); break; case FurnitureParticleSystemEmitter.SPHERE: - _local_3.x = ((this._Str_7471(0.5)) ? Math.random() : -(Math.random())); - _local_3.y = ((this._Str_7471(0.5)) ? Math.random() : -(Math.random())); - _local_3.z = ((this._Str_7471(0.5)) ? Math.random() : -(Math.random())); + _local_3.x = ((this.randomBoolean(0.5)) ? Math.random() : -(Math.random())); + _local_3.y = ((this.randomBoolean(0.5)) ? Math.random() : -(Math.random())); + _local_3.z = ((this.randomBoolean(0.5)) ? Math.random() : -(Math.random())); break; } @@ -171,7 +171,7 @@ export class FurnitureParticleSystemEmitter extends FurnitureParticleSystemParti } } - private _Str_23904() + private getRandomParticleConfiguration() { const k: number = Math.trunc(Math.floor((Math.random() * this._particleConfigurations.length))); return this._particleConfigurations[k]; @@ -180,35 +180,35 @@ export class FurnitureParticleSystemEmitter extends FurnitureParticleSystemParti public update(): void { super.update(); - this._Str_25039(); - this._Str_25400(); - this._Str_23140(); - if(((!(this._Str_16034)) && (this._emittedParticles < this._maxNumberOfParticles))) + this.accumulateForces(); + this.verlet(); + this.satisfyConstraints(); + if(((!(this.isAlive)) && (this._emittedParticles < this._maxNumberOfParticles))) { if((this.age % this._burstPulse) == 0) { - this._Str_19068(this, this.direction); + this.releaseParticles(this, this.direction); } } } - public _Str_25400(): void + public verlet(): void { let _local_2:FurnitureParticleSystemParticle; let _local_3: number; let _local_4: number; let _local_5: number; - if(((this._Str_16034) || (this._emittedParticles < this._maxNumberOfParticles))) + if(((this.isAlive) || (this._emittedParticles < this._maxNumberOfParticles))) { _local_3 = this.x; _local_4 = this.y; _local_5 = this.z; - this.x = (((2 - this._airFriction) * this.x) - ((1 - this._airFriction) * this._Str_10744)); - this.y = ((((2 - this._airFriction) * this.y) - ((1 - this._airFriction) * this._Str_12459)) + ((this._gravity * this._timeStep) * this._timeStep)); - this.z = (((2 - this._airFriction) * this.z) - ((1 - this._airFriction) * this._Str_11680)); - this._Str_10744 = _local_3; - this._Str_12459 = _local_4; - this._Str_11680 = _local_5; + this.x = (((2 - this._airFriction) * this.x) - ((1 - this._airFriction) * this.lastX)); + this.y = ((((2 - this._airFriction) * this.y) - ((1 - this._airFriction) * this.lastY)) + ((this._gravity * this._timeStep) * this._timeStep)); + this.z = (((2 - this._airFriction) * this.z) - ((1 - this._airFriction) * this.lastZ)); + this.lastX = _local_3; + this.lastY = _local_4; + this.lastZ = _local_5; } const k: FurnitureParticleSystemParticle[] = []; @@ -218,13 +218,13 @@ export class FurnitureParticleSystemEmitter extends FurnitureParticleSystemParti _local_3 = _local_2.x; _local_4 = _local_2.y; _local_5 = _local_2.z; - _local_2.x = (((2 - this._airFriction) * _local_2.x) - ((1 - this._airFriction) * _local_2._Str_10744)); - _local_2.y = ((((2 - this._airFriction) * _local_2.y) - ((1 - this._airFriction) * _local_2._Str_12459)) + ((this._gravity * this._timeStep) * this._timeStep)); - _local_2.z = (((2 - this._airFriction) * _local_2.z) - ((1 - this._airFriction) * _local_2._Str_11680)); - _local_2._Str_10744 = _local_3; - _local_2._Str_12459 = _local_4; - _local_2._Str_11680 = _local_5; - if(((_local_2.y > 10) || (!(_local_2._Str_16034)))) + _local_2.x = (((2 - this._airFriction) * _local_2.x) - ((1 - this._airFriction) * _local_2.lastX)); + _local_2.y = ((((2 - this._airFriction) * _local_2.y) - ((1 - this._airFriction) * _local_2.lastY)) + ((this._gravity * this._timeStep) * this._timeStep)); + _local_2.z = (((2 - this._airFriction) * _local_2.z) - ((1 - this._airFriction) * _local_2.lastZ)); + _local_2.lastX = _local_3; + _local_2.lastY = _local_4; + _local_2.lastZ = _local_5; + if(((_local_2.y > 10) || (!(_local_2.isAlive)))) { k.push(_local_2); } @@ -242,11 +242,11 @@ export class FurnitureParticleSystemEmitter extends FurnitureParticleSystemParti } } - private _Str_23140(): void + private satisfyConstraints(): void { } - private _Str_25039(): void + private accumulateForces(): void { for(const k of this._particles) { @@ -259,18 +259,18 @@ export class FurnitureParticleSystemEmitter extends FurnitureParticleSystemParti return this._particles; } - public get _Str_22727(): boolean + public get hasIgnited(): boolean { return this._hasIgnited; } - private _Str_7471(k: number): boolean + private randomBoolean(k: number): boolean { return Math.random() < k; } - public get _Str_9107(): number + public get roomObjectSpriteId(): number { return this._roomObjectSpriteId; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/furniture/FurnitureParticleSystemParticle.ts b/src/nitro/room/object/visualization/furniture/FurnitureParticleSystemParticle.ts index ec675c20..75a1b4d3 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureParticleSystemParticle.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureParticleSystemParticle.ts @@ -102,7 +102,7 @@ export class FurnitureParticleSystemParticle return this._isEmitter; } - public get _Str_16034(): boolean + public get isAlive(): boolean { return this._age <= this._lifeTime; } @@ -137,40 +137,40 @@ export class FurnitureParticleSystemParticle this._z = k; } - public get _Str_10744(): number + public get lastX(): number { return this._lastX; } - public set _Str_10744(k: number) + public set lastX(k: number) { this._hasMoved = true; this._lastX = k; } - public get _Str_12459(): number + public get lastY(): number { return this._lastY; } - public set _Str_12459(k: number) + public set lastY(k: number) { this._hasMoved = true; this._lastY = k; } - public get _Str_11680(): number + public get lastZ(): number { return this._lastZ; } - public set _Str_11680(k: number) + public set lastZ(k: number) { this._hasMoved = true; this._lastZ = k; } - public get _Str_22611(): boolean + public get hasMoved(): boolean { return this._hasMoved; } @@ -188,7 +188,7 @@ export class FurnitureParticleSystemParticle this._lastX = (k._lastX * _arg_2); this._lastY = (k._lastY * _arg_2); this._lastZ = (k._lastZ * _arg_2); - this._hasMoved = k._Str_22611; + this._hasMoved = k.hasMoved; this._direction = k._direction; this._age = k._age; this._lifeTime = k._lifeTime; @@ -197,4 +197,4 @@ export class FurnitureParticleSystemParticle this._fadeTime = k._fadeTime; this._alphaMultiplier = k._alphaMultiplier; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 8937ef93..c86d6648 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -512,7 +512,7 @@ export class RoomPlane implements IRoomPlane //const data = new PlaneDrawingData(maskData, blend(this._color, layer.getColor()), cm._Str_14945()); const data = new PlaneDrawingData(maskData, this._color, cm._Str_14945()); - Randomizer._Str_17384(this._randomSeed); + Randomizer.setSeed(this._randomSeed); for(const column of cm._Str_23721(this.screenWidth(geometry))) { @@ -664,7 +664,7 @@ export class RoomPlane implements IRoomPlane //this._bitmapData.fillRect(this._bitmapData.rect, 0xFFFFFF); } - Randomizer._Str_17384(this._randomSeed); + Randomizer.setSeed(this._randomSeed); const texture = this.getTexture(geometry, timeSinceStartMs); diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts index a42c576f..28e62cb2 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts @@ -16,7 +16,7 @@ export class LandscapePlane extends Plane { const _local_2 = this.getPlaneVisualization(k); - if(_local_2) return !(_local_2._Str_20530); + if(_local_2) return !(_local_2.hasAnimationLayers); return super.isStatic(k); } diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts index 9910fdbd..7257ca59 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts @@ -75,7 +75,7 @@ export class LandscapeRasterizer extends PlaneRasterizer if(planeVisualization) { - Randomizer._Str_17384(randomNumber); + Randomizer.setSeed(randomNumber); let layerId = 0; @@ -108,7 +108,7 @@ export class LandscapeRasterizer extends PlaneRasterizer else if(layer.align === 'top') align = PlaneVisualizationLayer.ALIGN_TOP; } - planeVisualization._Str_21464(layerId, material, color, align, offset); + planeVisualization.setLayer(layerId, material, color, align, offset); } layerId++; @@ -157,7 +157,7 @@ export class LandscapeRasterizer extends PlaneRasterizer layerId++; } - planeVisualization._Str_23489(layerId, animationItems, this.assetCollection); + planeVisualization.setAnimationLayer(layerId, animationItems, this.assetCollection); } } } @@ -183,7 +183,7 @@ export class LandscapeRasterizer extends PlaneRasterizer if((_arg_2.length > 0)) { const _local_4 = 10000; - const _local_5 = Randomizer._Str_1612(1, 0, _local_4); + const _local_5 = Randomizer.getValues(1, 0, _local_4); const _local_6 = (_local_5[0] / _local_4); if(_arg_2.charAt((_arg_2.length - 1)) === '%') diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts index 99eadbf9..cc758e3f 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts @@ -175,7 +175,7 @@ export class PlaneMaterialCell // const limitMin = Math.min(this._extraItemCount, this._extraItemOffsets.length); // const limitMax = Math.max(this._extraItemCount, this._extraItemOffsets.length); - // const offsetIndexes = Randomizer._Str_23572(this._extraItemCount, limitMax); + // const offsetIndexes = Randomizer.getArray(this._extraItemCount, limitMax); // let i = 0; diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts index 238ddddf..0ea62351 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts @@ -62,7 +62,7 @@ export class PlaneMaterialCellMatrix private static _Str_12526(k: number): number { - return ((Randomizer._Str_1612(1, 0, (k * 17631))[0]) % k); + return ((Randomizer.getValues(1, 0, (k * 17631))[0]) % k); } public get normalMinX(): number 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 f6cec42c..6073043e 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -578,7 +578,7 @@ export class PlaneRasterizer implements IPlaneRasterizer else if(layer.align == 'top') align = PlaneVisualizationLayer.ALIGN_TOP; } - planeVisualization._Str_21464(layerId, material, color, align, offset); + planeVisualization.setLayer(layerId, material, color, align, offset); } layerId++; diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts index 23aa9088..b85b0377 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualization.ts @@ -44,7 +44,7 @@ export class PlaneVisualization return this._geometry; } - public get _Str_20530(): boolean + public get hasAnimationLayers(): boolean { return this._hasAnimationLayers; } @@ -106,7 +106,7 @@ export class PlaneVisualization this._isCached = false; } - public _Str_21464(k: number, _arg_2: PlaneMaterial, _arg_3: number, _arg_4: number, _arg_5: number = 0): boolean + public setLayer(k: number, _arg_2: PlaneMaterial, _arg_3: number, _arg_4: number, _arg_5: number = 0): boolean { if((k < 0) || (k > this._layers.length)) return false; @@ -121,7 +121,7 @@ export class PlaneVisualization return true; } - public _Str_23489(k: number, _arg_2: any, _arg_3: IGraphicAssetCollection): boolean + public setAnimationLayer(k: number, _arg_2: any, _arg_3: IGraphicAssetCollection): boolean { if((k < 0) || (k > this._layers.length)) return false; @@ -154,7 +154,7 @@ export class PlaneVisualization { if(((this._cachedBitmapData.width === width) && (this._cachedBitmapData.height === height)) && (Vector3d.isEqual(this._cachedBitmapNormal, normal))) { - if(!this._Str_20530) + if(!this.hasAnimationLayers) { if(canvas) { diff --git a/src/nitro/room/object/visualization/room/utils/Randomizer.ts b/src/nitro/room/object/visualization/room/utils/Randomizer.ts index 7df59937..88464e74 100644 --- a/src/nitro/room/object/visualization/room/utils/Randomizer.ts +++ b/src/nitro/room/object/visualization/room/utils/Randomizer.ts @@ -1,60 +1,60 @@ export class Randomizer { - public static _Str_21045: number = 1; - public static _Str_20078: number = 16777216; + public static DEFAULT_SEED: number = 1; + public static DEFAULT_MODULUS: number = 16777216; - private static _Str_3699:Randomizer = null; + private static _randomizer:Randomizer = null; - private _Str_16737: number = 1; - private _Str_16979: number = 16777216; - private _Str_25697: number = 69069; - private _Str_23320: number = 5; + private _seed: number = 1; + private _modulus: number = 16777216; + private _multiplier: number = 69069; + private _increment: number = 5; - public static _Str_17384(k: number = 1): void + public static setSeed(k: number = 1): void { - if(!Randomizer._Str_3699) Randomizer._Str_3699 = new Randomizer(); + if(!Randomizer._randomizer) Randomizer._randomizer = new Randomizer(); - Randomizer._Str_3699._Str_15634 = k; + Randomizer._randomizer.seed = k; } - public static _Str_26085(k: number = 16777216): void + public static setModulus(k: number = 16777216): void { - if(!Randomizer._Str_3699) Randomizer._Str_3699 = new Randomizer(); + if(!Randomizer._randomizer) Randomizer._randomizer = new Randomizer(); - Randomizer._Str_3699._Str_25321 = k; + Randomizer._randomizer.modulus = k; } - public static _Str_1612(k: number, _arg_2: number, _arg_3: number): number[] + public static getValues(k: number, _arg_2: number, _arg_3: number): number[] { - if(!Randomizer._Str_3699) Randomizer._Str_3699 = new Randomizer(); + if(!Randomizer._randomizer) Randomizer._randomizer = new Randomizer(); - return Randomizer._Str_3699._Str_24535(k, _arg_2, _arg_3); + return Randomizer._randomizer.getRandomValues(k, _arg_2, _arg_3); } - public static _Str_23572(k: number, _arg_2: number): number[] + public static getArray(k: number, _arg_2: number): number[] { - if(!Randomizer._Str_3699) Randomizer._Str_3699 = new Randomizer(); + if(!Randomizer._randomizer) Randomizer._randomizer = new Randomizer(); - return Randomizer._Str_3699._Str_24231(k, _arg_2); + return Randomizer._randomizer.getRandomArray(k, _arg_2); } - public set _Str_15634(k: number) + public set seed(k: number) { - this._Str_16737 = k; + this._seed = k; } - public set _Str_25321(k: number) + public set modulus(k: number) { if(k < 1) k = 1; - this._Str_16979 = k; + this._modulus = k; } public dispose(): void { } - public _Str_24535(k: number, _arg_2: number, _arg_3: number): number[] + public getRandomValues(k: number, _arg_2: number, _arg_3: number): number[] { const _local_4: number[] = []; @@ -62,14 +62,14 @@ while(_local_5 < k) { - _local_4.push(this._Str_19361(_arg_2, (_arg_3 - _arg_2))); + _local_4.push(this.iterateScaled(_arg_2, (_arg_3 - _arg_2))); _local_5++; } return _local_4; } - public _Str_24231(k: number, _arg_2: number): number[] + public getRandomArray(k: number, _arg_2: number): number[] { if(((k > _arg_2) || (_arg_2 > 1000))) return null; @@ -89,7 +89,7 @@ while(_local_6 < k) { - const _local_7 = this._Str_19361(0, (_local_3.length - 1)); + const _local_7 = this.iterateScaled(0, (_local_3.length - 1)); _local_5.push(_local_3[_local_7]); _local_3.splice(_local_7, 1); @@ -100,27 +100,27 @@ return _local_5; } - private _Str_24980(): number + private iterate(): number { - let k: number = ((this._Str_25697 * this._Str_16737) + this._Str_23320); + let k: number = ((this._multiplier * this._seed) + this._increment); if(k < 0) k = -(k); - k = (k % this._Str_16979); + k = (k % this._modulus); - this._Str_16737 = k; + this._seed = k; return k; } - private _Str_19361(k: number, _arg_2: number): number + private iterateScaled(k: number, _arg_2: number): number { - let _local_3: number = this._Str_24980(); + let _local_3: number = this.iterate(); if(_arg_2 < 1) return k; - _local_3 = (k + ((_local_3 / this._Str_16979) * _arg_2)); + _local_3 = (k + ((_local_3 / this._modulus) * _arg_2)); return _local_3; } -} \ No newline at end of file +} From 7945a1550f5aaa54f0d8be01cc59b19dd5a2ba0b Mon Sep 17 00:00:00 2001 From: Dank074 Date: Mon, 7 Jun 2021 03:04:24 -0500 Subject: [PATCH 049/155] cleaned AvatarModelGeometry --- src/nitro/avatar/AvatarStructure.ts | 18 ++++---- src/nitro/avatar/figuredata/FigureData.ts | 2 +- src/nitro/avatar/figuredata/FigureDataView.ts | 4 +- .../avatar/geometry/AvatarModelGeometry.ts | 46 +++++++++---------- src/nitro/avatar/geometry/GeometryBodyPart.ts | 18 ++++---- src/nitro/avatar/geometry/GeometryItem.ts | 2 +- .../enums/FriendFurniEngravingWidgetType.ts | 10 ++-- src/nitro/room/object/RoomPlaneData.ts | 8 ++-- src/nitro/room/object/RoomPlaneMaskData.ts | 10 ++-- .../visualization/data/DirectionData.ts | 4 +- .../visualization/pet/PetVisualization.ts | 10 ++-- .../object/visualization/room/RoomPlane.ts | 26 +++++------ .../visualization/room/RoomPlaneBitmapMask.ts | 6 +-- .../room/RoomPlaneRectangleMask.ts | 10 ++-- 14 files changed, 87 insertions(+), 87 deletions(-) diff --git a/src/nitro/avatar/AvatarStructure.ts b/src/nitro/avatar/AvatarStructure.ts index cb6f8f51..df8a43c6 100644 --- a/src/nitro/avatar/AvatarStructure.ts +++ b/src/nitro/avatar/AvatarStructure.ts @@ -282,12 +282,12 @@ export class AvatarStructure extends EventDispatcher for(const _local_13 of _local_8.addData) { - const _local_6 = this._geometry._Str_1919(_local_5, _local_13.align); + const _local_6 = this._geometry.getBodyPart(_local_5, _local_13.align); if(_local_6) { _local_11.id = _local_13.id; - _local_6._Str_2020(_local_11, _arg_2); + _local_6.addPart(_local_11, _arg_2); _local_12.setType = _local_13.id; @@ -304,7 +304,7 @@ export class AvatarStructure extends EventDispatcher for(const _local_9 of _local_3) { - const _local_6 = this._geometry._Str_1919(_local_5, _local_9); + const _local_6 = this._geometry.getBodyPart(_local_5, _local_9); if(_local_6 && (_local_4.indexOf(_local_6.id) === -1)) _local_4.push(_local_6.id); } @@ -315,7 +315,7 @@ export class AvatarStructure extends EventDispatcher for(const _local_14 of _local_3) { - const _local_6 = this._geometry._Str_1701(_local_5, _local_14, _arg_2); + const _local_6 = this._geometry.getBodyPartOfItem(_local_5, _local_14, _arg_2); if(_local_6 && (_local_4.indexOf(_local_6.id) === -1)) _local_4.push(_local_6.id); } @@ -326,14 +326,14 @@ export class AvatarStructure extends EventDispatcher public getBodyPartsUnordered(k: string): string[] { - return this._geometry._Str_1307(k); + return this._geometry.getBodyPartIdsInAvatarSet(k); } public getBodyParts(k: string, _arg_2: string, _arg_3: number): string[] { const _local_4 = AvatarDirectionAngle.DIRECTION_TO_ANGLE[_arg_3]; - return this._geometry._Str_2250(k, _local_4, _arg_2); + return this._geometry.getBodyPartsAtAngle(k, _local_4, _arg_2); } public getFrameBodyPartOffset(k:IActiveActionData, _arg_2: number, _arg_3: number, _arg_4: string): Point @@ -373,11 +373,11 @@ export class AvatarStructure extends EventDispatcher { if(_local_25 === k) { - const _local_26 = this._geometry._Str_1919(_arg_4, _local_25); + const _local_26 = this._geometry.getBodyPart(_arg_4, _local_25); if(_local_26) { - for(const _local_27 of _local_26._Str_1883(_arg_7)) + for(const _local_27 of _local_26.getDynamicParts(_arg_7)) { _local_9.push(_local_27.id); } @@ -530,7 +530,7 @@ export class AvatarStructure extends EventDispatcher { if(_local_9.indexOf(_local_12) > -1) { - const _local_44 = this._geometry._Str_1701(_arg_4, _local_12, _arg_7); + const _local_44 = this._geometry.getBodyPartOfItem(_arg_4, _local_12, _arg_7); if(k !== _local_44.id) { diff --git a/src/nitro/avatar/figuredata/FigureData.ts b/src/nitro/avatar/figuredata/FigureData.ts index 7a06b017..cefcf535 100644 --- a/src/nitro/avatar/figuredata/FigureData.ts +++ b/src/nitro/avatar/figuredata/FigureData.ts @@ -33,7 +33,7 @@ export class FigureData implements IAvatarImageListener constructor() { - this._direction = FigureDataView._Str_9887; + this._direction = FigureDataView.PREVIEW_AVATAR_DIRECTION; this._view = new FigureDataView(this); } diff --git a/src/nitro/avatar/figuredata/FigureDataView.ts b/src/nitro/avatar/figuredata/FigureDataView.ts index 6d794f65..61e10638 100644 --- a/src/nitro/avatar/figuredata/FigureDataView.ts +++ b/src/nitro/avatar/figuredata/FigureDataView.ts @@ -3,7 +3,7 @@ import { FigureData } from './FigureData'; export class FigureDataView implements IAvatarImageListener { - public static _Str_9887: number = 4; + public static PREVIEW_AVATAR_DIRECTION: number = 4; private _model: FigureData; private _figureString: string; @@ -40,4 +40,4 @@ export class FigureDataView implements IAvatarImageListener { return this._figureString; } -} \ No newline at end of file +} diff --git a/src/nitro/avatar/geometry/AvatarModelGeometry.ts b/src/nitro/avatar/geometry/AvatarModelGeometry.ts index 11d044d8..501f1be9 100644 --- a/src/nitro/avatar/geometry/AvatarModelGeometry.ts +++ b/src/nitro/avatar/geometry/AvatarModelGeometry.ts @@ -76,7 +76,7 @@ export class AvatarModelGeometry bodyParts.set(geometryBodyPart.id, geometryBodyPart); - for(const part of geometryBodyPart._Str_1456(null)) + for(const part of geometryBodyPart.getPartIds(null)) { itemIds.set(part, geometryBodyPart); } @@ -99,12 +99,12 @@ export class AvatarModelGeometry { if(!part) continue; - part._Str_2004(k); + part.removeDynamicParts(k); } } } - public _Str_1307(k: string): string[] + public getBodyPartIdsInAvatarSet(k: string): string[] { const avatarSet = this._avatarSet._Str_1498(k); @@ -131,7 +131,7 @@ export class AvatarModelGeometry return (canvas.get(_arg_2) || null); } - private _Str_1342(k: string): boolean + private typeExists(k: string): boolean { const existing = this._geometryTypes.get(k); @@ -140,9 +140,9 @@ export class AvatarModelGeometry return false; } - private _Str_1332(k: string, _arg_2: string): boolean + private hasBodyPart(k: string, _arg_2: string): boolean { - if(this._Str_1342(k)) + if(this.typeExists(k)) { const existing = this._geometryTypes.get(k); @@ -152,9 +152,9 @@ export class AvatarModelGeometry return false; } - private _Str_2072(k: string): string[] + private getBodyPartIDs(k: string): string[] { - const parts = this._Str_1280(k); + const parts = this.getBodyPartsOfType(k); const types = []; @@ -171,19 +171,19 @@ export class AvatarModelGeometry return types; } - private _Str_1280(k: string): Map + private getBodyPartsOfType(k: string): Map { - if(this._Str_1342(k)) return this._geometryTypes.get(k); + if(this.typeExists(k)) return this._geometryTypes.get(k); return new Map(); } - public _Str_1919(k: string, _arg_2: string): GeometryBodyPart + public getBodyPart(k: string, _arg_2: string): GeometryBodyPart { - return (this._Str_1280(k).get(_arg_2) || null); + return (this.getBodyPartsOfType(k).get(_arg_2) || null); } - public _Str_1701(k: string, _arg_2: string, _arg_3:IAvatarImage): GeometryBodyPart + public getBodyPartOfItem(k: string, _arg_2: string, _arg_3:IAvatarImage): GeometryBodyPart { const itemIds = this._itemIdToBodyPartMap.get(k); @@ -193,7 +193,7 @@ export class AvatarModelGeometry if(part) return part; - const parts = this._Str_1280(k); + const parts = this.getBodyPartsOfType(k); if(parts) { @@ -201,7 +201,7 @@ export class AvatarModelGeometry { if(!part) continue; - if(part._Str_2030(_arg_2, _arg_3)) return part; + if(part.hasPart(_arg_2, _arg_3)) return part; } } } @@ -209,9 +209,9 @@ export class AvatarModelGeometry return null; } - private _Str_1787(k: Map, _arg_2: string): GeometryBodyPart[] + private getBodyPartsInAvatarSet(k: Map, _arg_2: string): GeometryBodyPart[] { - const parts = this._Str_1307(_arg_2); + const parts = this.getBodyPartIdsInAvatarSet(_arg_2); const geometryParts = []; for(const part of parts) @@ -229,12 +229,12 @@ export class AvatarModelGeometry return geometryParts; } - public _Str_2250(k: string, _arg_2: number, _arg_3: string): string[] + public getBodyPartsAtAngle(k: string, _arg_2: number, _arg_3: string): string[] { if(!_arg_3) return []; - const geometryParts = this._Str_1280(_arg_3); - const parts = this._Str_1787(geometryParts, k); + const geometryParts = this.getBodyPartsOfType(_arg_3); + const parts = this.getBodyPartsInAvatarSet(geometryParts, k); const sets: [ number, GeometryBodyPart ][] = []; const ids: string[] = []; @@ -246,7 +246,7 @@ export class AvatarModelGeometry part.applyTransform(this._transformation); - sets.push([ part._Str_1522(this._camera), part ]); + sets.push([ part.getDistance(this._camera), part ]); } sets.sort((a, b) => @@ -273,9 +273,9 @@ export class AvatarModelGeometry public getParts(k: string, _arg_2: string, _arg_3: number, _arg_4: any[], _arg_5:IAvatarImage): string[] { - if(this._Str_1332(k, _arg_2)) + if(this.hasBodyPart(k, _arg_2)) { - const part = this._Str_1280(k).get(_arg_2); + const part = this.getBodyPartsOfType(k).get(_arg_2); this._transformation = Matrix4x4.getYRotationMatrix(_arg_3); diff --git a/src/nitro/avatar/geometry/GeometryBodyPart.ts b/src/nitro/avatar/geometry/GeometryBodyPart.ts index 8b09ab22..1aa6ac94 100644 --- a/src/nitro/avatar/geometry/GeometryBodyPart.ts +++ b/src/nitro/avatar/geometry/GeometryBodyPart.ts @@ -33,7 +33,7 @@ export class GeometryBodyPart extends Node3D } } - public _Str_1883(k: IAvatarImage): GeometryItem[] + public getDynamicParts(k: IAvatarImage): GeometryItem[] { const existing = this._dynamicParts.get(k); const parts: GeometryItem[] = []; @@ -53,7 +53,7 @@ export class GeometryBodyPart extends Node3D return parts; } - public _Str_1456(k: IAvatarImage): string[] + public getPartIds(k: IAvatarImage): string[] { const ids: string[] = []; @@ -84,16 +84,16 @@ export class GeometryBodyPart extends Node3D return ids; } - public _Str_2004(k: IAvatarImage): boolean + public removeDynamicParts(k: IAvatarImage): boolean { this._dynamicParts.delete(k); return true; } - public _Str_2020(k: any, _arg_2: IAvatarImage): boolean + public addPart(k: any, _arg_2: IAvatarImage): boolean { - if(this._Str_2030(k.id, _arg_2)) return false; + if(this.hasPart(k.id, _arg_2)) return false; let existing = this._dynamicParts.get(_arg_2); @@ -109,7 +109,7 @@ export class GeometryBodyPart extends Node3D return true; } - public _Str_2030(k: string, _arg_2: IAvatarImage): boolean + public hasPart(k: string, _arg_2: IAvatarImage): boolean { let existingPart = (this._parts.get(k) || null); @@ -131,7 +131,7 @@ export class GeometryBodyPart extends Node3D part.applyTransform(k); - parts.push([ part._Str_1522(_arg_2), part ]); + parts.push([ part.getDistance(_arg_2), part ]); } const existingDynamic = this._dynamicParts.get(_arg_4); @@ -146,7 +146,7 @@ export class GeometryBodyPart extends Node3D part.applyTransform(k); - parts.push([ part._Str_1522(_arg_2), part ]); + parts.push([ part.getDistance(_arg_2), part ]); } } @@ -174,7 +174,7 @@ export class GeometryBodyPart extends Node3D return partIds; } - public _Str_1522(k: Vector3D): number + public getDistance(k: Vector3D): number { const _local_2 = Math.abs(((k.z - this.transformedLocation.z) - this._radius)); const _local_3 = Math.abs(((k.z - this.transformedLocation.z) + this._radius)); diff --git a/src/nitro/avatar/geometry/GeometryItem.ts b/src/nitro/avatar/geometry/GeometryItem.ts index 744950d4..0431cdcd 100644 --- a/src/nitro/avatar/geometry/GeometryItem.ts +++ b/src/nitro/avatar/geometry/GeometryItem.ts @@ -20,7 +20,7 @@ export class GeometryItem extends Node3D this._isDynamic = _arg_2; } - public _Str_1522(k: Vector3D): number + public getDistance(k: Vector3D): number { const _local_2 = Math.abs(((k.z - this.transformedLocation.z) - this._radius)); const _local_3 = Math.abs(((k.z - this.transformedLocation.z) + this._radius)); diff --git a/src/nitro/room/enums/FriendFurniEngravingWidgetType.ts b/src/nitro/room/enums/FriendFurniEngravingWidgetType.ts index 3cd762d8..e3c75c7a 100644 --- a/src/nitro/room/enums/FriendFurniEngravingWidgetType.ts +++ b/src/nitro/room/enums/FriendFurniEngravingWidgetType.ts @@ -1,8 +1,8 @@ export class FriendFurniEngravingWidgetType { - public static readonly _Str_13451:number = 0; - public static readonly _Str_17498:number = 1; - public static readonly _Str_18746:number = 2; - public static readonly _Str_15230:number = 3; - public static readonly _Str_15778:number = 4; + public static readonly LOVE_LOCK:number = 0; + public static readonly CARVE_A_TREE:number = 1; + public static readonly FRIENDS_PORTRAIT:number = 2; + public static readonly WILD_WEST_WANTED:number = 3; + public static readonly HABBOWEEN:number = 4; } diff --git a/src/nitro/room/object/RoomPlaneData.ts b/src/nitro/room/object/RoomPlaneData.ts index d8d483c6..7f410318 100644 --- a/src/nitro/room/object/RoomPlaneData.ts +++ b/src/nitro/room/object/RoomPlaneData.ts @@ -165,7 +165,7 @@ export class RoomPlaneData const _local_2:RoomPlaneMaskData = this._Str_8361(k); if(_local_2 != null) { - return _local_2._Str_5120; + return _local_2.leftSideLoc; } return -1; } @@ -175,7 +175,7 @@ export class RoomPlaneData const _local_2:RoomPlaneMaskData = this._Str_8361(k); if(_local_2 != null) { - return _local_2._Str_4659; + return _local_2.rightSideLoc; } return -1; } @@ -185,7 +185,7 @@ export class RoomPlaneData const _local_2:RoomPlaneMaskData = this._Str_8361(k); if(_local_2 != null) { - return _local_2._Str_9124; + return _local_2.leftSideLength; } return -1; } @@ -195,7 +195,7 @@ export class RoomPlaneData const _local_2:RoomPlaneMaskData = this._Str_8361(k); if(_local_2 != null) { - return _local_2._Str_12156; + return _local_2.rightSideLength; } return -1; } diff --git a/src/nitro/room/object/RoomPlaneMaskData.ts b/src/nitro/room/object/RoomPlaneMaskData.ts index 328fccac..b06eae26 100644 --- a/src/nitro/room/object/RoomPlaneMaskData.ts +++ b/src/nitro/room/object/RoomPlaneMaskData.ts @@ -13,23 +13,23 @@ this._rightSideLength = _arg_4; } - public get _Str_5120(): number + public get leftSideLoc(): number { return this._leftSideLoc; } - public get _Str_4659(): number + public get rightSideLoc(): number { return this._rightSideLoc; } - public get _Str_9124(): number + public get leftSideLength(): number { return this._leftSideLength; } - public get _Str_12156(): number + public get rightSideLength(): number { return this._rightSideLength; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/data/DirectionData.ts b/src/nitro/room/object/visualization/data/DirectionData.ts index 86af71fe..e3308387 100644 --- a/src/nitro/room/object/visualization/data/DirectionData.ts +++ b/src/nitro/room/object/visualization/data/DirectionData.ts @@ -2,7 +2,7 @@ import { LayerData } from './LayerData'; export class DirectionData { - public static _Str_9471: number = -1; + public static USE_DEFAULT_DIRECTION: number = -1; private _layers: LayerData[]; @@ -193,4 +193,4 @@ export class DirectionData { return this._layers.length; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/pet/PetVisualization.ts b/src/nitro/room/object/visualization/pet/PetVisualization.ts index 4d68428b..78d3a45c 100644 --- a/src/nitro/room/object/visualization/pet/PetVisualization.ts +++ b/src/nitro/room/object/visualization/pet/PetVisualization.ts @@ -436,8 +436,8 @@ export class PetVisualization extends FurnitureAnimatedVisualization { if(this._headSprites[layerId] === undefined) { - const isHead = (this._data.getLayerTag(this._scale, DirectionData._Str_9471, layerId) === PetVisualization.HEAD); - const isHair = (this._data.getLayerTag(this._scale, DirectionData._Str_9471, layerId) === PetVisualization.HAIR); + const isHead = (this._data.getLayerTag(this._scale, DirectionData.USE_DEFAULT_DIRECTION, layerId) === PetVisualization.HEAD); + const isHair = (this._data.getLayerTag(this._scale, DirectionData.USE_DEFAULT_DIRECTION, layerId) === PetVisualization.HAIR); if(isHead || isHair) this._headSprites[layerId] = true; else this._headSprites[layerId] = false; @@ -452,7 +452,7 @@ export class PetVisualization extends FurnitureAnimatedVisualization { if(layerId < (this.totalSprites - (1 + PetVisualization._Str_7490))) { - const tag = this._data.getLayerTag(this._scale, DirectionData._Str_9471, layerId); + const tag = this._data.getLayerTag(this._scale, DirectionData.USE_DEFAULT_DIRECTION, layerId); if(((tag && (tag.length > 0)) && (tag !== PetVisualization.HEAD)) && (tag !== PetVisualization.HAIR)) { @@ -476,7 +476,7 @@ export class PetVisualization extends FurnitureAnimatedVisualization { if(this._saddleSprites[layerId] === undefined) { - if(this._data.getLayerTag(this._scale, DirectionData._Str_9471, layerId) === PetVisualization.SADDLE) + if(this._data.getLayerTag(this._scale, DirectionData.USE_DEFAULT_DIRECTION, layerId) === PetVisualization.SADDLE) { this._saddleSprites[layerId] = true; } @@ -558,4 +558,4 @@ export class PetVisualization extends FurnitureAnimatedVisualization return posture; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index c86d6648..47515c9c 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -466,8 +466,8 @@ export class RoomPlane implements IRoomPlane if(asset) { - const _local_3 = (this._maskBitmapData.width * (1 - (mask._Str_5120 / this._leftSide.length))); - const _local_4 = (this._maskBitmapData.height * (1 - (mask._Str_4659 / this._rightSide.length))); + const _local_3 = (this._maskBitmapData.width * (1 - (mask.leftSideLoc / this._leftSide.length))); + const _local_4 = (this._maskBitmapData.height * (1 - (mask.rightSideLoc / this._rightSide.length))); const _local_11 = new Point((_local_3 + asset.offsetX), (_local_4 + asset.offsetY)); _local_5.addMask(assetName, _local_11, asset.flipH, asset.flipV); @@ -794,7 +794,7 @@ export class RoomPlane implements IRoomPlane if(mask) { - if((((mask.type === k) && (mask._Str_5120 === _arg_2)) && (mask._Str_4659 === _arg_3))) return false; + if((((mask.type === k) && (mask.leftSideLoc === _arg_2)) && (mask.rightSideLoc === _arg_3))) return false; } _local_5++; @@ -824,7 +824,7 @@ export class RoomPlane implements IRoomPlane { if(!mask) continue; - if((((mask._Str_5120 === k) && (mask._Str_4659 === _arg_2)) && (mask._Str_9124 === _arg_3)) && (mask._Str_12156 === _arg_4)) return false; + if((((mask.leftSideLoc === k) && (mask.rightSideLoc === _arg_2)) && (mask.leftSideLength === _arg_3)) && (mask.rightSideLength === _arg_4)) return false; } const _local_5 = new RoomPlaneRectangleMask(k, _arg_2, _arg_3, _arg_4); @@ -857,7 +857,7 @@ export class RoomPlane implements IRoomPlane { if(!plane) continue; - if(((plane.type === mask.type) && (plane._Str_5120 === mask._Str_5120)) && (plane._Str_4659 === mask._Str_4659)) + if(((plane.type === mask.type) && (plane.leftSideLoc === mask.leftSideLoc)) && (plane.rightSideLoc === mask.rightSideLoc)) { _local_6 = true; @@ -942,11 +942,11 @@ export class RoomPlane implements IRoomPlane if(mask) { type = mask.type; - posX = (this._maskBitmapData.width - ((this._maskBitmapData.width * mask._Str_5120) / this._leftSide.length)); - posY = (this._maskBitmapData.height - ((this._maskBitmapData.height * mask._Str_4659) / this._rightSide.length)); + posX = (this._maskBitmapData.width - ((this._maskBitmapData.width * mask.leftSideLoc) / this._leftSide.length)); + posY = (this._maskBitmapData.height - ((this._maskBitmapData.height * mask.rightSideLoc) / this._rightSide.length)); this._maskManager.updateMask(this._maskBitmapData, type, geometry.scale, normal, posX, posY); - this._bitmapMasksOld.push(new RoomPlaneBitmapMask(type, mask._Str_5120, mask._Str_4659)); + this._bitmapMasksOld.push(new RoomPlaneBitmapMask(type, mask.leftSideLoc, mask.rightSideLoc)); } i++; @@ -960,18 +960,18 @@ export class RoomPlane implements IRoomPlane if(rectMask) { - posX = (this._maskBitmapData.width - ((this._maskBitmapData.width * rectMask._Str_5120) / this._leftSide.length)); - posY = (this._maskBitmapData.height - ((this._maskBitmapData.height * rectMask._Str_4659) / this._rightSide.length)); + posX = (this._maskBitmapData.width - ((this._maskBitmapData.width * rectMask.leftSideLoc) / this._leftSide.length)); + posY = (this._maskBitmapData.height - ((this._maskBitmapData.height * rectMask.rightSideLoc) / this._rightSide.length)); - const wd = ((this._maskBitmapData.width * rectMask._Str_9124) / this._leftSide.length); - const ht = ((this._maskBitmapData.height * rectMask._Str_12156) / this._rightSide.length); + const wd = ((this._maskBitmapData.width * rectMask.leftSideLength) / this._leftSide.length); + const ht = ((this._maskBitmapData.height * rectMask.rightSideLength) / this._rightSide.length); this._maskBitmapData .beginFill(0xFF0000) .drawRect((posX - wd), (posY - ht), wd, ht) .endFill(); - this._rectangleMasksOld.push(new RoomPlaneRectangleMask(rectMask._Str_9124, rectMask._Str_4659, rectMask._Str_9124, rectMask._Str_12156)); + this._rectangleMasksOld.push(new RoomPlaneRectangleMask(rectMask.leftSideLength, rectMask.rightSideLoc, rectMask.leftSideLength, rectMask.rightSideLength)); } i++; diff --git a/src/nitro/room/object/visualization/room/RoomPlaneBitmapMask.ts b/src/nitro/room/object/visualization/room/RoomPlaneBitmapMask.ts index 1d12b7d9..fb725f35 100644 --- a/src/nitro/room/object/visualization/room/RoomPlaneBitmapMask.ts +++ b/src/nitro/room/object/visualization/room/RoomPlaneBitmapMask.ts @@ -16,13 +16,13 @@ return this._type; } - public get _Str_5120(): number + public get leftSideLoc(): number { return this._leftSideLoc; } - public get _Str_4659(): number + public get rightSideLoc(): number { return this._rightSideLoc; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/RoomPlaneRectangleMask.ts b/src/nitro/room/object/visualization/room/RoomPlaneRectangleMask.ts index b36a9feb..1647c479 100644 --- a/src/nitro/room/object/visualization/room/RoomPlaneRectangleMask.ts +++ b/src/nitro/room/object/visualization/room/RoomPlaneRectangleMask.ts @@ -13,23 +13,23 @@ this._rightSideLength = _arg_4; } - public get _Str_5120(): number + public get leftSideLoc(): number { return this._leftSideLoc; } - public get _Str_4659(): number + public get rightSideLoc(): number { return this._rightSideLoc; } - public get _Str_9124(): number + public get leftSideLength(): number { return this._leftSideLength; } - public get _Str_12156(): number + public get rightSideLength(): number { return this._rightSideLength; } -} \ No newline at end of file +} From 9f49c58dca97856209e39009ee90031973ab9f79 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Mon, 7 Jun 2021 03:09:59 -0500 Subject: [PATCH 050/155] cleaned PlaneDrawingData --- .../visualization/room/PlaneDrawingData.ts | 16 ++++++++-------- .../room/object/visualization/room/RoomPlane.ts | 8 ++++---- .../rasterizer/basic/PlaneMaterialCellMatrix.ts | 2 +- .../object/visualization/IPlaneDrawingData.ts | 14 +++++++------- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/nitro/room/object/visualization/room/PlaneDrawingData.ts b/src/nitro/room/object/visualization/room/PlaneDrawingData.ts index a5c48b29..244e7005 100644 --- a/src/nitro/room/object/visualization/room/PlaneDrawingData.ts +++ b/src/nitro/room/object/visualization/room/PlaneDrawingData.ts @@ -41,7 +41,7 @@ export class PlaneDrawingData implements IPlaneDrawingData this._maskAssetFlipVs.push(_arg_4); } - public _Str_22862(k: string[]): void + public addAssetColumn(k: string[]): void { this._assetNames.push(k); } @@ -71,33 +71,33 @@ export class PlaneDrawingData implements IPlaneDrawingData return this._color; } - public get _Str_21807(): string[] + public get maskAssetNames(): string[] { return this._maskAssetNames; } - public get _Str_20731(): Point[] + public get maskAssetLocations(): Point[] { return this._maskAssetLocations; } - public get _Str_21810(): boolean[] + public get maskAssetFlipHs(): boolean[] { return this._maskAssetFlipHs; } - public get _Str_19044(): boolean[] + public get maskAssetFlipVs(): boolean[] { return this._maskAssetFlipVs; } - public _Str_14945(): boolean + public isBottomAligned(): boolean { return this._alignBottom; } - public get _Str_17636(): string[][] + public get assetNameColumns(): string[][] { return this._assetNames; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 47515c9c..5f1d324a 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -509,8 +509,8 @@ export class RoomPlane implements IRoomPlane { const normal = geometry.getCoordinatePosition(this._normal); const cm = layer.getMaterial()._Str_21968(normal); - //const data = new PlaneDrawingData(maskData, blend(this._color, layer.getColor()), cm._Str_14945()); - const data = new PlaneDrawingData(maskData, this._color, cm._Str_14945()); + //const data = new PlaneDrawingData(maskData, blend(this._color, layer.getColor()), cm.isBottomAligned()); + const data = new PlaneDrawingData(maskData, this._color, cm.isBottomAligned()); Randomizer.setSeed(this._randomSeed); @@ -529,11 +529,11 @@ export class RoomPlane implements IRoomPlane { if(!column._Str_24523()) assetNames.push(''); - data._Str_22862(assetNames); + data.addAssetColumn(assetNames); } } - if(data._Str_17636.length > 0) drawingDatas.push(data); + if(data.assetNameColumns.length > 0) drawingDatas.push(data); } else { diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts index 0ea62351..06dd7ed6 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts @@ -85,7 +85,7 @@ export class PlaneMaterialCellMatrix return this._normalMaxY; } - public _Str_14945(): boolean + public isBottomAligned(): boolean { return this._align === PlaneMaterialCellMatrix._Str_3606; } diff --git a/src/room/object/visualization/IPlaneDrawingData.ts b/src/room/object/visualization/IPlaneDrawingData.ts index c043e177..8a67219e 100644 --- a/src/room/object/visualization/IPlaneDrawingData.ts +++ b/src/room/object/visualization/IPlaneDrawingData.ts @@ -2,13 +2,13 @@ export interface IPlaneDrawingData { - _Str_14945(): boolean; + isBottomAligned(): boolean; z: number; cornerPoints: Point[]; color: number; - _Str_21807: string[]; - _Str_20731: Point[]; - _Str_21810: boolean[]; - _Str_19044: boolean[]; - _Str_17636: string[][]; -} \ No newline at end of file + maskAssetNames: string[]; + maskAssetLocations: Point[]; + maskAssetFlipHs: boolean[]; + maskAssetFlipVs: boolean[]; + assetNameColumns: string[][]; +} From b744c602abdf965e0fcd73237827e45e58b9e4dc Mon Sep 17 00:00:00 2001 From: Dank074 Date: Mon, 7 Jun 2021 03:28:52 -0500 Subject: [PATCH 051/155] cleaned SelectedRoomObjectData --- .../avatar/geometry/AvatarModelGeometry.ts | 4 ++-- src/nitro/avatar/geometry/AvatarSet.ts | 4 ++-- src/nitro/avatar/geometry/GeometryItem.ts | 4 ++-- src/nitro/room/ISelectedRoomObjectData.ts | 4 ++-- src/nitro/room/RoomObjectEventHandler.ts | 22 +++++++++---------- .../events/RoomEngineObjectPlacedEvent.ts | 4 ++-- .../room/object/logic/avatar/AvatarLogic.ts | 2 +- .../object/logic/furniture/FurnitureLogic.ts | 12 +++++----- src/nitro/room/object/logic/pet/PetLogic.ts | 6 ++--- src/nitro/room/object/logic/room/RoomLogic.ts | 4 ++-- .../object/visualization/room/RoomPlane.ts | 2 +- .../visualization/room/mask/PlaneMask.ts | 10 ++++----- .../room/mask/PlaneMaskManager.ts | 6 ++--- .../room/utils/SelectedRoomObjectData.ts | 6 ++--- src/room/events/RoomSpriteMouseEvent.ts | 4 ++-- 15 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/nitro/avatar/geometry/AvatarModelGeometry.ts b/src/nitro/avatar/geometry/AvatarModelGeometry.ts index 501f1be9..f8fd57cf 100644 --- a/src/nitro/avatar/geometry/AvatarModelGeometry.ts +++ b/src/nitro/avatar/geometry/AvatarModelGeometry.ts @@ -106,7 +106,7 @@ export class AvatarModelGeometry public getBodyPartIdsInAvatarSet(k: string): string[] { - const avatarSet = this._avatarSet._Str_1498(k); + const avatarSet = this._avatarSet.findAvatarSet(k); if(!avatarSet) return []; @@ -115,7 +115,7 @@ export class AvatarModelGeometry public isMainAvatarSet(k: string): boolean { - const avatarSet = this._avatarSet._Str_1498(k); + const avatarSet = this._avatarSet.findAvatarSet(k); if(!avatarSet) return false; diff --git a/src/nitro/avatar/geometry/AvatarSet.ts b/src/nitro/avatar/geometry/AvatarSet.ts index e11d0ce6..7aea7dca 100644 --- a/src/nitro/avatar/geometry/AvatarSet.ts +++ b/src/nitro/avatar/geometry/AvatarSet.ts @@ -48,7 +48,7 @@ this._allBodyParts = bodyParts; } - public _Str_1498(k: string): AvatarSet + public findAvatarSet(k: string): AvatarSet { if(k === this._id) return this; @@ -56,7 +56,7 @@ { if(!avatarSet) continue; - if(!avatarSet._Str_1498(k)) continue; + if(!avatarSet.findAvatarSet(k)) continue; return avatarSet; } diff --git a/src/nitro/avatar/geometry/GeometryItem.ts b/src/nitro/avatar/geometry/GeometryItem.ts index 0431cdcd..189a4061 100644 --- a/src/nitro/avatar/geometry/GeometryItem.ts +++ b/src/nitro/avatar/geometry/GeometryItem.ts @@ -38,7 +38,7 @@ export class GeometryItem extends Node3D return this._normal; } - public get _Str_2207(): boolean + public get isDoubleSided(): boolean { return this._isDoubleSided; } @@ -48,7 +48,7 @@ export class GeometryItem extends Node3D return ((((this._id + ': ') + this.location) + ' - ') + this.transformedLocation); } - public get _Str_1457(): boolean + public get isDynamic(): boolean { return this._isDynamic; } diff --git a/src/nitro/room/ISelectedRoomObjectData.ts b/src/nitro/room/ISelectedRoomObjectData.ts index da80dc1d..eb46a127 100644 --- a/src/nitro/room/ISelectedRoomObjectData.ts +++ b/src/nitro/room/ISelectedRoomObjectData.ts @@ -6,9 +6,9 @@ export interface ISelectedRoomObjectData category: number; operation: string; typeId: number; - _Str_4766: string; + instanceData: string; stuffData: IObjectData; state: number; - _Str_15896: number; + animFrame: number; posture: string; } diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 66a8b265..fa2a02be 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -134,7 +134,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou roomObject.setDirection(direction); - this._Str_16022(event.roomId, selectedData.id, selectedData.category, selectedData.loc, direction, selectedData.operation, selectedData.typeId, selectedData._Str_4766, selectedData.stuffData, selectedData.state, selectedData._Str_15896, selectedData.posture); + this._Str_16022(event.roomId, selectedData.id, selectedData.category, selectedData.loc, direction, selectedData.operation, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); selectedData = this.getSelectedRoomObjectData(event.roomId); @@ -161,15 +161,15 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou const _local_7 = this._Str_18648(category, event.type); - if(_local_7 === event._Str_3463) + if(_local_7 === event.eventId) { if((event.type === MouseEventType.MOUSE_CLICK) || (event.type === MouseEventType.DOUBLE_CLICK) || (event.type === MouseEventType.MOUSE_DOWN) || (event.type === MouseEventType.MOUSE_UP) || (event.type === MouseEventType.MOUSE_MOVE)) return; } else { - if(event._Str_3463) + if(event.eventId) { - this._Str_11142(category, event.type, event._Str_3463); + this._Str_11142(category, event.type, event.eventId); } } @@ -970,12 +970,12 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { if(selectedData.category === RoomObjectCategory.FLOOR) { - this._roomEngine.addFurnitureFloor(roomId, selectedData.id, selectedData.typeId, selectedData.loc, selectedData.dir, 0, selectedData.stuffData, parseFloat(selectedData._Str_4766), -1, 0, 0, '', false); + this._roomEngine.addFurnitureFloor(roomId, selectedData.id, selectedData.typeId, selectedData.loc, selectedData.dir, 0, selectedData.stuffData, parseFloat(selectedData.instanceData), -1, 0, 0, '', false); } else if(selectedData.category === RoomObjectCategory.UNIT) { - this._roomEngine.addRoomObjectUser(roomId, selectedData.id, new Vector3d(), new Vector3d(180), 180, selectedData.typeId, selectedData._Str_4766); + this._roomEngine.addRoomObjectUser(roomId, selectedData.id, new Vector3d(), new Vector3d(180), 180, selectedData.typeId, selectedData.instanceData); const roomObject = this._roomEngine.getRoomObject(roomId, selectedData.id, selectedData.category); @@ -987,7 +987,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { if(selectedData.category === RoomObjectCategory.WALL) { - this._roomEngine.addFurnitureWall(roomId, selectedData.id, selectedData.typeId, selectedData.loc, selectedData.dir, 0, selectedData._Str_4766, 0); + this._roomEngine.addFurnitureWall(roomId, selectedData.id, selectedData.typeId, selectedData.loc, selectedData.dir, 0, selectedData.instanceData, 0); } } @@ -1005,7 +1005,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou roomObject.setDirection(direction); - this._Str_16022(roomId, selectedData.id, selectedData.category, selectedData.loc, direction, selectedData.operation, selectedData.typeId, selectedData._Str_4766, selectedData.stuffData, selectedData.state, selectedData._Str_15896, selectedData.posture); + this._Str_16022(roomId, selectedData.id, selectedData.category, selectedData.loc, direction, selectedData.operation, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); selectedData = this.getSelectedRoomObjectData(roomId); @@ -1524,7 +1524,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { const placedInRoom = (roomObject && (roomObject.id === selectedData.id)); - this._roomEngine.events.dispatchEvent(new RoomEngineObjectPlacedEvent(RoomEngineObjectEvent.PLACED, roomId, objectId, category, wallLocation, x, y, z, direction, placedInRoom, isTileEvent, isWallEvent, selectedData._Str_4766)); + this._roomEngine.events.dispatchEvent(new RoomEngineObjectPlacedEvent(RoomEngineObjectEvent.PLACED, roomId, objectId, category, wallLocation, x, y, z, direction, placedInRoom, isTileEvent, isWallEvent, selectedData.instanceData)); } } @@ -1653,7 +1653,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou case RoomObjectOperationType.OBJECT_MOVE_TO: { const selectedData = this.getSelectedRoomObjectData(roomId); - this._Str_16022(roomId, selectedData.id, selectedData.category, selectedData.loc, selectedData.dir, RoomObjectOperationType.OBJECT_MOVE_TO, selectedData.typeId, selectedData._Str_4766, selectedData.stuffData, selectedData.state, selectedData._Str_15896, selectedData.posture); + this._Str_16022(roomId, selectedData.id, selectedData.category, selectedData.loc, selectedData.dir, RoomObjectOperationType.OBJECT_MOVE_TO, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); this.setFurnitureAlphaMultiplier(roomObject, 1); this._roomEngine._Str_17948(); @@ -1938,7 +1938,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou this._roomEngine.updateRoomObjectMask(roomId, selectedData.id, true); } - this._Str_16022(roomId, selectedData.id, selectedData.category, selectedData.loc, selectedData.dir, RoomObjectOperationType.OBJECT_MOVE, selectedData.typeId, selectedData._Str_4766, selectedData.stuffData, selectedData.state, selectedData._Str_15896, selectedData.posture); + this._Str_16022(roomId, selectedData.id, selectedData.category, selectedData.loc, selectedData.dir, RoomObjectOperationType.OBJECT_MOVE, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); } else if((selectedData.operation === RoomObjectOperationType.OBJECT_PLACE)) diff --git a/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts b/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts index b9667a21..929ff615 100644 --- a/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts +++ b/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts @@ -67,8 +67,8 @@ export class RoomEngineObjectPlacedEvent extends RoomEngineObjectEvent return this._placedOnWall; } - public get _Str_4766(): string + public get instanceData(): string { return this._instanceData; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/avatar/AvatarLogic.ts b/src/nitro/room/object/logic/avatar/AvatarLogic.ts index 1ac68b28..2930fc97 100644 --- a/src/nitro/room/object/logic/avatar/AvatarLogic.ts +++ b/src/nitro/room/object/logic/avatar/AvatarLogic.ts @@ -503,7 +503,7 @@ export class AvatarLogic extends MovingObjectLogic break; } - if(eventType && this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMouseEvent(eventType, this.object, event._Str_3463, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown)); + if(eventType && this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMouseEvent(eventType, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown)); } private randomTalkingPauseStartTimestamp(): number diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index c3e70a6d..c485cb12 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -241,7 +241,7 @@ export class FurnitureLogic extends MovingObjectLogic case MouseEventType.MOUSE_MOVE: if(this.eventDispatcher) { - const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_MOVE, this.object, event._Str_3463, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); + const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_MOVE, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); mouseEvent.localX = event.localX; mouseEvent.localY = event.localY; @@ -256,7 +256,7 @@ export class FurnitureLogic extends MovingObjectLogic { if(this.eventDispatcher) { - const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_ENTER, this.object, event._Str_3463, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); + const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_ENTER, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); mouseEvent.localX = event.localX; mouseEvent.localY = event.localY; @@ -274,7 +274,7 @@ export class FurnitureLogic extends MovingObjectLogic { if(this.eventDispatcher) { - const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_LEAVE, this.object, event._Str_3463, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); + const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_LEAVE, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); mouseEvent.localX = event.localX; mouseEvent.localY = event.localY; @@ -293,7 +293,7 @@ export class FurnitureLogic extends MovingObjectLogic case MouseEventType.MOUSE_CLICK: if(this.eventDispatcher) { - const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.CLICK, this.object, event._Str_3463, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); + const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.CLICK, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); mouseEvent.localX = event.localX; mouseEvent.localY = event.localY; @@ -311,7 +311,7 @@ export class FurnitureLogic extends MovingObjectLogic case MouseEventType.MOUSE_DOWN: if(this.eventDispatcher) { - const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_DOWN, this.object, event._Str_3463, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); + const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_DOWN, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); this.eventDispatcher.dispatchEvent(mouseEvent); } @@ -371,4 +371,4 @@ export class FurnitureLogic extends MovingObjectLogic super.tearDown(); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/pet/PetLogic.ts b/src/nitro/room/object/logic/pet/PetLogic.ts index e14580c0..0b8779e9 100644 --- a/src/nitro/room/object/logic/pet/PetLogic.ts +++ b/src/nitro/room/object/logic/pet/PetLogic.ts @@ -231,12 +231,12 @@ export class PetLogic extends MovingObjectLogic if(petType == PetType.MONSTERPLANT) { - if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_DOWN, this.object, event._Str_3463, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown)); + if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_DOWN, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown)); } break; } } - if(eventType && this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMouseEvent(eventType, this.object, event._Str_3463, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown)); + if(eventType && this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMouseEvent(eventType, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown)); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/room/RoomLogic.ts b/src/nitro/room/object/logic/room/RoomLogic.ts index f8082915..07ced056 100644 --- a/src/nitro/room/object/logic/room/RoomLogic.ts +++ b/src/nitro/room/object/logic/room/RoomLogic.ts @@ -430,7 +430,7 @@ export class RoomLogic extends RoomObjectLogicBase if(_local_12 === RoomPlaneData.PLANE_FLOOR) { - newEvent = new RoomObjectTileMouseEvent(eventType, this.object, event._Str_3463, _local_19, _local_20, _local_21, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); + newEvent = new RoomObjectTileMouseEvent(eventType, this.object, event.eventId, _local_19, _local_20, _local_21, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); } else if((_local_12 === RoomPlaneData.PLANE_WALL) || (_local_12 === RoomPlaneData.PLANE_LANDSCAPE)) @@ -447,7 +447,7 @@ export class RoomLogic extends RoomObjectLogicBase const _local_27 = ((_local_9.length * _local_7.x) / _local_13); const _local_28 = ((_local_10.length * _local_7.y) / _local_14); - newEvent = new RoomObjectWallMouseEvent(eventType, this.object, event._Str_3463, _local_8, _local_9, _local_10, _local_27, _local_28, direction, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); + newEvent = new RoomObjectWallMouseEvent(eventType, this.object, event.eventId, _local_8, _local_9, _local_10, _local_27, _local_28, direction, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); } if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(newEvent); diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 5f1d324a..ca9aaf41 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -462,7 +462,7 @@ export class RoomPlane implements IRoomPlane if(assetName) { const position = k.getCoordinatePosition(this._normal); - const asset = planeMask._Str_21021(k.scale, position); + const asset = planeMask.getGraphicAsset(k.scale, position); if(asset) { diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMask.ts b/src/nitro/room/object/visualization/room/mask/PlaneMask.ts index 7e6ba4e5..dabd4e57 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMask.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMask.ts @@ -37,7 +37,7 @@ export class PlaneMask this._sizes = null; } - public _Str_24540(size: number): PlaneMaskVisualization + public createMaskVisualization(size: number): PlaneMaskVisualization { const existing = this._maskVisualizations.get(size); @@ -73,7 +73,7 @@ export class PlaneMask return sizeIndex; } - protected _Str_24650(k: number): PlaneMaskVisualization + protected getMaskVisualization(k: number): PlaneMaskVisualization { if(k === this._lastSize) return this._lastMaskVisualization; @@ -93,9 +93,9 @@ export class PlaneMask return this._lastMaskVisualization; } - public _Str_21021(k: number, _arg_2: IVector3D): IGraphicAsset + public getGraphicAsset(k: number, _arg_2: IVector3D): IGraphicAsset { - const visualization = this._Str_24650(k); + const visualization = this.getMaskVisualization(k); if(!visualization) return null; @@ -109,7 +109,7 @@ export class PlaneMask return this._assetNames.get(k) || null; } - public _Str_24425(k: number, _arg_2: string): void + public setAssetName(k: number, _arg_2: string): void { if(!this._assetNames) return; diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts index 63c9329f..b56b6b00 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts @@ -86,13 +86,13 @@ export class PlaneMaskManager if(visualization) { const size = visualization.size as number; - const maskVisualization = newMask._Str_24540(size); + const maskVisualization = newMask.createMaskVisualization(size); if(maskVisualization) { const assetName = this._Str_25815(visualization.bitmaps, maskVisualization, _arg_2); - newMask._Str_24425(size, assetName); + newMask.setAssetName(size, assetName); } } @@ -147,7 +147,7 @@ export class PlaneMaskManager if(!mask) return true; - const asset = mask._Str_21021(_arg_3, _arg_4); + const asset = mask.getGraphicAsset(_arg_3, _arg_4); if(!asset) return true; diff --git a/src/nitro/room/utils/SelectedRoomObjectData.ts b/src/nitro/room/utils/SelectedRoomObjectData.ts index 23667e98..e56b57a6 100644 --- a/src/nitro/room/utils/SelectedRoomObjectData.ts +++ b/src/nitro/room/utils/SelectedRoomObjectData.ts @@ -64,7 +64,7 @@ export class SelectedRoomObjectData implements ISelectedRoomObjectData return this._typeId; } - public get _Str_4766(): string + public get instanceData(): string { return this._instanceData; } @@ -79,7 +79,7 @@ export class SelectedRoomObjectData implements ISelectedRoomObjectData return this._state; } - public get _Str_15896(): number + public get animFrame(): number { return this._animFrame; } @@ -94,4 +94,4 @@ export class SelectedRoomObjectData implements ISelectedRoomObjectData this._loc = null; this._dir = null; } -} \ No newline at end of file +} diff --git a/src/room/events/RoomSpriteMouseEvent.ts b/src/room/events/RoomSpriteMouseEvent.ts index db2656d8..457f55af 100644 --- a/src/room/events/RoomSpriteMouseEvent.ts +++ b/src/room/events/RoomSpriteMouseEvent.ts @@ -38,7 +38,7 @@ export class RoomSpriteMouseEvent return this._type; } - public get _Str_3463(): string + public get eventId(): string { return this._eventId; } @@ -112,4 +112,4 @@ export class RoomSpriteMouseEvent { this._spriteOffsetY = k; } -} \ No newline at end of file +} From 8451540b3773093a41da19d6f43a76d2fa228542 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Mon, 7 Jun 2021 03:42:27 -0500 Subject: [PATCH 052/155] cleaned HabboClubLevelEnum --- src/nitro/room/object/visualization/room/RoomPlane.ts | 2 +- .../room/object/visualization/room/RoomVisualization.ts | 2 +- .../room/rasterizer/animated/AnimationItem.ts | 4 ++-- .../animated/PlaneVisualizationAnimationLayer.ts | 2 +- .../visualization/room/rasterizer/basic/PlaneMaterial.ts | 6 +++--- .../room/rasterizer/basic/PlaneRasterizer.ts | 2 +- src/nitro/room/utils/SpriteDataCollector.ts | 2 +- src/nitro/session/HabboClubLevelEnum.ts | 8 ++++---- src/nitro/session/RoomUserData.ts | 8 ++++---- src/room/object/visualization/IPlaneVisualization.ts | 4 ++-- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index ca9aaf41..b5d4c5c8 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -508,7 +508,7 @@ export class RoomPlane implements IRoomPlane if(this._hasTexture && layer.getMaterial()) { const normal = geometry.getCoordinatePosition(this._normal); - const cm = layer.getMaterial()._Str_21968(normal); + const cm = layer.getMaterial().getMaterialCellMatrix(normal); //const data = new PlaneDrawingData(maskData, blend(this._color, layer.getColor()), cm.isBottomAligned()); const data = new PlaneDrawingData(maskData, this._color, cm.isBottomAligned()); diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index 23ace882..26009171 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -994,7 +994,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements return new Rectangle(this._boundingRectangle.x, this._boundingRectangle.y, this._boundingRectangle.width, this._boundingRectangle.height); } - public get _Str_19113(): IRoomPlane[] + public get planes(): IRoomPlane[] { const planes: IRoomPlane[] = []; diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/AnimationItem.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/AnimationItem.ts index fdc92022..57c128b8 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/AnimationItem.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/AnimationItem.ts @@ -36,7 +36,7 @@ export class AnimationItem this._bitmapData = null; } - public _Str_6729(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number): Point + public getPosition(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number): Point { let _local_6 = this._x; let _local_7 = this._y; @@ -50,4 +50,4 @@ export class AnimationItem return new Point(_local_8, _local_9); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts index 9c4455a1..62b2e598 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/PlaneVisualizationAnimationLayer.ts @@ -105,7 +105,7 @@ export class PlaneVisualizationAnimationLayer implements IDisposable const _local_13 = (this._items[_local_12] as AnimationItem); if(_local_13 != null) { - const _local_14 = _local_13._Str_6729(_arg_7, _arg_8, _arg_9, _arg_10, _arg_11); + const _local_14 = _local_13.getPosition(_arg_7, _arg_8, _arg_9, _arg_10, _arg_11); _local_14.x = (_local_14.x - _arg_5); _local_14.y = (_local_14.y - _arg_6); diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts index 76ae6a0d..70a02762 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterial.ts @@ -50,7 +50,7 @@ export class PlaneMaterial this._isCached = false; } - public _Str_24503(k: number, _arg_2: number, _arg_3: number, _arg_4: number = -1, _arg_5: number = 1, _arg_6: number = -1, _arg_7: number = 1): PlaneMaterialCellMatrix + public addMaterialCellMatrix(k: number, _arg_2: number, _arg_3: number, _arg_4: number = -1, _arg_5: number = 1, _arg_6: number = -1, _arg_7: number = 1): PlaneMaterialCellMatrix { const cellMatrix = new PlaneMaterialCellMatrix(k, _arg_2, _arg_3, _arg_4, _arg_5, _arg_6, _arg_7); @@ -59,7 +59,7 @@ export class PlaneMaterial return cellMatrix; } - public _Str_21968(k: IVector3D): PlaneMaterialCellMatrix + public getMaterialCellMatrix(k: IVector3D): PlaneMaterialCellMatrix { if(!k) return null; @@ -82,7 +82,7 @@ export class PlaneMaterial if(_arg_3 < 1) _arg_3 = 1; - const cellMatrix = this._Str_21968(_arg_4); + const cellMatrix = this.getMaterialCellMatrix(_arg_4); if(!cellMatrix) return null; 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 6073043e..2a7759cb 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -332,7 +332,7 @@ export class PlaneRasterizer implements IPlaneRasterizer if(matrix.columns && matrix.columns.length) { - const cellMatrix = newMaterial._Str_24503(matrix.columns.length, repeatMode, align, normalMinX, normalMaxX, normalMinY, normalMaxY); + const cellMatrix = newMaterial.addMaterialCellMatrix(matrix.columns.length, repeatMode, align, normalMinX, normalMaxX, normalMinY, normalMaxY); let index = 0; diff --git a/src/nitro/room/utils/SpriteDataCollector.ts b/src/nitro/room/utils/SpriteDataCollector.ts index 39a56000..1aebf619 100644 --- a/src/nitro/room/utils/SpriteDataCollector.ts +++ b/src/nitro/room/utils/SpriteDataCollector.ts @@ -395,7 +395,7 @@ export class SpriteDataCollector if(visualization) { const _local_8 = _arg_2.geometry; - const _local_9 = this._Str_25623(visualization._Str_19113, _arg_2, _arg_3); + const _local_9 = this._Str_25623(visualization.planes, _arg_2, _arg_3); const _local_10 = Nitro.instance.stage; for(const _local_11 of _local_9) diff --git a/src/nitro/session/HabboClubLevelEnum.ts b/src/nitro/session/HabboClubLevelEnum.ts index e52a706c..3986c8e8 100644 --- a/src/nitro/session/HabboClubLevelEnum.ts +++ b/src/nitro/session/HabboClubLevelEnum.ts @@ -1,6 +1,6 @@ export class HabboClubLevelEnum { - public static _Str_3159: number = 0; - public static _Str_2964: number = 1; - public static _Str_2575: number = 2; -} \ No newline at end of file + public static NO_CLUB: number = 0; + public static CLUB: number = 1; + public static VIP: number = 2; +} diff --git a/src/nitro/session/RoomUserData.ts b/src/nitro/session/RoomUserData.ts index 1e854420..5bd4648f 100644 --- a/src/nitro/session/RoomUserData.ts +++ b/src/nitro/session/RoomUserData.ts @@ -22,7 +22,7 @@ export class RoomUserData private _canRevive: boolean; private _hasBreedingPermission: boolean; private _botSkills: number[]; - private _Str_9831: boolean; + private _isModerator: boolean; constructor(k: number) { @@ -246,11 +246,11 @@ export class RoomUserData public get isModerator(): boolean { - return this._Str_9831; + return this._isModerator; } public set isModerator(k: boolean) { - this._Str_9831 = k; + this._isModerator = k; } -} \ No newline at end of file +} diff --git a/src/room/object/visualization/IPlaneVisualization.ts b/src/room/object/visualization/IPlaneVisualization.ts index f0602772..65b5de2b 100644 --- a/src/room/object/visualization/IPlaneVisualization.ts +++ b/src/room/object/visualization/IPlaneVisualization.ts @@ -2,5 +2,5 @@ export interface IPlaneVisualization { - _Str_19113: IRoomPlane[]; -} \ No newline at end of file + planes: IRoomPlane[]; +} From e115e6689537ae4303036f2aaacfc703571fa36b Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 8 Jun 2021 17:19:56 -0500 Subject: [PATCH 053/155] cleaned RoomCamera --- src/nitro/room/RoomEngine.ts | 60 +++++++++++++++--------------- src/nitro/room/utils/RoomCamera.ts | 56 ++++++++++++++-------------- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index d305d973..e70b9705 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -1139,10 +1139,10 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(camera) { - camera._Str_10760 = objectId; - camera._Str_16562 = RoomObjectCategory.UNIT; + camera.targetId = objectId; + camera.targetCategory = RoomObjectCategory.UNIT; - camera._Str_19465(this._Str_19549); + camera.activateFollowing(this._Str_19549); } } @@ -1162,7 +1162,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!camera) continue; - const object = this.getRoomObject(instanceData.roomId, camera._Str_10760, camera._Str_16562); + const object = this.getRoomObject(instanceData.roomId, camera.targetId, camera.targetCategory); if(!object) continue; @@ -1214,9 +1214,9 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato roomCamera.reset(); } - if((roomCamera._Str_7609 !== width) || (roomCamera._Str_7902 !== height) || (roomCamera.scale !== roomGeometry.scale) || (roomCamera._Str_16377 !== roomGeometry.updateId) || !Vector3d.isEqual(objectLocation, roomCamera._Str_16185) || roomCamera._Str_12536) + if((roomCamera.screenWd !== width) || (roomCamera.screenHt !== height) || (roomCamera.scale !== roomGeometry.scale) || (roomCamera.geometryUpdateId !== roomGeometry.updateId) || !Vector3d.isEqual(objectLocation, roomCamera.targetObjectLoc) || roomCamera.isMoving) { - roomCamera._Str_16185 = objectLocation; + roomCamera.targetObjectLoc = objectLocation; const _local_15 = new Vector3d(); @@ -1349,11 +1349,11 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato { _local_41 = (150 / height); } - if((((roomCamera._Str_10235) && (roomCamera._Str_7609 == width)) && (roomCamera._Str_7902 == height))) + if((((roomCamera.limitedLocationX) && (roomCamera.screenWd == width)) && (roomCamera.screenHt == height))) { _local_42 = 0; } - if((((roomCamera._Str_10446) && (roomCamera._Str_7609 == width)) && (roomCamera._Str_7902 == height))) + if((((roomCamera.limitedLocationY) && (roomCamera.screenWd == width)) && (roomCamera.screenHt == height))) { _local_40 = 0; _local_41 = 0; @@ -1399,11 +1399,11 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato roomGeometry.location = _local_15; if(this._Str_11555) { - roomCamera._Str_20685(new Vector3d(0, 0, 0)); + roomCamera.initializeLocation(new Vector3d(0, 0, 0)); } else { - roomCamera._Str_20685(_local_15); + roomCamera.initializeLocation(_local_15); } } const _local_45 = roomGeometry.getScreenPoint(_local_15); @@ -1413,10 +1413,10 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato _local_46.x = _local_45.x; _local_46.y = _local_45.y; } - if(((((((((_local_33.x < canvasRectangle.left) || (_local_33.x > canvasRectangle.right)) && (!(roomCamera._Str_8564))) || (((_local_33.y < canvasRectangle.top) || (_local_33.y > canvasRectangle.bottom)) && (!(roomCamera._Str_8690)))) || (((_local_36) && (!(roomCamera._Str_8564))) && (!(roomCamera._Str_7609 == width)))) || (((_local_37) && (!(roomCamera._Str_8690))) && (!(roomCamera._Str_7902 == height)))) || ((!(roomCamera._Str_18975 == bounds.width)) || (!(roomCamera._Str_15953 == bounds.height)))) || ((!(roomCamera._Str_7609 == width)) || (!(roomCamera._Str_7902 == height))))) + if(((((((((_local_33.x < canvasRectangle.left) || (_local_33.x > canvasRectangle.right)) && (!(roomCamera.centeredLocX))) || (((_local_33.y < canvasRectangle.top) || (_local_33.y > canvasRectangle.bottom)) && (!(roomCamera.centeredLocY)))) || (((_local_36) && (!(roomCamera.centeredLocX))) && (!(roomCamera.screenWd == width)))) || (((_local_37) && (!(roomCamera.centeredLocY))) && (!(roomCamera.screenHt == height)))) || ((!(roomCamera.roomWd == bounds.width)) || (!(roomCamera.roomHt == bounds.height)))) || ((!(roomCamera.screenWd == width)) || (!(roomCamera.screenHt == height))))) { - roomCamera._Str_10235 = _local_34; - roomCamera._Str_10446 = _local_35; + roomCamera.limitedLocationX = _local_34; + roomCamera.limitedLocationY = _local_35; if(this._Str_11555) { roomCamera.target = _local_46; @@ -1428,20 +1428,20 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } else { - if(!_local_34) roomCamera._Str_10235 = false; + if(!_local_34) roomCamera.limitedLocationX = false; - if(!_local_35) roomCamera._Str_10446 = false; + if(!_local_35) roomCamera.limitedLocationY = false; } } - roomCamera._Str_8564 = _local_36; - roomCamera._Str_8690 = _local_37; - roomCamera._Str_7609 = width; - roomCamera._Str_7902 = height; + roomCamera.centeredLocX = _local_36; + roomCamera.centeredLocY = _local_37; + roomCamera.screenWd = width; + roomCamera.screenHt = height; roomCamera.scale = roomGeometry.scale; - roomCamera._Str_16377 = roomGeometry.updateId; - roomCamera._Str_18975 = bounds.width; - roomCamera._Str_15953 = bounds.height; + roomCamera.geometryUpdateId = roomGeometry.updateId; + roomCamera.roomWd = bounds.width; + roomCamera.roomHt = bounds.height; if(!this._sessionDataManager.isCameraFollowDisabled) { @@ -1467,10 +1467,10 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } else { - roomCamera._Str_10235 = false; - roomCamera._Str_10446 = false; - roomCamera._Str_8564 = false; - roomCamera._Str_8690 = false; + roomCamera.limitedLocationX = false; + roomCamera.limitedLocationY = false; + roomCamera.centeredLocX = false; + roomCamera.centeredLocY = false; } } @@ -2525,13 +2525,13 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato { if(this._Str_11555) { - if(!camera._Str_12536) + if(!camera.isMoving) { - camera._Str_8564 = false; - camera._Str_8690 = false; + camera.centeredLocX = false; + camera.centeredLocY = false; } - camera._Str_25467(new Vector3d(-(canvas.screenOffsetX), -(canvas.screenOffsetY))); + camera.resetLocation(new Vector3d(-(canvas.screenOffsetX), -(canvas.screenOffsetY))); } if(this._roomDraggingAlwaysCenters) camera.reset(); diff --git a/src/nitro/room/utils/RoomCamera.ts b/src/nitro/room/utils/RoomCamera.ts index 2d80d065..9cd9ec7c 100644 --- a/src/nitro/room/utils/RoomCamera.ts +++ b/src/nitro/room/utils/RoomCamera.ts @@ -36,92 +36,92 @@ export class RoomCamera return this._currentLoc; } - public get _Str_10760(): number + public get targetId(): number { return this._targetId; } - public set _Str_10760(k: number) + public set targetId(k: number) { this._targetId = k; } - public get _Str_16562(): number + public get targetCategory(): number { return this._targetCategory; } - public set _Str_16562(k: number) + public set targetCategory(k: number) { this._targetCategory = k; } - public get _Str_16185():IVector3D + public get targetObjectLoc():IVector3D { return this._targetObjectLoc; } - public set _Str_16185(k:IVector3D) + public set targetObjectLoc(k:IVector3D) { this._targetObjectLoc.assign(k); } - public get _Str_10235(): boolean + public get limitedLocationX(): boolean { return this._limitedLocX; } - public set _Str_10235(k: boolean) + public set limitedLocationX(k: boolean) { this._limitedLocX = k; } - public get _Str_10446(): boolean + public get limitedLocationY(): boolean { return this._limitedLocY; } - public set _Str_10446(k: boolean) + public set limitedLocationY(k: boolean) { this._limitedLocY = k; } - public get _Str_8564(): boolean + public get centeredLocX(): boolean { return this._centeredLocX; } - public set _Str_8564(k: boolean) + public set centeredLocX(k: boolean) { this._centeredLocX = k; } - public get _Str_8690(): boolean + public get centeredLocY(): boolean { return this._centeredLocY; } - public set _Str_8690(k: boolean) + public set centeredLocY(k: boolean) { this._centeredLocY = k; } - public get _Str_7609(): number + public get screenWd(): number { return this._screenWd; } - public set _Str_7609(k: number) + public set screenWd(k: number) { this._screenWd = k; } - public get _Str_7902(): number + public get screenHt(): number { return this._screenHt; } - public set _Str_7902(k: number) + public set screenHt(k: number) { this._screenHt = k; } @@ -140,37 +140,37 @@ export class RoomCamera } } - public get _Str_18975(): number + public get roomWd(): number { return this._roomWd; } - public set _Str_18975(k: number) + public set roomWd(k: number) { this._roomWd = k; } - public get _Str_15953(): number + public get roomHt(): number { return this._roomHt; } - public set _Str_15953(k: number) + public set roomHt(k: number) { this._roomHt = k; } - public get _Str_16377(): number + public get geometryUpdateId(): number { return this._geometryUpdateId; } - public set _Str_16377(k: number) + public set geometryUpdateId(k: number) { this._geometryUpdateId = k; } - public get _Str_12536(): boolean + public get isMoving(): boolean { if(((!(this._targetLoc == null)) && (!(this._currentLoc == null)))) { @@ -201,7 +201,7 @@ export class RoomCamera this._currentLoc = null; } - public _Str_20685(k:IVector3D): void + public initializeLocation(k:IVector3D): void { if(this._currentLoc != null) { @@ -211,7 +211,7 @@ export class RoomCamera this._currentLoc.assign(k); } - public _Str_25467(k:IVector3D): void + public resetLocation(k:IVector3D): void { if(this._currentLoc == null) { @@ -281,7 +281,7 @@ export class RoomCamera this._geometryUpdateId = -1; } - public _Str_19465(k: number): void + public activateFollowing(k: number): void { this._followDuration = k; } From c7487862a2623e05c105f760d808465c533e01ac Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 8 Jun 2021 17:37:36 -0500 Subject: [PATCH 054/155] cleaned WallPlane --- .../rasterizer/animated/LandscapePlane.ts | 6 ++--- .../animated/LandscapeRasterizer.ts | 6 ++--- .../room/rasterizer/basic/FloorPlane.ts | 6 ++--- .../room/rasterizer/basic/PlaneRasterizer.ts | 6 ++--- .../room/rasterizer/basic/WallPlane.ts | 6 ++--- ...RoomSessionDimmerPresetsEventPresetItem.ts | 4 ++-- .../session/events/RoomSessionQueueEvent.ts | 24 +++++++++---------- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts index 28e62cb2..80beaa2b 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapePlane.ts @@ -5,9 +5,9 @@ import { Plane } from '../basic/Plane'; export class LandscapePlane extends Plane { - public static _Str_2531: number = 0xFFFFFF; - public static _Str_5433: number = 45; - public static _Str_5509: number = 30; + public static DEFAULT_COLOR: number = 0xFFFFFF; + public static HORIZONTAL_ANGLE_DEFAULT: number = 45; + public static VERTICAL_ANGLE_DEFAULT: number = 30; private _width: number = 0; private _height: number = 0; diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts index 7257ca59..4ee73554 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts @@ -59,8 +59,8 @@ export class LandscapeRasterizer extends PlaneRasterizer const size = visualization.size; - let horizontalAngle = LandscapePlane._Str_5433; - let verticalAngle = LandscapePlane._Str_5509; + let horizontalAngle = LandscapePlane.HORIZONTAL_ANGLE_DEFAULT; + let verticalAngle = LandscapePlane.VERTICAL_ANGLE_DEFAULT; if(visualization.horizontalAngle) horizontalAngle = visualization.horizontalAngle; if(visualization.verticalAngle) verticalAngle = visualization.verticalAngle; @@ -89,7 +89,7 @@ export class LandscapeRasterizer extends PlaneRasterizer { let material: PlaneMaterial = null; let align: number = PlaneVisualizationLayer._Str_6914; - let color: number = LandscapePlane._Str_2531; + let color: number = LandscapePlane.DEFAULT_COLOR; let offset: number = PlaneVisualizationLayer.DEFAULT_OFFSET; if(layer.materialId) material = this.getMaterial(layer.materialId); diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts index 568bcd1d..d6a5f63e 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorPlane.ts @@ -5,9 +5,9 @@ import { Plane } from './Plane'; export class FloorPlane extends Plane { - public static _Str_2531: number = 0xFFFFFF; - public static _Str_5433: number = 45; - public static _Str_5509: number = 30; + public static DEFAULT_COLOR: number = 0xFFFFFF; + public static HORIZONTAL_ANGLE_DEFAULT: number = 45; + public static VERTICAL_ANGLE_DEFAULT: number = 30; public render(k: Graphics, _arg_2: number, _arg_3: number, size: number, _arg_5: IVector3D, _arg_6: boolean, _arg_7: number, _arg_8: number): Graphics { 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 2a7759cb..0889ab26 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -540,8 +540,8 @@ export class PlaneRasterizer implements IPlaneRasterizer const size = visualization.size; - let horizontalAngle = FloorPlane._Str_5433; - let verticalAngle = FloorPlane._Str_5509; + let horizontalAngle = FloorPlane.HORIZONTAL_ANGLE_DEFAULT; + let verticalAngle = FloorPlane.VERTICAL_ANGLE_DEFAULT; if(visualization.horizontalAngle) horizontalAngle = visualization.horizontalAngle; if(visualization.verticalAngle) verticalAngle = visualization.verticalAngle; @@ -562,7 +562,7 @@ export class PlaneRasterizer implements IPlaneRasterizer { let material: PlaneMaterial = null; let align: number = PlaneVisualizationLayer._Str_6914; - let color: number = FloorPlane._Str_2531; + let color: number = FloorPlane.DEFAULT_COLOR; let offset: number = PlaneVisualizationLayer.DEFAULT_OFFSET; if(layer.materialId) material = this.getMaterial(layer.materialId); diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts index a2bebded..620ba281 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/WallPlane.ts @@ -5,9 +5,9 @@ import { Plane } from './Plane'; export class WallPlane extends Plane { - public static _Str_2531: number = 0xFFFFFF; - public static _Str_5433: number = 45; - public static _Str_5509: number = 30; + public static DEFAULT_COLOR: number = 0xFFFFFF; + public static HORIZONTAL_ANGLE_DEFAULT: number = 45; + public static VERTICAL_ANGLE_DEFAULT: number = 30; public render(k: Graphics, _arg_2: number, _arg_3: number, size: number, _arg_5: IVector3D, _arg_6: boolean): Graphics { diff --git a/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts b/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts index e52afad2..8bccc4c3 100644 --- a/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts +++ b/src/nitro/session/events/RoomSessionDimmerPresetsEventPresetItem.ts @@ -28,8 +28,8 @@ return this._color; } - public get _Str_4272(): number + public get light(): number { return this._light; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionQueueEvent.ts b/src/nitro/session/events/RoomSessionQueueEvent.ts index 18089e5b..ca765402 100644 --- a/src/nitro/session/events/RoomSessionQueueEvent.ts +++ b/src/nitro/session/events/RoomSessionQueueEvent.ts @@ -3,11 +3,11 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionQueueEvent extends RoomSessionEvent { - public static RSQE_QUEUE_STATUS: string = 'RSQE_QUEUE_STATUS'; - public static C: string = 'c'; - public static D: string = 'd'; - public static _Str_14665: number = 2; - public static _Str_14078: number = 1; + public static QUEUE_STATUS: string = 'RSQE_QUEUE_STATUS'; + public static QUEUE_TYPE_CLUB: string = 'c'; + public static QUEUE_TYPE_NORMAL: string = 'd'; + public static QUEUE_TARGET_VISITOR: number = 2; + public static QUEUE_TARGET_SPECTATOR: number = 1; private _name: string; private _target: number; @@ -17,7 +17,7 @@ export class RoomSessionQueueEvent extends RoomSessionEvent constructor(k: IRoomSession, _arg_2: string, _arg_3: number, _arg_4: boolean = false) { - super(RoomSessionQueueEvent.RSQE_QUEUE_STATUS, k); + super(RoomSessionQueueEvent.QUEUE_STATUS, k); this._name = _arg_2; this._target = _arg_3; @@ -30,28 +30,28 @@ export class RoomSessionQueueEvent extends RoomSessionEvent return this._isActive; } - public get _Str_26076(): string + public get queueSetName(): string { return this._name; } - public get _Str_22709(): number + public get queueSetTarget(): number { return this._target; } - public get _Str_14282(): string[] + public get queueTypes(): string[] { return Array.from(this._queues.keys()); } - public _Str_11510(k: string): number + public getQueueSize(k: string): number { return this._queues.get(k); } - public _Str_17628(k: string, _arg_2: number): void + public addQueue(k: string, _arg_2: number): void { this._queues.set(k, _arg_2); } -} \ No newline at end of file +} From 2dd8306c3bc62e81f60cccc4307cf88b3109918d Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 8 Jun 2021 17:48:37 -0500 Subject: [PATCH 055/155] cleaned FloorRasterizer --- .../logic/furniture/FurnitureScoreLogic.ts | 6 +++--- .../logic/furniture/FurnitureVoteCounterLogic.ts | 6 +++--- .../rasterizer/animated/LandscapeRasterizer.ts | 16 ++++++++-------- .../room/rasterizer/basic/FloorRasterizer.ts | 4 ++-- .../room/rasterizer/basic/WallRasterizer.ts | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/nitro/room/object/logic/furniture/FurnitureScoreLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureScoreLogic.ts index 99e53692..a9cf6297 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureScoreLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureScoreLogic.ts @@ -5,7 +5,7 @@ import { FurnitureLogic } from './FurnitureLogic'; export class FurnitureScoreLogic extends FurnitureLogic { - private static _Str_3536: number = 50; + private static UPDATE_INTERVAL: number = 50; private static _Str_5967: number = 3000; private _score: number; @@ -40,8 +40,8 @@ export class FurnitureScoreLogic extends FurnitureLogic if(difference < 0) difference = -(difference); - if((difference * FurnitureScoreLogic._Str_3536) > FurnitureScoreLogic._Str_5967) this._scoreIncreaser = (FurnitureScoreLogic._Str_5967 / difference); - else this._scoreIncreaser = FurnitureScoreLogic._Str_3536; + if((difference * FurnitureScoreLogic.UPDATE_INTERVAL) > FurnitureScoreLogic._Str_5967) this._scoreIncreaser = (FurnitureScoreLogic._Str_5967 / difference); + else this._scoreIncreaser = FurnitureScoreLogic.UPDATE_INTERVAL; this._scoreTimer = Nitro.instance.time; } diff --git a/src/nitro/room/object/logic/furniture/FurnitureVoteCounterLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureVoteCounterLogic.ts index f3ade08a..a5c9422e 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureVoteCounterLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureVoteCounterLogic.ts @@ -7,7 +7,7 @@ import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; export class FurnitureVoteCounterLogic extends FurnitureMultiStateLogic { - private static _Str_3536: number = 33; + private static UPDATE_INTERVAL: number = 33; private static _Str_5967: number = 1000; private _total: number; @@ -54,13 +54,13 @@ export class FurnitureVoteCounterLogic extends FurnitureMultiStateLogic { const difference = Math.abs((this._total - this._Str_8221)); - if((difference * FurnitureVoteCounterLogic._Str_3536) > FurnitureVoteCounterLogic._Str_5967) + if((difference * FurnitureVoteCounterLogic.UPDATE_INTERVAL) > FurnitureVoteCounterLogic._Str_5967) { this._interval = (FurnitureVoteCounterLogic._Str_5967 / difference); } else { - this._interval = FurnitureVoteCounterLogic._Str_3536; + this._interval = FurnitureVoteCounterLogic.UPDATE_INTERVAL; } this._lastUpdate = Nitro.instance.time; diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts index 4ee73554..b93591ee 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts @@ -10,7 +10,7 @@ import { LandscapePlane } from './LandscapePlane'; export class LandscapeRasterizer extends PlaneRasterizer { - private static _Str_3536: number = 500; + private static UPDATE_INTERVAL: number = 500; private _landscapeWidth: number = 0; private _landscapeHeight: number = 0; @@ -33,10 +33,10 @@ export class LandscapeRasterizer extends PlaneRasterizer const landscapes = this.data.landscapes; - if(landscapes && landscapes.length) this._Str_25478(landscapes); + if(landscapes && landscapes.length) this.parseLandscapes(landscapes); } - private _Str_25478(k: any): void + private parseLandscapes(k: any): void { if(!k) return; @@ -137,8 +137,8 @@ export class LandscapeRasterizer extends PlaneRasterizer { const id = item.id; const assetId = item.assetId; - const x = this._Str_21504(item.x || '', item.randomX || ''); - const y = this._Str_21504(item.y || '', item.randomY || ''); + const x = this.getCoordinateValue(item.x || '', item.randomX || ''); + const y = this.getCoordinateValue(item.y || '', item.randomY || ''); const speedX = item.speedX ? item.speedX / Nitro.instance.getConfiguration('animation.fps') : 0; const speedY = item.speedY ? item.speedY / Nitro.instance.getConfiguration('animation.fps') : 0; @@ -166,7 +166,7 @@ export class LandscapeRasterizer extends PlaneRasterizer } } - private _Str_21504(k: string, _arg_2: string): number + private getCoordinateValue(k: string, _arg_2: string): number { let _local_3 = 0; @@ -221,9 +221,9 @@ export class LandscapeRasterizer extends PlaneRasterizer let planeBitmapData: PlaneBitmapData = null; - if(!plane.isStatic(scale) && (LandscapeRasterizer._Str_3536 > 0)) + if(!plane.isStatic(scale) && (LandscapeRasterizer.UPDATE_INTERVAL > 0)) { - planeBitmapData = new PlaneBitmapData(graphic, ((Math.round((timeSinceStartMs / LandscapeRasterizer._Str_3536)) * LandscapeRasterizer._Str_3536) + LandscapeRasterizer._Str_3536)); + planeBitmapData = new PlaneBitmapData(graphic, ((Math.round((timeSinceStartMs / LandscapeRasterizer.UPDATE_INTERVAL)) * LandscapeRasterizer.UPDATE_INTERVAL) + LandscapeRasterizer.UPDATE_INTERVAL)); } else { diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts index d5b30e16..541de89a 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/FloorRasterizer.ts @@ -12,10 +12,10 @@ export class FloorRasterizer extends PlaneRasterizer const floors = this.data.floors; - if(floors && floors.length) this._Str_24495(floors); + if(floors && floors.length) this.parseFloors(floors); } - private _Str_24495(k: any): void + private parseFloors(k: any): void { if(!k) return; diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts index 4cea3fdf..284347c8 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/WallRasterizer.ts @@ -12,10 +12,10 @@ export class WallRasterizer extends PlaneRasterizer const walls = this.data.walls; - if(walls && walls.length) this._Str_24495(walls); + if(walls && walls.length) this.parseWalls(walls); } - private _Str_24495(k: any): void + private parseWalls(k: any): void { if(!k) return; From 75f15cc73f3923c9c3d7c224469fed3c810f710d Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 8 Jun 2021 18:11:09 -0500 Subject: [PATCH 056/155] cleaned IsBadgeRequestFulfilledParser --- .../incoming/inventory/badges/_Str_8120.ts | 12 +++---- .../incoming/inventory/badges/_Str_8179.ts | 12 +++---- .../incoming/inventory/badges/_Str_8980.ts | 12 +++---- .../{_Str_7446.ts => BadgeAndPointLimit.ts} | 6 ++-- ..._Str_7305.ts => BadgePointLimitsParser.ts} | 16 ++++----- .../inventory/badges/BadgeReceivedParser.ts | 36 +++++++++++++++++++ .../badges/IsBadgeRequestFulfilledParser.ts | 33 +++++++++++++++++ .../parser/inventory/badges/_Str_7491.ts | 36 ------------------- .../parser/inventory/badges/_Str_9135.ts | 33 ----------------- .../messages/parser/inventory/badges/index.ts | 8 ++--- src/nitro/session/IgnoredUsersManager.ts | 10 +++--- 11 files changed, 107 insertions(+), 107 deletions(-) rename src/nitro/communication/messages/parser/inventory/badges/{_Str_7446.ts => BadgeAndPointLimit.ts} (75%) rename src/nitro/communication/messages/parser/inventory/badges/{_Str_7305.ts => BadgePointLimitsParser.ts} (51%) create mode 100644 src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser.ts create mode 100644 src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser.ts delete mode 100644 src/nitro/communication/messages/parser/inventory/badges/_Str_7491.ts delete mode 100644 src/nitro/communication/messages/parser/inventory/badges/_Str_9135.ts diff --git a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8120.ts b/src/nitro/communication/messages/incoming/inventory/badges/_Str_8120.ts index f3413334..71b80984 100644 --- a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8120.ts +++ b/src/nitro/communication/messages/incoming/inventory/badges/_Str_8120.ts @@ -1,16 +1,16 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { BadgeReceivedParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser'; +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { _Str_7491 } from '../../../parser/inventory/badges/_Str_7491'; export class _Str_8120 extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, _Str_7491); + super(callBack, BadgeReceivedParser); } - public getParser(): _Str_7491 + public getParser(): BadgeReceivedParser { - return this.parser as _Str_7491; + return this.parser as BadgeReceivedParser; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8179.ts b/src/nitro/communication/messages/incoming/inventory/badges/_Str_8179.ts index 15feb804..4128d05c 100644 --- a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8179.ts +++ b/src/nitro/communication/messages/incoming/inventory/badges/_Str_8179.ts @@ -1,16 +1,16 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { IsBadgeRequestFulfilledParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser'; +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { _Str_9135 } from '../../../parser/inventory/badges/_Str_9135'; export class _Str_8179 extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, _Str_9135); + super(callBack, IsBadgeRequestFulfilledParser); } - public getParser(): _Str_9135 + public getParser(): IsBadgeRequestFulfilledParser { - return this.parser as _Str_9135; + return this.parser as IsBadgeRequestFulfilledParser; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8980.ts b/src/nitro/communication/messages/incoming/inventory/badges/_Str_8980.ts index 75597335..72178d60 100644 --- a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8980.ts +++ b/src/nitro/communication/messages/incoming/inventory/badges/_Str_8980.ts @@ -1,16 +1,16 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { BadgePointLimitsParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser'; +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { _Str_7305 } from '../../../parser/inventory/badges/_Str_7305'; export class _Str_8980 extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, _Str_7305); + super(callBack, BadgePointLimitsParser); } - public getParser(): _Str_7305 + public getParser(): BadgePointLimitsParser { - return this.parser as _Str_7305; + return this.parser as BadgePointLimitsParser; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/badges/_Str_7446.ts b/src/nitro/communication/messages/parser/inventory/badges/BadgeAndPointLimit.ts similarity index 75% rename from src/nitro/communication/messages/parser/inventory/badges/_Str_7446.ts rename to src/nitro/communication/messages/parser/inventory/badges/BadgeAndPointLimit.ts index 775d3382..c6d29381 100644 --- a/src/nitro/communication/messages/parser/inventory/badges/_Str_7446.ts +++ b/src/nitro/communication/messages/parser/inventory/badges/BadgeAndPointLimit.ts @@ -1,6 +1,6 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; -export class _Str_7446 +export class BadgeAndPointLimit { private _badgeId: string; private _limit: number; @@ -22,4 +22,4 @@ export class _Str_7446 { return this._limit; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/badges/_Str_7305.ts b/src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser.ts similarity index 51% rename from src/nitro/communication/messages/parser/inventory/badges/_Str_7305.ts rename to src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser.ts index c3f977d8..f06d8be9 100644 --- a/src/nitro/communication/messages/parser/inventory/badges/_Str_7305.ts +++ b/src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser.ts @@ -1,10 +1,10 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { _Str_7446 } from './_Str_7446'; +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from 'nitro-renderer/src/core/communication/messages/IMessageParser'; +import { BadgeAndPointLimit } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/BadgeAndPointLimit'; -export class _Str_7305 implements IMessageParser +export class BadgePointLimitsParser implements IMessageParser { - private _data: _Str_7446[]; + private _data: BadgeAndPointLimit[]; public flush(): boolean { @@ -28,7 +28,7 @@ export class _Str_7305 implements IMessageParser while(_local_6 < _local_5) { - this._data.push(new _Str_7446(_local_4, wrapper)); + this._data.push(new BadgeAndPointLimit(_local_4, wrapper)); _local_6++; } @@ -39,8 +39,8 @@ export class _Str_7305 implements IMessageParser return true; } - public get data(): _Str_7446[] + public get data(): BadgeAndPointLimit[] { return this._data; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser.ts b/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser.ts new file mode 100644 index 00000000..90d226ab --- /dev/null +++ b/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser.ts @@ -0,0 +1,36 @@ +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from 'nitro-renderer/src/core/communication/messages/IMessageParser'; + +export class BadgeReceivedParser implements IMessageParser +{ + private _badgeId: number; + private _badgeCode: string; + + public flush(): boolean + { + this._badgeId = 0; + this._badgeCode = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._badgeId = wrapper.readInt(); + this._badgeCode = wrapper.readString(); + + return true; + } + + public get badgeId(): number + { + return this._badgeId; + } + + public get badgeCode(): string + { + return this._badgeCode; + } +} diff --git a/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser.ts b/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser.ts new file mode 100644 index 00000000..c089af44 --- /dev/null +++ b/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser.ts @@ -0,0 +1,33 @@ +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from 'nitro-renderer/src/core/communication/messages/IMessageParser'; + +export class IsBadgeRequestFulfilledParser implements IMessageParser +{ + private _requestCode: string; + private _fulfilled: boolean; + + public flush(): boolean + { + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._requestCode = wrapper.readString(); + this._fulfilled = wrapper.readBoolean(); + + return true; + } + + public get requestCode(): string + { + return this._requestCode; + } + + public get fulfilled(): boolean + { + return this._fulfilled; + } +} diff --git a/src/nitro/communication/messages/parser/inventory/badges/_Str_7491.ts b/src/nitro/communication/messages/parser/inventory/badges/_Str_7491.ts deleted file mode 100644 index e6eb6a18..00000000 --- a/src/nitro/communication/messages/parser/inventory/badges/_Str_7491.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; - -export class _Str_7491 implements IMessageParser -{ - private _badgeId: number; - private _Str_2722: string; - - public flush(): boolean - { - this._badgeId = 0; - this._Str_2722 = null; - - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - this._badgeId = wrapper.readInt(); - this._Str_2722 = wrapper.readString(); - - return true; - } - - public get badgeId(): number - { - return this._badgeId; - } - - public get _Str_2494(): string - { - return this._Str_2722; - } -} \ No newline at end of file diff --git a/src/nitro/communication/messages/parser/inventory/badges/_Str_9135.ts b/src/nitro/communication/messages/parser/inventory/badges/_Str_9135.ts deleted file mode 100644 index 29ffa69c..00000000 --- a/src/nitro/communication/messages/parser/inventory/badges/_Str_9135.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; - -export class _Str_9135 implements IMessageParser -{ - private _Str_10244: string; - private _Str_22220: boolean; - - public flush(): boolean - { - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - this._Str_10244 = wrapper.readString(); - this._Str_22220 = wrapper.readBoolean(); - - return true; - } - - public get _Str_25181(): string - { - return this._Str_10244; - } - - public get _Str_25366(): boolean - { - return this._Str_22220; - } -} \ No newline at end of file diff --git a/src/nitro/communication/messages/parser/inventory/badges/index.ts b/src/nitro/communication/messages/parser/inventory/badges/index.ts index b849f91b..5ba16864 100644 --- a/src/nitro/communication/messages/parser/inventory/badges/index.ts +++ b/src/nitro/communication/messages/parser/inventory/badges/index.ts @@ -1,5 +1,5 @@ +export * from './BadgeAndPointLimit'; +export * from './BadgePointLimitsParser'; +export * from './BadgeReceivedParser'; export * from './BadgesParser'; -export * from './_Str_7305'; -export * from './_Str_7446'; -export * from './_Str_7491'; -export * from './_Str_9135'; +export * from './IsBadgeRequestFulfilledParser'; diff --git a/src/nitro/session/IgnoredUsersManager.ts b/src/nitro/session/IgnoredUsersManager.ts index bb356045..a3360676 100644 --- a/src/nitro/session/IgnoredUsersManager.ts +++ b/src/nitro/session/IgnoredUsersManager.ts @@ -79,24 +79,24 @@ export class IgnoredUsersManager implements IDisposable case 0: return; case 1: - this._Str_19721(name); + this.addUserToIgnoreList(name); return; case 2: - this._Str_19721(name); + this.addUserToIgnoreList(name); this._ignoredUsers.shift(); return; case 3: - this._Str_23631(name); + this.removeUserFromIgnoreList(name); return; } } - private _Str_19721(name: string): void + private addUserToIgnoreList(name: string): void { if(this._ignoredUsers.indexOf(name) < 0) this._ignoredUsers.push(name); } - private _Str_23631(name: string): void + private removeUserFromIgnoreList(name: string): void { const index = this._ignoredUsers.indexOf(name); From b7351d372cc3cc17c7bc02ce5e636c0d5db56bd1 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 8 Jun 2021 18:36:38 -0500 Subject: [PATCH 057/155] cleaned AchievementData --- .../inventory/achievements/Achievement.ts | 156 ------------------ .../inventory/achievements/AchievementData.ts | 156 ++++++++++++++++++ .../incoming/inventory/achievements/index.ts | 2 +- .../achievements/AchievementParser.ts | 10 +- .../achievements/AchievementsParser.ts | 12 +- 5 files changed, 168 insertions(+), 168 deletions(-) delete mode 100644 src/nitro/communication/messages/incoming/inventory/achievements/Achievement.ts create mode 100644 src/nitro/communication/messages/incoming/inventory/achievements/AchievementData.ts diff --git a/src/nitro/communication/messages/incoming/inventory/achievements/Achievement.ts b/src/nitro/communication/messages/incoming/inventory/achievements/Achievement.ts deleted file mode 100644 index fc7efce0..00000000 --- a/src/nitro/communication/messages/incoming/inventory/achievements/Achievement.ts +++ /dev/null @@ -1,156 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; - -export class Achievement -{ - public static _Str_21736: number = -1; - public static _Str_21318: number = 0; - public static _Str_15908: number = 1; - public static _Str_20384: number = 2; - - private _achievementId: number; - private _level: number; - private _badgeId: string; - private _Str_6791: number; - private _Str_18274: number; - private _Str_10280: number; - private _Str_12282: number; - private _Str_19007: number; - private _Str_16081: boolean; - private _category: string; - private _Str_21707: string; - private _Str_20339: number; - private _Str_19099: number; - - private _unseen: number = 0; - - constructor(wrapper: IMessageDataWrapper) - { - if(!wrapper) throw new Error('invalid_parser'); - - this._achievementId = wrapper.readInt(); - this._level = wrapper.readInt(); - this._badgeId = wrapper.readString(); - this._Str_6791 = wrapper.readInt(); - this._Str_18274 = Math.max(1, wrapper.readInt()); - this._Str_10280 = wrapper.readInt(); - this._Str_12282 = wrapper.readInt(); - this._Str_19007 = wrapper.readInt(); - this._Str_16081 = wrapper.readBoolean(); - this._category = wrapper.readString(); - this._Str_21707 = wrapper.readString(); - this._Str_20339 = wrapper.readInt(); - this._Str_19099 = wrapper.readInt(); - } - - public get achievementId(): number - { - return this._achievementId; - } - - public get badgeId(): string - { - return this._badgeId; - } - - public get level(): number - { - return this._level; - } - - public get _Str_25209(): number - { - return this._Str_6791; - } - - public get _Str_24142(): number - { - return (this._Str_18274 - this._Str_6791); - } - - public get rewardAmount(): number - { - return this._Str_10280; - } - - public get rewardType(): number - { - return this._Str_12282; - } - - public get _Str_22939(): number - { - return (this._Str_19007 - this._Str_6791); - } - - public get _Str_7518(): boolean - { - return this._Str_16081; - } - - public get category(): string - { - return this._category; - } - - public get _Str_25896(): string - { - return this._Str_21707; - } - - public get totalLevels(): number - { - return this._Str_20339; - } - - public get _Str_10438(): boolean - { - return (this._level > 1) || (this._Str_16081); - } - - public _Str_24410(): void - { - this._Str_19007 = this._Str_18274; - } - - public get _Str_24874(): number - { - return this._Str_19099; - } - - public get progress(): number - { - return this._Str_19007; - } - - public get toNextProgress(): number - { - return this._Str_18274; - } - - public set unseen(unseen: number) - { - this._unseen = unseen; - } - - public get unseen(): number - { - return this._unseen; - } - - public reset(badge: Achievement) - { - this._achievementId = badge._achievementId; - this._level = badge._level; - this._badgeId = badge._badgeId; - this._Str_6791 = badge._Str_6791; - this._Str_18274 = badge._Str_18274; - this._Str_10280 = badge._Str_10280; - this._Str_12282 = badge._Str_12282; - this._Str_19007 = badge._Str_19007; - this._Str_16081 = badge._Str_16081; - this._category = badge.category; - this._Str_21707 = badge._Str_21707; - this._Str_20339 = badge._Str_20339; - this._Str_19099 = badge._Str_19099; - } -} \ No newline at end of file diff --git a/src/nitro/communication/messages/incoming/inventory/achievements/AchievementData.ts b/src/nitro/communication/messages/incoming/inventory/achievements/AchievementData.ts new file mode 100644 index 00000000..005a4d10 --- /dev/null +++ b/src/nitro/communication/messages/incoming/inventory/achievements/AchievementData.ts @@ -0,0 +1,156 @@ +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; + +export class AchievementData +{ + public static DISPLAY_METHOD_OBSOLETE: number = -1; + public static DISPLAY_METHOD_SHOW_LEVEL_PROGRESS: number = 0; + public static DISPLAY_METHOD_NEVER_SHOW_PROGRESS: number = 1; + public static DISPLAY_METHOD_SHOW_TOTAL_PROGRESS: number = 2; + + private _achievementId: number; + private _level: number; + private _badgeId: string; + private _scoreAtStartOfLevel: number; + private _scoreLimit: number; + private _levelRewardPoints: number; + private _levelRewardPointType: number; + private _currentPoints: number; + private _finalLevel: boolean; + private _category: string; + private _subCategory: string; + private _levelCount: number; + private _displayMethod: number; + + private _unseen: number = 0; + + constructor(wrapper: IMessageDataWrapper) + { + if(!wrapper) throw new Error('invalid_parser'); + + this._achievementId = wrapper.readInt(); + this._level = wrapper.readInt(); + this._badgeId = wrapper.readString(); + this._scoreAtStartOfLevel = wrapper.readInt(); + this._scoreLimit = Math.max(1, wrapper.readInt()); + this._levelRewardPoints = wrapper.readInt(); + this._levelRewardPointType = wrapper.readInt(); + this._currentPoints = wrapper.readInt(); + this._finalLevel = wrapper.readBoolean(); + this._category = wrapper.readString(); + this._subCategory = wrapper.readString(); + this._levelCount = wrapper.readInt(); + this._displayMethod = wrapper.readInt(); + } + + public get achievementId(): number + { + return this._achievementId; + } + + public get badgeId(): string + { + return this._badgeId; + } + + public get level(): number + { + return this._level; + } + + public get scoreAtStartOfLevel(): number + { + return this._scoreAtStartOfLevel; + } + + public get scoreLimit(): number + { + return (this._scoreLimit - this._scoreAtStartOfLevel); + } + + public get levelRewardPoints(): number + { + return this._levelRewardPoints; + } + + public get levelRewardPointType(): number + { + return this._levelRewardPointType; + } + + public get currentPoints(): number + { + return (this._currentPoints - this._scoreAtStartOfLevel); + } + + public get finalLevel(): boolean + { + return this._finalLevel; + } + + public get category(): string + { + return this._category; + } + + public get subCategory(): string + { + return this._subCategory; + } + + public get levelCount(): number + { + return this._levelCount; + } + + public get firstLevelAchieved(): boolean + { + return (this._level > 1) || (this._finalLevel); + } + + public setMaxProgress(): void + { + this._currentPoints = this._scoreLimit; + } + + public get displayMethod(): number + { + return this._displayMethod; + } + + public get progress(): number + { + return this._currentPoints; + } + + public get toNextProgress(): number + { + return this._scoreLimit; + } + + public set unseen(unseen: number) + { + this._unseen = unseen; + } + + public get unseen(): number + { + return this._unseen; + } + + public reset(badge: AchievementData) + { + this._achievementId = badge._achievementId; + this._level = badge._level; + this._badgeId = badge._badgeId; + this._scoreAtStartOfLevel = badge._scoreAtStartOfLevel; + this._scoreLimit = badge._scoreLimit; + this._levelRewardPoints = badge._levelRewardPoints; + this._levelRewardPointType = badge._levelRewardPointType; + this._currentPoints = badge._currentPoints; + this._finalLevel = badge._finalLevel; + this._category = badge.category; + this._subCategory = badge._subCategory; + this._levelCount = badge._levelCount; + this._displayMethod = badge._displayMethod; + } +} diff --git a/src/nitro/communication/messages/incoming/inventory/achievements/index.ts b/src/nitro/communication/messages/incoming/inventory/achievements/index.ts index edebe5a4..91d4ad95 100644 --- a/src/nitro/communication/messages/incoming/inventory/achievements/index.ts +++ b/src/nitro/communication/messages/incoming/inventory/achievements/index.ts @@ -1,4 +1,4 @@ -export * from './Achievement'; +export * from './AchievementData'; export * from './AchievementEvent'; export * from './AchievementResolution'; export * from './AchievementsEvent'; diff --git a/src/nitro/communication/messages/parser/inventory/achievements/AchievementParser.ts b/src/nitro/communication/messages/parser/inventory/achievements/AchievementParser.ts index cd8fa43f..3a67b502 100644 --- a/src/nitro/communication/messages/parser/inventory/achievements/AchievementParser.ts +++ b/src/nitro/communication/messages/parser/inventory/achievements/AchievementParser.ts @@ -1,10 +1,10 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { Achievement } from '../../../incoming/inventory/achievements/Achievement'; +import { AchievementData } from '../../../incoming/inventory/achievements/AchievementData'; export class AchievementParser implements IMessageParser { - private _achievement: Achievement; + private _achievement: AchievementData; public flush(): boolean { @@ -17,13 +17,13 @@ export class AchievementParser implements IMessageParser { if(!k) return false; - this._achievement = new Achievement(k); + this._achievement = new AchievementData(k); return true; } - public get achievement(): Achievement + public get achievement(): AchievementData { return this._achievement; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts b/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts index 9e7b081a..682c1317 100644 --- a/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts +++ b/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts @@ -1,10 +1,10 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { AchievementData } from 'nitro-renderer/src/nitro/communication/messages/incoming/inventory/achievements/AchievementData'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { Achievement } from '../../../incoming/inventory/achievements/Achievement'; export class AchievementsParser implements IMessageParser { - private _achievements: Achievement[]; + private _achievements: AchievementData[]; private _Str_19269: string; public flush(): boolean @@ -25,7 +25,7 @@ export class AchievementsParser implements IMessageParser while(totalCount > 0) { - this._achievements.push(new Achievement(k)); + this._achievements.push(new AchievementData(k)); totalCount--; } @@ -35,7 +35,7 @@ export class AchievementsParser implements IMessageParser return true; } - public get achievements(): Achievement[] + public get achievements(): AchievementData[] { return this._achievements; } @@ -44,4 +44,4 @@ export class AchievementsParser implements IMessageParser { return this._Str_19269; } -} \ No newline at end of file +} From d5843fc8bda18ce46f11df776351dea8ce7dd04e Mon Sep 17 00:00:00 2001 From: Dank074 Date: Tue, 8 Jun 2021 19:07:46 -0500 Subject: [PATCH 058/155] cleaned IsBadgeRequestFulfilledEvent --- .../inventory/badges/BadgePointLimitsEvent.ts | 16 ++++++++++++++++ .../inventory/badges/BadgeReceivedEvent.ts | 16 ++++++++++++++++ .../badges/IsBadgeRequestFulfilledEvent.ts | 16 ++++++++++++++++ .../incoming/inventory/badges/_Str_8120.ts | 16 ---------------- .../incoming/inventory/badges/_Str_8179.ts | 16 ---------------- .../incoming/inventory/badges/_Str_8980.ts | 16 ---------------- .../messages/incoming/inventory/badges/index.ts | 6 +++--- 7 files changed, 51 insertions(+), 51 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/inventory/badges/BadgePointLimitsEvent.ts create mode 100644 src/nitro/communication/messages/incoming/inventory/badges/BadgeReceivedEvent.ts create mode 100644 src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts delete mode 100644 src/nitro/communication/messages/incoming/inventory/badges/_Str_8120.ts delete mode 100644 src/nitro/communication/messages/incoming/inventory/badges/_Str_8179.ts delete mode 100644 src/nitro/communication/messages/incoming/inventory/badges/_Str_8980.ts diff --git a/src/nitro/communication/messages/incoming/inventory/badges/BadgePointLimitsEvent.ts b/src/nitro/communication/messages/incoming/inventory/badges/BadgePointLimitsEvent.ts new file mode 100644 index 00000000..061c7e08 --- /dev/null +++ b/src/nitro/communication/messages/incoming/inventory/badges/BadgePointLimitsEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from 'nitro-renderer/src/core/communication/messages/IMessageEvent'; +import { MessageEvent } from 'nitro-renderer/src/core/communication/messages/MessageEvent'; +import { BadgePointLimitsParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser'; + +export class BadgePointLimitsEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, BadgePointLimitsParser); + } + + public getParser(): BadgePointLimitsParser + { + return this.parser as BadgePointLimitsParser; + } +} diff --git a/src/nitro/communication/messages/incoming/inventory/badges/BadgeReceivedEvent.ts b/src/nitro/communication/messages/incoming/inventory/badges/BadgeReceivedEvent.ts new file mode 100644 index 00000000..71338979 --- /dev/null +++ b/src/nitro/communication/messages/incoming/inventory/badges/BadgeReceivedEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from 'nitro-renderer/src/core/communication/messages/IMessageEvent'; +import { MessageEvent } from 'nitro-renderer/src/core/communication/messages/MessageEvent'; +import { BadgeReceivedParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser'; + +export class BadgeReceivedEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, BadgeReceivedParser); + } + + public getParser(): BadgeReceivedParser + { + return this.parser as BadgeReceivedParser; + } +} diff --git a/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts b/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts new file mode 100644 index 00000000..87b97c87 --- /dev/null +++ b/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from 'nitro-renderer/src/core/communication/messages/IMessageEvent'; +import { MessageEvent } from 'nitro-renderer/src/core/communication/messages/MessageEvent'; +import { IsBadgeRequestFulfilledParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser'; + +export class IsBadgeRequestFulfilledEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, IsBadgeRequestFulfilledParser); + } + + public getParser(): IsBadgeRequestFulfilledParser + { + return this.parser as IsBadgeRequestFulfilledParser; + } +} diff --git a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8120.ts b/src/nitro/communication/messages/incoming/inventory/badges/_Str_8120.ts deleted file mode 100644 index 71b80984..00000000 --- a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8120.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { BadgeReceivedParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser'; -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; - -export class _Str_8120 extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, BadgeReceivedParser); - } - - public getParser(): BadgeReceivedParser - { - return this.parser as BadgeReceivedParser; - } -} diff --git a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8179.ts b/src/nitro/communication/messages/incoming/inventory/badges/_Str_8179.ts deleted file mode 100644 index 4128d05c..00000000 --- a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8179.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IsBadgeRequestFulfilledParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser'; -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; - -export class _Str_8179 extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, IsBadgeRequestFulfilledParser); - } - - public getParser(): IsBadgeRequestFulfilledParser - { - return this.parser as IsBadgeRequestFulfilledParser; - } -} diff --git a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8980.ts b/src/nitro/communication/messages/incoming/inventory/badges/_Str_8980.ts deleted file mode 100644 index 72178d60..00000000 --- a/src/nitro/communication/messages/incoming/inventory/badges/_Str_8980.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { BadgePointLimitsParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser'; -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; - -export class _Str_8980 extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, BadgePointLimitsParser); - } - - public getParser(): BadgePointLimitsParser - { - return this.parser as BadgePointLimitsParser; - } -} diff --git a/src/nitro/communication/messages/incoming/inventory/badges/index.ts b/src/nitro/communication/messages/incoming/inventory/badges/index.ts index 165da41a..fe4c995d 100644 --- a/src/nitro/communication/messages/incoming/inventory/badges/index.ts +++ b/src/nitro/communication/messages/incoming/inventory/badges/index.ts @@ -1,4 +1,4 @@ +export * from './BadgePointLimitsEvent'; +export * from './BadgeReceivedEvent'; export * from './BadgesEvent'; -export * from './_Str_8120'; -export * from './_Str_8179'; -export * from './_Str_8980'; +export * from './IsBadgeRequestFulfilledEvent'; From c56f0d86c1af2c1c95d750d7592c59c415e94abf Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 10 Jun 2021 03:02:26 -0400 Subject: [PATCH 059/155] FPS update --- src/nitro/Nitro.ts | 2 +- src/room/renderer/RoomSpriteCanvas.ts | 81 ++++++++++++++++----------- 2 files changed, 49 insertions(+), 34 deletions(-) diff --git a/src/nitro/Nitro.ts b/src/nitro/Nitro.ts index 4f8fa875..a286a053 100644 --- a/src/nitro/Nitro.ts +++ b/src/nitro/Nitro.ts @@ -221,7 +221,7 @@ export class Nitro extends Application implements INitro const animationFPS = this.getConfiguration('animation.fps', 24); const limitsFPS = this.getConfiguration('limits.fps', true); - Nitro.instance.ticker.maxFPS = animationFPS; + if(limitsFPS) Nitro.instance.ticker.maxFPS = animationFPS; } private onRoomEngineReady(event: RoomEngineEvent): void diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index e9b25172..09912b3d 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -26,7 +26,10 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas private _container: IRoomSpriteCanvasContainer; private _geometry: RoomGeometry; + private _animationFPS: number; private _renderTimestamp: number; + private _totalTimeRunning: number; + private _lastFrame: number; private _master: Sprite; private _display: Container; @@ -71,7 +74,10 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas this._container = container; this._geometry = new RoomGeometry(scale, new Vector3d(-135, 30, 0), new Vector3d(11, 11, 5), new Vector3d(-135, 0.5, 0)); + this._animationFPS = Nitro.instance.getConfiguration('animation.fps', 24); this._renderTimestamp = 0; + this._totalTimeRunning = 0; + this._lastFrame = 0; this._master = null; this._display = null; @@ -321,12 +327,14 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas { this._canvasUpdated = false; + this._totalTimeRunning += Nitro.instance.ticker.deltaTime; + + if(this._totalTimeRunning === this._renderTimestamp) return; + if(time === -1) time = (this._renderTimestamp + 1); if(!this._container || !this._geometry) return; - if(time === this._renderTimestamp) return; - if((this._width !== this._renderedWidth) || (this._height !== this._renderedHeight)) update = true; if((this._display.x !== this._screenOffsetX) || (this._display.y !== this._screenOffsetY)) @@ -344,46 +352,53 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas update = true; } - let spriteCount = 0; + const frame = Math.round(this._totalTimeRunning / (60 / this._animationFPS)); - const objects = this._container.objects; - - if(objects.size) + if(frame !== this._lastFrame) { - for(const object of objects.values()) + this._lastFrame = frame; + + let spriteCount = 0; + + const objects = this._container.objects; + + if(objects.size) { - if(!object) continue; + for(const object of objects.values()) + { + if(!object) continue; - spriteCount = (spriteCount + this.renderObject(object, object.instanceId.toString(), time, update, spriteCount)); + spriteCount = (spriteCount + this.renderObject(object, object.instanceId.toString(), time, update, spriteCount)); + } } + + this._sortableSprites.sort((a, b) => + { + return b.z - a.z; + }); + + if(spriteCount < this._sortableSprites.length) + { + this._sortableSprites.splice(spriteCount); + } + + let iterator = 0; + + while(iterator < spriteCount) + { + const sprite = this._sortableSprites[iterator]; + + if(sprite && sprite.sprite) this.renderSprite(iterator, sprite); + + iterator++; + } + + this._Str_20677(spriteCount); } - this._sortableSprites.sort((a, b) => - { - return b.z - a.z; - }); - - if(spriteCount < this._sortableSprites.length) - { - this._sortableSprites.splice(spriteCount); - } - - let iterator = 0; - - while(iterator < spriteCount) - { - const sprite = this._sortableSprites[iterator]; - - if(sprite && sprite.sprite) this.renderSprite(iterator, sprite); - - iterator++; - } - - this._Str_20677(spriteCount); - if(update) this._canvasUpdated = true; - this._renderTimestamp = time; + this._renderTimestamp = this._totalTimeRunning; this._renderedWidth = this._width; this._renderedHeight = this._height; } From 4b85e85626c36b09e322361b30255628a228b250 Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 10 Jun 2021 03:02:59 -0400 Subject: [PATCH 060/155] Add long touch/mouse events --- src/nitro/room/RoomEngine.ts | 8 +++-- src/nitro/room/RoomObjectEventHandler.ts | 29 +++++++++++++++++++ .../room/events/RoomEngineObjectEvent.ts | 25 ++++++++-------- .../object/logic/furniture/FurnitureLogic.ts | 12 ++++++-- src/nitro/ui/MouseEventType.ts | 3 +- src/nitro/ui/TouchEventType.ts | 3 +- src/room/events/RoomObjectMouseEvent.ts | 17 ++++++----- 7 files changed, 70 insertions(+), 27 deletions(-) diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index d54ff4a5..2dfd98ee 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2476,6 +2476,8 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato else if(type === MouseEventType.MOUSE_DOWN) eventType = RoomObjectMouseEvent.MOUSE_DOWN; + else if(type === MouseEventType.MOUSE_DOWN_LONG) eventType = RoomObjectMouseEvent.MOUSE_DOWN_LONG; + else if(type === MouseEventType.MOUSE_UP) eventType = RoomObjectMouseEvent.MOUSE_UP; } @@ -2483,9 +2485,9 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } } - this._activeRoomActiveCanvas = canvasId; - this._activeRoomActiveCanvasMouseX = x; - this._activeRoomActiveCanvasMouseY = y; + this._activeRoomActiveCanvas = canvasId; + this._activeRoomActiveCanvasMouseX = x; + this._activeRoomActiveCanvasMouseY = y; } private _Str_25871(canvas: IRoomRenderingCanvas, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean): boolean diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 58a20147..18ce0f1b 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -338,6 +338,9 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou case RoomObjectMouseEvent.MOUSE_DOWN: this.handleRoomObjectMouseDownEvent(event, roomId); return; + case RoomObjectMouseEvent.MOUSE_DOWN_LONG: + this.handleRoomObjectMouseDownLongEvent(event, roomId); + return; case RoomObjectMouseEvent.MOUSE_ENTER: this.handleRoomObjectMouseEnterEvent(event, roomId); return; @@ -605,6 +608,32 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } + private handleRoomObjectMouseDownLongEvent(event: RoomObjectMouseEvent, roomId: number): void + { + if(!event) return; + + let operation = RoomObjectOperationType.OBJECT_UNDEFINED; + + const selectedData = this.getSelectedRoomObjectData(roomId); + + if(selectedData) operation = selectedData.operation; + + const category = this._roomEngine.getRoomObjectCategoryForType(event.objectType); + + switch(operation) + { + case RoomObjectOperationType.OBJECT_UNDEFINED: + if((category === RoomObjectCategory.FLOOR) || (category === RoomObjectCategory.WALL) || (event.objectType === RoomObjectUserType.MONSTER_PLANT)) + { + if((!event.ctrlKey && !event.shiftKey) || this._Str_25211(event)) + { + if(this._roomEngine.events) this._roomEngine.events.dispatchEvent(new RoomEngineObjectEvent(RoomEngineObjectEvent.REQUEST_MANIPULATION, roomId, event.objectId, category)); + } + } + return; + } + } + private handleRoomObjectMouseEnterEvent(event: RoomObjectMouseEvent, roomId: number): void { const id = event.objectId; diff --git a/src/nitro/room/events/RoomEngineObjectEvent.ts b/src/nitro/room/events/RoomEngineObjectEvent.ts index 04f78656..ac88815f 100644 --- a/src/nitro/room/events/RoomEngineObjectEvent.ts +++ b/src/nitro/room/events/RoomEngineObjectEvent.ts @@ -2,17 +2,18 @@ import { RoomEngineEvent } from './RoomEngineEvent'; export class RoomEngineObjectEvent extends RoomEngineEvent { - public static SELECTED: string = 'REOE_SELECTED'; - public static DESELECTED: string = 'REOE_DESELECTED'; - public static ADDED: string = 'REOE_ADDED'; - public static REMOVED: string = 'REOE_REMOVED'; - public static PLACED: string = 'REOE_PLACED'; - public static PLACED_ON_USER: string = 'REOE_PLACED_ON_USER'; - public static CONTENT_UPDATED: string = 'REOE_CONTENT_UPDATED'; - public static REQUEST_MOVE: string = 'REOE_REQUEST_MOVE'; - public static REQUEST_ROTATE: string = 'REOE_REQUEST_ROTATE'; - public static MOUSE_ENTER: string = 'REOE_MOUSE_ENTER'; - public static MOUSE_LEAVE: string = 'REOE_MOUSE_LEAVE'; + public static SELECTED: string = 'REOE_SELECTED'; + public static DESELECTED: string = 'REOE_DESELECTED'; + public static ADDED: string = 'REOE_ADDED'; + public static REMOVED: string = 'REOE_REMOVED'; + public static PLACED: string = 'REOE_PLACED'; + public static PLACED_ON_USER: string = 'REOE_PLACED_ON_USER'; + public static CONTENT_UPDATED: string = 'REOE_CONTENT_UPDATED'; + public static REQUEST_MOVE: string = 'REOE_REQUEST_MOVE'; + public static REQUEST_ROTATE: string = 'REOE_REQUEST_ROTATE'; + public static REQUEST_MANIPULATION: string = 'REOE_REQUEST_MANIPULATION'; + public static MOUSE_ENTER: string = 'REOE_MOUSE_ENTER'; + public static MOUSE_LEAVE: string = 'REOE_MOUSE_LEAVE'; private _objectId: number; private _category: number; @@ -34,4 +35,4 @@ export class RoomEngineObjectEvent extends RoomEngineEvent { return this._category; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index c3e70a6d..db82ca0c 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -62,7 +62,7 @@ export class FurnitureLogic extends MovingObjectLogic public getEventTypes(): string[] { - const types = [ RoomObjectStateChangedEvent.STATE_CHANGE, RoomObjectMouseEvent.CLICK, RoomObjectMouseEvent.MOUSE_DOWN ]; + const types = [ RoomObjectStateChangedEvent.STATE_CHANGE, RoomObjectMouseEvent.CLICK, RoomObjectMouseEvent.MOUSE_DOWN, RoomObjectMouseEvent.MOUSE_DOWN_LONG ]; if(this.widget) types.push(RoomObjectWidgetRequestEvent.OPEN_WIDGET, RoomObjectWidgetRequestEvent.CLOSE_WIDGET); @@ -316,6 +316,14 @@ export class FurnitureLogic extends MovingObjectLogic this.eventDispatcher.dispatchEvent(mouseEvent); } return; + case MouseEventType.MOUSE_DOWN_LONG: + if(this.eventDispatcher) + { + const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_DOWN_LONG, this.object, event._Str_3463, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); + + this.eventDispatcher.dispatchEvent(mouseEvent); + } + return; } } @@ -371,4 +379,4 @@ export class FurnitureLogic extends MovingObjectLogic super.tearDown(); } -} \ No newline at end of file +} diff --git a/src/nitro/ui/MouseEventType.ts b/src/nitro/ui/MouseEventType.ts index 4d5c7f19..f7b0892e 100644 --- a/src/nitro/ui/MouseEventType.ts +++ b/src/nitro/ui/MouseEventType.ts @@ -4,7 +4,8 @@ export class MouseEventType public static DOUBLE_CLICK: string = 'double_click'; public static MOUSE_MOVE: string = 'mousemove'; public static MOUSE_DOWN: string = 'mousedown'; + public static MOUSE_DOWN_LONG: string = 'mousedown_long'; public static MOUSE_UP: string = 'mouseup'; public static ROLL_OVER: string = 'mouseover'; public static ROLL_OUT: string = 'mouseout'; -} \ No newline at end of file +} diff --git a/src/nitro/ui/TouchEventType.ts b/src/nitro/ui/TouchEventType.ts index 4f903421..0944c48f 100644 --- a/src/nitro/ui/TouchEventType.ts +++ b/src/nitro/ui/TouchEventType.ts @@ -4,4 +4,5 @@ export class TouchEventType public static TOUCH_MOVE: string = 'touchmove'; public static TOUCH_CANCEL: string = 'touchcancel'; public static TOUCH_END: string = 'touchend'; -} \ No newline at end of file + public static TOUCH_LONG: string = 'touchlong'; +} diff --git a/src/room/events/RoomObjectMouseEvent.ts b/src/room/events/RoomObjectMouseEvent.ts index 487e4d85..18ebb530 100644 --- a/src/room/events/RoomObjectMouseEvent.ts +++ b/src/room/events/RoomObjectMouseEvent.ts @@ -3,13 +3,14 @@ import { RoomObjectEvent } from './RoomObjectEvent'; export class RoomObjectMouseEvent extends RoomObjectEvent { - public static CLICK: string = 'ROE_MOUSE_CLICK'; - public static DOUBLE_CLICK: string = 'ROE_MOUSE_DOUBLE_CLICK'; - public static MOUSE_MOVE: string = 'ROE_MOUSE_MOVE'; - public static MOUSE_DOWN: string = 'ROE_MOUSE_DOWN'; - public static MOUSE_UP: string = 'ROE_MOUSE_UP'; - public static MOUSE_ENTER: string = 'ROE_MOUSE_ENTER'; - public static MOUSE_LEAVE: string = 'ROE_MOUSE_LEAVE'; + public static CLICK: string = 'ROE_MOUSE_CLICK'; + public static DOUBLE_CLICK: string = 'ROE_MOUSE_DOUBLE_CLICK'; + public static MOUSE_MOVE: string = 'ROE_MOUSE_MOVE'; + public static MOUSE_DOWN: string = 'ROE_MOUSE_DOWN'; + public static MOUSE_DOWN_LONG: string = 'ROE_MOUSE_DOWN_LONG'; + public static MOUSE_UP: string = 'ROE_MOUSE_UP'; + public static MOUSE_ENTER: string = 'ROE_MOUSE_ENTER'; + public static MOUSE_LEAVE: string = 'ROE_MOUSE_LEAVE'; private _eventId: string = ''; private _altKey: boolean; @@ -96,4 +97,4 @@ export class RoomObjectMouseEvent extends RoomObjectEvent { this._spriteOffsetY = k; } -} \ No newline at end of file +} From 3184d9a117fee8e6d9e9bda454267de8f386dcd6 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Fri, 11 Jun 2021 19:44:40 -0500 Subject: [PATCH 061/155] renamed ChangeUserNameResultMessageEvent --- src/nitro/communication/NitroMessages.ts | 4 +-- .../incoming/avatar/ChangeNameUpdateEvent.ts | 25 ------------------- .../ChangeUserNameResultMessageEvent.ts | 25 +++++++++++++++++++ .../messages/incoming/avatar/index.ts | 2 +- src/nitro/session/SessionDataManager.ts | 8 +++--- 5 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 src/nitro/communication/messages/incoming/avatar/ChangeNameUpdateEvent.ts create mode 100644 src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 45c40f1b..2f37ccb2 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,6 +1,6 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; -import { ChangeNameUpdateEvent } from './messages/incoming/avatar/ChangeNameUpdateEvent'; +import { ChangeUserNameResultMessageEvent } from 'nitro-renderer/src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent'; import { CatalogGiftConfigurationEvent } from './messages/incoming/catalog/CatalogGiftConfigurationEvent'; @@ -423,7 +423,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.GENERIC_ERROR, GenericErrorEvent); // AVATAR - this._events.set(IncomingHeader.USER_CHANGE_NAME, ChangeNameUpdateEvent); + this._events.set(IncomingHeader.USER_CHANGE_NAME, ChangeUserNameResultMessageEvent); // CATALOG this._events.set(IncomingHeader.CATALOG_CLUB, CatalogClubEvent); diff --git a/src/nitro/communication/messages/incoming/avatar/ChangeNameUpdateEvent.ts b/src/nitro/communication/messages/incoming/avatar/ChangeNameUpdateEvent.ts deleted file mode 100644 index e31aaa32..00000000 --- a/src/nitro/communication/messages/incoming/avatar/ChangeNameUpdateEvent.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { ChangeNameUpdateParser } from '../../parser/avatar/ChangeNameUpdateParser'; - -export class ChangeNameUpdateEvent extends MessageEvent implements IMessageEvent -{ - public static _Str_5797: number = 0; - public static _Str_7005: number = 1; - public static _Str_7389: number = 2; - public static _Str_7137: number = 3; - public static _Str_7836: number = 4; - public static _Str_7721: number = 5; - public static _Str_8620: number = 6; - public static _Str_9429: number = 7; - - constructor(callBack: Function) - { - super(callBack, ChangeNameUpdateParser); - } - - public getParser(): ChangeNameUpdateParser - { - return this.parser as ChangeNameUpdateParser; - } -} \ No newline at end of file diff --git a/src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent.ts b/src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent.ts new file mode 100644 index 00000000..f0058005 --- /dev/null +++ b/src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent.ts @@ -0,0 +1,25 @@ +import { IMessageEvent } from 'nitro-renderer/src/core/communication/messages/IMessageEvent'; +import { MessageEvent } from 'nitro-renderer/src/core/communication/messages/MessageEvent'; +import { ChangeNameUpdateParser } from 'nitro-renderer/src/nitro/communication/messages/parser/avatar/ChangeNameUpdateParser'; + +export class ChangeUserNameResultMessageEvent extends MessageEvent implements IMessageEvent +{ + public static NAME_OK: number = 0; + public static ERROR_NAME_REQUIRED: number = 1; + public static ERROR_NAME_TOO_SHORT: number = 2; + public static ERROR_NAME_TOO_LONG: number = 3; + public static ERROR_NAME_NOT_VALID: number = 4; + public static ERROR_NAME_IN_USE: number = 5; + public static ERROR_NAME_CHANGE_NOT_ALLOWED: number = 6; + public static ERROR_MERGE_HOTEL_DOWN: number = 7; + + constructor(callBack: Function) + { + super(callBack, ChangeNameUpdateParser); + } + + public getParser(): ChangeNameUpdateParser + { + return this.parser as ChangeNameUpdateParser; + } +} diff --git a/src/nitro/communication/messages/incoming/avatar/index.ts b/src/nitro/communication/messages/incoming/avatar/index.ts index ac009e5c..53faf063 100644 --- a/src/nitro/communication/messages/incoming/avatar/index.ts +++ b/src/nitro/communication/messages/incoming/avatar/index.ts @@ -1 +1 @@ -export * from './ChangeNameUpdateEvent'; +export * from './ChangeUserNameResultMessageEvent'; diff --git a/src/nitro/session/SessionDataManager.ts b/src/nitro/session/SessionDataManager.ts index 1dbb20f5..9a604c44 100644 --- a/src/nitro/session/SessionDataManager.ts +++ b/src/nitro/session/SessionDataManager.ts @@ -4,7 +4,7 @@ import { IMessageComposer } from '../../core/communication/messages/IMessageComp import { NitroEvent } from '../../core/events/NitroEvent'; import { INitroCommunicationManager } from '../communication/INitroCommunicationManager'; import { AvailabilityStatusMessageEvent } from '../communication/messages/incoming/availability/AvailabilityStatusMessageEvent'; -import { ChangeNameUpdateEvent } from '../communication/messages/incoming/avatar/ChangeNameUpdateEvent'; +import { ChangeUserNameResultMessageEvent } from '../communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent'; import { RoomModelNameEvent } from '../communication/messages/incoming/room/mapping/RoomModelNameEvent'; import { UserPermissionsEvent } from '../communication/messages/incoming/user/access/UserPermissionsEvent'; import { UserFigureEvent } from '../communication/messages/incoming/user/data/UserFigureEvent'; @@ -123,7 +123,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana this._communication.registerMessageEvent(new UserInfoEvent(this.onUserInfoEvent.bind(this))); this._communication.registerMessageEvent(new UserPermissionsEvent(this.onUserPermissionsEvent.bind(this))); this._communication.registerMessageEvent(new AvailabilityStatusMessageEvent(this.onAvailabilityStatusMessageEvent.bind(this))); - this._communication.registerMessageEvent(new ChangeNameUpdateEvent(this.onChangeNameUpdateEvent.bind(this))); + this._communication.registerMessageEvent(new ChangeUserNameResultMessageEvent(this.onChangeNameUpdateEvent.bind(this))); this._communication.registerMessageEvent(new UserNameChangeMessageEvent(this.onUserNameChangeMessageEvent.bind(this))); this._communication.registerMessageEvent(new RoomModelNameEvent(this.onRoomModelNameEvent.bind(this))); this._communication.registerMessageEvent(new InClientLinkEvent(this.onInClientLinkEvent.bind(this))); @@ -291,7 +291,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana this._isAuthenticHabbo = parser.isAuthenticUser; } - private onChangeNameUpdateEvent(event: ChangeNameUpdateEvent): void + private onChangeNameUpdateEvent(event: ChangeUserNameResultMessageEvent): void { if(!event || !event.connection) return; @@ -299,7 +299,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana if(!parser) return; - if(parser.resultCode !== ChangeNameUpdateEvent._Str_5797) return; + if(parser.resultCode !== ChangeUserNameResultMessageEvent.NAME_OK) return; this._canChangeName = false; From d8692c7b4d2a6e93b33a239cce2622541260a0f6 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Fri, 11 Jun 2021 22:50:52 -0300 Subject: [PATCH 062/155] Fixes because bill is dummy --- src/nitro/avatar/cache/AvatarImageActionCache.ts | 4 ++-- src/nitro/avatar/cache/AvatarImageBodyPartCache.ts | 4 ++-- src/nitro/avatar/cache/AvatarImageCache.ts | 4 ++-- src/nitro/communication/NitroMessages.ts | 3 +-- .../incoming/avatar/ChangeUserNameResultMessageEvent.ts | 6 +++--- .../incoming/inventory/achievements/AchievementData.ts | 2 +- .../incoming/inventory/badges/BadgePointLimitsEvent.ts | 6 +++--- .../incoming/inventory/badges/BadgeReceivedEvent.ts | 6 +++--- .../inventory/badges/IsBadgeRequestFulfilledEvent.ts | 7 +++---- .../parser/inventory/achievements/AchievementsParser.ts | 3 ++- .../parser/inventory/badges/BadgeAndPointLimit.ts | 2 +- .../parser/inventory/badges/BadgePointLimitsParser.ts | 6 +++--- .../parser/inventory/badges/BadgeReceivedParser.ts | 4 ++-- .../inventory/badges/IsBadgeRequestFulfilledParser.ts | 4 ++-- .../messages/parser/modtool/ModtoolMainParser.ts | 2 +- .../messages/parser/modtool/ModtoolUserInfoParser.ts | 2 +- .../parser/modtool/utils/IssueInfoMessageParser.ts | 8 ++++---- .../messages/parser/modtool/utils/IssueMessageData.ts | 2 +- .../messages/parser/modtool/utils/ModeratorInitData.ts | 6 +++--- .../parser/modtool/utils/ModeratorUserInfoData.ts | 2 +- .../messages/parser/modtool/utils/PatternMatchData.ts | 4 ++-- src/nitro/session/events/RoomSessionPollEvent.ts | 5 +++-- src/nitro/session/events/RoomSessionVoteEvent.ts | 5 +++-- 23 files changed, 49 insertions(+), 48 deletions(-) diff --git a/src/nitro/avatar/cache/AvatarImageActionCache.ts b/src/nitro/avatar/cache/AvatarImageActionCache.ts index c8bc0d55..0bd7ee51 100644 --- a/src/nitro/avatar/cache/AvatarImageActionCache.ts +++ b/src/nitro/avatar/cache/AvatarImageActionCache.ts @@ -1,5 +1,5 @@ -import { AvatarImageDirectionCache } from 'nitro-renderer/src/nitro/avatar/cache/AvatarImageDirectionCache'; -import { Nitro } from 'nitro-renderer/src/nitro/Nitro'; +import { Nitro } from '../../Nitro'; +import { AvatarImageDirectionCache } from './AvatarImageDirectionCache'; export class AvatarImageActionCache { diff --git a/src/nitro/avatar/cache/AvatarImageBodyPartCache.ts b/src/nitro/avatar/cache/AvatarImageBodyPartCache.ts index e98862a4..430d3add 100644 --- a/src/nitro/avatar/cache/AvatarImageBodyPartCache.ts +++ b/src/nitro/avatar/cache/AvatarImageBodyPartCache.ts @@ -1,5 +1,5 @@ -import { IActiveActionData } from 'nitro-renderer/src/nitro/avatar/actions/IActiveActionData'; -import { AvatarImageActionCache } from 'nitro-renderer/src/nitro/avatar/cache/AvatarImageActionCache'; +import { IActiveActionData } from '../actions/IActiveActionData'; +import { AvatarImageActionCache } from './AvatarImageActionCache'; export class AvatarImageBodyPartCache { diff --git a/src/nitro/avatar/cache/AvatarImageCache.ts b/src/nitro/avatar/cache/AvatarImageCache.ts index 4c6a76f1..520829f1 100644 --- a/src/nitro/avatar/cache/AvatarImageCache.ts +++ b/src/nitro/avatar/cache/AvatarImageCache.ts @@ -1,5 +1,3 @@ -import { AvatarImageActionCache } from 'nitro-renderer/src/nitro/avatar/cache/AvatarImageActionCache'; -import { AvatarImageBodyPartCache } from 'nitro-renderer/src/nitro/avatar/cache/AvatarImageBodyPartCache'; import { Container, Matrix, Point, Rectangle, Sprite, Texture } from 'pixi.js'; import { RoomObjectSpriteData } from '../../../room/data/RoomObjectSpriteData'; import { Nitro } from '../../Nitro'; @@ -15,6 +13,8 @@ import { AvatarScaleType } from '../enum/AvatarScaleType'; import { GeometryType } from '../enum/GeometryType'; import { IAvatarImage } from '../IAvatarImage'; import { AvatarCanvas } from '../structure/AvatarCanvas'; +import { AvatarImageActionCache } from './AvatarImageActionCache'; +import { AvatarImageBodyPartCache } from './AvatarImageBodyPartCache'; import { AvatarImageDirectionCache } from './AvatarImageDirectionCache'; import { ImageData } from './ImageData'; diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index e7d8ec54..23aba82e 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -1,7 +1,6 @@ import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration'; -import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, SellablePetPalettesEvent } from './messages'; +import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, ChangeUserNameResultMessageEvent, SellablePetPalettesEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; -import { ChangeUserNameResultMessageEvent } from 'nitro-renderer/src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent'; import { CatalogGiftConfigurationEvent } from './messages/incoming/catalog/CatalogGiftConfigurationEvent'; diff --git a/src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent.ts b/src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent.ts index f0058005..297b8b21 100644 --- a/src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent.ts +++ b/src/nitro/communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent.ts @@ -1,6 +1,6 @@ -import { IMessageEvent } from 'nitro-renderer/src/core/communication/messages/IMessageEvent'; -import { MessageEvent } from 'nitro-renderer/src/core/communication/messages/MessageEvent'; -import { ChangeNameUpdateParser } from 'nitro-renderer/src/nitro/communication/messages/parser/avatar/ChangeNameUpdateParser'; +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ChangeNameUpdateParser } from '../../parser/avatar/ChangeNameUpdateParser'; export class ChangeUserNameResultMessageEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/inventory/achievements/AchievementData.ts b/src/nitro/communication/messages/incoming/inventory/achievements/AchievementData.ts index 005a4d10..c1767003 100644 --- a/src/nitro/communication/messages/incoming/inventory/achievements/AchievementData.ts +++ b/src/nitro/communication/messages/incoming/inventory/achievements/AchievementData.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; export class AchievementData { diff --git a/src/nitro/communication/messages/incoming/inventory/badges/BadgePointLimitsEvent.ts b/src/nitro/communication/messages/incoming/inventory/badges/BadgePointLimitsEvent.ts index 061c7e08..10cd2557 100644 --- a/src/nitro/communication/messages/incoming/inventory/badges/BadgePointLimitsEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/badges/BadgePointLimitsEvent.ts @@ -1,6 +1,6 @@ -import { IMessageEvent } from 'nitro-renderer/src/core/communication/messages/IMessageEvent'; -import { MessageEvent } from 'nitro-renderer/src/core/communication/messages/MessageEvent'; -import { BadgePointLimitsParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser'; +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { BadgePointLimitsParser } from '../../../parser/inventory/badges/BadgePointLimitsParser'; export class BadgePointLimitsEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/inventory/badges/BadgeReceivedEvent.ts b/src/nitro/communication/messages/incoming/inventory/badges/BadgeReceivedEvent.ts index 71338979..fc346823 100644 --- a/src/nitro/communication/messages/incoming/inventory/badges/BadgeReceivedEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/badges/BadgeReceivedEvent.ts @@ -1,6 +1,6 @@ -import { IMessageEvent } from 'nitro-renderer/src/core/communication/messages/IMessageEvent'; -import { MessageEvent } from 'nitro-renderer/src/core/communication/messages/MessageEvent'; -import { BadgeReceivedParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser'; +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { BadgeReceivedParser } from '../../../parser/inventory/badges/BadgeReceivedParser'; export class BadgeReceivedEvent extends MessageEvent implements IMessageEvent { diff --git a/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts b/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts index 87b97c87..c50a257e 100644 --- a/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/badges/IsBadgeRequestFulfilledEvent.ts @@ -1,7 +1,6 @@ -import { IMessageEvent } from 'nitro-renderer/src/core/communication/messages/IMessageEvent'; -import { MessageEvent } from 'nitro-renderer/src/core/communication/messages/MessageEvent'; -import { IsBadgeRequestFulfilledParser } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser'; - +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { IsBadgeRequestFulfilledParser } from '../../../parser/inventory/badges/IsBadgeRequestFulfilledParser'; export class IsBadgeRequestFulfilledEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) diff --git a/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts b/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts index 682c1317..22b98cf9 100644 --- a/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts +++ b/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts @@ -1,6 +1,7 @@ -import { AchievementData } from 'nitro-renderer/src/nitro/communication/messages/incoming/inventory/achievements/AchievementData'; + import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; +import { AchievementData } from '../../../incoming/inventory/achievements/AchievementData'; export class AchievementsParser implements IMessageParser { diff --git a/src/nitro/communication/messages/parser/inventory/badges/BadgeAndPointLimit.ts b/src/nitro/communication/messages/parser/inventory/badges/BadgeAndPointLimit.ts index c6d29381..a53a898a 100644 --- a/src/nitro/communication/messages/parser/inventory/badges/BadgeAndPointLimit.ts +++ b/src/nitro/communication/messages/parser/inventory/badges/BadgeAndPointLimit.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; export class BadgeAndPointLimit { diff --git a/src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser.ts b/src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser.ts index f06d8be9..7f8bcada 100644 --- a/src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser.ts +++ b/src/nitro/communication/messages/parser/inventory/badges/BadgePointLimitsParser.ts @@ -1,6 +1,6 @@ -import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from 'nitro-renderer/src/core/communication/messages/IMessageParser'; -import { BadgeAndPointLimit } from 'nitro-renderer/src/nitro/communication/messages/parser/inventory/badges/BadgeAndPointLimit'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; +import { BadgeAndPointLimit } from './BadgeAndPointLimit'; export class BadgePointLimitsParser implements IMessageParser { diff --git a/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser.ts b/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser.ts index 90d226ab..7bb5331c 100644 --- a/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser.ts +++ b/src/nitro/communication/messages/parser/inventory/badges/BadgeReceivedParser.ts @@ -1,5 +1,5 @@ -import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from 'nitro-renderer/src/core/communication/messages/IMessageParser'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; export class BadgeReceivedParser implements IMessageParser { diff --git a/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser.ts b/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser.ts index c089af44..47cd1c45 100644 --- a/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser.ts +++ b/src/nitro/communication/messages/parser/inventory/badges/IsBadgeRequestFulfilledParser.ts @@ -1,5 +1,5 @@ -import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from 'nitro-renderer/src/core/communication/messages/IMessageParser'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; export class IsBadgeRequestFulfilledParser implements IMessageParser { diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts b/src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts index 2ac50285..fc471017 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModtoolMainParser.ts @@ -1,6 +1,6 @@ -import { ModeratorInitData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData'; import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; +import { ModeratorInitData } from './utils/ModeratorInitData'; export class ModtoolMainParser implements IMessageParser { diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts b/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts index 265c6c30..bf0a4f63 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModtoolUserInfoParser.ts @@ -1,6 +1,6 @@ -import { ModeratorUserInfoData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData'; import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; +import { ModeratorUserInfoData } from './utils/ModeratorUserInfoData'; export class ModtoolUserInfoParser implements IMessageParser { diff --git a/src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser.ts b/src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser.ts index 4150d496..daad709b 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser.ts @@ -1,7 +1,7 @@ -import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from 'nitro-renderer/src/core/communication/messages/IMessageParser'; -import { IssueMessageData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData'; -import { PatternMatchData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; +import { IssueMessageData } from './IssueMessageData'; +import { PatternMatchData } from './PatternMatchData'; export class IssueInfoMessageParser implements IMessageParser { diff --git a/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts b/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts index 79ea7b58..a779a5ef 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData.ts @@ -1,4 +1,4 @@ -import { PatternMatchData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData'; +import { PatternMatchData } from './PatternMatchData'; export class IssueMessageData { diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData.ts b/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData.ts index 3c5dc73c..e2a78645 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/ModeratorInitData.ts @@ -1,6 +1,6 @@ -import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; -import { IssueInfoMessageParser } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/IssueInfoMessageParser'; -import { IssueMessageData } from 'nitro-renderer/src/nitro/communication/messages/parser/modtool/utils/IssueMessageData'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IssueInfoMessageParser } from './IssueInfoMessageParser'; +import { IssueMessageData } from './IssueMessageData'; export class ModeratorInitData { diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts b/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts index 2c96f7c1..05e18b5e 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/ModeratorUserInfoData.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; export class ModeratorUserInfoData { diff --git a/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData.ts b/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData.ts index d3463dea..c0ea416a 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/PatternMatchData.ts @@ -1,5 +1,5 @@ -import { IDisposable } from 'nitro-renderer/src/core/common/disposable/IDisposable'; -import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; +import { IDisposable } from '../../../../../../core/common/disposable/IDisposable'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; export class PatternMatchData implements IDisposable { diff --git a/src/nitro/session/events/RoomSessionPollEvent.ts b/src/nitro/session/events/RoomSessionPollEvent.ts index 704af576..5f9dff0d 100644 --- a/src/nitro/session/events/RoomSessionPollEvent.ts +++ b/src/nitro/session/events/RoomSessionPollEvent.ts @@ -1,5 +1,6 @@ -import { RoomSessionEvent } from 'nitro-renderer/src/nitro/session/events/RoomSessionEvent'; -import { IRoomSession } from 'nitro-renderer/src/nitro/session/IRoomSession'; +import { IRoomSession } from '../IRoomSession'; +import { RoomSessionEvent } from './RoomSessionEvent'; + export class RoomSessionPollEvent extends RoomSessionEvent { diff --git a/src/nitro/session/events/RoomSessionVoteEvent.ts b/src/nitro/session/events/RoomSessionVoteEvent.ts index c0f59bc1..1cd7a855 100644 --- a/src/nitro/session/events/RoomSessionVoteEvent.ts +++ b/src/nitro/session/events/RoomSessionVoteEvent.ts @@ -1,5 +1,6 @@ -import { RoomSessionEvent } from 'nitro-renderer/src/nitro/session/events/RoomSessionEvent'; -import { IRoomSession } from 'nitro-renderer/src/nitro/session/IRoomSession'; +import { IRoomSession } from '../IRoomSession'; +import { RoomSessionEvent } from './RoomSessionEvent'; + export class RoomSessionVoteEvent extends RoomSessionEvent { From 3f0062d3db81a71aeed0996c06fc83e14248af3c Mon Sep 17 00:00:00 2001 From: Dank074 Date: Fri, 11 Jun 2021 22:27:16 -0500 Subject: [PATCH 063/155] cleaned AchievementResolutionData --- ...lution.ts => AchievementResolutionData.ts} | 20 +++++++++---------- .../incoming/inventory/achievements/index.ts | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) rename src/nitro/communication/messages/incoming/inventory/achievements/{AchievementResolution.ts => AchievementResolutionData.ts} (65%) diff --git a/src/nitro/communication/messages/incoming/inventory/achievements/AchievementResolution.ts b/src/nitro/communication/messages/incoming/inventory/achievements/AchievementResolutionData.ts similarity index 65% rename from src/nitro/communication/messages/incoming/inventory/achievements/AchievementResolution.ts rename to src/nitro/communication/messages/incoming/inventory/achievements/AchievementResolutionData.ts index 39f2577c..eb0fdebf 100644 --- a/src/nitro/communication/messages/incoming/inventory/achievements/AchievementResolution.ts +++ b/src/nitro/communication/messages/incoming/inventory/achievements/AchievementResolutionData.ts @@ -1,13 +1,13 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; -export class AchievementResolution +export class AchievementResolutionData { - public static _Str_16945: number = 0; + public static STATE_SELECTABLE: number = 0; private _achievementId: number; private _level: number; private _badgeId: string; - private _Str_8741: number; + private _requiredLevel: number; private _state: number; constructor(wrapper: IMessageDataWrapper) @@ -15,7 +15,7 @@ export class AchievementResolution this._achievementId = wrapper.readInt(); this._level = wrapper.readInt(); this._badgeId = wrapper.readString(); - this._Str_8741 = wrapper.readInt(); + this._requiredLevel = wrapper.readInt(); this._state = wrapper.readInt(); } @@ -24,7 +24,7 @@ export class AchievementResolution this._achievementId = 0; this._level = 0; this._badgeId = ''; - this._Str_8741 = 0; + this._requiredLevel = 0; } public get achievementId(): number @@ -42,18 +42,18 @@ export class AchievementResolution return this._badgeId; } - public get _Str_20240(): number + public get requiredLevel(): number { - return this._Str_8741; + return this._requiredLevel; } public get enabled(): boolean { - return (this._state === AchievementResolution._Str_16945); + return (this._state === AchievementResolutionData.STATE_SELECTABLE); } public get state(): number { return this._state; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/inventory/achievements/index.ts b/src/nitro/communication/messages/incoming/inventory/achievements/index.ts index 91d4ad95..eac884bd 100644 --- a/src/nitro/communication/messages/incoming/inventory/achievements/index.ts +++ b/src/nitro/communication/messages/incoming/inventory/achievements/index.ts @@ -1,5 +1,5 @@ export * from './AchievementData'; export * from './AchievementEvent'; -export * from './AchievementResolution'; +export * from './AchievementResolutionData'; export * from './AchievementsEvent'; export * from './AchievementsScoreEvent'; From d0754d22c4fe54c0ba77b7089d6ccd71c04b384b Mon Sep 17 00:00:00 2001 From: Dank074 Date: Fri, 11 Jun 2021 23:07:21 -0500 Subject: [PATCH 064/155] cleaned IFurnitureItemData --- .../inventory/avatareffect/AvatarEffect.ts | 16 +++--- .../inventory/furni/IFurnitureItemData.ts | 16 +++--- ...radingListItem.ts => ItemDataStructure.ts} | 50 +++++++++---------- .../inventory/trading/TradingListItemEvent.ts | 8 +-- .../incoming/inventory/trading/index.ts | 2 +- .../avatareffect/AvatarEffectAddedParser.ts | 4 +- .../avatareffect/AvatarEffectsParser.ts | 8 +-- .../utils/FurnitureListItemParser.ts | 36 ++++++------- .../trading/TradingListItemParser.ts | 16 +++--- 9 files changed, 78 insertions(+), 78 deletions(-) rename src/nitro/communication/messages/incoming/inventory/trading/{TradingListItem.ts => ItemDataStructure.ts} (73%) diff --git a/src/nitro/communication/messages/incoming/inventory/avatareffect/AvatarEffect.ts b/src/nitro/communication/messages/incoming/inventory/avatareffect/AvatarEffect.ts index 01c08256..e4b8f21e 100644 --- a/src/nitro/communication/messages/incoming/inventory/avatareffect/AvatarEffect.ts +++ b/src/nitro/communication/messages/incoming/inventory/avatareffect/AvatarEffect.ts @@ -17,12 +17,12 @@ this._type = k; } - public get _Str_3882(): number + public get subType(): number { return this._subType; } - public set _Str_3882(k: number) + public set subType(k: number) { this._subType = k; } @@ -37,32 +37,32 @@ this._duration = k; } - public get _Str_18572(): number + public get inactiveEffectsInInventory(): number { return this._inactiveEffectsInInventory; } - public set _Str_18572(k: number) + public set inactiveEffectsInInventory(k: number) { this._inactiveEffectsInInventory = k; } - public get _Str_12185(): number + public get secondsLeftIfActive(): number { return this._secondsLeftIfActive; } - public set _Str_12185(k: number) + public set secondsLeftIfActive(k: number) { this._secondsLeftIfActive = k; } - public get _Str_4010(): boolean + public get isPermanent(): boolean { return this._permanent; } - public set _Str_4010(k: boolean) + public set isPermanent(k: boolean) { this._permanent = k; } diff --git a/src/nitro/communication/messages/incoming/inventory/furni/IFurnitureItemData.ts b/src/nitro/communication/messages/incoming/inventory/furni/IFurnitureItemData.ts index 813d08b2..536bf7d4 100644 --- a/src/nitro/communication/messages/incoming/inventory/furni/IFurnitureItemData.ts +++ b/src/nitro/communication/messages/incoming/inventory/furni/IFurnitureItemData.ts @@ -15,14 +15,14 @@ export interface IFurnitureItemData secondsToExpiration: number; flatId: number; slotId: string; - _Str_3951: number; - _Str_2794: number; + songId: number; + extra: number; rentable: boolean; isWallItem: boolean; hasRentPeriodStarted: boolean; - _Str_10616: number; - _Str_8932: number; - _Str_9050: number; - _Str_9408: number; - _Str_19297: boolean; -} \ No newline at end of file + expirationTimeStamp: number; + creationDay: number; + creationMonth: number; + creationYear: number; + isExternalImageFurni: boolean; +} diff --git a/src/nitro/communication/messages/incoming/inventory/trading/TradingListItem.ts b/src/nitro/communication/messages/incoming/inventory/trading/ItemDataStructure.ts similarity index 73% rename from src/nitro/communication/messages/incoming/inventory/trading/TradingListItem.ts rename to src/nitro/communication/messages/incoming/inventory/trading/ItemDataStructure.ts index 15b08418..bb0f67be 100644 --- a/src/nitro/communication/messages/incoming/inventory/trading/TradingListItem.ts +++ b/src/nitro/communication/messages/incoming/inventory/trading/ItemDataStructure.ts @@ -4,9 +4,9 @@ import { IObjectData } from '../../../../../room/object/data/IObjectData'; import { FurnitureDataParser } from '../../../parser/room/furniture/FurnitureDataParser'; import { IFurnitureItemData } from '../furni/IFurnitureItemData'; -export class TradingListItem implements IFurnitureItemData +export class ItemDataStructure implements IFurnitureItemData { - private _Str_5390: number; + private _expirationTimeStamp: number; private _isWallItem: boolean; private _itemId: number; private _furniType: string; @@ -14,13 +14,13 @@ export class TradingListItem implements IFurnitureItemData private _spriteId: number; private _category: number; private _stuffData: IObjectData; - private _Str_3182: number; + private _extra: number; private _secondsToExpiration: number; - private _Str_9291: number; - private _Str_8744: number; - private _Str_9700: number; + private _creationDay: number; + private _creationMonth: number; + private _creationYear: number; private _isGroupable: boolean; - private _Str_2808: number; + private _songId: number; private _flatId: number; private _rentable: boolean; private _hasRentPeriodStarted: boolean; @@ -35,12 +35,12 @@ export class TradingListItem implements IFurnitureItemData this._isGroupable = wrapper.readBoolean(); this._stuffData = FurnitureDataParser.parseObjectData(wrapper); this._secondsToExpiration = -1; - this._Str_5390 = Nitro.instance.time; + this._expirationTimeStamp = Nitro.instance.time; this._hasRentPeriodStarted = false; - this._Str_9291 = wrapper.readInt(); - this._Str_8744 = wrapper.readInt(); - this._Str_9700 = wrapper.readInt(); - this._Str_3182 = ((this.furniType === 'S') ? wrapper.readInt() : -1); + this._creationDay = wrapper.readInt(); + this._creationMonth = wrapper.readInt(); + this._creationYear = wrapper.readInt(); + this._extra = ((this.furniType === 'S') ? wrapper.readInt() : -1); this._flatId = -1; this._rentable = false; this._isWallItem = (this._furniType === 'I'); @@ -76,9 +76,9 @@ export class TradingListItem implements IFurnitureItemData return this._stuffData; } - public get _Str_2794(): number + public get extra(): number { - return this._Str_3182; + return this._extra; } public get secondsToExpiration(): number @@ -86,19 +86,19 @@ export class TradingListItem implements IFurnitureItemData return this._secondsToExpiration; } - public get _Str_8932(): number + public get creationDay(): number { - return this._Str_9291; + return this._creationDay; } - public get _Str_9050(): number + public get creationMonth(): number { - return this._Str_8744; + return this._creationMonth; } - public get _Str_9408(): number + public get creationYear(): number { - return this._Str_9700; + return this._creationYear; } public get isGroupable(): boolean @@ -106,9 +106,9 @@ export class TradingListItem implements IFurnitureItemData return this._isGroupable; } - public get _Str_3951(): number + public get songId(): number { - return this._Str_3182; + return this._extra; } public get flatId(): number @@ -131,9 +131,9 @@ export class TradingListItem implements IFurnitureItemData return this._hasRentPeriodStarted; } - public get _Str_10616(): number + public get expirationTimeStamp(): number { - return this._Str_5390; + return this._expirationTimeStamp; } public get isRecycleable(): boolean @@ -156,7 +156,7 @@ export class TradingListItem implements IFurnitureItemData return null; } - public get _Str_19297(): boolean + public get isExternalImageFurni(): boolean { return (this._furniType.indexOf('external_image') !== -1); } diff --git a/src/nitro/communication/messages/incoming/inventory/trading/TradingListItemEvent.ts b/src/nitro/communication/messages/incoming/inventory/trading/TradingListItemEvent.ts index 8d91fd827..18500575 100644 --- a/src/nitro/communication/messages/incoming/inventory/trading/TradingListItemEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/trading/TradingListItemEvent.ts @@ -1,7 +1,7 @@ import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; import { TradingListItemParser } from '../../../parser/inventory/trading/TradingListItemParser'; -import { TradingListItem } from './TradingListItem'; +import { ItemDataStructure } from './ItemDataStructure'; export class TradingListItemEvent extends MessageEvent implements IMessageEvent { @@ -40,12 +40,12 @@ export class TradingListItemEvent extends MessageEvent implements IMessageEvent return this.getParser()._Str_9138; } - public get _Str_17841(): TradingListItem[] + public get _Str_17841(): ItemDataStructure[] { return this.getParser()._Str_17841; } - public get _Str_17465(): TradingListItem[] + public get _Str_17465(): ItemDataStructure[] { return this.getParser()._Str_17465; } @@ -54,4 +54,4 @@ export class TradingListItemEvent extends MessageEvent implements IMessageEvent { return this.parser as TradingListItemParser; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/inventory/trading/index.ts b/src/nitro/communication/messages/incoming/inventory/trading/index.ts index 2edef971..ae6758f5 100644 --- a/src/nitro/communication/messages/incoming/inventory/trading/index.ts +++ b/src/nitro/communication/messages/incoming/inventory/trading/index.ts @@ -1,8 +1,8 @@ +export * from './ItemDataStructure'; export * from './TradingAcceptEvent'; export * from './TradingCloseEvent'; export * from './TradingCompletedEvent'; export * from './TradingConfirmationEvent'; -export * from './TradingListItem'; export * from './TradingListItemEvent'; export * from './TradingNotOpenEvent'; export * from './TradingOpenEvent'; diff --git a/src/nitro/communication/messages/parser/inventory/avatareffect/AvatarEffectAddedParser.ts b/src/nitro/communication/messages/parser/inventory/avatareffect/AvatarEffectAddedParser.ts index 533aa2d7..9271ae99 100644 --- a/src/nitro/communication/messages/parser/inventory/avatareffect/AvatarEffectAddedParser.ts +++ b/src/nitro/communication/messages/parser/inventory/avatareffect/AvatarEffectAddedParser.ts @@ -35,7 +35,7 @@ export class AvatarEffectAddedParser implements IMessageParser return this._type; } - public get _Str_3882(): number + public get subType(): number { return this._subType; } @@ -45,7 +45,7 @@ export class AvatarEffectAddedParser implements IMessageParser return this._duration; } - public get _Str_4010(): boolean + public get isPermanent(): boolean { return this._permanent; } diff --git a/src/nitro/communication/messages/parser/inventory/avatareffect/AvatarEffectsParser.ts b/src/nitro/communication/messages/parser/inventory/avatareffect/AvatarEffectsParser.ts index bb1475a3..6615e3bd 100644 --- a/src/nitro/communication/messages/parser/inventory/avatareffect/AvatarEffectsParser.ts +++ b/src/nitro/communication/messages/parser/inventory/avatareffect/AvatarEffectsParser.ts @@ -24,11 +24,11 @@ export class AvatarEffectsParser implements IMessageParser const effect = new AvatarEffect(); effect.type = wrapper.readInt(); - effect._Str_3882 = wrapper.readInt(); + effect.subType = wrapper.readInt(); effect.duration = wrapper.readInt(); - effect._Str_18572 = wrapper.readInt(); - effect._Str_12185 = wrapper.readInt(); - effect._Str_4010 = wrapper.readBoolean(); + effect.inactiveEffectsInInventory = wrapper.readInt(); + effect.secondsLeftIfActive = wrapper.readInt(); + effect.isPermanent = wrapper.readBoolean(); this._effects.push(effect); diff --git a/src/nitro/communication/messages/parser/inventory/furniture/utils/FurnitureListItemParser.ts b/src/nitro/communication/messages/parser/inventory/furniture/utils/FurnitureListItemParser.ts index ac47d00c..4938dc17 100644 --- a/src/nitro/communication/messages/parser/inventory/furniture/utils/FurnitureListItemParser.ts +++ b/src/nitro/communication/messages/parser/inventory/furniture/utils/FurnitureListItemParser.ts @@ -21,13 +21,13 @@ export class FurnitureListItemParser implements IFurnitureItemData private _tradable: boolean; private _sellable: boolean; private _secondsToExpiration: number; - private _Str_3182: number; + private _extra: number; private _flatId: number; private _isWallItem: boolean; private _hasRentPeriodStarted: boolean; - private _Str_5390: number; + private _expirationTimeStamp: number; private _slotId: string; - private _Str_2808: number; + private _songId: number; constructor(wrapper: IMessageDataWrapper) { @@ -51,13 +51,13 @@ export class FurnitureListItemParser implements IFurnitureItemData this._tradable = false; this._sellable = false; this._secondsToExpiration = 0; - this._Str_3182 = 0; + this._extra = 0; this._flatId = 0; this._isWallItem = false; this._hasRentPeriodStarted = false; - this._Str_5390 = 0; + this._expirationTimeStamp = 0; this._slotId = ''; - this._Str_2808 = -1; + this._songId = -1; return true; } @@ -77,7 +77,7 @@ export class FurnitureListItemParser implements IFurnitureItemData this._isGroupable = wrapper.readBoolean(); this._sellable = wrapper.readBoolean(); this._secondsToExpiration = wrapper.readInt(); - this._Str_5390 = Nitro.instance.time; + this._expirationTimeStamp = Nitro.instance.time; if(this.secondsToExpiration > -1) { @@ -96,7 +96,7 @@ export class FurnitureListItemParser implements IFurnitureItemData if(this._furniType === FurnitureListItemParser.FLOOR_ITEM) { this._slotId = wrapper.readString(); - this._Str_3182 = wrapper.readInt(); + this._extra = wrapper.readInt(); } return true; @@ -167,14 +167,14 @@ export class FurnitureListItemParser implements IFurnitureItemData return this._slotId; } - public get _Str_3951(): number + public get songId(): number { - return this._Str_2808; + return this._songId; } - public get _Str_2794(): number + public get extra(): number { - return this._Str_3182; + return this._extra; } public get rentable(): boolean @@ -192,27 +192,27 @@ export class FurnitureListItemParser implements IFurnitureItemData return this._hasRentPeriodStarted; } - public get _Str_10616(): number + public get expirationTimeStamp(): number { - return this._Str_5390; + return this._expirationTimeStamp; } - public get _Str_8932(): number + public get creationDay(): number { return 0; } - public get _Str_9050(): number + public get creationMonth(): number { return 0; } - public get _Str_9408(): number + public get creationYear(): number { return 0; } - public get _Str_19297(): boolean + public get isExternalImageFurni(): boolean { return !(this._furniType.indexOf('external_image') === -1); } diff --git a/src/nitro/communication/messages/parser/inventory/trading/TradingListItemParser.ts b/src/nitro/communication/messages/parser/inventory/trading/TradingListItemParser.ts index 88897ae0..a8ce6554 100644 --- a/src/nitro/communication/messages/parser/inventory/trading/TradingListItemParser.ts +++ b/src/nitro/communication/messages/parser/inventory/trading/TradingListItemParser.ts @@ -1,15 +1,15 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { TradingListItem } from '../../../incoming/inventory/trading/TradingListItem'; +import { ItemDataStructure } from '../../../incoming/inventory/trading/ItemDataStructure'; export class TradingListItemParser implements IMessageParser { private _firstUserID: number; - private _firstUserItemArray: TradingListItem[]; + private _firstUserItemArray: ItemDataStructure[]; private _firstUserNumItems: number; private _firstUserNumCredits: number; private _secondUserID: number; - private _secondUserItemArray: TradingListItem[]; + private _secondUserItemArray: ItemDataStructure[]; private _secondUserNumItems: number; private _secondUserNumCredits: number; @@ -50,13 +50,13 @@ export class TradingListItemParser implements IMessageParser return true; } - private parseItems(k: IMessageDataWrapper, itemArray: TradingListItem[]): boolean + private parseItems(k: IMessageDataWrapper, itemArray: ItemDataStructure[]): boolean { let count = k.readInt(); while(count > 0) { - itemArray.push(new TradingListItem(k)); + itemArray.push(new ItemDataStructure(k)); count--; } @@ -69,7 +69,7 @@ export class TradingListItemParser implements IMessageParser return this._firstUserID; } - public get _Str_17841(): TradingListItem[] + public get _Str_17841(): ItemDataStructure[] { return this._firstUserItemArray; } @@ -89,7 +89,7 @@ export class TradingListItemParser implements IMessageParser return this._secondUserID; } - public get _Str_17465(): TradingListItem[] + public get _Str_17465(): ItemDataStructure[] { return this._secondUserItemArray; } @@ -103,4 +103,4 @@ export class TradingListItemParser implements IMessageParser { return this._secondUserNumCredits; } -} \ No newline at end of file +} From 557c773ad92a1fe50ac7a270e57ee95ebc13fc4e Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 12 Jun 2021 00:41:17 -0400 Subject: [PATCH 065/155] Updates --- src/nitro/room/RoomEngine.ts | 102 +++++++++++++++++------------------ 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 2dfd98ee..bb242ac5 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2508,87 +2508,81 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } } } - else + + else if(type === MouseEventType.MOUSE_UP) { - if(type === MouseEventType.MOUSE_UP) + if(this._activeRoomIsDragged) { - if(this._activeRoomIsDragged) + this._activeRoomIsDragged = false; + + if(this._activeRoomWasDragged) { - this._activeRoomIsDragged = false; + const instanceData = this.getRoomInstanceData(this._activeRoomId); - if(this._activeRoomWasDragged) + if(instanceData) { - const instanceData = this.getRoomInstanceData(this._activeRoomId); + const camera = instanceData.roomCamera; - if(instanceData) + if(camera) { - const camera = instanceData.roomCamera; - - if(camera) + if(this._Str_11555) { - if(this._Str_11555) + if(!camera._Str_12536) { - if(!camera._Str_12536) - { - camera._Str_8564 = false; - camera._Str_8690 = false; - } - - camera._Str_25467(new Vector3d(-(canvas.screenOffsetX), -(canvas.screenOffsetY))); + camera._Str_8564 = false; + camera._Str_8690 = false; } - if(this._roomDraggingAlwaysCenters) camera.reset(); + camera._Str_25467(new Vector3d(-(canvas.screenOffsetX), -(canvas.screenOffsetY))); } + + if(this._roomDraggingAlwaysCenters) camera.reset(); } } } } - else + } + + else if(type === MouseEventType.MOUSE_MOVE) + { + if(this._activeRoomIsDragged) { - if(type === MouseEventType.MOUSE_MOVE) + if(!this._activeRoomWasDragged) { - if(this._activeRoomIsDragged) + offsetX = (x - this._activeRoomDragStartX); + offsetY = (y - this._activeRoomDragStartY); + + if(((((offsetX <= -(RoomEngine.DRAG_THRESHOLD)) || (offsetX >= RoomEngine.DRAG_THRESHOLD)) || (offsetY <= -(RoomEngine.DRAG_THRESHOLD))) || (offsetY >= RoomEngine.DRAG_THRESHOLD))) { - if(!this._activeRoomWasDragged) - { - offsetX = (x - this._activeRoomDragStartX); - offsetY = (y - this._activeRoomDragStartY); - - if(((((offsetX <= -(RoomEngine.DRAG_THRESHOLD)) || (offsetX >= RoomEngine.DRAG_THRESHOLD)) || (offsetY <= -(RoomEngine.DRAG_THRESHOLD))) || (offsetY >= RoomEngine.DRAG_THRESHOLD))) - { - this._activeRoomWasDragged = true; - } - - offsetX = 0; - offsetY = 0; - } - - if(((!(offsetX == 0)) || (!(offsetY == 0)))) - { - this._activeRoomDragX += offsetX; - this._activeRoomDragY += offsetY; - - this._activeRoomWasDragged = true; - } + this._activeRoomWasDragged = true; } + + offsetX = 0; + offsetY = 0; } - else + + if(((!(offsetX == 0)) || (!(offsetY == 0)))) { - if((type === MouseEventType.MOUSE_CLICK) || (type === MouseEventType.DOUBLE_CLICK)) - { - this._activeRoomIsDragged = false; + this._activeRoomDragX += offsetX; + this._activeRoomDragY += offsetY; - if(this._activeRoomWasDragged) - { - this._activeRoomWasDragged = false; - - return true; - } - } + this._activeRoomWasDragged = true; } } } + else if((type === MouseEventType.MOUSE_CLICK) || (type === MouseEventType.DOUBLE_CLICK)) + { + this._activeRoomIsDragged = false; + + if(this._activeRoomWasDragged) + { + this._activeRoomWasDragged = false; + + return true; + } + } + return false; } From 00c571ea863a2ebf8ae2d79f4bafc60034545049 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Fri, 11 Jun 2021 23:41:44 -0500 Subject: [PATCH 066/155] cleaned trading parsers --- .../inventory/trading/TradingAcceptEvent.ts | 10 +++--- .../inventory/trading/TradingCloseEvent.ts | 6 ++-- .../inventory/trading/TradingListItemEvent.ts | 32 +++++++++---------- .../inventory/trading/TradingOpenEvent.ts | 18 +++++------ .../inventory/trading/TradingAcceptParser.ts | 6 ++-- .../inventory/trading/TradingCloseParser.ts | 6 ++-- .../trading/TradingListItemParser.ts | 16 +++++----- .../trading/TradingOpenFailedParser.ts | 14 ++++---- .../inventory/trading/TradingOpenParser.ts | 10 +++--- 9 files changed, 59 insertions(+), 59 deletions(-) diff --git a/src/nitro/communication/messages/incoming/inventory/trading/TradingAcceptEvent.ts b/src/nitro/communication/messages/incoming/inventory/trading/TradingAcceptEvent.ts index bc9e636a..3a471864 100644 --- a/src/nitro/communication/messages/incoming/inventory/trading/TradingAcceptEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/trading/TradingAcceptEvent.ts @@ -9,18 +9,18 @@ export class TradingAcceptEvent extends MessageEvent implements IMessageEvent super(callBack, TradingAcceptParser); } - public get _Str_4963(): number + public get userID(): number { - return this.getParser()._Str_4963; + return this.getParser().userID; } - public get _Str_15794(): boolean + public get userAccepts(): boolean { - return this.getParser()._Str_15794; + return this.getParser().userAccepts; } public getParser(): TradingAcceptParser { return this.parser as TradingAcceptParser; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/inventory/trading/TradingCloseEvent.ts b/src/nitro/communication/messages/incoming/inventory/trading/TradingCloseEvent.ts index e0957081..4747ddf5 100644 --- a/src/nitro/communication/messages/incoming/inventory/trading/TradingCloseEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/trading/TradingCloseEvent.ts @@ -9,13 +9,13 @@ export class TradingCloseEvent extends MessageEvent implements IMessageEvent super(callBack, TradingCloseParser); } - public get _Str_4963(): number + public get userID(): number { - return this.getParser()._Str_4963; + return this.getParser().userID; } public getParser(): TradingCloseParser { return this.parser as TradingCloseParser; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/inventory/trading/TradingListItemEvent.ts b/src/nitro/communication/messages/incoming/inventory/trading/TradingListItemEvent.ts index 18500575..38638f45 100644 --- a/src/nitro/communication/messages/incoming/inventory/trading/TradingListItemEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/trading/TradingListItemEvent.ts @@ -10,44 +10,44 @@ export class TradingListItemEvent extends MessageEvent implements IMessageEvent super(callBack, TradingListItemParser); } - public get _Str_15162(): number + public get firstUserID(): number { - return this.getParser()._Str_15162; + return this.getParser().firstUserID; } - public get _Str_18215(): number + public get secondUserID(): number { - return this.getParser()._Str_18215; + return this.getParser().secondUserID; } - public get _Str_14946(): number + public get firstUserNumItems(): number { - return this.getParser()._Str_14946; + return this.getParser().firstUserNumItems; } - public get _Str_13801(): number + public get secondUserNumItems(): number { - return this.getParser()._Str_13801; + return this.getParser().secondUserNumItems; } - public get _Str_15709(): number + public get firstUserNumCredits(): number { - return this.getParser()._Str_15709; + return this.getParser().firstUserNumCredits; } - public get _Str_9138(): number + public get secondUserNumCredits(): number { - return this.getParser()._Str_9138; + return this.getParser().secondUserNumCredits; } - public get _Str_17841(): ItemDataStructure[] + public get firstUserItemArray(): ItemDataStructure[] { - return this.getParser()._Str_17841; + return this.getParser().firstUserItemArray; } - public get _Str_17465(): ItemDataStructure[] + public get secondUserItemArray(): ItemDataStructure[] { - return this.getParser()._Str_17465; + return this.getParser().secondUserItemArray; } public getParser(): TradingListItemParser diff --git a/src/nitro/communication/messages/incoming/inventory/trading/TradingOpenEvent.ts b/src/nitro/communication/messages/incoming/inventory/trading/TradingOpenEvent.ts index 2ed9243c..bf387f6d 100644 --- a/src/nitro/communication/messages/incoming/inventory/trading/TradingOpenEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/trading/TradingOpenEvent.ts @@ -9,28 +9,28 @@ export class TradingOpenEvent extends MessageEvent implements IMessageEvent super(callBack, TradingOpenParser); } - public get _Str_4963(): number + public get userID(): number { - return this.getParser()._Str_4963; + return this.getParser().userID; } - public get _Str_16764(): boolean + public get userCanTrade(): boolean { - return this.getParser()._Str_16764; + return this.getParser().userCanTrade; } - public get _Str_17613(): number + public get otherUserID(): number { - return this.getParser()._Str_17613; + return this.getParser().otherUserID; } - public get _Str_13374(): boolean + public get otherUserCanTrade(): boolean { - return this.getParser()._Str_13374; + return this.getParser().otherUserCanTrade; } public getParser(): TradingOpenParser { return this.parser as TradingOpenParser; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/trading/TradingAcceptParser.ts b/src/nitro/communication/messages/parser/inventory/trading/TradingAcceptParser.ts index bbd24e58..9d59b4f0 100644 --- a/src/nitro/communication/messages/parser/inventory/trading/TradingAcceptParser.ts +++ b/src/nitro/communication/messages/parser/inventory/trading/TradingAcceptParser.ts @@ -24,13 +24,13 @@ export class TradingAcceptParser implements IMessageParser return true; } - public get _Str_4963(): number + public get userID(): number { return this._userID; } - public get _Str_15794(): boolean + public get userAccepts(): boolean { return this._userAccepts; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/trading/TradingCloseParser.ts b/src/nitro/communication/messages/parser/inventory/trading/TradingCloseParser.ts index 7ca2c836..0ff562f0 100644 --- a/src/nitro/communication/messages/parser/inventory/trading/TradingCloseParser.ts +++ b/src/nitro/communication/messages/parser/inventory/trading/TradingCloseParser.ts @@ -3,7 +3,7 @@ import { IMessageParser } from '../../../../../../core/communication/messages/IM export class TradingCloseParser implements IMessageParser { - public static _Str_16410: number = 1; + public static ERROR_WHILE_COMMIT: number = 1; private _userId: number; private _reason: number; @@ -23,7 +23,7 @@ export class TradingCloseParser implements IMessageParser return true; } - public get _Str_4963(): number + public get userID(): number { return this._userId; } @@ -32,4 +32,4 @@ export class TradingCloseParser implements IMessageParser { return this._reason; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/trading/TradingListItemParser.ts b/src/nitro/communication/messages/parser/inventory/trading/TradingListItemParser.ts index a8ce6554..c0a54b4f 100644 --- a/src/nitro/communication/messages/parser/inventory/trading/TradingListItemParser.ts +++ b/src/nitro/communication/messages/parser/inventory/trading/TradingListItemParser.ts @@ -64,42 +64,42 @@ export class TradingListItemParser implements IMessageParser return true; } - public get _Str_15162(): number + public get firstUserID(): number { return this._firstUserID; } - public get _Str_17841(): ItemDataStructure[] + public get firstUserItemArray(): ItemDataStructure[] { return this._firstUserItemArray; } - public get _Str_14946(): number + public get firstUserNumItems(): number { return this._firstUserNumItems; } - public get _Str_15709(): number + public get firstUserNumCredits(): number { return this._firstUserNumCredits; } - public get _Str_18215(): number + public get secondUserID(): number { return this._secondUserID; } - public get _Str_17465(): ItemDataStructure[] + public get secondUserItemArray(): ItemDataStructure[] { return this._secondUserItemArray; } - public get _Str_13801(): number + public get secondUserNumItems(): number { return this._secondUserNumItems; } - public get _Str_9138(): number + public get secondUserNumCredits(): number { return this._secondUserNumCredits; } diff --git a/src/nitro/communication/messages/parser/inventory/trading/TradingOpenFailedParser.ts b/src/nitro/communication/messages/parser/inventory/trading/TradingOpenFailedParser.ts index 2f9950a8..7fe0cd86 100644 --- a/src/nitro/communication/messages/parser/inventory/trading/TradingOpenFailedParser.ts +++ b/src/nitro/communication/messages/parser/inventory/trading/TradingOpenFailedParser.ts @@ -3,11 +3,11 @@ import { IMessageParser } from '../../../../../../core/communication/messages/IM export class TradingOpenFailedParser implements IMessageParser { - public static _Str_18150: number = 7; - public static _Str_18383: number = 8; + public static REASON_YOU_ARE_ALREADY_TRADING: number = 7; + public static REASON_OTHER_USER_ALREADY_TRADING: number = 8; private _reason: number; - private _Str_10068: string; + private _otherUserName: string; public flush(): boolean { @@ -19,7 +19,7 @@ export class TradingOpenFailedParser implements IMessageParser if(!wrapper) return false; this._reason = wrapper.readInt(); - this._Str_10068 = wrapper.readString(); + this._otherUserName = wrapper.readString(); return true; } @@ -29,8 +29,8 @@ export class TradingOpenFailedParser implements IMessageParser return this._reason; } - public get _Str_17035(): string + public get otherUserName(): string { - return this._Str_10068; + return this._otherUserName; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/trading/TradingOpenParser.ts b/src/nitro/communication/messages/parser/inventory/trading/TradingOpenParser.ts index 37b318d3..441b9ae4 100644 --- a/src/nitro/communication/messages/parser/inventory/trading/TradingOpenParser.ts +++ b/src/nitro/communication/messages/parser/inventory/trading/TradingOpenParser.ts @@ -30,23 +30,23 @@ export class TradingOpenParser implements IMessageParser return true; } - public get _Str_4963(): number + public get userID(): number { return this._userId; } - public get _Str_16764(): boolean + public get userCanTrade(): boolean { return this._userCanTrade; } - public get _Str_17613(): number + public get otherUserID(): number { return this._otherUserId; } - public get _Str_13374(): boolean + public get otherUserCanTrade(): boolean { return this._otherUserCanTrade; } -} \ No newline at end of file +} From 590d9a53cc32a4bd318dcc5acea0200df2bddb9b Mon Sep 17 00:00:00 2001 From: Dank074 Date: Fri, 11 Jun 2021 23:59:27 -0500 Subject: [PATCH 067/155] cleaned Triggerable --- .../messages/incoming/roomevents/Triggerable.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nitro/communication/messages/incoming/roomevents/Triggerable.ts b/src/nitro/communication/messages/incoming/roomevents/Triggerable.ts index e51a254a..d9f454d1 100644 --- a/src/nitro/communication/messages/incoming/roomevents/Triggerable.ts +++ b/src/nitro/communication/messages/incoming/roomevents/Triggerable.ts @@ -48,17 +48,17 @@ export class Triggerable return (this._intParams[index] === 1); } - public get _Str_21824(): boolean + public get stuffTypeSelectionEnabled(): boolean { return this._stuffTypeSelectionEnabled; } - public get _Str_6040(): number + public get stuffTypeSelectionCode(): number { return this._stuffTypeSelectionCode; } - public set _Str_6040(k: number) + public set stuffTypeSelectionCode(k: number) { this._stuffTypeSelectionCode = k; } @@ -97,4 +97,4 @@ export class Triggerable { return this._stuffTypeId; } -} \ No newline at end of file +} From 9c3e213b3d2ee34c059f767b73f7fe5c54dcc2d7 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 00:21:22 -0500 Subject: [PATCH 068/155] oops forgot to add changes --- src/nitro/room/object/logic/furniture/FurnitureLogic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index 6d1add21..ce836f53 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -319,7 +319,7 @@ export class FurnitureLogic extends MovingObjectLogic case MouseEventType.MOUSE_DOWN_LONG: if(this.eventDispatcher) { - const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_DOWN_LONG, this.object, event._Str_3463, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); + const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_DOWN_LONG, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); this.eventDispatcher.dispatchEvent(mouseEvent); } From 095d7ee8849f90bf191c05de6651ba39ee4b451d Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 12 Jun 2021 02:41:18 -0300 Subject: [PATCH 069/155] Fix import --- .../inventory/achievements/AchievementResolutionData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/communication/messages/incoming/inventory/achievements/AchievementResolutionData.ts b/src/nitro/communication/messages/incoming/inventory/achievements/AchievementResolutionData.ts index eb0fdebf..adb44562 100644 --- a/src/nitro/communication/messages/incoming/inventory/achievements/AchievementResolutionData.ts +++ b/src/nitro/communication/messages/incoming/inventory/achievements/AchievementResolutionData.ts @@ -1,4 +1,4 @@ -import { IMessageDataWrapper } from 'nitro-renderer/src/core/communication/messages/IMessageDataWrapper'; +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; export class AchievementResolutionData { From 6e1ebeb03a1917954ab8944bd28ac377af78d226 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 00:56:43 -0500 Subject: [PATCH 070/155] cleaned PlaneMaskManager --- .../room/object/RoomPlaneBitmapMaskParser.ts | 20 ++++++------- src/nitro/room/object/RoomPlaneData.ts | 30 +++++++++---------- src/nitro/room/object/RoomPlaneParser.ts | 16 +++++----- src/nitro/room/object/logic/room/RoomLogic.ts | 4 +-- .../object/visualization/room/RoomPlane.ts | 2 +- .../visualization/room/RoomVisualization.ts | 6 ++-- .../room/mask/PlaneMaskManager.ts | 10 +++---- 7 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/nitro/room/object/RoomPlaneBitmapMaskParser.ts b/src/nitro/room/object/RoomPlaneBitmapMaskParser.ts index 70f2b93e..e763fdc3 100644 --- a/src/nitro/room/object/RoomPlaneBitmapMaskParser.ts +++ b/src/nitro/room/object/RoomPlaneBitmapMaskParser.ts @@ -11,7 +11,7 @@ export class RoomPlaneBitmapMaskParser this._masks = new Map(); } - public get _Str_6845(): number + public get maskCount(): number { return this._masks.size; } @@ -69,7 +69,7 @@ export class RoomPlaneBitmapMaskParser this._masks.set(k, mask); } - public _Str_23574(k: string): boolean + public removeMask(k: string): boolean { const existing = this._masks.get(k); @@ -85,7 +85,7 @@ export class RoomPlaneBitmapMaskParser return false; } - public _Str_5598(): RoomMapMaskData + public getXML(): RoomMapMaskData { const data = new RoomMapMaskData(); @@ -93,9 +93,9 @@ export class RoomPlaneBitmapMaskParser { if(!mask) continue; - const type = this._Str_21678(mask); - const category = this._Str_21644(mask); - const location = this._Str_19038(mask); + const type = this.getMaskType(mask); + const category = this.getMaskCategory(mask); + const location = this.getMaskLocation(mask); if(type && category && location) { @@ -119,21 +119,21 @@ export class RoomPlaneBitmapMaskParser return data; } - public _Str_19038(mask: RoomPlaneBitmapMaskData): IVector3D + public getMaskLocation(mask: RoomPlaneBitmapMaskData): IVector3D { if(!mask) return null; return mask.loc; } - public _Str_21678(mask: RoomPlaneBitmapMaskData): string + public getMaskType(mask: RoomPlaneBitmapMaskData): string { if(!mask) return null; return mask.type; } - public _Str_21644(mask: RoomPlaneBitmapMaskData): string + public getMaskCategory(mask: RoomPlaneBitmapMaskData): string { if(!mask) return null; @@ -144,4 +144,4 @@ export class RoomPlaneBitmapMaskParser { return this._masks; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/RoomPlaneData.ts b/src/nitro/room/object/RoomPlaneData.ts index 7f410318..7efde482 100644 --- a/src/nitro/room/object/RoomPlaneData.ts +++ b/src/nitro/room/object/RoomPlaneData.ts @@ -119,24 +119,24 @@ export class RoomPlaneData return this._normal; } - public get _Str_25207(): IVector3D + public get normalDirection(): IVector3D { return this._normalDirection; } - public get _Str_20277(): number + public get secondaryNormalCount(): number { return this._secondaryNormals.length; } - public get _Str_6845(): number + public get maskCount(): number { return this._masks.length; } - public _Str_22585(k: number): IVector3D + public getSecondaryNormal(k: number): IVector3D { - if(((k < 0) || (k >= this._Str_20277))) + if(((k < 0) || (k >= this.secondaryNormalCount))) { return null; } @@ -151,18 +151,18 @@ export class RoomPlaneData this._masks.push(_local_5); } - private _Str_8361(k: number):RoomPlaneMaskData + private getMask(k: number):RoomPlaneMaskData { - if(((k < 0) || (k >= this._Str_6845))) + if(((k < 0) || (k >= this.maskCount))) { return null; } return this._masks[k]; } - public _Str_25133(k: number): number + public getMaskLeftSideLoc(k: number): number { - const _local_2:RoomPlaneMaskData = this._Str_8361(k); + const _local_2:RoomPlaneMaskData = this.getMask(k); if(_local_2 != null) { return _local_2.leftSideLoc; @@ -170,9 +170,9 @@ export class RoomPlaneData return -1; } - public _Str_23609(k: number): number + public getMaskRightSideLoc(k: number): number { - const _local_2:RoomPlaneMaskData = this._Str_8361(k); + const _local_2:RoomPlaneMaskData = this.getMask(k); if(_local_2 != null) { return _local_2.rightSideLoc; @@ -180,9 +180,9 @@ export class RoomPlaneData return -1; } - public _Str_25097(k: number): number + public getMaskLeftSideLength(k: number): number { - const _local_2:RoomPlaneMaskData = this._Str_8361(k); + const _local_2:RoomPlaneMaskData = this.getMask(k); if(_local_2 != null) { return _local_2.leftSideLength; @@ -190,9 +190,9 @@ export class RoomPlaneData return -1; } - public _Str_25617(k: number): number + public getMaskRightSideLength(k: number): number { - const _local_2:RoomPlaneMaskData = this._Str_8361(k); + const _local_2:RoomPlaneMaskData = this.getMask(k); if(_local_2 != null) { return _local_2.rightSideLength; diff --git a/src/nitro/room/object/RoomPlaneParser.ts b/src/nitro/room/object/RoomPlaneParser.ts index 0f802a80..cc5464d2 100644 --- a/src/nitro/room/object/RoomPlaneParser.ts +++ b/src/nitro/room/object/RoomPlaneParser.ts @@ -1407,7 +1407,7 @@ export class RoomPlaneParser if(!planeData) return null; - return planeData._Str_25207; + return planeData.normalDirection; } public getPlaneSecondaryNormals(k: number): IVector3D[] @@ -1423,9 +1423,9 @@ export class RoomPlaneParser { _local_3 = []; _local_4 = 0; - while(_local_4 < _local_2._Str_20277) + while(_local_4 < _local_2.secondaryNormalCount) { - _local_3.push(_local_2._Str_22585(_local_4)); + _local_3.push(_local_2.getSecondaryNormal(_local_4)); _local_4++; } return _local_3; @@ -1452,7 +1452,7 @@ export class RoomPlaneParser if(!planeData) return 0; - return planeData._Str_6845; + return planeData.maskCount; } public getPlaneMaskLeftSideLoc(k: number, _arg_2: number): number @@ -1463,7 +1463,7 @@ export class RoomPlaneParser if(!planeData) return -1; - return planeData._Str_25133(_arg_2); + return planeData.getMaskLeftSideLoc(_arg_2); } public getPlaneMaskRightSideLoc(k: number, _arg_2: number): number @@ -1474,7 +1474,7 @@ export class RoomPlaneParser if(!planeData) return -1; - return planeData._Str_23609(_arg_2); + return planeData.getMaskRightSideLoc(_arg_2); } public getPlaneMaskLeftSideLength(k: number, _arg_2: number): number @@ -1485,7 +1485,7 @@ export class RoomPlaneParser if(!planeData) return -1; - return planeData._Str_25097(_arg_2); + return planeData.getMaskLeftSideLength(_arg_2); } public getPlaneMaskRightSideLength(k: number, _arg_2: number): number @@ -1496,7 +1496,7 @@ export class RoomPlaneParser if(!planeData) return -1; - return planeData._Str_25617(_arg_2); + return planeData.getMaskRightSideLength(_arg_2); } public addFloorHole(k: number, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: number): void diff --git a/src/nitro/room/object/logic/room/RoomLogic.ts b/src/nitro/room/object/logic/room/RoomLogic.ts index 07ced056..50604fcb 100644 --- a/src/nitro/room/object/logic/room/RoomLogic.ts +++ b/src/nitro/room/object/logic/room/RoomLogic.ts @@ -260,12 +260,12 @@ export class RoomLogic extends RoomObjectLogicBase update = true; break; case ObjectRoomMaskUpdateMessage._Str_10260: - update = this._planeBitmapMaskParser._Str_23574(message.maskId); + update = this._planeBitmapMaskParser.removeMask(message.maskId); break; } - if(update) _arg_2.setValue(RoomObjectVariable.ROOM_PLANE_MASK_XML, this._planeBitmapMaskParser._Str_5598()); + if(update) _arg_2.setValue(RoomObjectVariable.ROOM_PLANE_MASK_XML, this._planeBitmapMaskParser.getXML()); } private onObjectRoomPlaneVisibilityUpdateMessage(message: ObjectRoomPlaneVisibilityUpdateMessage, model: IRoomObjectModel): void diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index b5d4c5c8..2f84c822 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -453,7 +453,7 @@ export class RoomPlane implements IRoomPlane if(mask) { - const planeMask = this._maskManager._Str_8361(mask.type); + const planeMask = this._maskManager.getMask(mask.type); if(planeMask) { diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index 26009171..0b9e594c 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -895,9 +895,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements for(const mask of this._roomPlaneBitmapMaskParser.masks.values()) { - const maskType = this._roomPlaneBitmapMaskParser._Str_21678(mask); - const maskLocation = this._roomPlaneBitmapMaskParser._Str_19038(mask); - const maskCategory = this._roomPlaneBitmapMaskParser._Str_21644(mask); + const maskType = this._roomPlaneBitmapMaskParser.getMaskType(mask); + const maskLocation = this._roomPlaneBitmapMaskParser.getMaskLocation(mask); + const maskCategory = this._roomPlaneBitmapMaskParser.getMaskCategory(mask); if(maskLocation) { diff --git a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts index b56b6b00..431f7de9 100644 --- a/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts +++ b/src/nitro/room/object/visualization/room/mask/PlaneMaskManager.ts @@ -51,10 +51,10 @@ export class PlaneMaskManager this._assetCollection = k; - this._Str_22834(this.data, k); + this.parseMasks(this.data, k); } - private _Str_22834(k: any, _arg_2: IGraphicAssetCollection): void + private parseMasks(k: any, _arg_2: IGraphicAssetCollection): void { if(!k || !_arg_2) return; @@ -90,7 +90,7 @@ export class PlaneMaskManager if(maskVisualization) { - const assetName = this._Str_25815(visualization.bitmaps, maskVisualization, _arg_2); + const assetName = this.parseMaskBitmaps(visualization.bitmaps, maskVisualization, _arg_2); newMask.setAssetName(size, assetName); } @@ -108,7 +108,7 @@ export class PlaneMaskManager } } - private _Str_25815(k: any, _arg_2: PlaneMaskVisualization, _arg_3: IGraphicAssetCollection): string + private parseMaskBitmaps(k: any, _arg_2: PlaneMaskVisualization, _arg_3: IGraphicAssetCollection): string { if(!k || !k.length) return null; @@ -187,7 +187,7 @@ export class PlaneMaskManager return true; } - public _Str_8361(k: string): PlaneMask + public getMask(k: string): PlaneMask { if(!this._masks || !this._masks.size) return null; From 035779da5710c030b7ed249d96beab4c0d5d675f Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 14:44:20 -0500 Subject: [PATCH 071/155] cleaned moodlight event variables --- src/nitro/room/RoomObjectEventHandler.ts | 2 +- .../room/events/RoomBackgroundColorEvent.ts | 18 +++++++++--------- .../room/events/RoomEngineDimmerStateEvent.ts | 8 ++++---- .../events/RoomObjectDimmerStateUpdateEvent.ts | 8 ++++---- src/nitro/session/IRoomSession.ts | 2 +- src/nitro/session/RoomSession.ts | 4 ++-- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 0975b60a..9fdfd1ee 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -692,7 +692,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou switch(event.type) { case RoomObjectDimmerStateUpdateEvent.DIMMER_STATE: - this._roomEngine.events.dispatchEvent(new RoomEngineDimmerStateEvent(roomId, event.state, event._Str_14686, event._Str_6815, event.color, event._Str_5123)); + this._roomEngine.events.dispatchEvent(new RoomEngineDimmerStateEvent(roomId, event.state, event.presetId, event.effectId, event.color, event.brightness)); return; } } diff --git a/src/nitro/room/events/RoomBackgroundColorEvent.ts b/src/nitro/room/events/RoomBackgroundColorEvent.ts index 0b814630..e05b7057 100644 --- a/src/nitro/room/events/RoomBackgroundColorEvent.ts +++ b/src/nitro/room/events/RoomBackgroundColorEvent.ts @@ -5,16 +5,16 @@ export class RoomBackgroundColorEvent extends RoomEngineEvent public static ROOM_COLOR: string = 'REE_ROOM_COLOR'; private _color: number; - private _Str_21672: number; - private _Str_6930: boolean; + private _brightness: number; + private _bgOnly: boolean; constructor(roomId: number, color: number, _arg_3: number, _arg_4: boolean) { super(RoomBackgroundColorEvent.ROOM_COLOR, roomId); this._color = color; - this._Str_21672 = _arg_3; - this._Str_6930 = _arg_4; + this._brightness = _arg_3; + this._bgOnly = _arg_4; } public get color(): number @@ -22,13 +22,13 @@ export class RoomBackgroundColorEvent extends RoomEngineEvent return this._color; } - public get _Str_5123(): number + public get brightness(): number { - return this._Str_21672; + return this._brightness; } - public get _Str_11464(): boolean + public get bgOnly(): boolean { - return this._Str_6930; + return this._bgOnly; } -} \ No newline at end of file +} diff --git a/src/nitro/room/events/RoomEngineDimmerStateEvent.ts b/src/nitro/room/events/RoomEngineDimmerStateEvent.ts index 754072a1..c0bd9e3e 100644 --- a/src/nitro/room/events/RoomEngineDimmerStateEvent.ts +++ b/src/nitro/room/events/RoomEngineDimmerStateEvent.ts @@ -26,12 +26,12 @@ export class RoomEngineDimmerStateEvent extends RoomEngineEvent return this._state; } - public get _Str_14686(): number + public get presetId(): number { return this._presetId; } - public get _Str_6815(): number + public get effectId(): number { return this._effectId; } @@ -41,8 +41,8 @@ export class RoomEngineDimmerStateEvent extends RoomEngineEvent return this._color; } - public get _Str_5123(): number + public get brightness(): number { return this._brightness; } -} \ No newline at end of file +} diff --git a/src/nitro/room/events/RoomObjectDimmerStateUpdateEvent.ts b/src/nitro/room/events/RoomObjectDimmerStateUpdateEvent.ts index 572e3691..57d98a11 100644 --- a/src/nitro/room/events/RoomObjectDimmerStateUpdateEvent.ts +++ b/src/nitro/room/events/RoomObjectDimmerStateUpdateEvent.ts @@ -27,12 +27,12 @@ export class RoomObjectDimmerStateUpdateEvent extends RoomObjectEvent return this._state; } - public get _Str_14686(): number + public get presetId(): number { return this._presetId; } - public get _Str_6815(): number + public get effectId(): number { return this._effectId; } @@ -42,8 +42,8 @@ export class RoomObjectDimmerStateUpdateEvent extends RoomObjectEvent return this._color; } - public get _Str_5123(): number + public get brightness(): number { return this._brightness; } -} \ No newline at end of file +} diff --git a/src/nitro/session/IRoomSession.ts b/src/nitro/session/IRoomSession.ts index 20341709..954131ba 100644 --- a/src/nitro/session/IRoomSession.ts +++ b/src/nitro/session/IRoomSession.ts @@ -28,7 +28,7 @@ export interface IRoomSession extends IDisposable sendBanMessage(userId: number, type: string): void; sendGiveRightsMessage(userId: number): void; sendTakeRightsMessage(userId: number): void; - updateMoodlightData(_Str_25037: number, _Str_24446: number, color: number, _Str_5123: number, apply: boolean): void; + updateMoodlightData(_Str_25037: number, _Str_24446: number, color: number, brightness: number, apply: boolean): void; toggleMoodlightState(): void; pickupPet(id: number): void; pickupBot(id: number): void; diff --git a/src/nitro/session/RoomSession.ts b/src/nitro/session/RoomSession.ts index 87239c33..bda29ab3 100644 --- a/src/nitro/session/RoomSession.ts +++ b/src/nitro/session/RoomSession.ts @@ -224,11 +224,11 @@ export class RoomSession extends Disposable implements IRoomSession this._connection.send(new RoomTakeRightsComposer(userId)); } - public updateMoodlightData(id: number, _Str_24446: number, color: number, _Str_5123: number, apply: boolean): void + public updateMoodlightData(id: number, _Str_24446: number, color: number, brightness: number, apply: boolean): void { const local6 = '000000' + color.toString(16).toUpperCase(); const local7 = '#' + local6.substring((local6.length - 6)); - this.connection.send(new MoodlightSettingsSaveComposer(id, _Str_24446, local7, _Str_5123, apply)); + this.connection.send(new MoodlightSettingsSaveComposer(id, _Str_24446, local7, brightness, apply)); } public toggleMoodlightState(): void From ea1c12a9e9d7634e26971e332f59b44793aa7cb2 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 15:05:04 -0500 Subject: [PATCH 072/155] cleaned RoomEngineObjectPlacedEvent --- .../inventory/furniture/FurnitureGiftOpenedParser.ts | 2 +- src/nitro/room/RoomEngine.ts | 4 ++-- src/nitro/room/RoomObjectEventHandler.ts | 10 +++++----- src/nitro/room/events/RoomEngineObjectPlacedEvent.ts | 8 ++++---- src/nitro/room/events/RoomObjectTileMouseEvent.ts | 8 ++++---- src/nitro/room/messages/ObjectRoomMaskUpdateMessage.ts | 4 ++-- .../room/messages/ObjectTileCursorUpdateMessage.ts | 4 ++-- src/nitro/room/object/logic/room/RoomLogic.ts | 2 +- src/nitro/room/object/logic/room/TileCursorLogic.ts | 6 +++--- src/nitro/session/handler/RoomPresentHandler.ts | 6 +++--- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts b/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts index 2b95cea5..d20b82f0 100644 --- a/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts +++ b/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts @@ -60,7 +60,7 @@ export class FurnitureGiftOpenedParser implements IMessageParser return this._Str_3970; } - public get _Str_4057():boolean + public get placedInRoom():boolean { return this._Str_3224; } diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 9bfcc3e2..0f2f42f9 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2043,12 +2043,12 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato const location = roomObject.getLocation(); if(_arg_3) maskUpdate = new ObjectRoomMaskUpdateMessage(ObjectRoomMaskUpdateMessage.ADD_MASK, maskName, maskType, location); - else maskUpdate = new ObjectRoomMaskUpdateMessage(ObjectRoomMaskUpdateMessage._Str_10260, maskName); + else maskUpdate = new ObjectRoomMaskUpdateMessage(ObjectRoomMaskUpdateMessage.REMOVE_MASK, maskName); } } else { - maskUpdate = new ObjectRoomMaskUpdateMessage(ObjectRoomMaskUpdateMessage._Str_10260, maskName); + maskUpdate = new ObjectRoomMaskUpdateMessage(ObjectRoomMaskUpdateMessage.REMOVE_MASK, maskName); } const roomOwnObject = this.getRoomOwnObject(roomId); diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 9fdfd1ee..a6f0ebf5 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -904,7 +904,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if(!session || session.isSpectator) return; - this.sendWalkUpdate(event._Str_16836, event._Str_17676); + this.sendWalkUpdate(event.tileXAsInt, event.tileYAsInt); } private _Str_24048(event: RoomObjectMouseEvent, roomId: number): void @@ -1429,16 +1429,16 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { if(this._whereYouClickIsWhereYouGo) { - return new ObjectTileCursorUpdateMessage(new Vector3d(k._Str_16836, k._Str_17676, k._Str_21459), 0, true, k.eventId); + return new ObjectTileCursorUpdateMessage(new Vector3d(k.tileXAsInt, k.tileYAsInt, k.tileZAsInt), 0, true, k.eventId); } const roomObject = this._roomEngine.getRoomObjectCursor(roomId); if(roomObject && roomObject.visualization) { - const _local_4 = k._Str_16836; - const _local_5 = k._Str_17676; - const _local_6 = k._Str_21459; + const _local_4 = k.tileXAsInt; + const _local_5 = k.tileYAsInt; + const _local_6 = k.tileZAsInt; const _local_7 = this._roomEngine.getRoomInstance(roomId); if(_local_7) diff --git a/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts b/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts index 929ff615..660dd1d5 100644 --- a/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts +++ b/src/nitro/room/events/RoomEngineObjectPlacedEvent.ts @@ -27,7 +27,7 @@ export class RoomEngineObjectPlacedEvent extends RoomEngineObjectEvent this._instanceData = instanceData; } - public get _Str_7031(): string + public get wallLocation(): string { return this._wallLocation; } @@ -52,17 +52,17 @@ export class RoomEngineObjectPlacedEvent extends RoomEngineObjectEvent return this._direction; } - public get _Str_4057(): boolean + public get placedInRoom(): boolean { return this._placedInRoom; } - public get _Str_23888(): boolean + public get placedOnFloor(): boolean { return this._placedOnFloor; } - public get _Str_23432(): boolean + public get placedOnWall(): boolean { return this._placedOnWall; } diff --git a/src/nitro/room/events/RoomObjectTileMouseEvent.ts b/src/nitro/room/events/RoomObjectTileMouseEvent.ts index f9ca55d9..bdabf0a6 100644 --- a/src/nitro/room/events/RoomObjectTileMouseEvent.ts +++ b/src/nitro/room/events/RoomObjectTileMouseEvent.ts @@ -31,18 +31,18 @@ export class RoomObjectTileMouseEvent extends RoomObjectMouseEvent return this._tileZ; } - public get _Str_16836(): number + public get tileXAsInt(): number { return Math.trunc(this._tileX + 0.499); } - public get _Str_17676(): number + public get tileYAsInt(): number { return Math.trunc(this._tileY + 0.499); } - public get _Str_21459(): number + public get tileZAsInt(): number { return Math.trunc(this._tileZ + 0.499); } -} \ No newline at end of file +} diff --git a/src/nitro/room/messages/ObjectRoomMaskUpdateMessage.ts b/src/nitro/room/messages/ObjectRoomMaskUpdateMessage.ts index a26eef4d..d8dd5337 100644 --- a/src/nitro/room/messages/ObjectRoomMaskUpdateMessage.ts +++ b/src/nitro/room/messages/ObjectRoomMaskUpdateMessage.ts @@ -5,7 +5,7 @@ import { Vector3d } from '../../../room/utils/Vector3d'; export class ObjectRoomMaskUpdateMessage extends RoomObjectUpdateMessage { public static ADD_MASK: string = 'RORMUM_ADD_MASK'; - public static _Str_10260: string = 'RORMUM_ADD_MASK'; + public static REMOVE_MASK: string = 'RORMUM_ADD_MASK'; public static DOOR: string = 'door'; public static WINDOW: string = 'window'; public static HOLE: string = 'hole'; @@ -51,4 +51,4 @@ export class ObjectRoomMaskUpdateMessage extends RoomObjectUpdateMessage { return this._maskCategory; } -} \ No newline at end of file +} diff --git a/src/nitro/room/messages/ObjectTileCursorUpdateMessage.ts b/src/nitro/room/messages/ObjectTileCursorUpdateMessage.ts index b9acab81..63d9e23b 100644 --- a/src/nitro/room/messages/ObjectTileCursorUpdateMessage.ts +++ b/src/nitro/room/messages/ObjectTileCursorUpdateMessage.ts @@ -28,7 +28,7 @@ export class ObjectTileCursorUpdateMessage extends RoomObjectUpdateMessage return this._visible; } - public get _Str_20637(): string + public get sourceEventId(): string { return this._sourceEventId; } @@ -37,4 +37,4 @@ export class ObjectTileCursorUpdateMessage extends RoomObjectUpdateMessage { return this._toggleVisibility; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/room/RoomLogic.ts b/src/nitro/room/object/logic/room/RoomLogic.ts index 50604fcb..c9ef0e50 100644 --- a/src/nitro/room/object/logic/room/RoomLogic.ts +++ b/src/nitro/room/object/logic/room/RoomLogic.ts @@ -259,7 +259,7 @@ export class RoomLogic extends RoomObjectLogicBase update = true; break; - case ObjectRoomMaskUpdateMessage._Str_10260: + case ObjectRoomMaskUpdateMessage.REMOVE_MASK: update = this._planeBitmapMaskParser.removeMask(message.maskId); break; diff --git a/src/nitro/room/object/logic/room/TileCursorLogic.ts b/src/nitro/room/object/logic/room/TileCursorLogic.ts index 2827265e..19ac9ab3 100644 --- a/src/nitro/room/object/logic/room/TileCursorLogic.ts +++ b/src/nitro/room/object/logic/room/TileCursorLogic.ts @@ -34,7 +34,7 @@ export class TileCursorLogic extends RoomObjectLogicBase { if(!(message instanceof ObjectTileCursorUpdateMessage)) return; - if(this._lastEventId && (this._lastEventId === message._Str_20637)) return; + if(this._lastEventId && (this._lastEventId === message.sourceEventId)) return; if(message.toggleVisibility) this._isHidden = !this._isHidden; @@ -61,6 +61,6 @@ export class TileCursorLogic extends RoomObjectLogicBase } } - this._lastEventId = message._Str_20637; + this._lastEventId = message.sourceEventId; } -} \ No newline at end of file +} diff --git a/src/nitro/session/handler/RoomPresentHandler.ts b/src/nitro/session/handler/RoomPresentHandler.ts index 2b6de335..56892ee7 100644 --- a/src/nitro/session/handler/RoomPresentHandler.ts +++ b/src/nitro/session/handler/RoomPresentHandler.ts @@ -1,8 +1,8 @@ import { IConnection } from '../../../core/communication/connections/IConnection'; -import { IRoomHandlerListener } from '../IRoomHandlerListener'; -import { BaseHandler } from './BaseHandler'; import { FurnitureGiftOpenedEvent } from '../../communication/messages/incoming/inventory/furni/gifts/FurnitureGiftOpenedEvent'; import { RoomSessionPresentEvent } from '../events/RoomSessionPresentEvent'; +import { IRoomHandlerListener } from '../IRoomHandlerListener'; +import { BaseHandler } from './BaseHandler'; export class RoomPresentHandler extends BaseHandler { @@ -29,7 +29,7 @@ export class RoomPresentHandler extends BaseHandler if(this.listener && this.listener.events) this.listener.events.dispatchEvent( new RoomSessionPresentEvent(RoomSessionPresentEvent.RSPE_PRESENT_OPENED, session, parser.classId, parser._Str_2887, - parser.productCode, parser.placedItemId, parser.placedItemType, parser._Str_4057, parser.petFigureString)); + parser.productCode, parser.placedItemId, parser.placedItemType, parser.placedInRoom, parser.petFigureString)); } From 9f2c1fa2f0797497c5c6fa2a8ee0114f1d5216e0 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 15:49:11 -0500 Subject: [PATCH 073/155] cleaned IRoomEngineServices --- src/nitro/room/IRoomEngineServices.ts | 8 +++--- src/nitro/room/RoomEngine.ts | 16 ++++++------ src/nitro/room/RoomObjectEventHandler.ts | 32 ++++++++++++------------ 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/nitro/room/IRoomEngineServices.ts b/src/nitro/room/IRoomEngineServices.ts index 8c9b5676..c54e2dbc 100644 --- a/src/nitro/room/IRoomEngineServices.ts +++ b/src/nitro/room/IRoomEngineServices.ts @@ -38,10 +38,10 @@ export interface IRoomEngineServices removeRoomObjectUser(roomId: number, objectId: number): void; loadRoomObjectBadgeImage(roomId: number, objectId: number, objectCategory: number, badgeId: string, groupBadge?: boolean): void; updateRoomObjectMask(roomId: number, objectId: number, _arg_?: boolean): void; - _Str_16645(objectId: number, category: number, _arg_3: boolean, instanceData?: string, stuffData?: IObjectData, state?: number, frameNumber?: number, posture?: string): void; - _Str_7972(k: boolean): void; + setObjectMoverIconSprite(objectId: number, category: number, _arg_3: boolean, instanceData?: string, stuffData?: IObjectData, state?: number, frameNumber?: number, posture?: string): void; + setObjectMoverIconSpriteVisible(k: boolean): void; updateMousePointer(type: string, objectId: number, objectType: string): void; - _Str_17948(): void; + removeObjectMoverIconSprite(): void; getRoomTileObjectMap(k: number): TileObjectMap; isPlayingGame(): boolean; connection: IConnection; @@ -50,4 +50,4 @@ export interface IRoomEngineServices activeRoomId: number; events: IEventDispatcher; isDecorating: boolean; -} \ No newline at end of file +} diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 0f2f42f9..3323be54 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2724,7 +2724,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._roomObjectEventHandler._Str_8675(this._activeRoomId); } - private _Str_24651(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; @@ -2769,7 +2769,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } } - public _Str_16645(objectId: number, category: number, _arg_3: boolean, instanceData: string = null, stuffData: IObjectData = null, state: number = -1, frameNumber: number = -1, posture: string = null): void + public setObjectMoverIconSprite(objectId: number, category: number, _arg_3: boolean, instanceData: string = null, stuffData: IObjectData = null, state: number = -1, frameNumber: number = -1, posture: string = null): void { let type: string = null; let colorIndex = 0; @@ -2828,9 +2828,9 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato const overlay = this.getRenderingCanvasOverlay(canvas); - this._Str_21215(overlay, RoomEngine.OBJECT_ICON_SPRITE); + this.removeOverlayIconSprite(overlay, RoomEngine.OBJECT_ICON_SPRITE); - const _local_15 = this._Str_24651(overlay, RoomEngine.OBJECT_ICON_SPRITE, imageResult.data, scale); + const _local_15 = this.addOverlayIconSprite(overlay, RoomEngine.OBJECT_ICON_SPRITE, imageResult.data, scale); if(_local_15) { @@ -3266,7 +3266,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(geometry) geometry.dispose(); } - public _Str_7972(k: boolean): void + public setObjectMoverIconSpriteVisible(k: boolean): void { const canvas = this.getActiveRoomInstanceRenderingCanvas(); @@ -3281,7 +3281,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } } - public _Str_17948(): void + public removeObjectMoverIconSprite(): void { const canvas = this.getActiveRoomInstanceRenderingCanvas(); @@ -3289,7 +3289,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato const sprite = this.getRenderingCanvasOverlay(canvas); - this._Str_21215(sprite, RoomEngine.OBJECT_ICON_SPRITE); + this.removeOverlayIconSprite(sprite, RoomEngine.OBJECT_ICON_SPRITE); } private getRenderingCanvasOverlay(k: IRoomRenderingCanvas): Sprite @@ -3307,7 +3307,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return sprite; } - private _Str_21215(k: Sprite, _arg_2: string): boolean + private removeOverlayIconSprite(k: Sprite, _arg_2: string): boolean { if(!k) return false; diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index a6f0ebf5..be9211ca 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -187,8 +187,8 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if(this._roomEngine) { - this._roomEngine._Str_16645(typeId, category, false, extra, stuffData, state, frameNumber, posture); - this._roomEngine._Str_7972(false); + this._roomEngine.setObjectMoverIconSprite(typeId, category, false, extra, stuffData, state, frameNumber, posture); + this._roomEngine.setObjectMoverIconSpriteVisible(false); } return true; @@ -196,7 +196,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou public _Str_8675(k: number): boolean { - this._Str_13199(k); + this.resetSelectedObjectData(k); return true; } @@ -969,13 +969,13 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { this.setFurnitureAlphaMultiplier(roomObject, 0.5); - this._roomEngine._Str_7972(false); + this._roomEngine.setObjectMoverIconSpriteVisible(false); } else { this.setFurnitureAlphaMultiplier(roomObject, 0); - this._roomEngine._Str_7972(true); + this._roomEngine.setObjectMoverIconSpriteVisible(true); } } @@ -1044,7 +1044,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } this.setFurnitureAlphaMultiplier(roomObject, 0.5); - this._roomEngine._Str_7972(true); + this._roomEngine.setObjectMoverIconSpriteVisible(true); } if(roomObject) @@ -1100,7 +1100,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - this._roomEngine._Str_7972(!_local_12); + this._roomEngine.setObjectMoverIconSpriteVisible(!_local_12); } } @@ -1547,7 +1547,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou this._roomEngine.setPlacedRoomObjectData(roomId, new SelectedRoomObjectData(selectedData.id, selectedData.category, null, selectedData.dir, null)); - this._Str_13199(roomId); + this.resetSelectedObjectData(roomId); if(this._roomEngine && this._roomEngine.events) { @@ -1676,15 +1676,15 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou _local_9 = false; this.setFurnitureAlphaMultiplier(roomObject, 0.5); this.setSelectedRoomObjectData(roomId, roomObject.id, category, roomObject.getLocation(), roomObject.getDirection(), operation); - this._roomEngine._Str_16645(roomObject.id, category, true); - this._roomEngine._Str_7972(false); + this._roomEngine.setObjectMoverIconSprite(roomObject.id, category, true); + this._roomEngine.setObjectMoverIconSpriteVisible(false); break; case RoomObjectOperationType.OBJECT_MOVE_TO: { const selectedData = this.getSelectedRoomObjectData(roomId); this._Str_16022(roomId, selectedData.id, selectedData.category, selectedData.loc, selectedData.dir, RoomObjectOperationType.OBJECT_MOVE_TO, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); this.setFurnitureAlphaMultiplier(roomObject, 1); - this._roomEngine._Str_17948(); + this._roomEngine.removeObjectMoverIconSprite(); if(this._roomEngine.connection) { @@ -1731,7 +1731,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - if(_local_9) this._Str_13199(roomId); + if(_local_9) this.resetSelectedObjectData(roomId); return true; } @@ -1940,11 +1940,11 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - private _Str_13199(roomId: number): void + private resetSelectedObjectData(roomId: number): void { if(!this._roomEngine) return; - this._roomEngine._Str_17948(); + this._roomEngine.removeObjectMoverIconSprite(); const selectedData = this.getSelectedRoomObjectData(roomId); @@ -2014,14 +2014,14 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou public cancelRoomObjectPlacement(roomId: number): boolean { - this._Str_13199(roomId); + this.resetSelectedObjectData(roomId); return true; } private setSelectedRoomObjectData(roomId: number, id: number, category: number, location: IVector3D, direction: IVector3D, operation: string, typeId: number = 0, instanceData: string = null, stuffData: IObjectData =null, state: number = -1, frameNumber: number = -1, posture: string = null): void { - this._Str_13199(roomId); + this.resetSelectedObjectData(roomId); if(!this._roomEngine) return; From 5a842a2864c1614ff3ffdbf8d0c76b0eeb2d6027 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 16:21:38 -0500 Subject: [PATCH 074/155] cleaned SpriteDataCollector --- src/nitro/room/IRoomEngine.ts | 2 +- src/nitro/room/RoomEngine.ts | 12 ++-- src/nitro/room/RoomObjectEventHandler.ts | 2 +- src/nitro/room/utils/SpriteDataCollector.ts | 68 ++++++++++----------- 4 files changed, 42 insertions(+), 42 deletions(-) diff --git a/src/nitro/room/IRoomEngine.ts b/src/nitro/room/IRoomEngine.ts index f46405dd..a8a9e4ae 100644 --- a/src/nitro/room/IRoomEngine.ts +++ b/src/nitro/room/IRoomEngine.ts @@ -73,7 +73,7 @@ export interface IRoomEngine extends INitroManager getRoomObjectImage(roomId: number, objectId: number, category: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number): ImageResult; getRoomObjectPetImage(typeId: number, paletteId: number, color: number, direction: IVector3D, scale: number, listener: IGetImageListener, headOnly?: boolean, bgColor?: number, customParts?: PetCustomPart[], posture?: string): ImageResult; selectRoomObject(roomId: number, objectId: number, objectCategory: number): void; - _Str_8675(): void; + cancelRoomObjectInsert(): void; getPetColorResult(petIndex: number, paletteIndex: number): PetColorResult; cancelRoomObjectPlacement(): void; getFurnitureFloorName(typeId: number): string; diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 3323be54..04229e78 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2717,11 +2717,11 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._roomObjectEventHandler._Str_17481(roomId, objectId, objectCategory); } - public _Str_8675(): void + public cancelRoomObjectInsert(): void { if(!this._roomObjectEventHandler) return; - this._roomObjectEventHandler._Str_8675(this._activeRoomId); + this._roomObjectEventHandler.cancelRoomObjectInsert(this._activeRoomId); } private addOverlayIconSprite(k: Sprite, _arg_2: string, _arg_3: Texture, scale: number = 1): Sprite @@ -3391,7 +3391,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(tileObjectMap) tileObjectMap.populate(this._Str_21072(k, RoomObjectCategory.FLOOR)); } - public _Str_9972(k: Rectangle, _arg_2: number, _arg_3: boolean = false, _arg_4: boolean = true, _arg_5: boolean = false, canvasId: number = -1): IMessageComposer + public getRenderRoomMessage(k: Rectangle, _arg_2: number, _arg_3: boolean = false, _arg_4: boolean = true, _arg_5: boolean = false, canvasId: number = -1): IMessageComposer { let canvas: IRoomRenderingCanvas = null; @@ -3419,9 +3419,9 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } const _local_9 = new SpriteDataCollector(); - const _local_10 = _local_9._Str_4536(k, canvas, this, _local_8); - const _local_11 = _local_9._Str_24177(this); - const _local_12 = _local_9._Str_22985(k, canvas, this, _arg_2); + const _local_10 = _local_9.getFurniData(k, canvas, this, _local_8); + const _local_11 = _local_9.getRoomRenderingModifiers(this); + const _local_12 = _local_9.getRoomPlanes(k, canvas, this, _arg_2); if(_arg_5) canvas.resumeSpriteVisibilityChecking(); diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index be9211ca..36f04e4a 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -194,7 +194,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return true; } - public _Str_8675(k: number): boolean + public cancelRoomObjectInsert(k: number): boolean { this.resetSelectedObjectData(k); diff --git a/src/nitro/room/utils/SpriteDataCollector.ts b/src/nitro/room/utils/SpriteDataCollector.ts index 1aebf619..189e7f6a 100644 --- a/src/nitro/room/utils/SpriteDataCollector.ts +++ b/src/nitro/room/utils/SpriteDataCollector.ts @@ -13,16 +13,16 @@ import { RoomEngine } from '../RoomEngine'; export class SpriteDataCollector { - private static _Str_16967: number = 1; - private static _Str_18197: number = -16; - private static _Str_18565: number = -52; - private static _Str_17558: number = 30; + private static MANNEQUIN_MAGIC_X_OFFSET: number = 1; + private static MANNEQUIN_MAGIC_Y_OFFSET: number = -16; + private static AVATAR_WATER_EFFECT_MAGIC_Y_OFFSET: number = -52; + private static MAX_EXTERNAL_IMAGE_COUNT: number = 30; - private _Str_6409: number; + private maxZ: number; private spriteCount: number = 0; - private _Str_18433: number = 0; + private externalImageCount: number = 0; - private static _Str_22230(k: RoomObjectSpriteData[], _arg_2: RoomEngine): RoomObjectSpriteData[] + private static addMannequinSprites(k: RoomObjectSpriteData[], _arg_2: RoomEngine): RoomObjectSpriteData[] { const datas: RoomObjectSpriteData[] = []; @@ -42,8 +42,8 @@ export class SpriteDataCollector { for(const sprite of spriteList) { - sprite.x = (sprite.x + ((data.x + (data.width / 2)) + SpriteDataCollector._Str_16967)); - sprite.y = (sprite.y + ((data.y + data.height) + SpriteDataCollector._Str_18197)); + sprite.x = (sprite.x + ((data.x + (data.width / 2)) + SpriteDataCollector.MANNEQUIN_MAGIC_X_OFFSET)); + sprite.y = (sprite.y + ((data.y + data.height) + SpriteDataCollector.MANNEQUIN_MAGIC_Y_OFFSET)); sprite.z = (sprite.z + data.z); datas.push(sprite); } @@ -59,7 +59,7 @@ export class SpriteDataCollector return datas; } - private static _Str_22564(k: RoomObjectSpriteData, _arg_2: RoomObjectSpriteData): number + private static sortSpriteDataObjects(k: RoomObjectSpriteData, _arg_2: RoomObjectSpriteData): number { if(k.z < _arg_2.z) return 1; @@ -68,7 +68,7 @@ export class SpriteDataCollector return -1; } - private static _Str_20789(k:RoomObjectSpriteData, _arg_2: Rectangle, _arg_3: IRoomRenderingCanvas): boolean + private static isSpriteInViewPort(k:RoomObjectSpriteData, _arg_2: Rectangle, _arg_3: IRoomRenderingCanvas): boolean { return true; // var _local_4 = new Rectangle((k.x + _arg_3.screenOffsetX), (k.y + _arg_3.screenOffsetY), k.width, k.height); @@ -76,7 +76,7 @@ export class SpriteDataCollector // return _local_4.contains(_arg_2.x, _arg_2.y); } - private static _Str_14110(k: Point, _arg_2: Point, _arg_3: Point, _arg_4: Point): Point[] + private static sortQuadPoints(k: Point, _arg_2: Point, _arg_3: Point, _arg_4: Point): Point[] { const points: Point[] = []; @@ -133,7 +133,7 @@ export class SpriteDataCollector } - public _Str_4536(k: Rectangle, _arg_2:IRoomRenderingCanvas, _arg_3:RoomEngine, _arg_4: number): string + public getFurniData(k: Rectangle, _arg_2:IRoomRenderingCanvas, _arg_3:RoomEngine, _arg_4: number): string { const _local_5: Object[] = []; let _local_6 = _arg_2.getSortableSpriteList(); @@ -176,7 +176,7 @@ export class SpriteDataCollector if(((_local_16.name.indexOf('h_std_fx29_') === 0) || (_local_16.name.indexOf('h_std_fx185_') === 0))) { - _local_16.y = (_local_16.y + SpriteDataCollector._Str_18565); + _local_16.y = (_local_16.y + SpriteDataCollector.AVATAR_WATER_EFFECT_MAGIC_Y_OFFSET); } _local_6.push(_local_16); @@ -186,16 +186,16 @@ export class SpriteDataCollector } } - _local_6 = SpriteDataCollector._Str_22230(_local_6, _arg_3); - _local_6.sort(SpriteDataCollector._Str_22564); + _local_6 = SpriteDataCollector.addMannequinSprites(_local_6, _arg_3); + _local_6.sort(SpriteDataCollector.sortSpriteDataObjects); for(const _local_9 of _local_6) { - if((((((!(_local_9.name === null)) && (_local_9.name.length > 0)) && (!(_local_9.name.indexOf('tile_cursor_') === 0))) && (SpriteDataCollector._Str_20789(_local_9, k, _arg_2))) && ((_arg_4 < 0) || (!(_local_9.objectId == _arg_4))))) + if((((((!(_local_9.name === null)) && (_local_9.name.length > 0)) && (!(_local_9.name.indexOf('tile_cursor_') === 0))) && (SpriteDataCollector.isSpriteInViewPort(_local_9, k, _arg_2))) && ((_arg_4 < 0) || (!(_local_9.objectId == _arg_4))))) { - _local_5.push(this._Str_25132(_local_9, k, _arg_2, _arg_3)); + _local_5.push(this.getSpriteDataObject(_local_9, k, _arg_2, _arg_3)); - if(!this._Str_6409) this._Str_6409 = _local_9.z; + if(!this.maxZ) this.maxZ = _local_9.z; this.spriteCount++; } @@ -204,12 +204,12 @@ export class SpriteDataCollector return JSON.stringify(_local_5); } - public _Str_24177(k: RoomEngine): string + public getRoomRenderingModifiers(k: RoomEngine): string { return JSON.stringify(new Object()); } - private _Str_25132(k: RoomObjectSpriteData, _arg_2: Rectangle, _arg_3: IRoomRenderingCanvas, _arg_4: RoomEngine): Object + private getSpriteDataObject(k: RoomObjectSpriteData, _arg_2: Rectangle, _arg_3: IRoomRenderingCanvas, _arg_4: RoomEngine): Object { let _local_7: string = null; let _local_9: string[] = []; @@ -288,9 +288,9 @@ export class SpriteDataCollector _local_5.width = k.width; _local_5.height = k.height; - this._Str_18433++; + this.externalImageCount++; - if(this._Str_18433 > SpriteDataCollector._Str_17558) _local_5.name = 'box'; + if(this.externalImageCount > SpriteDataCollector.MAX_EXTERNAL_IMAGE_COUNT) _local_5.name = 'box'; } if(k.posture) _local_5.posture = k.posture; @@ -298,13 +298,13 @@ export class SpriteDataCollector return _local_5; } - private _Str_25196(k: Rectangle, _arg_2: number, _arg_3: IPlaneDrawingData[]): PlaneDrawingData + private makeBackgroundPlane(k: Rectangle, _arg_2: number, _arg_3: IPlaneDrawingData[]): PlaneDrawingData { const _local_4 = new Point(0, 0); const _local_5 = new Point(k.width, 0); const _local_6 = new Point(0, k.height); const _local_7 = new Point(k.width, k.height); - const _local_8 = SpriteDataCollector._Str_14110(_local_4, _local_5, _local_6, _local_7); + const _local_8 = SpriteDataCollector.sortQuadPoints(_local_4, _local_5, _local_6, _local_7); let _local_9 = 0; @@ -312,11 +312,11 @@ export class SpriteDataCollector { _local_9 = _arg_3[0].z; - if(this._Str_6409) _local_9 = Math.max(this._Str_6409, _local_9); + if(this.maxZ) _local_9 = Math.max(this.maxZ, _local_9); } else { - _local_9 = ((this._Str_6409) ? this._Str_6409 : 0); + _local_9 = ((this.maxZ) ? this.maxZ : 0); } _local_9 = (_local_9 + ((this.spriteCount * 1.776104) + (_arg_3.length * 2.31743))); @@ -329,15 +329,15 @@ export class SpriteDataCollector return _local_10; } - private _Str_25623(k: IRoomPlane[], _arg_2: IRoomRenderingCanvas, _arg_3: RoomEngine): { plane: IRoomPlane, z: number }[] + private sortRoomPlanes(k: IRoomPlane[], _arg_2: IRoomRenderingCanvas, _arg_3: RoomEngine): { plane: IRoomPlane, z: number }[] { const _local_4: Map = new Map(); let _local_5 = 1; - if(this._Str_6409) + if(this.maxZ) { - _local_5 = (_local_5 + this._Str_6409); + _local_5 = (_local_5 + this.maxZ); } for(const _local_6 of k) @@ -385,7 +385,7 @@ export class SpriteDataCollector return _local_8; } - public _Str_22985(k: Rectangle, _arg_2: IRoomRenderingCanvas, _arg_3: RoomEngine, _arg_4: number): PlaneDrawingData[] + public getRoomPlanes(k: Rectangle, _arg_2: IRoomRenderingCanvas, _arg_3: RoomEngine, _arg_4: number): PlaneDrawingData[] { const _local_5: PlaneDrawingData[] = []; @@ -395,7 +395,7 @@ export class SpriteDataCollector if(visualization) { const _local_8 = _arg_2.geometry; - const _local_9 = this._Str_25623(visualization.planes, _arg_2, _arg_3); + const _local_9 = this.sortRoomPlanes(visualization.planes, _arg_2, _arg_3); const _local_10 = Nitro.instance.stage; for(const _local_11 of _local_9) @@ -440,7 +440,7 @@ export class SpriteDataCollector } else { - const _local_22 = SpriteDataCollector._Str_14110(_local_15, _local_16, _local_17, _local_18); + const _local_22 = SpriteDataCollector.sortQuadPoints(_local_15, _local_16, _local_17, _local_18); for(const _local_23 of _local_12.getDrawingDatas(_local_8)) { @@ -452,7 +452,7 @@ export class SpriteDataCollector } } - _local_5.unshift(this._Str_25196(k, _arg_4, _local_5)); + _local_5.unshift(this.makeBackgroundPlane(k, _arg_4, _local_5)); } return _local_5; From aaf9e858ba91a1818c6b5a9d7939277a69b844a7 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 16:31:52 -0500 Subject: [PATCH 075/155] cleaned IRoomEngine variables --- src/nitro/room/IRoomEngine.ts | 2 +- src/nitro/room/RoomEngine.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/room/IRoomEngine.ts b/src/nitro/room/IRoomEngine.ts index a8a9e4ae..6cba4698 100644 --- a/src/nitro/room/IRoomEngine.ts +++ b/src/nitro/room/IRoomEngine.ts @@ -37,7 +37,7 @@ export interface IRoomEngine extends INitroManager updateRoomInstancePlaneVisibility(roomId: number, wallVisible: boolean, floorVisible?: boolean): boolean; updateRoomInstancePlaneThickness(roomId: number, wallThickness: number, floorThickness: number): boolean; updateRoomInstancePlaneType(roomId: number, floorType?: string, wallType?: string, landscapeType?: string, _arg_5?: boolean): boolean; - _Str_17804(k: number, _arg_2: number, _arg_3: number, _arg_4: boolean): boolean; + updateObjectRoomColor(k: number, _arg_2: number, _arg_3: number, _arg_4: boolean): boolean; getRoomInstanceGeometry(roomId: number, canvasId?: number): IRoomGeometry; getRoomInstanceVariable(roomId: number, key: string): T; getTotalObjectsForManager(roomId: number, category: number): number; diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 04229e78..20c682b9 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -789,7 +789,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return true; } - public _Str_17804(k: number, _arg_2: number, _arg_3: number, _arg_4: boolean): boolean + public updateObjectRoomColor(k: number, _arg_2: number, _arg_3: number, _arg_4: boolean): boolean { const roomObject = this.getRoomOwnObject(k); From 33b7c61841eadee76250c7e9a2696292c4e85f96 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 17:07:07 -0500 Subject: [PATCH 076/155] cleaned RoomInstanceData --- src/nitro/room/RoomEngine.ts | 22 +++++++++---------- .../FurnitureExternalImageVisualization.ts | 4 ++-- src/nitro/room/utils/RoomInstanceData.ts | 6 ++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 20c682b9..12dc2614 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -902,7 +902,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._roomManager.update(time, update); - this._Str_22919(time); + this.updateRoomCameras(time); if(this._mouseCursorUpdate) this.setPointer(); @@ -915,7 +915,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato const instanceData = this.getRoomInstanceData(this._activeRoomId); - if(instanceData && instanceData._Str_22598()) + if(instanceData && instanceData.hasButtonMouseCursorOwners()) { document.body.style.cursor = 'pointer'; } @@ -1143,17 +1143,17 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato camera.targetId = objectId; camera.targetCategory = RoomObjectCategory.UNIT; - camera.activateFollowing(this._Str_19549); + camera.activateFollowing(this.cameraFollowDuration); } } - private get _Str_19549(): number + private get cameraFollowDuration(): number { return 1000; //return (getBoolean("room.camera.follow_user")) ? 1000 : 0; } - private _Str_22919(time: number): void + private updateRoomCameras(time: number): void { for(const instanceData of this._roomInstanceDatas.values()) { @@ -1169,7 +1169,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if((instanceData.roomId !== this._activeRoomId) || !this._activeRoomIsDragged) { - this._Str_25242(instanceData.roomId, 1, object.getLocation(), time); + this.updateRoomCamera(instanceData.roomId, 1, object.getLocation(), time); } } @@ -1188,7 +1188,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } } - private _Str_25242(roomId: number, canvasId: number, objectLocation: IVector3D, time: number): void + private updateRoomCamera(roomId: number, canvasId: number, objectLocation: IVector3D, time: number): void { const renderingCanvas = this.getRoomInstanceRenderingCanvas(roomId, canvasId); const instanceData = this.getRoomInstanceData(roomId); @@ -1201,7 +1201,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!roomGeometry || !roomCamera || !roomInstance) return; - const canvasRectangle = this._Str_25261(roomId, canvasId); + const canvasRectangle = this.getRoomCanvasRectangle(roomId, canvasId); if(!canvasRectangle) return; @@ -1475,7 +1475,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } } - private _Str_25261(roomId: number, canvasId: number): Rectangle + private getRoomCanvasRectangle(roomId: number, canvasId: number): Rectangle { const canvas = this.getRoomInstanceRenderingCanvas(roomId, canvasId); @@ -2615,7 +2615,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(instanceData) { - if(instanceData._Str_16810((category + '_' + objectId))) this._mouseCursorUpdate = true; + if(instanceData.addButtonMouseCursorOwner((category + '_' + objectId))) this._mouseCursorUpdate = true; } } } @@ -2628,7 +2628,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(instanceData) { - if(instanceData._Str_11959((category + '_' + objectId))) this._mouseCursorUpdate = true; + if(instanceData.removeButtonMouseCursorOwner((category + '_' + objectId))) this._mouseCursorUpdate = true; } } diff --git a/src/nitro/room/object/visualization/furniture/FurnitureExternalImageVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureExternalImageVisualization.ts index 4e6e3837..75430e53 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureExternalImageVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureExternalImageVisualization.ts @@ -32,14 +32,14 @@ export class FurnitureExternalImageVisualization extends FurnitureDynamicThumbna let url = (json.w || ''); - url = this._Str_18056(url); + url = this.buildThumbnailUrl(url); this._url = url; return this._url; } - private _Str_18056(url: string): string + private buildThumbnailUrl(url: string): string { url = url.replace('.png', '_small.png'); diff --git a/src/nitro/room/utils/RoomInstanceData.ts b/src/nitro/room/utils/RoomInstanceData.ts index 7e5ecc75..0c61630d 100644 --- a/src/nitro/room/utils/RoomInstanceData.ts +++ b/src/nitro/room/utils/RoomInstanceData.ts @@ -160,7 +160,7 @@ export class RoomInstanceData return this.getPendingFurnitureWall(keys.next().value as number); } - public _Str_16810(k: string): boolean + public addButtonMouseCursorOwner(k: string): boolean { const _local_2 = this._mouseButtonCursorOwners.indexOf(k); @@ -174,7 +174,7 @@ export class RoomInstanceData return false; } - public _Str_11959(k: string): boolean + public removeButtonMouseCursorOwner(k: string): boolean { const _local_2 = this._mouseButtonCursorOwners.indexOf(k); @@ -188,7 +188,7 @@ export class RoomInstanceData return false; } - public _Str_22598(): boolean + public hasButtonMouseCursorOwners(): boolean { return this._mouseButtonCursorOwners.length > 0; } From 325482fe7eded4918e6de9d7276715cae8f29959 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 18:02:59 -0500 Subject: [PATCH 077/155] cleaned RoomEngine --- src/nitro/room/IRoomCreator.ts | 2 +- src/nitro/room/RoomEngine.ts | 40 ++++++++++----------- src/nitro/room/RoomMessageHandler.ts | 4 +-- src/nitro/room/RoomObjectEventHandler.ts | 32 ++++++++--------- src/nitro/room/utils/LegacyWallGeometry.ts | 14 ++++---- src/nitro/room/utils/SpriteDataCollector.ts | 2 +- src/nitro/room/utils/TileObjectMap.ts | 14 ++++---- 7 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/nitro/room/IRoomCreator.ts b/src/nitro/room/IRoomCreator.ts index bcafccf1..490d664f 100644 --- a/src/nitro/room/IRoomCreator.ts +++ b/src/nitro/room/IRoomCreator.ts @@ -51,7 +51,7 @@ export interface IRoomCreator updateRoomObjectUserPosture(roomId: number, objectId: number, type: string, parameter?: string): boolean; updateRoomObjectUserOwn(roomId: number, objectId: number): void; getPetTypeId(figure: string): number; - _Str_17722(k: number, _arg_2: string): void; + refreshTileObjectMap(k: number, _arg_2: string): void; setRoomEngineGameMode(roomId: number, isPlaying: boolean): void; sessionDataManager: ISessionDataManager; roomSessionManager: IRoomSessionManager; diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 12dc2614..2dac004c 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -1068,7 +1068,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this.selectRoomObject(roomId, id, RoomObjectCategory.FLOOR); } - if(object.isReady && data.synchronized) this._Str_21543(roomId, object); + if(object.isReady && data.synchronized) this.addObjectToTileMap(roomId, object); return true; } @@ -1398,7 +1398,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!roomCamera.location) { roomGeometry.location = _local_15; - if(this._Str_11555) + if(this.useOffsetScrolling) { roomCamera.initializeLocation(new Vector3d(0, 0, 0)); } @@ -1418,7 +1418,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato { roomCamera.limitedLocationX = _local_34; roomCamera.limitedLocationY = _local_35; - if(this._Str_11555) + if(this.useOffsetScrolling) { roomCamera.target = _local_46; } @@ -1446,7 +1446,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!this._sessionDataManager.isCameraFollowDisabled) { - if(this._Str_11555) + if(this.useOffsetScrolling) { roomCamera.update(time, 8); } @@ -1456,7 +1456,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } } - if(this._Str_11555) + if(this.useOffsetScrolling) { renderingCanvas.screenOffsetX = -(roomCamera.location.x); renderingCanvas.screenOffsetY = -(roomCamera.location.y); @@ -1845,7 +1845,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this.removeRoomObject(roomId, objectId, RoomObjectCategory.FLOOR); this.setMouseDefault(roomId, RoomObjectCategory.FLOOR, objectId); - if(_arg_4) this._Str_17722(roomId, 'RoomEngine.disposeObjectFurniture()'); + if(_arg_4) this.refreshTileObjectMap(roomId, 'RoomEngine.disposeObjectFurniture()'); } public getRoomObjectWall(roomId: number, objectId: number): IRoomObjectController @@ -2142,7 +2142,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if((Math.abs((_local_5 - _local_6)) < 0.1) && (Math.abs((_local_6 - _local_7)) < 0.1)) { - _local_5 = wallGeometry._Str_24141(location.x, location.y); + _local_5 = wallGeometry.getFloorAltitude(location.x, location.y); } return new Vector3d(location.x, location.y, _local_5); @@ -2327,7 +2327,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this.events.dispatchEvent(new RoomEngineObjectEvent(RoomEngineObjectEvent.CONTENT_UPDATED, id, objectId, category)); } - if(roomId !== RoomEngine.TEMPORARY_ROOM) this._Str_21543(id, object); + if(roomId !== RoomEngine.TEMPORARY_ROOM) this.addObjectToTileMap(id, object); } public changeObjectModelData(roomId: number, objectId: number, category: number, numberKey: string, numberValue: number): boolean @@ -2445,7 +2445,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!canvas) return; const overlay = this.getRenderingCanvasOverlay(canvas); - const sprite = this._Str_16498(overlay, RoomEngine.OBJECT_ICON_SPRITE); + const sprite = this.getOverlayIconSprite(overlay, RoomEngine.OBJECT_ICON_SPRITE); if(sprite) { @@ -2525,7 +2525,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(camera) { - if(this._Str_11555) + if(this.useOffsetScrolling) { if(!camera.isMoving) { @@ -2714,7 +2714,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato { if(!this._roomObjectEventHandler) return; - this._roomObjectEventHandler._Str_17481(roomId, objectId, objectCategory); + this._roomObjectEventHandler.setSelectedObject(roomId, objectId, objectCategory); } public cancelRoomObjectInsert(): void @@ -2728,7 +2728,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato { if(!k || !_arg_3) return; - let sprite = this._Str_16498(k, _arg_2); + let sprite = this.getOverlayIconSprite(k, _arg_2); if(sprite) return null; @@ -3273,7 +3273,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!canvas) return; const overlay = this.getRenderingCanvasOverlay(canvas); - const sprite = this._Str_16498(overlay, RoomEngine.OBJECT_ICON_SPRITE); + const sprite = this.getOverlayIconSprite(overlay, RoomEngine.OBJECT_ICON_SPRITE); if(sprite) { @@ -3342,7 +3342,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return false; } - private _Str_16498(k: Sprite, _arg_2: string): Sprite + private getOverlayIconSprite(k: Sprite, _arg_2: string): Sprite { if(!k) return null; @@ -3363,7 +3363,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return null; } - public _Str_21072(k: number, _arg_2: number): IRoomObject[] + public getRoomObjects(k: number, _arg_2: number): IRoomObject[] { if(this._ready) { @@ -3377,18 +3377,18 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return []; } - protected _Str_21543(k: number, _arg_2: IRoomObject): void + protected addObjectToTileMap(k: number, _arg_2: IRoomObject): void { const tileObjectMap = this.getRoomInstanceData(k).tileObjectMap; - if(tileObjectMap) tileObjectMap._Str_21192(_arg_2); + if(tileObjectMap) tileObjectMap.addRoomObject(_arg_2); } - public _Str_17722(k: number, _arg_2: string): void + public refreshTileObjectMap(k: number, _arg_2: string): void { const tileObjectMap = this.getRoomInstanceData(k).tileObjectMap; - if(tileObjectMap) tileObjectMap.populate(this._Str_21072(k, RoomObjectCategory.FLOOR)); + if(tileObjectMap) tileObjectMap.populate(this.getRoomObjects(k, RoomObjectCategory.FLOOR)); } public getRenderRoomMessage(k: Rectangle, _arg_2: number, _arg_3: boolean = false, _arg_4: boolean = true, _arg_5: boolean = false, canvasId: number = -1): IMessageComposer @@ -3624,7 +3624,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return (session && session.isDecorating) || false; } - private get _Str_11555(): boolean + private get useOffsetScrolling(): boolean { return true; } diff --git a/src/nitro/room/RoomMessageHandler.ts b/src/nitro/room/RoomMessageHandler.ts index 8cc609dd..5c72ef59 100644 --- a/src/nitro/room/RoomMessageHandler.ts +++ b/src/nitro/room/RoomMessageHandler.ts @@ -383,7 +383,7 @@ export class RoomMessageHandler extends Disposable heightMap.setIsRoomTile(parser.x, parser.y, parser.isRoomTile()); } - this._roomCreator._Str_17722(this._currentRoomId, 'RoomMessageHandler.onRoomHeightMapUpdateEvent()'); + this._roomCreator.refreshTileObjectMap(this._currentRoomId, 'RoomMessageHandler.onRoomHeightMapUpdateEvent()'); } private onRoomThicknessEvent(event: RoomThicknessEvent): void @@ -903,7 +903,7 @@ export class RoomMessageHandler extends Disposable } else { - //location = wallGeometry._Str_24084(data.y, data.z, data.direction); + //location = wallGeometry.getLocationOldFormat(data.y, data.z, data.direction); } const direction = new Vector3d(wallGeometry.getDirection(data.direction)); diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 36f04e4a..53b60a27 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -398,7 +398,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou didMove = true; - if(event.objectId !== -1) this._Str_17481(roomId, event.objectId, category); + if(event.objectId !== -1) this.setSelectedObject(roomId, event.objectId, category); break; case RoomObjectOperationType.OBJECT_PLACE: @@ -433,7 +433,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } else { - this._Str_17481(roomId, event.objectId, category); + this.setSelectedObject(roomId, event.objectId, category); didMove = false; @@ -518,11 +518,11 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if((_local_15 !== event.eventId) && (_local_16 !== event.eventId) && !didMove) { - this._Str_16209(roomId); + this.deselectObject(roomId); if(this._roomEngine.events) this._roomEngine.events.dispatchEvent(new RoomEngineObjectEvent(RoomEngineObjectEvent.DESELECTED, roomId, -1, RoomObjectCategory.MINIMUM)); - this._Str_12227(roomId, 0, false); + this.setSelectedAvatar(roomId, 0, false); } } } @@ -719,7 +719,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return; } case RoomObjectMoveEvent.OBJECT_REMOVED: - this._Str_12227(roomId, 0, false); + this.setSelectedAvatar(roomId, 0, false); return; } } @@ -1447,7 +1447,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if(_local_8) { - const _local_9 = _local_8._Str_19056(_local_4, _local_5); + const _local_9 = _local_8.getObjectIntTile(_local_4, _local_5); const _local_10 = this._roomEngine.getFurnitureStackingHeightMap(roomId); if(_local_10) @@ -1510,7 +1510,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou const wallGeometry = this._roomEngine.getLegacyWallGeometry(roomId); - if(wallGeometry) wallLocation = wallGeometry._Str_21860(location, direction); + if(wallGeometry) wallLocation = wallGeometry.getOldLocationString(location, direction); } direction = ((((direction / 45) % 8) + 8) % 8); @@ -1704,7 +1704,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if(wallGeometry) { - const location = wallGeometry._Str_21860(roomObject.getLocation(), angle); + const location = wallGeometry.getOldLocationString(roomObject.getLocation(), angle); if(location) this._roomEngine.connection.send(new FurnitureWallUpdateComposer(objectId, location)); } @@ -1838,7 +1838,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou this._roomEngine.events.dispatchEvent(new RoomEngineObjectPlacedOnUserEvent(RoomEngineObjectEvent.PLACED_ON_USER, roomId, objectId, category, _local_4.id, _local_4.category)); } - public _Str_17481(roomId: number, objectId: number, category: number): void + public setSelectedObject(roomId: number, objectId: number, category: number): void { if(!this._roomEngine) return; @@ -1853,16 +1853,16 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou case RoomObjectCategory.WALL: if(category === RoomObjectCategory.UNIT) { - this._Str_16209(roomId); - this._Str_12227(roomId, objectId, true); + this.deselectObject(roomId); + this.setSelectedAvatar(roomId, objectId, true); } else { - this._Str_12227(roomId, 0, false); + this.setSelectedAvatar(roomId, 0, false); if(objectId !== this._selectedObjectId) { - this._Str_16209(roomId); + this.deselectObject(roomId); const _local_5 = this._roomEngine.getRoomObject(roomId, objectId, category); @@ -1882,7 +1882,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - private _Str_16209(k: number): void + private deselectObject(k: number): void { if(this._selectedObjectId === -1) return; @@ -1897,7 +1897,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - public _Str_12227(k: number, _arg_2: number, _arg_3: boolean): void + public setSelectedAvatar(k: number, _arg_2: number, _arg_3: boolean): void { if(!this._roomEngine) return; @@ -2041,7 +2041,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou private _Str_25586(roomObject: IRoomObjectController, x: number, y: number, wallGeometry: LegacyWallGeometry): boolean { - if(!wallGeometry._Str_10375(x, y)) return false; + if(!wallGeometry.isRoomTile(x, y)) return false; roomObject.setLocation(new Vector3d(x, y, wallGeometry.getHeight(x, y))); diff --git a/src/nitro/room/utils/LegacyWallGeometry.ts b/src/nitro/room/utils/LegacyWallGeometry.ts index cf0d9b19..d0e33aaa 100644 --- a/src/nitro/room/utils/LegacyWallGeometry.ts +++ b/src/nitro/room/utils/LegacyWallGeometry.ts @@ -191,7 +191,7 @@ export class LegacyWallGeometry return _local_11; } - public _Str_24084(k: number, _arg_2: number, _arg_3: string):IVector3D + public getLocationOldFormat(k: number, _arg_2: number, _arg_3: string):IVector3D { let _local_4: number; let _local_5: number; @@ -244,7 +244,7 @@ export class LegacyWallGeometry return this.getLocation(_local_8, _local_9, _local_10, _local_11, _arg_3); } - public _Str_22875(k:IVector3D, _arg_2: number): [ number, number, number, number, string ] + public getOldLocation(k:IVector3D, _arg_2: number): [ number, number, number, number, string ] { if(k == null) { @@ -284,9 +284,9 @@ export class LegacyWallGeometry return [_local_3, _local_4, _local_5, _local_6, _local_7]; } - public _Str_21860(k:IVector3D, _arg_2: number): string + public getOldLocationString(k:IVector3D, _arg_2: number): string { - const _local_3 = this._Str_22875(k, _arg_2); + const _local_3 = this.getOldLocation(k, _arg_2); if(_local_3 == null) { return null; @@ -309,7 +309,7 @@ export class LegacyWallGeometry return 90; } - public _Str_24141(k: number, _arg_2: number): number + public getFloorAltitude(k: number, _arg_2: number): number { const _local_3 = this.getHeight(k, _arg_2); const _local_4 = (_local_3 + 1); @@ -317,8 +317,8 @@ export class LegacyWallGeometry return _local_3 + (((((((((Math.trunc(this.getHeight((k - 1), (_arg_2 - 1))) == _local_4) || (Math.trunc(this.getHeight(k, (_arg_2 - 1))) == _local_4)) || (Math.trunc(this.getHeight((k + 1), (_arg_2 - 1))) == _local_4)) || (Math.trunc(this.getHeight((k - 1), _arg_2)) == _local_4)) || (Math.trunc(this.getHeight((k + 1), _arg_2)) == _local_4)) || (Math.trunc(this.getHeight((k - 1), (_arg_2 + 1))) == _local_4)) || (Math.trunc(this.getHeight(k, (_arg_2 + 1))) == _local_4)) || (Math.trunc(this.getHeight((k + 1), (_arg_2 + 1))) == _local_4)) ? 0.5 : 0); } - public _Str_10375(k: number, _arg_2: number): boolean + public isRoomTile(k: number, _arg_2: number): boolean { return ((((k >= 0) && (k < this._width)) && (_arg_2 >= 0)) && (_arg_2 < this._height)) && (this._heightMap[_arg_2][k] >= 0); } -} \ No newline at end of file +} diff --git a/src/nitro/room/utils/SpriteDataCollector.ts b/src/nitro/room/utils/SpriteDataCollector.ts index 189e7f6a..8812e966 100644 --- a/src/nitro/room/utils/SpriteDataCollector.ts +++ b/src/nitro/room/utils/SpriteDataCollector.ts @@ -138,7 +138,7 @@ export class SpriteDataCollector const _local_5: Object[] = []; let _local_6 = _arg_2.getSortableSpriteList(); - const _local_7 = _arg_3._Str_21072(_arg_3.activeRoomId, RoomObjectCategory.UNIT); + const _local_7 = _arg_3.getRoomObjects(_arg_3.activeRoomId, RoomObjectCategory.UNIT); for(const _local_8 of _local_7) { diff --git a/src/nitro/room/utils/TileObjectMap.ts b/src/nitro/room/utils/TileObjectMap.ts index 8acc8df7..448f54c3 100644 --- a/src/nitro/room/utils/TileObjectMap.ts +++ b/src/nitro/room/utils/TileObjectMap.ts @@ -41,7 +41,7 @@ export class TileObjectMap { this.clear(); - for(const _local_2 of k) this._Str_21192(_local_2); + for(const _local_2 of k) this.addRoomObject(_local_2); } public dispose(): void @@ -51,7 +51,7 @@ export class TileObjectMap this._height = 0; } - public _Str_19056(k: number, _arg_2: number): IRoomObject + public getObjectIntTile(k: number, _arg_2: number): IRoomObject { if((((k >= 0) && (k < this._width)) && (_arg_2 >= 0)) && (_arg_2 < this._height)) { @@ -63,7 +63,7 @@ export class TileObjectMap return null; } - public _Str_23932(k: number, _arg_2: number, _arg_3:IRoomObject): void + public setObjectInTile(k: number, _arg_2: number, _arg_3:IRoomObject): void { if(!_arg_3.isReady) { @@ -80,7 +80,7 @@ export class TileObjectMap } } - public _Str_21192(k: IRoomObject): void + public addRoomObject(k: IRoomObject): void { if(!k || !k.model || !k.isReady) return; @@ -107,11 +107,11 @@ export class TileObjectMap while(x < (location.x + sizeX)) { - const roomObject = this._Str_19056(x, y); + const roomObject = this.getObjectIntTile(x, y); if((!(roomObject)) || ((!(roomObject === k)) && (roomObject.getLocation().z <= location.z))) { - this._Str_23932(x, y, k); + this.setObjectInTile(x, y, k); } x++; @@ -120,4 +120,4 @@ export class TileObjectMap y++; } } -} \ No newline at end of file +} From 16807ff08f3adb6c8edc2a15fdbda92591efac9a Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 13 Jun 2021 02:17:00 -0400 Subject: [PATCH 078/155] Fix calculateVertices issues --- src/room/object/visualization/utils/index.ts | 2 +- src/room/renderer/RoomSpriteCanvas.ts | 6 +++--- src/room/renderer/utils/ExtendedSprite.ts | 17 ++++------------- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/src/room/object/visualization/utils/index.ts b/src/room/object/visualization/utils/index.ts index fbad1632..e65d8bbf 100644 --- a/src/room/object/visualization/utils/index.ts +++ b/src/room/object/visualization/utils/index.ts @@ -1,5 +1,5 @@ export * from './GraphicAsset'; -export * from './GraphicAssetCollection'; +//export * from './GraphicAssetCollection'; export * from './GraphicAssetPalette'; export * from './IGraphicAsset'; export * from './IGraphicAssetCollection'; diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index e2097a0b..6b45a696 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -549,11 +549,11 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas { if((index < 0) || (index >= this._spriteCount)) return null; - const sprite = this._display.getChildAt(index); + const sprite = (this._display.getChildAt(index) as ExtendedSprite); if(!sprite) return null; - return sprite as ExtendedSprite; + return sprite; } protected getExtendedSpriteIdentifier(sprite: ExtendedSprite): string @@ -678,7 +678,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas extendedSprite.offsetX = sprite.offsetX; extendedSprite.offsetY = sprite.offsetY; extendedSprite.name = sprite.name; - extendedSprite.varyingDepth = sprite.varyingDepth; + extendedSprite.varyingDepth = sprite.varyingDepth; extendedSprite.clickHandling = sprite.clickHandling; extendedSprite.blendMode = sprite.blendMode; extendedSprite.filters = sprite.filters; diff --git a/src/room/renderer/utils/ExtendedSprite.ts b/src/room/renderer/utils/ExtendedSprite.ts index aceeed9b..658bba94 100644 --- a/src/room/renderer/utils/ExtendedSprite.ts +++ b/src/room/renderer/utils/ExtendedSprite.ts @@ -1,4 +1,4 @@ -import { BaseTexture, BLEND_MODES, Point, Renderer, RenderTexture, Sprite, Texture } from 'pixi.js'; +import { BaseTexture, BLEND_MODES, Point, RenderTexture, Sprite, Texture } from 'pixi.js'; import { Nitro } from '../../../nitro/Nitro'; export class ExtendedSprite extends Sprite @@ -38,20 +38,11 @@ export class ExtendedSprite extends Sprite return true; } - public render(renderer: Renderer): void + public calculateVertices(): void { - try - { - //@ts-ignore - if(!this._texture || !this._texture._uvs || !this._texture._uvs.uvsFloat32) return; - } + if(!this.texture.orig) return; - catch (err) - { - return; - } - - super.render(renderer); + super.calculateVertices(); } public setTexture(texture: Texture): void From 8f9a6bc0792cf0ba5ce6c8bdf8ea35895826c66d Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 13 Jun 2021 03:39:55 -0500 Subject: [PATCH 079/155] cleaned RoomObjectEventHandler --- src/nitro/room/RoomEngine.ts | 2 +- src/nitro/room/RoomObjectEventHandler.ts | 124 +++++++++++------------ src/nitro/room/preview/RoomPreviewer.ts | 2 +- 3 files changed, 64 insertions(+), 64 deletions(-) diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 2dac004c..2911c764 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2636,7 +2636,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato { if(!this._roomObjectEventHandler) return false; - this._roomObjectEventHandler.processRoomObjectOperation(this._activeRoomId, objectId, category, operation); + this._roomObjectEventHandler.modifyRoomObject(this._activeRoomId, objectId, category, operation); } public processRoomObjectWallOperation(objectId: number, category: number, operation: string, data: Map): boolean diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 53b60a27..0ebf04b2 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -134,7 +134,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou roomObject.setDirection(direction); - this._Str_16022(event.roomId, selectedData.id, selectedData.category, selectedData.loc, direction, selectedData.operation, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); + this.updateSelectedObjectData(event.roomId, selectedData.id, selectedData.category, selectedData.loc, direction, selectedData.operation, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); selectedData = this.getSelectedRoomObjectData(event.roomId); @@ -159,7 +159,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if((category !== RoomObjectCategory.ROOM) && (!this._roomEngine.isPlayingGame() || category !== RoomObjectCategory.UNIT)) category = RoomObjectCategory.MINIMUM; - const _local_7 = this._Str_18648(category, event.type); + const _local_7 = this.getMouseEventId(category, event.type); if(_local_7 === event.eventId) { @@ -169,7 +169,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { if(event.eventId) { - this._Str_11142(category, event.type, event.eventId); + this.setMouseEventId(category, event.type, event.eventId); } } @@ -201,7 +201,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return true; } - private _Str_18648(k: number, _arg_2: string): string + private getMouseEventId(k: number, _arg_2: string): string { const existing = this._eventIds.get(k); @@ -210,7 +210,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return (existing.get(_arg_2) || null); } - private _Str_11142(k: number, _arg_2: string, _arg_3: string): void + private setMouseEventId(k: number, _arg_2: string, _arg_3: string): void { let existing = this._eventIds.get(k); @@ -367,7 +367,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { if(!operation || (operation === RoomObjectOperationType.OBJECT_UNDEFINED)) { - didWalk = this._Str_23423(roomId, event); + didWalk = this.handleMoveTargetFurni(roomId, event); } } @@ -380,7 +380,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { if(selectedData) { - this.processRoomObjectOperation(roomId, selectedData.id, selectedData.category, RoomObjectOperationType.OBJECT_MOVE_TO); + this.modifyRoomObject(roomId, selectedData.id, selectedData.category, RoomObjectOperationType.OBJECT_MOVE_TO); } } @@ -388,12 +388,12 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { if(selectedData && (event.objectType === RoomObjectUserType.MONSTER_PLANT)) { - this.processRoomObjectOperation(roomId, selectedData.id, selectedData.category, RoomObjectOperationType.OBJECT_MOVE_TO); + this.modifyRoomObject(roomId, selectedData.id, selectedData.category, RoomObjectOperationType.OBJECT_MOVE_TO); } - if(!event.eventId) this._Str_11142(RoomObjectCategory.ROOM, MouseEventType.MOUSE_CLICK, event.eventId); + if(event.eventId) this.setMouseEventId(RoomObjectCategory.ROOM, MouseEventType.MOUSE_CLICK, event.eventId); - this._Str_19253(roomId, event.objectId, category); + this.placeObjectOnUser(roomId, event.objectId, category); } didMove = true; @@ -404,7 +404,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou case RoomObjectOperationType.OBJECT_PLACE: if(category === RoomObjectCategory.ROOM) { - this._Str_19271(roomId, (event instanceof RoomObjectTileMouseEvent), (event instanceof RoomObjectWallMouseEvent)); + this.placeObject(roomId, (event instanceof RoomObjectTileMouseEvent), (event instanceof RoomObjectWallMouseEvent)); } else if(category === RoomObjectCategory.UNIT) @@ -413,15 +413,15 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { case RoomObjectUserType.MONSTER_PLANT: case RoomObjectUserType.RENTABLE_BOT: - this._Str_19271(roomId, (event instanceof RoomObjectTileMouseEvent), (event instanceof RoomObjectWallMouseEvent)); + this.placeObject(roomId, (event instanceof RoomObjectTileMouseEvent), (event instanceof RoomObjectWallMouseEvent)); break; default: if(event.eventId) { - this._Str_11142(RoomObjectCategory.ROOM, MouseEventType.MOUSE_CLICK, event.eventId); + this.setMouseEventId(RoomObjectCategory.ROOM, MouseEventType.MOUSE_CLICK, event.eventId); } - this._Str_19253(roomId, event.objectId, category); + this.placeObjectOnUser(roomId, event.objectId, category); break; } } @@ -441,17 +441,17 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { if(event.ctrlKey && !event.altKey && !event.shiftKey && (event.objectType === RoomObjectUserType.RENTABLE_BOT)) { - this.processRoomObjectOperation(roomId, event.objectId, category, RoomObjectOperationType.OBJECT_PICKUP_BOT); + this.modifyRoomObject(roomId, event.objectId, category, RoomObjectOperationType.OBJECT_PICKUP_BOT); } else if(event.ctrlKey && !event.altKey && !event.shiftKey && (event.objectType === RoomObjectUserType.MONSTER_PLANT)) { - this.processRoomObjectOperation(roomId, event.objectId, category, RoomObjectOperationType.OBJECT_PICKUP_PET); + this.modifyRoomObject(roomId, event.objectId, category, RoomObjectOperationType.OBJECT_PICKUP_PET); } else if(!event.ctrlKey && !event.altKey && event.shiftKey && (event.objectType === RoomObjectUserType.MONSTER_PLANT)) { - this.processRoomObjectOperation(roomId, event.objectId, category, RoomObjectOperationType.OBJECT_ROTATE_POSITIVE); + this.modifyRoomObject(roomId, event.objectId, category, RoomObjectOperationType.OBJECT_ROTATE_POSITIVE); } if(!this._roomEngine.isPlayingGame()) @@ -481,7 +481,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou else if(event.ctrlKey && !event.altKey && !event.shiftKey) { - this.processRoomObjectOperation(roomId, event.objectId, category, RoomObjectOperationType.OBJECT_PICKUP); + this.modifyRoomObject(roomId, event.objectId, category, RoomObjectOperationType.OBJECT_PICKUP); } if(!this._roomEngine.isPlayingGame()) @@ -499,12 +499,12 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { if(didWalk) { - this._Str_11142(RoomObjectCategory.ROOM, MouseEventType.MOUSE_CLICK, event.eventId); + this.setMouseEventId(RoomObjectCategory.ROOM, MouseEventType.MOUSE_CLICK, event.eventId); } if(didMove) { - this._Str_11142(RoomObjectCategory.MINIMUM, MouseEventType.MOUSE_CLICK, event.eventId); + this.setMouseEventId(RoomObjectCategory.MINIMUM, MouseEventType.MOUSE_CLICK, event.eventId); } } } @@ -513,8 +513,8 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if(category === RoomObjectCategory.ROOM) { - const _local_15 = this._Str_18648(RoomObjectCategory.MINIMUM, MouseEventType.MOUSE_CLICK); - const _local_16 = this._Str_18648(RoomObjectCategory.UNIT, MouseEventType.MOUSE_CLICK); + const _local_15 = this.getMouseEventId(RoomObjectCategory.MINIMUM, MouseEventType.MOUSE_CLICK); + const _local_16 = this.getMouseEventId(RoomObjectCategory.UNIT, MouseEventType.MOUSE_CLICK); if((_local_15 !== event.eventId) && (_local_16 !== event.eventId) && !didMove) { @@ -549,14 +549,14 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if(event instanceof RoomObjectTileMouseEvent) { - newEvent = this._Str_23824(event, roomId); + newEvent = this.handleMouseOverTile(event, roomId); } else if(event.object && (event.object.id !== -1)) { if(this._whereYouClickIsWhereYouGo) { - newEvent = this._Str_25124(category, roomId, event); + newEvent = this.handleMouseOverObject(category, roomId, event); } } @@ -572,11 +572,11 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou switch(operation) { case RoomObjectOperationType.OBJECT_MOVE: - if(category === RoomObjectCategory.ROOM) this._Str_24048(event, roomId); + if(category === RoomObjectCategory.ROOM) this.handleObjectMove(event, roomId); return; case RoomObjectOperationType.OBJECT_PLACE: - if(category === RoomObjectCategory.ROOM) this._Str_22548(event, roomId); + if(category === RoomObjectCategory.ROOM) this.handleObjectPlace(event, roomId); return; } @@ -599,7 +599,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou case RoomObjectOperationType.OBJECT_UNDEFINED: if((category === RoomObjectCategory.FLOOR) || (category === RoomObjectCategory.WALL) || (event.objectType === RoomObjectUserType.MONSTER_PLANT)) { - if((event.altKey && !event.ctrlKey && !event.shiftKey) || this._Str_25211(event)) + if((event.altKey && !event.ctrlKey && !event.shiftKey) || this.decorateModeMove(event)) { if(this._roomEngine.events) this._roomEngine.events.dispatchEvent(new RoomEngineObjectEvent(RoomEngineObjectEvent.REQUEST_MOVE, roomId, event.objectId, category)); } @@ -625,7 +625,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou case RoomObjectOperationType.OBJECT_UNDEFINED: if((category === RoomObjectCategory.FLOOR) || (category === RoomObjectCategory.WALL) || (event.objectType === RoomObjectUserType.MONSTER_PLANT)) { - if((!event.ctrlKey && !event.shiftKey) || this._Str_25211(event)) + if((!event.ctrlKey && !event.shiftKey) || this.decorateModeMove(event)) { if(this._roomEngine.events) this._roomEngine.events.dispatchEvent(new RoomEngineObjectEvent(RoomEngineObjectEvent.REQUEST_MANIPULATION, roomId, event.objectId, category)); } @@ -907,7 +907,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou this.sendWalkUpdate(event.tileXAsInt, event.tileYAsInt); } - private _Str_24048(event: RoomObjectMouseEvent, roomId: number): void + private handleObjectMove(event: RoomObjectMouseEvent, roomId: number): void { if(!event || !this._roomEngine) return; @@ -929,9 +929,9 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { const stackingHeightMap = this._roomEngine.getFurnitureStackingHeightMap(roomId); - if(!(((event instanceof RoomObjectTileMouseEvent)) && (this._Str_18155(roomObject, selectedData, Math.trunc(event.tileX + 0.5), Math.trunc(event.tileY + 0.5), stackingHeightMap)))) + if(!(((event instanceof RoomObjectTileMouseEvent)) && (this.handleFurnitureMove(roomObject, selectedData, Math.trunc(event.tileX + 0.5), Math.trunc(event.tileY + 0.5), stackingHeightMap)))) { - this._Str_18155(roomObject, selectedData, selectedData.loc.x, selectedData.loc.y, stackingHeightMap); + this.handleFurnitureMove(roomObject, selectedData, selectedData.loc.x, selectedData.loc.y, stackingHeightMap); _local_6 = false; } @@ -950,7 +950,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou const _local_14 = event.y; const _local_15 = event.direction; - if(this._Str_22090(roomObject, selectedData, _local_10, _local_11, _local_12, _local_13, _local_14, _local_15)) + if(this.handleWallItemMove(roomObject, selectedData, _local_10, _local_11, _local_12, _local_13, _local_14, _local_15)) { _local_6 = true; } @@ -979,7 +979,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - private _Str_22548(event: RoomObjectMouseEvent, roomId: number): void + private handleObjectPlace(event: RoomObjectMouseEvent, roomId: number): void { if(!event || !this._roomEngine) return; @@ -1034,7 +1034,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou roomObject.setDirection(direction); - this._Str_16022(roomId, selectedData.id, selectedData.category, selectedData.loc, direction, selectedData.operation, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); + this.updateSelectedObjectData(roomId, selectedData.id, selectedData.category, selectedData.loc, direction, selectedData.operation, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); selectedData = this.getSelectedRoomObjectData(roomId); @@ -1055,7 +1055,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if(selectedData.category === RoomObjectCategory.FLOOR) { - if(!((event instanceof RoomObjectTileMouseEvent) && this._Str_18155(roomObject, selectedData, Math.trunc(event.tileX + 0.5), Math.trunc(event.tileY + 0.5), stackingHeightMap))) + if(!((event instanceof RoomObjectTileMouseEvent) && this.handleFurnitureMove(roomObject, selectedData, Math.trunc(event.tileX + 0.5), Math.trunc(event.tileY + 0.5), stackingHeightMap))) { this._roomEngine.removeRoomObjectFloor(roomId, selectedData.id); @@ -1076,7 +1076,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou const _local_18 = event.y; const _local_19 = event.direction; - if(this._Str_22090(roomObject, selectedData, _local_14, _local_15, _local_16, _local_17, _local_18, _local_19)) + if(this.handleWallItemMove(roomObject, selectedData, _local_14, _local_15, _local_16, _local_17, _local_18, _local_19)) { _local_12 = true; } @@ -1092,7 +1092,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou else if(selectedData.category === RoomObjectCategory.UNIT) { - if(!((event instanceof RoomObjectTileMouseEvent) && this._Str_25586(roomObject, Math.trunc(event.tileX + 0.5), Math.trunc(event.tileY + 0.5), this._roomEngine.getLegacyWallGeometry(roomId)))) + if(!((event instanceof RoomObjectTileMouseEvent) && this.handleUserPlace(roomObject, Math.trunc(event.tileX + 0.5), Math.trunc(event.tileY + 0.5), this._roomEngine.getLegacyWallGeometry(roomId)))) { this._roomEngine.removeRoomObjectUser(roomId, selectedData.id); @@ -1104,7 +1104,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - private _Str_18155(roomObject: IRoomObjectController, selectedObjectData: SelectedRoomObjectData, x: number, y: number, stackingHeightMap: FurnitureStackingHeightMap): boolean + private handleFurnitureMove(roomObject: IRoomObjectController, selectedObjectData: SelectedRoomObjectData, x: number, y: number, stackingHeightMap: FurnitureStackingHeightMap): boolean { if(!roomObject || !selectedObjectData) return false; @@ -1118,15 +1118,15 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou _local_8.assign(roomObject.getDirection()); - let _local_9 = this._Str_21004(roomObject, _local_7, selectedObjectData.loc, selectedObjectData.dir, stackingHeightMap); + let _local_9 = this.validateFurnitureLocation(roomObject, _local_7, selectedObjectData.loc, selectedObjectData.dir, stackingHeightMap); if(!_local_9) { - _local_8.x = this._Str_17555(roomObject, true); + _local_8.x = this.getValidRoomObjectDirection(roomObject, true); roomObject.setDirection(_local_8); - _local_9 = this._Str_21004(roomObject, _local_7, selectedObjectData.loc, selectedObjectData.dir, stackingHeightMap); + _local_9 = this.validateFurnitureLocation(roomObject, _local_7, selectedObjectData.loc, selectedObjectData.dir, stackingHeightMap); } if(!_local_9) @@ -1143,12 +1143,12 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return true; } - private _Str_22090(k: IRoomObjectController, _arg_2: SelectedRoomObjectData, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: IVector3D, _arg_6: number, _arg_7: number, _arg_8: number): boolean + private handleWallItemMove(k: IRoomObjectController, _arg_2: SelectedRoomObjectData, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: IVector3D, _arg_6: number, _arg_7: number, _arg_8: number): boolean { if(!k || !_arg_2) return false; const _local_9 = new Vector3d(_arg_8); - const _local_10 = this._Str_25568(k, _arg_3, _arg_4, _arg_5, _arg_6, _arg_7, _arg_2); + const _local_10 = this.validateWallItemLocation(k, _arg_3, _arg_4, _arg_5, _arg_6, _arg_7, _arg_2); if(!_local_10) return false; @@ -1158,7 +1158,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return true; } - private _Str_21004(k: IRoomObject, _arg_2: IVector3D, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: FurnitureStackingHeightMap): Vector3d + private validateFurnitureLocation(k: IRoomObject, _arg_2: IVector3D, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: FurnitureStackingHeightMap): Vector3d { if(!k || !k.model || !_arg_2) return null; @@ -1228,7 +1228,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return null; } - private _Str_25568(k: IRoomObject, _arg_2: IVector3D, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: number, _arg_6: number, _arg_7: SelectedRoomObjectData): Vector3d + private validateWallItemLocation(k: IRoomObject, _arg_2: IVector3D, _arg_3: IVector3D, _arg_4: IVector3D, _arg_5: number, _arg_6: number, _arg_7: SelectedRoomObjectData): Vector3d { if((((((k == null) || (k.model == null)) || (_arg_2 == null)) || (_arg_3 == null)) || (_arg_4 == null)) || (_arg_7 == null)) return null; @@ -1336,7 +1336,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou this._roomEngine.connection.send(new RoomUnitWalkComposer(x, y)); } - private _Str_25124(category: number, roomId: number, event: RoomObjectMouseEvent): ObjectTileCursorUpdateMessage + private handleMouseOverObject(category: number, roomId: number, event: RoomObjectMouseEvent): ObjectTileCursorUpdateMessage { if(category !== RoomObjectCategory.FLOOR) return null; @@ -1344,7 +1344,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if(!roomObject) return null; - const location = this._Str_21925(roomObject, event); + const location = this.getActiveSurfaceLocation(roomObject, event); if(!location) return null; @@ -1359,10 +1359,10 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return new ObjectTileCursorUpdateMessage(new Vector3d(x, y, roomObject.getLocation().z), z, true, event.eventId); } - private _Str_23423(k: number, _arg_2: RoomObjectMouseEvent): boolean + private handleMoveTargetFurni(k: number, _arg_2: RoomObjectMouseEvent): boolean { const _local_3 = this._roomEngine.getRoomObject(k, _arg_2.objectId, RoomObjectCategory.FLOOR); - const _local_4 = this._Str_21925(_local_3, _arg_2); + const _local_4 = this.getActiveSurfaceLocation(_local_3, _arg_2); if(_local_4) { @@ -1374,7 +1374,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return false; } - private _Str_21925(k: IRoomObject, _arg_2: RoomObjectMouseEvent): Vector3d + private getActiveSurfaceLocation(k: IRoomObject, _arg_2: RoomObjectMouseEvent): Vector3d { if(!k || !_arg_2) return null; @@ -1425,7 +1425,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return null; } - private _Str_23824(k: RoomObjectTileMouseEvent, roomId: number): ObjectTileCursorUpdateMessage + private handleMouseOverTile(k: RoomObjectTileMouseEvent, roomId: number): ObjectTileCursorUpdateMessage { if(this._whereYouClickIsWhereYouGo) { @@ -1469,7 +1469,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return null; } - private _Str_19271(roomId: number, isTileEvent: boolean, isWallEvent: boolean): void + private placeObject(roomId: number, isTileEvent: boolean, isWallEvent: boolean): void { const selectedData = this.getSelectedRoomObjectData(roomId); @@ -1587,7 +1587,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return true; } - public processRoomObjectOperation(roomId: number, objectId: number, category: number, operation: string): boolean + public modifyRoomObject(roomId: number, objectId: number, category: number, operation: string): boolean { if(!this._roomEngine) return false; @@ -1607,11 +1607,11 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou if(operation == RoomObjectOperationType.OBJECT_ROTATE_NEGATIVE) { - direction = this._Str_17555(roomObject, false); + direction = this.getValidRoomObjectDirection(roomObject, false); } else { - direction = this._Str_17555(roomObject, true); + direction = this.getValidRoomObjectDirection(roomObject, true); } const x = roomObject.getLocation().x; @@ -1682,7 +1682,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou case RoomObjectOperationType.OBJECT_MOVE_TO: { const selectedData = this.getSelectedRoomObjectData(roomId); - this._Str_16022(roomId, selectedData.id, selectedData.category, selectedData.loc, selectedData.dir, RoomObjectOperationType.OBJECT_MOVE_TO, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); + this.updateSelectedObjectData(roomId, selectedData.id, selectedData.category, selectedData.loc, selectedData.dir, RoomObjectOperationType.OBJECT_MOVE_TO, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); this.setFurnitureAlphaMultiplier(roomObject, 1); this._roomEngine.removeObjectMoverIconSprite(); @@ -1736,7 +1736,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return true; } - public _Str_17555(k: IRoomObjectController, _arg_2: boolean): number + public getValidRoomObjectDirection(k: IRoomObjectController, _arg_2: boolean): number { if(!k || !k.model) return 0; @@ -1823,7 +1823,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou return false; } - private _Str_19253(roomId: number, objectId: number, category: number): void + private placeObjectOnUser(roomId: number, objectId: number, category: number): void { const _local_4 = this.getSelectedRoomObjectData(roomId); @@ -1967,7 +1967,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou this._roomEngine.updateRoomObjectMask(roomId, selectedData.id, true); } - this._Str_16022(roomId, selectedData.id, selectedData.category, selectedData.loc, selectedData.dir, RoomObjectOperationType.OBJECT_MOVE, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); + this.updateSelectedObjectData(roomId, selectedData.id, selectedData.category, selectedData.loc, selectedData.dir, RoomObjectOperationType.OBJECT_MOVE, selectedData.typeId, selectedData.instanceData, selectedData.stuffData, selectedData.state, selectedData.animFrame, selectedData.posture); } else if((selectedData.operation === RoomObjectOperationType.OBJECT_PLACE)) @@ -2007,7 +2007,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou object.model.setValue(RoomObjectVariable.FURNITURE_ALPHA_MULTIPLIER, multiplier); } - private _Str_25211(event: RoomObjectMouseEvent): boolean + private decorateModeMove(event: RoomObjectMouseEvent): boolean { return (this._roomEngine.isDecorating) && (!(event.ctrlKey || event.shiftKey)); } @@ -2030,7 +2030,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou this._roomEngine.setSelectedRoomObjectData(roomId, selectedData); } - private _Str_16022(roomId: number, id: number, category: number, location: IVector3D, direction: IVector3D, operation: string, typeId: number = 0, instanceData: string = null, stuffData: IObjectData = null, state: number = -1, frameNumber: number = -1, posture: string = null): void + private updateSelectedObjectData(roomId: number, id: number, category: number, location: IVector3D, direction: IVector3D, operation: string, typeId: number = 0, instanceData: string = null, stuffData: IObjectData = null, state: number = -1, frameNumber: number = -1, posture: string = null): void { if(!this._roomEngine) return null; @@ -2039,7 +2039,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou this._roomEngine.setSelectedRoomObjectData(roomId, selectedData); } - private _Str_25586(roomObject: IRoomObjectController, x: number, y: number, wallGeometry: LegacyWallGeometry): boolean + private handleUserPlace(roomObject: IRoomObjectController, x: number, y: number, wallGeometry: LegacyWallGeometry): boolean { if(!wallGeometry.isRoomTile(x, y)) return false; diff --git a/src/nitro/room/preview/RoomPreviewer.ts b/src/nitro/room/preview/RoomPreviewer.ts index 90757f2c..6fe24cf3 100644 --- a/src/nitro/room/preview/RoomPreviewer.ts +++ b/src/nitro/room/preview/RoomPreviewer.ts @@ -405,7 +405,7 @@ export class RoomPreviewer if(!roomObject) return; - const direction = this._roomEngine.objectEventHandler._Str_17555(roomObject, true); + const direction = this._roomEngine.objectEventHandler.getValidRoomObjectDirection(roomObject, true); switch(this._currentPreviewObjectCategory) { From fe7bb7e947649e44df570cb8037f7e850b3169d6 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 14 Jun 2021 00:56:57 -0400 Subject: [PATCH 080/155] Add packet --- src/nitro/communication/NitroMessages.ts | 3 ++- .../messages/outgoing/OutgoingHeader.ts | 1 + .../unit/RoomUnitGiveHandItemPetComposer.ts | 21 +++++++++++++++++++ .../messages/outgoing/room/unit/index.ts | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/outgoing/room/unit/RoomUnitGiveHandItemPetComposer.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index ce735ef3..cb76d426 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, SellablePetPalettesEvent } from './messages'; +import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, RoomUnitGiveHandItemPetComposer, SellablePetPalettesEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent'; @@ -918,6 +918,7 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.UNIT_DANCE, RoomUnitDanceComposer); this._composers.set(OutgoingHeader.UNIT_DROP_HAND_ITEM, RoomUnitDropHandItemComposer); this._composers.set(OutgoingHeader.UNIT_GIVE_HANDITEM, RoomUnitGiveHandItemComposer); + this._composers.set(OutgoingHeader.UNIT_GIVE_HANDITEM_PET, RoomUnitGiveHandItemPetComposer); this._composers.set(OutgoingHeader.UNIT_LOOK, RoomUnitLookComposer); this._composers.set(OutgoingHeader.UNIT_SIGN, RoomUnitSignComposer); this._composers.set(OutgoingHeader.UNIT_POSTURE, RoomUnitPostureComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 52a7906d..bf00374a 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -232,4 +232,5 @@ export class OutgoingHeader public static MARKETPLACE_BUY_OFFER = 1603; public static CATALOG_REQUESET_PET_BREEDS = 1756; public static APPROVE_NAME = 2109; + public static UNIT_GIVE_HANDITEM_PET = 2768; } diff --git a/src/nitro/communication/messages/outgoing/room/unit/RoomUnitGiveHandItemPetComposer.ts b/src/nitro/communication/messages/outgoing/room/unit/RoomUnitGiveHandItemPetComposer.ts new file mode 100644 index 00000000..7d3378e5 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/unit/RoomUnitGiveHandItemPetComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class RoomUnitGiveHandItemPetComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(unitId: number) + { + this._data = [ unitId ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/unit/index.ts b/src/nitro/communication/messages/outgoing/room/unit/index.ts index c080bffd..52a7296a 100644 --- a/src/nitro/communication/messages/outgoing/room/unit/index.ts +++ b/src/nitro/communication/messages/outgoing/room/unit/index.ts @@ -3,6 +3,7 @@ export * from './RoomUnitActionComposer'; export * from './RoomUnitDanceComposer'; export * from './RoomUnitDropHandItemComposer'; export * from './RoomUnitGiveHandItemComposer'; +export * from './RoomUnitGiveHandItemPetComposer'; export * from './RoomUnitLookComposer'; export * from './RoomUnitPostureComposer'; export * from './RoomUnitSignComposer'; From 2b1e75b06f8c8e6a8ac8f544b08f14aa48d07fe6 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 14 Jun 2021 11:12:22 -0400 Subject: [PATCH 081/155] Update screenshot code --- src/nitro/room/IRoomEngine.ts | 2 +- src/nitro/room/RoomEngine.ts | 28 ++++++++++++++++++++++------ src/room/utils/NitroRectangle.ts | 4 ++++ src/room/utils/index.ts | 1 + 4 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 src/room/utils/NitroRectangle.ts diff --git a/src/nitro/room/IRoomEngine.ts b/src/nitro/room/IRoomEngine.ts index 6cba4698..af24f853 100644 --- a/src/nitro/room/IRoomEngine.ts +++ b/src/nitro/room/IRoomEngine.ts @@ -86,7 +86,7 @@ export interface IRoomEngine extends INitroManager processRoomObjectOperation(objectId: number, category: number, operation: string): boolean; processRoomObjectPlacement(placementSource: string, id: number, category: number, typeId: number, legacyString?: string, stuffData?: IObjectData, state?: number, frameNumber?: number, posture?: string): boolean; dispatchMouseEvent(canvasId: number, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): void; - createRoomScreenshot(roomId: number, canvasId: number): void; + createRoomScreenshot(roomId: number, canvasId?: number, bounds?: Rectangle): void; modifyRoomObjectData(objectId: number, objectCategory: number, colorHex: string, text: string): boolean; deleteRoomObject(objectId: number, objectCategory: number): boolean; sessionDataManager: ISessionDataManager; diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 2911c764..ce8f1807 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -6,6 +6,7 @@ import { NitroManager } from '../../core/common/NitroManager'; import { IConnection } from '../../core/communication/connections/IConnection'; import { IMessageComposer } from '../../core/communication/messages/IMessageComposer'; import { NitroEvent } from '../../core/events/NitroEvent'; +import { TextureUtils } from '../../room'; import { RoomObjectEvent } from '../../room/events/RoomObjectEvent'; import { RoomObjectMouseEvent } from '../../room/events/RoomObjectMouseEvent'; import { IRoomInstance } from '../../room/IRoomInstance'; @@ -3437,17 +3438,32 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return null; } - public createRoomScreenshot(roomId: number, canvasId: number): void + public createRoomScreenshot(roomId: number, canvasId: number = -1, bounds: Rectangle = null): void { - const canvas = this.getRoomInstanceRenderingCanvas(roomId, canvasId); + let canvas: IRoomRenderingCanvas = null; - if(!canvas) return; + if(canvasId > -1) + { + canvas = this.getRoomInstanceRenderingCanvas(this._activeRoomId, canvasId); + } + else + { + canvas = this.getActiveRoomInstanceRenderingCanvas(); + } - const texture = canvas.getDisplayAsTexture(); + let texture: RenderTexture = null; - const base64 = Nitro.instance.renderer.extract.base64(texture); + if(bounds) + { + texture = TextureUtils.generateTexture(canvas.master, bounds); + } + else + { + texture = canvas.getDisplayAsTexture(); + } - const image = new Image(); + const base64 = TextureUtils.generateImageUrl(texture); + const image = new Image(); image.src = base64; diff --git a/src/room/utils/NitroRectangle.ts b/src/room/utils/NitroRectangle.ts new file mode 100644 index 00000000..9ced33b0 --- /dev/null +++ b/src/room/utils/NitroRectangle.ts @@ -0,0 +1,4 @@ +import { Rectangle } from 'pixi.js'; + +export class NitroRectangle extends Rectangle +{} diff --git a/src/room/utils/index.ts b/src/room/utils/index.ts index 6462d4d3..c4341a71 100644 --- a/src/room/utils/index.ts +++ b/src/room/utils/index.ts @@ -3,6 +3,7 @@ export * from './INitroPoint'; export * from './IRoomGeometry'; export * from './IVector3D'; export * from './NitroPoint'; +export * from './NitroRectangle'; export * from './NumberBank'; export * from './PointMath'; export * from './Rasterizer'; From 5389d4c1b0e5ed406e8d52226920a0ac831a5b28 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Tue, 15 Jun 2021 14:39:23 -0300 Subject: [PATCH 082/155] Camera updates --- src/nitro/room/IRoomEngine.ts | 4 +- src/nitro/room/RoomEngine.ts | 18 ++- .../RoomCameraWidgetEditorEffect.ts | 28 +++++ .../RoomCameraWidgetEditorSelectedEffect.ts | 22 ++++ .../camera-widget/RoomCameraWidgetManager.ts | 108 ++++++++++++++++++ .../events/RoomCameraWidgetManagerEvent.ts | 11 ++ src/nitro/room/events/index.ts | 1 + .../FurnitureThumbnailVisualization.ts | 2 +- 8 files changed, 189 insertions(+), 5 deletions(-) create mode 100644 src/nitro/room/camera-widget/RoomCameraWidgetEditorEffect.ts create mode 100644 src/nitro/room/camera-widget/RoomCameraWidgetEditorSelectedEffect.ts create mode 100644 src/nitro/room/camera-widget/RoomCameraWidgetManager.ts create mode 100644 src/nitro/room/events/RoomCameraWidgetManagerEvent.ts diff --git a/src/nitro/room/IRoomEngine.ts b/src/nitro/room/IRoomEngine.ts index af24f853..6352ea18 100644 --- a/src/nitro/room/IRoomEngine.ts +++ b/src/nitro/room/IRoomEngine.ts @@ -11,6 +11,7 @@ import { IVector3D } from '../../room/utils/IVector3D'; import { PetCustomPart } from '../avatar/pets/PetCustomPart'; import { IRoomSessionManager } from '../session/IRoomSessionManager'; import { ISessionDataManager } from '../session/ISessionDataManager'; +import { RoomCameraWidgetManager } from './camera-widget/RoomCameraWidgetManager'; import { IGetImageListener } from './IGetImageListener'; import { ImageResult } from './ImageResult'; import { IObjectData } from './object/data/IObjectData'; @@ -86,7 +87,7 @@ export interface IRoomEngine extends INitroManager processRoomObjectOperation(objectId: number, category: number, operation: string): boolean; processRoomObjectPlacement(placementSource: string, id: number, category: number, typeId: number, legacyString?: string, stuffData?: IObjectData, state?: number, frameNumber?: number, posture?: string): boolean; dispatchMouseEvent(canvasId: number, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): void; - createRoomScreenshot(roomId: number, canvasId?: number, bounds?: Rectangle): void; + createRoomScreenshot(roomId: number, canvasId?: number, bounds?: Rectangle): HTMLImageElement; modifyRoomObjectData(objectId: number, objectCategory: number, colorHex: string, text: string): boolean; deleteRoomObject(objectId: number, objectCategory: number): boolean; sessionDataManager: ISessionDataManager; @@ -102,4 +103,5 @@ export interface IRoomEngine extends INitroManager disposed: boolean; selectedAvatarId: number; isDecorating: boolean; + roomCameraWidgetManager: RoomCameraWidgetManager; } diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index ce8f1807..f3620571 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -41,6 +41,7 @@ import { IRoomSessionManager } from '../session/IRoomSessionManager'; import { ISessionDataManager } from '../session/ISessionDataManager'; import { MouseEventType } from '../ui/MouseEventType'; import { FurniId } from '../utils/FurniId'; +import { RoomCameraWidgetManager } from './camera-widget/RoomCameraWidgetManager'; import { RoomBackgroundColorEvent } from './events/RoomBackgroundColorEvent'; import { RoomEngineEvent } from './events/RoomEngineEvent'; import { RoomEngineObjectEvent } from './events/RoomEngineObjectEvent'; @@ -162,6 +163,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato private _mouseCursorUpdate: boolean; private _badgeListenerObjects: Map; private _logicFactory: IRoomObjectLogicFactory; + private _roomCameraWidgetManager: RoomCameraWidgetManager; constructor(communication: INitroCommunicationManager) { @@ -202,6 +204,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._roomDraggingAlwaysCenters = false; this._roomAllowsDragging = true; this._badgeListenerObjects = new Map(); + this._roomCameraWidgetManager = new RoomCameraWidgetManager(this.events); this.runVisibilityUpdate = this.runVisibilityUpdate.bind(this); this.processRoomObjectEvent = this.processRoomObjectEvent.bind(this); @@ -241,6 +244,8 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._roomSessionManager.events.addEventListener(RoomSessionEvent.ENDED, this.onRoomSessionEvent); } + this._roomCameraWidgetManager.initialize(); + this.events.addEventListener(RoomContentLoader.LOADER_READY, this.onRoomContentLoaderReadyEvent); Nitro.instance.ticker.add(this.update, this); @@ -3438,7 +3443,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return null; } - public createRoomScreenshot(roomId: number, canvasId: number = -1, bounds: Rectangle = null): void + public createRoomScreenshot(roomId: number, canvasId: number = -1, bounds: Rectangle = null): HTMLImageElement { let canvas: IRoomRenderingCanvas = null; @@ -3467,8 +3472,10 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato image.src = base64; - const newWindow = window.open(''); - newWindow.document.write(image.outerHTML); + /*const newWindow = window.open(''); + newWindow.document.write(image.outerHTML);*/ + + return image; } public objectsInitialized(k: string): void @@ -3658,4 +3665,9 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return this._roomManager.getRoomInstance(roomId.toString()).getRoomObjectsForCategory(categoryId).length; } + + public get roomCameraWidgetManager(): RoomCameraWidgetManager + { + return this._roomCameraWidgetManager; + } } diff --git a/src/nitro/room/camera-widget/RoomCameraWidgetEditorEffect.ts b/src/nitro/room/camera-widget/RoomCameraWidgetEditorEffect.ts new file mode 100644 index 00000000..804760c3 --- /dev/null +++ b/src/nitro/room/camera-widget/RoomCameraWidgetEditorEffect.ts @@ -0,0 +1,28 @@ +export class RoomCameraWidgetEditorEffect +{ + private _name: string; + private _colorMatrix: number[]; + private _minLevel: number; + + constructor(name: string, minLevel: number, colorMatrix?: number[]) + { + this._name = name; + this._minLevel = minLevel; + this._colorMatrix = colorMatrix ?? []; + } + + public get name(): string + { + return this._name; + } + + public get colorMatrix(): number[] + { + return this._colorMatrix; + } + + public get minLevel(): number + { + return this._minLevel; + } +} diff --git a/src/nitro/room/camera-widget/RoomCameraWidgetEditorSelectedEffect.ts b/src/nitro/room/camera-widget/RoomCameraWidgetEditorSelectedEffect.ts new file mode 100644 index 00000000..bfce8d1e --- /dev/null +++ b/src/nitro/room/camera-widget/RoomCameraWidgetEditorSelectedEffect.ts @@ -0,0 +1,22 @@ +import { RoomCameraWidgetEditorEffect } from './RoomCameraWidgetEditorEffect'; +export class RoomCameraWidgetEditorSelectedEffect +{ + private _effect: RoomCameraWidgetEditorEffect; + private _alpha: number; + + constructor(effect: RoomCameraWidgetEditorEffect, alpha: number) + { + this._effect = effect; + this._alpha = alpha; + } + + public get effect(): RoomCameraWidgetEditorEffect + { + return this._effect; + } + + public get alpha(): number + { + return this._alpha; + } +} diff --git a/src/nitro/room/camera-widget/RoomCameraWidgetManager.ts b/src/nitro/room/camera-widget/RoomCameraWidgetManager.ts new file mode 100644 index 00000000..8ed36e0c --- /dev/null +++ b/src/nitro/room/camera-widget/RoomCameraWidgetManager.ts @@ -0,0 +1,108 @@ +import { Container, Sprite, Texture } from 'pixi.js'; +import { Nitro } from '../../Nitro'; +import { IEventDispatcher } from './../../../core/events/IEventDispatcher'; +import { IGraphicAsset } from './../../../room/object/visualization/utils/IGraphicAsset'; +import { TextureUtils } from './../../../room/utils/TextureUtils'; +import { RoomCameraWidgetManagerEvent } from './../events/RoomCameraWidgetManagerEvent'; +import { RoomCameraWidgetEditorEffect } from './RoomCameraWidgetEditorEffect'; +import { RoomCameraWidgetEditorSelectedEffect } from './RoomCameraWidgetEditorSelectedEffect'; + +export class RoomCameraWidgetManager +{ + private _loaded: boolean; + private _loadedEffects: Map; + private _events: IEventDispatcher; + + constructor(events: IEventDispatcher) + { + this._loaded = false; + this._loadedEffects = new Map(); + this._events = events; + } + + public initialize(): void + { + const urls: string[] = []; + + const imagesUrl = Nitro.instance.getConfiguration('image.library.url') + 'Habbo-Stories/'; + const effects = Nitro.instance.getConfiguration<{ name: string, colorMatrix?: number[], minLevel: number, enabled: boolean }[]>('camera.available.effects'); + + for(const effect of effects) + { + if(effect.enabled) + { + if(!effect.colorMatrix) urls.push(imagesUrl + effect.name + '.png'); + + this._loadedEffects.set(effect.name, new RoomCameraWidgetEditorEffect(effect.name, effect.minLevel, effect.colorMatrix)); + } + } + + Nitro.instance.core.asset.downloadAssets(urls, (status: boolean) => + { + console.log('LOADED', status) + this._loaded = true; + this._events.dispatchEvent(new RoomCameraWidgetManagerEvent(RoomCameraWidgetManagerEvent.INITIALIZED)); + }); + } + + public editImage(image: HTMLImageElement, selectedEffects: RoomCameraWidgetEditorSelectedEffect[]): HTMLImageElement + { + const container = new Container(); + const texture = Texture.from(image); + const sprite = new Sprite(texture); + + container.addChild(sprite); + + for(const selectedEffect of selectedEffects) + { + if(selectedEffect.effect.colorMatrix.length > 0) + { + const filter = new PIXI.filters.ColorMatrixFilter(); + + if(!sprite.filters) sprite.filters = []; + + sprite.filters.push(filter); + + filter.matrix = selectedEffect.effect.colorMatrix; + filter.alpha = selectedEffect.alpha; + } + else + { + const effectAsset = this.getEffectAsset(selectedEffect.effect.name); + + if(!effectAsset) continue; + + const effectSprite = new Sprite(effectAsset.texture); + effectSprite.alpha = selectedEffect.alpha; + container.addChild(effectSprite); + } + } + + return TextureUtils.generateImage(container); + } + + public getEffectAsset(name: string): IGraphicAsset | null + { + const effect = this._loadedEffects.get(name); + + if(!effect) return null; + + if(effect.colorMatrix.length > 0) return null; + + const imagesUrl = Nitro.instance.getConfiguration('image.library.url') + 'Habbo-Stories/'; + + console.log('asset', imagesUrl + effect.name + '.png', Nitro.instance.core.asset.getAsset(imagesUrl + effect.name + '.png')); + + return Nitro.instance.core.asset.getAsset(effect.name + '.png'); + } + + public get loadedEffects(): Map + { + return this._loadedEffects; + } + + public get isLoaded(): boolean + { + return this._loaded; + } +} diff --git a/src/nitro/room/events/RoomCameraWidgetManagerEvent.ts b/src/nitro/room/events/RoomCameraWidgetManagerEvent.ts new file mode 100644 index 00000000..578f8ce4 --- /dev/null +++ b/src/nitro/room/events/RoomCameraWidgetManagerEvent.ts @@ -0,0 +1,11 @@ +import { NitroEvent } from '../../../core/events/NitroEvent'; + +export class RoomCameraWidgetManagerEvent extends NitroEvent +{ + public static INITIALIZED: string = 'RCWM_INITIALIZED'; + + constructor(type: string) + { + super(type); + } +} diff --git a/src/nitro/room/events/index.ts b/src/nitro/room/events/index.ts index 18ba5258..a61d77d2 100644 --- a/src/nitro/room/events/index.ts +++ b/src/nitro/room/events/index.ts @@ -1,4 +1,5 @@ export * from './RoomBackgroundColorEvent'; +export * from './RoomCameraWidgetManagerEvent'; export * from './RoomEngineDimmerStateEvent'; export * from './RoomEngineEvent'; export * from './RoomEngineObjectEvent'; diff --git a/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts index 407113f2..0971f7c2 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts @@ -147,4 +147,4 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat { return [this._type, k, 'thumb', _arg_2].join('_'); } -} \ No newline at end of file +} From 7c1e81f1d167d0d4ebbee6527bb9a8e815ca853f Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 15 Jun 2021 13:41:22 -0400 Subject: [PATCH 083/155] Update FPS --- src/room/renderer/RoomSpriteCanvas.ts | 82 ++++++++++++++------------- 1 file changed, 43 insertions(+), 39 deletions(-) diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 6b45a696..79a1987a 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -354,49 +354,53 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas const frame = Math.round(this._totalTimeRunning / (60 / this._animationFPS)); + let updateVisuals = false; + if(frame !== this._lastFrame) { this._lastFrame = frame; - let spriteCount = 0; - - const objects = this._container.objects; - - if(objects.size) - { - for(const object of objects.values()) - { - if(!object) continue; - - spriteCount = (spriteCount + this.renderObject(object, object.instanceId.toString(), time, update, spriteCount)); - } - } - - this._sortableSprites.sort((a, b) => - { - return b.z - a.z; - }); - - if(spriteCount < this._sortableSprites.length) - { - this._sortableSprites.splice(spriteCount); - } - - let iterator = 0; - - while(iterator < spriteCount) - { - const sprite = this._sortableSprites[iterator]; - - if(sprite && sprite.sprite) this.renderSprite(iterator, sprite); - - iterator++; - } - - this.cleanSprites(spriteCount); + updateVisuals = true; } - if(update) this._canvasUpdated = true; + let spriteCount = 0; + + const objects = this._container.objects; + + if(objects.size) + { + for(const object of objects.values()) + { + if(!object) continue; + + spriteCount = (spriteCount + this.renderObject(object, object.instanceId.toString(), time, update, updateVisuals, spriteCount)); + } + } + + this._sortableSprites.sort((a, b) => + { + return b.z - a.z; + }); + + if(spriteCount < this._sortableSprites.length) + { + this._sortableSprites.splice(spriteCount); + } + + let iterator = 0; + + while(iterator < spriteCount) + { + const sprite = this._sortableSprites[iterator]; + + if(sprite && sprite.sprite) this.renderSprite(iterator, sprite); + + iterator++; + } + + this.cleanSprites(spriteCount); + + if(update || updateVisuals) this._canvasUpdated = true; this._renderTimestamp = this._totalTimeRunning; this._renderedWidth = this._width; @@ -430,7 +434,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas this._objectCache.removeObjectCache(identifier); } - private renderObject(object: IRoomObject, identifier: string, time: number, update: boolean, count: number): number + private renderObject(object: IRoomObject, identifier: string, time: number, update: boolean, updateVisuals: boolean, count: number): number { if(!object) return 0; @@ -458,7 +462,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas return 0; } - visualization.update(this._geometry, time, (!sortableCache.isEmpty || update), (this._skipObjectUpdate && this._runningSlow)); + if(updateVisuals) visualization.update(this._geometry, time, (!sortableCache.isEmpty || update), (this._skipObjectUpdate && this._runningSlow)); if(locationCache.locationChanged) update = true; From f98a70a87190ad0fdb0ef0beb0ec232095e1a4f0 Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 15 Jun 2021 16:52:08 -0400 Subject: [PATCH 084/155] Update camera --- src/nitro/INitro.ts | 2 + src/nitro/Nitro.ts | 9 ++ src/nitro/camera/IRoomCameraWidgetEffect.ts | 9 ++ src/nitro/camera/IRoomCameraWidgetManager.ts | 12 ++ .../camera/IRoomCameraWidgetSelectedEffect.ts | 7 ++ src/nitro/camera/RoomCameraWidgetEffect.ts | 48 ++++++++ src/nitro/camera/RoomCameraWidgetManager.ts | 103 +++++++++++++++++ .../camera/RoomCameraWidgetSelectedEffect.ts | 23 ++++ .../events/RoomCameraWidgetManagerEvent.ts | 2 +- src/nitro/room/IRoomEngine.ts | 2 - src/nitro/room/RoomEngine.ts | 10 -- .../RoomCameraWidgetEditorEffect.ts | 28 ----- .../RoomCameraWidgetEditorSelectedEffect.ts | 22 ---- .../camera-widget/RoomCameraWidgetManager.ts | 108 ------------------ src/nitro/room/events/index.ts | 1 - 15 files changed, 214 insertions(+), 172 deletions(-) create mode 100644 src/nitro/camera/IRoomCameraWidgetEffect.ts create mode 100644 src/nitro/camera/IRoomCameraWidgetManager.ts create mode 100644 src/nitro/camera/IRoomCameraWidgetSelectedEffect.ts create mode 100644 src/nitro/camera/RoomCameraWidgetEffect.ts create mode 100644 src/nitro/camera/RoomCameraWidgetManager.ts create mode 100644 src/nitro/camera/RoomCameraWidgetSelectedEffect.ts rename src/nitro/{room => camera}/events/RoomCameraWidgetManagerEvent.ts (73%) delete mode 100644 src/nitro/room/camera-widget/RoomCameraWidgetEditorEffect.ts delete mode 100644 src/nitro/room/camera-widget/RoomCameraWidgetEditorSelectedEffect.ts delete mode 100644 src/nitro/room/camera-widget/RoomCameraWidgetManager.ts diff --git a/src/nitro/INitro.ts b/src/nitro/INitro.ts index 6f61b6fe..b085637f 100644 --- a/src/nitro/INitro.ts +++ b/src/nitro/INitro.ts @@ -6,6 +6,7 @@ import { INitroCore } from '../core/INitroCore'; import { NitroTimer } from '../core/utils/NitroTimer'; import { IRoomManager } from '../room/IRoomManager'; import { IAvatarRenderManager } from './avatar/IAvatarRenderManager'; +import { IRoomCameraWidgetManager } from './camera/IRoomCameraWidgetManager'; import { INitroCommunicationManager } from './communication/INitroCommunicationManager'; import { INitroLocalizationManager } from './localization/INitroLocalizationManager'; import { IRoomEngine } from './room/IRoomEngine'; @@ -38,6 +39,7 @@ export interface INitro extends Application sessionDataManager: ISessionDataManager; roomSessionManager: IRoomSessionManager; roomManager: IRoomManager; + cameraManager: IRoomCameraWidgetManager; width: number; height: number; time: number; diff --git a/src/nitro/Nitro.ts b/src/nitro/Nitro.ts index a286a053..651b0c3f 100644 --- a/src/nitro/Nitro.ts +++ b/src/nitro/Nitro.ts @@ -12,6 +12,8 @@ import { IRoomManager } from '../room/IRoomManager'; import { RoomManager } from '../room/RoomManager'; import { AvatarRenderManager } from './avatar/AvatarRenderManager'; import { IAvatarRenderManager } from './avatar/IAvatarRenderManager'; +import { IRoomCameraWidgetManager } from './camera/IRoomCameraWidgetManager'; +import { RoomCameraWidgetManager } from './camera/RoomCameraWidgetManager'; import { INitroCommunicationManager } from './communication/INitroCommunicationManager'; import { NitroCommunicationManager } from './communication/NitroCommunicationManager'; import { LegacyExternalInterface } from './externalInterface/LegacyExternalInterface'; @@ -53,6 +55,7 @@ export class Nitro extends Application implements INitro private _sessionDataManager: ISessionDataManager; private _roomSessionManager: IRoomSessionManager; private _roomManager: IRoomManager; + private _cameraManager: IRoomCameraWidgetManager; private _linkTrackers: ILinkEventTracker[]; private _workerTrackers: IWorkerEventTracker[]; @@ -93,6 +96,7 @@ export class Nitro extends Application implements INitro this._sessionDataManager = new SessionDataManager(this._communication); this._roomSessionManager = new RoomSessionManager(this._communication, this._roomEngine); this._roomManager = new RoomManager(this._roomEngine, this._roomEngine.visualizationFactory, this._roomEngine.logicFactory); + this._cameraManager = new RoomCameraWidgetManager(); this._linkTrackers = []; this._workerTrackers = []; @@ -391,6 +395,11 @@ export class Nitro extends Application implements INitro return this._roomManager; } + public get cameraManager(): IRoomCameraWidgetManager + { + return this._cameraManager; + } + public get width(): number { return (this.renderer.width / this.renderer.resolution); diff --git a/src/nitro/camera/IRoomCameraWidgetEffect.ts b/src/nitro/camera/IRoomCameraWidgetEffect.ts new file mode 100644 index 00000000..954947b1 --- /dev/null +++ b/src/nitro/camera/IRoomCameraWidgetEffect.ts @@ -0,0 +1,9 @@ +import { Texture } from 'pixi.js'; + +export interface IRoomCameraWidgetEffect +{ + name: string; + minLevel: number; + texture: Texture; + colorMatrix: number[]; +} diff --git a/src/nitro/camera/IRoomCameraWidgetManager.ts b/src/nitro/camera/IRoomCameraWidgetManager.ts new file mode 100644 index 00000000..029f1ee7 --- /dev/null +++ b/src/nitro/camera/IRoomCameraWidgetManager.ts @@ -0,0 +1,12 @@ +import { IEventDispatcher } from '../../core'; +import { IRoomCameraWidgetEffect } from './IRoomCameraWidgetEffect'; +import { IRoomCameraWidgetSelectedEffect } from './IRoomCameraWidgetSelectedEffect'; + +export interface IRoomCameraWidgetManager +{ + init(): void; + applyEffects(image: HTMLImageElement, selectedEffects: IRoomCameraWidgetSelectedEffect[]): HTMLImageElement; + events: IEventDispatcher; + effects: Map; + isLoaded: boolean; +} diff --git a/src/nitro/camera/IRoomCameraWidgetSelectedEffect.ts b/src/nitro/camera/IRoomCameraWidgetSelectedEffect.ts new file mode 100644 index 00000000..3bb3b2c7 --- /dev/null +++ b/src/nitro/camera/IRoomCameraWidgetSelectedEffect.ts @@ -0,0 +1,7 @@ +import { IRoomCameraWidgetEffect } from './IRoomCameraWidgetEffect'; + +export interface IRoomCameraWidgetSelectedEffect +{ + effect: IRoomCameraWidgetEffect; + alpha: number; +} diff --git a/src/nitro/camera/RoomCameraWidgetEffect.ts b/src/nitro/camera/RoomCameraWidgetEffect.ts new file mode 100644 index 00000000..8cd285ea --- /dev/null +++ b/src/nitro/camera/RoomCameraWidgetEffect.ts @@ -0,0 +1,48 @@ +import { 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 _colorMatrix: number[] = null; + + constructor(name: string, minLevel: number = -1, texture: Texture = null, colorMatrix: number[] = null) + { + this._name = name; + this._minLevel = minLevel; + this._texture = texture; + this._colorMatrix = colorMatrix; + } + + public get name(): string + { + return this._name; + } + + public get texture(): Texture + { + return this._texture; + } + + public set texture(texture: Texture) + { + this._texture = texture; + } + + public get colorMatrix(): number[] + { + return this._colorMatrix; + } + + public set colorMatrix(colorMatrix: number[]) + { + this._colorMatrix = colorMatrix; + } + + public get minLevel(): number + { + return this._minLevel; + } +} diff --git a/src/nitro/camera/RoomCameraWidgetManager.ts b/src/nitro/camera/RoomCameraWidgetManager.ts new file mode 100644 index 00000000..4fb0f505 --- /dev/null +++ b/src/nitro/camera/RoomCameraWidgetManager.ts @@ -0,0 +1,103 @@ +import { Container, filters, Sprite, Texture } from 'pixi.js'; +import { EventDispatcher, IEventDispatcher } from '../../core'; +import { TextureUtils } from '../../room'; +import { Nitro } from '../Nitro'; +import { RoomCameraWidgetManagerEvent } from './events/RoomCameraWidgetManagerEvent'; +import { IRoomCameraWidgetEffect } from './IRoomCameraWidgetEffect'; +import { IRoomCameraWidgetManager } from './IRoomCameraWidgetManager'; +import { IRoomCameraWidgetSelectedEffect } from './IRoomCameraWidgetSelectedEffect'; +import { RoomCameraWidgetEffect } from './RoomCameraWidgetEffect'; + +export class RoomCameraWidgetManager implements IRoomCameraWidgetManager +{ + private _effects: Map; + private _events: IEventDispatcher; + private _isLoaded: boolean; + + constructor() + { + this._effects = new Map(); + this._events = new EventDispatcher(); + this._isLoaded = false; + } + + public init(): void + { + if(this._isLoaded) return; + + this._isLoaded = true; + + const imagesUrl = Nitro.instance.getConfiguration('image.library.url') + 'Habbo-Stories/'; + const effects = Nitro.instance.getConfiguration<{ name: string, colorMatrix?: number[], minLevel: number, enabled: boolean }[]>('camera.available.effects'); + + for(const effect of effects) + { + if(!effect.enabled) continue; + + const cameraEffect = new RoomCameraWidgetEffect(effect.name, effect.minLevel); + + if(effect.colorMatrix.length) + { + cameraEffect.colorMatrix = effect.colorMatrix; + } + else + { + cameraEffect.texture = Texture.from(imagesUrl + effect.name + '.png'); + } + + this._effects.set(cameraEffect.name, cameraEffect); + } + + this.events.dispatchEvent(new RoomCameraWidgetManagerEvent(RoomCameraWidgetManagerEvent.INITIALIZED)); + } + + public applyEffects(image: HTMLImageElement, selectedEffects: IRoomCameraWidgetSelectedEffect[]): HTMLImageElement + { + const container = new Container(); + const texture = Texture.from(image); + const sprite = new Sprite(texture); + + container.addChild(sprite); + + for(const selectedEffect of selectedEffects) + { + const effect = selectedEffect.effect; + + if(!effect) continue; + + if(effect.colorMatrix) + { + const filter = new filters.ColorMatrixFilter(); + + filter.matrix = effect.colorMatrix; + filter.alpha = selectedEffect.alpha; + + if(!sprite.filters) sprite.filters = [ filter ]; + } + else + { + const effectSprite = new Sprite(effect.texture); + effectSprite.alpha = selectedEffect.alpha; + + container.addChild(effectSprite); + } + } + + return TextureUtils.generateImage(container); + } + + public get effects(): Map + { + return this._effects; + } + + public get events(): IEventDispatcher + { + return this._events; + } + + public get isLoaded(): boolean + { + return this._isLoaded; + } +} diff --git a/src/nitro/camera/RoomCameraWidgetSelectedEffect.ts b/src/nitro/camera/RoomCameraWidgetSelectedEffect.ts new file mode 100644 index 00000000..9cbf2217 --- /dev/null +++ b/src/nitro/camera/RoomCameraWidgetSelectedEffect.ts @@ -0,0 +1,23 @@ +import { IRoomCameraWidgetEffect } from './IRoomCameraWidgetEffect'; + +export class RoomCameraWidgetSelectedEffect +{ + private _effect: IRoomCameraWidgetEffect; + private _alpha: number; + + constructor(effect: IRoomCameraWidgetEffect, alpha: number) + { + this._effect = effect; + this._alpha = alpha; + } + + public get effect(): IRoomCameraWidgetEffect + { + return this._effect; + } + + public get alpha(): number + { + return this._alpha; + } +} diff --git a/src/nitro/room/events/RoomCameraWidgetManagerEvent.ts b/src/nitro/camera/events/RoomCameraWidgetManagerEvent.ts similarity index 73% rename from src/nitro/room/events/RoomCameraWidgetManagerEvent.ts rename to src/nitro/camera/events/RoomCameraWidgetManagerEvent.ts index 578f8ce4..fb5abd8b 100644 --- a/src/nitro/room/events/RoomCameraWidgetManagerEvent.ts +++ b/src/nitro/camera/events/RoomCameraWidgetManagerEvent.ts @@ -2,7 +2,7 @@ import { NitroEvent } from '../../../core/events/NitroEvent'; export class RoomCameraWidgetManagerEvent extends NitroEvent { - public static INITIALIZED: string = 'RCWM_INITIALIZED'; + public static INITIALIZED: string = 'RCWM_INITIALIZED'; constructor(type: string) { diff --git a/src/nitro/room/IRoomEngine.ts b/src/nitro/room/IRoomEngine.ts index 6352ea18..9d11d2fa 100644 --- a/src/nitro/room/IRoomEngine.ts +++ b/src/nitro/room/IRoomEngine.ts @@ -11,7 +11,6 @@ import { IVector3D } from '../../room/utils/IVector3D'; import { PetCustomPart } from '../avatar/pets/PetCustomPart'; import { IRoomSessionManager } from '../session/IRoomSessionManager'; import { ISessionDataManager } from '../session/ISessionDataManager'; -import { RoomCameraWidgetManager } from './camera-widget/RoomCameraWidgetManager'; import { IGetImageListener } from './IGetImageListener'; import { ImageResult } from './ImageResult'; import { IObjectData } from './object/data/IObjectData'; @@ -103,5 +102,4 @@ export interface IRoomEngine extends INitroManager disposed: boolean; selectedAvatarId: number; isDecorating: boolean; - roomCameraWidgetManager: RoomCameraWidgetManager; } diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index f3620571..b06af370 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -41,7 +41,6 @@ import { IRoomSessionManager } from '../session/IRoomSessionManager'; import { ISessionDataManager } from '../session/ISessionDataManager'; import { MouseEventType } from '../ui/MouseEventType'; import { FurniId } from '../utils/FurniId'; -import { RoomCameraWidgetManager } from './camera-widget/RoomCameraWidgetManager'; import { RoomBackgroundColorEvent } from './events/RoomBackgroundColorEvent'; import { RoomEngineEvent } from './events/RoomEngineEvent'; import { RoomEngineObjectEvent } from './events/RoomEngineObjectEvent'; @@ -163,7 +162,6 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato private _mouseCursorUpdate: boolean; private _badgeListenerObjects: Map; private _logicFactory: IRoomObjectLogicFactory; - private _roomCameraWidgetManager: RoomCameraWidgetManager; constructor(communication: INitroCommunicationManager) { @@ -204,7 +202,6 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._roomDraggingAlwaysCenters = false; this._roomAllowsDragging = true; this._badgeListenerObjects = new Map(); - this._roomCameraWidgetManager = new RoomCameraWidgetManager(this.events); this.runVisibilityUpdate = this.runVisibilityUpdate.bind(this); this.processRoomObjectEvent = this.processRoomObjectEvent.bind(this); @@ -244,8 +241,6 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._roomSessionManager.events.addEventListener(RoomSessionEvent.ENDED, this.onRoomSessionEvent); } - this._roomCameraWidgetManager.initialize(); - this.events.addEventListener(RoomContentLoader.LOADER_READY, this.onRoomContentLoaderReadyEvent); Nitro.instance.ticker.add(this.update, this); @@ -3665,9 +3660,4 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return this._roomManager.getRoomInstance(roomId.toString()).getRoomObjectsForCategory(categoryId).length; } - - public get roomCameraWidgetManager(): RoomCameraWidgetManager - { - return this._roomCameraWidgetManager; - } } diff --git a/src/nitro/room/camera-widget/RoomCameraWidgetEditorEffect.ts b/src/nitro/room/camera-widget/RoomCameraWidgetEditorEffect.ts deleted file mode 100644 index 804760c3..00000000 --- a/src/nitro/room/camera-widget/RoomCameraWidgetEditorEffect.ts +++ /dev/null @@ -1,28 +0,0 @@ -export class RoomCameraWidgetEditorEffect -{ - private _name: string; - private _colorMatrix: number[]; - private _minLevel: number; - - constructor(name: string, minLevel: number, colorMatrix?: number[]) - { - this._name = name; - this._minLevel = minLevel; - this._colorMatrix = colorMatrix ?? []; - } - - public get name(): string - { - return this._name; - } - - public get colorMatrix(): number[] - { - return this._colorMatrix; - } - - public get minLevel(): number - { - return this._minLevel; - } -} diff --git a/src/nitro/room/camera-widget/RoomCameraWidgetEditorSelectedEffect.ts b/src/nitro/room/camera-widget/RoomCameraWidgetEditorSelectedEffect.ts deleted file mode 100644 index bfce8d1e..00000000 --- a/src/nitro/room/camera-widget/RoomCameraWidgetEditorSelectedEffect.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { RoomCameraWidgetEditorEffect } from './RoomCameraWidgetEditorEffect'; -export class RoomCameraWidgetEditorSelectedEffect -{ - private _effect: RoomCameraWidgetEditorEffect; - private _alpha: number; - - constructor(effect: RoomCameraWidgetEditorEffect, alpha: number) - { - this._effect = effect; - this._alpha = alpha; - } - - public get effect(): RoomCameraWidgetEditorEffect - { - return this._effect; - } - - public get alpha(): number - { - return this._alpha; - } -} diff --git a/src/nitro/room/camera-widget/RoomCameraWidgetManager.ts b/src/nitro/room/camera-widget/RoomCameraWidgetManager.ts deleted file mode 100644 index 8ed36e0c..00000000 --- a/src/nitro/room/camera-widget/RoomCameraWidgetManager.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { Container, Sprite, Texture } from 'pixi.js'; -import { Nitro } from '../../Nitro'; -import { IEventDispatcher } from './../../../core/events/IEventDispatcher'; -import { IGraphicAsset } from './../../../room/object/visualization/utils/IGraphicAsset'; -import { TextureUtils } from './../../../room/utils/TextureUtils'; -import { RoomCameraWidgetManagerEvent } from './../events/RoomCameraWidgetManagerEvent'; -import { RoomCameraWidgetEditorEffect } from './RoomCameraWidgetEditorEffect'; -import { RoomCameraWidgetEditorSelectedEffect } from './RoomCameraWidgetEditorSelectedEffect'; - -export class RoomCameraWidgetManager -{ - private _loaded: boolean; - private _loadedEffects: Map; - private _events: IEventDispatcher; - - constructor(events: IEventDispatcher) - { - this._loaded = false; - this._loadedEffects = new Map(); - this._events = events; - } - - public initialize(): void - { - const urls: string[] = []; - - const imagesUrl = Nitro.instance.getConfiguration('image.library.url') + 'Habbo-Stories/'; - const effects = Nitro.instance.getConfiguration<{ name: string, colorMatrix?: number[], minLevel: number, enabled: boolean }[]>('camera.available.effects'); - - for(const effect of effects) - { - if(effect.enabled) - { - if(!effect.colorMatrix) urls.push(imagesUrl + effect.name + '.png'); - - this._loadedEffects.set(effect.name, new RoomCameraWidgetEditorEffect(effect.name, effect.minLevel, effect.colorMatrix)); - } - } - - Nitro.instance.core.asset.downloadAssets(urls, (status: boolean) => - { - console.log('LOADED', status) - this._loaded = true; - this._events.dispatchEvent(new RoomCameraWidgetManagerEvent(RoomCameraWidgetManagerEvent.INITIALIZED)); - }); - } - - public editImage(image: HTMLImageElement, selectedEffects: RoomCameraWidgetEditorSelectedEffect[]): HTMLImageElement - { - const container = new Container(); - const texture = Texture.from(image); - const sprite = new Sprite(texture); - - container.addChild(sprite); - - for(const selectedEffect of selectedEffects) - { - if(selectedEffect.effect.colorMatrix.length > 0) - { - const filter = new PIXI.filters.ColorMatrixFilter(); - - if(!sprite.filters) sprite.filters = []; - - sprite.filters.push(filter); - - filter.matrix = selectedEffect.effect.colorMatrix; - filter.alpha = selectedEffect.alpha; - } - else - { - const effectAsset = this.getEffectAsset(selectedEffect.effect.name); - - if(!effectAsset) continue; - - const effectSprite = new Sprite(effectAsset.texture); - effectSprite.alpha = selectedEffect.alpha; - container.addChild(effectSprite); - } - } - - return TextureUtils.generateImage(container); - } - - public getEffectAsset(name: string): IGraphicAsset | null - { - const effect = this._loadedEffects.get(name); - - if(!effect) return null; - - if(effect.colorMatrix.length > 0) return null; - - const imagesUrl = Nitro.instance.getConfiguration('image.library.url') + 'Habbo-Stories/'; - - console.log('asset', imagesUrl + effect.name + '.png', Nitro.instance.core.asset.getAsset(imagesUrl + effect.name + '.png')); - - return Nitro.instance.core.asset.getAsset(effect.name + '.png'); - } - - public get loadedEffects(): Map - { - return this._loadedEffects; - } - - public get isLoaded(): boolean - { - return this._loaded; - } -} diff --git a/src/nitro/room/events/index.ts b/src/nitro/room/events/index.ts index a61d77d2..18ba5258 100644 --- a/src/nitro/room/events/index.ts +++ b/src/nitro/room/events/index.ts @@ -1,5 +1,4 @@ export * from './RoomBackgroundColorEvent'; -export * from './RoomCameraWidgetManagerEvent'; export * from './RoomEngineDimmerStateEvent'; export * from './RoomEngineEvent'; export * from './RoomEngineObjectEvent'; From 6b7749998cc020b4908612a4e162a696e4d7809b Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 15 Jun 2021 16:55:22 -0400 Subject: [PATCH 085/155] Updates --- src/nitro/camera/RoomCameraWidgetManager.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nitro/camera/RoomCameraWidgetManager.ts b/src/nitro/camera/RoomCameraWidgetManager.ts index 4fb0f505..a6ce1d7b 100644 --- a/src/nitro/camera/RoomCameraWidgetManager.ts +++ b/src/nitro/camera/RoomCameraWidgetManager.ts @@ -73,6 +73,8 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager filter.alpha = selectedEffect.alpha; if(!sprite.filters) sprite.filters = [ filter ]; + + sprite.filters.push(filter); } else { From a567a812e9322078b3e2c61000a616c805a7d07f Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Tue, 15 Jun 2021 18:22:44 -0300 Subject: [PATCH 086/155] Fix camera effect --- src/nitro/camera/RoomCameraWidgetManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/camera/RoomCameraWidgetManager.ts b/src/nitro/camera/RoomCameraWidgetManager.ts index a6ce1d7b..98c818b8 100644 --- a/src/nitro/camera/RoomCameraWidgetManager.ts +++ b/src/nitro/camera/RoomCameraWidgetManager.ts @@ -72,7 +72,7 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager filter.matrix = effect.colorMatrix; filter.alpha = selectedEffect.alpha; - if(!sprite.filters) sprite.filters = [ filter ]; + if(!sprite.filters) sprite.filters = []; sprite.filters.push(filter); } From d3978b31a08c62fe68a2ca7f05f9dceab94dcbf6 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Thu, 17 Jun 2021 18:34:47 -0500 Subject: [PATCH 087/155] cleaned PlaneMaterialCellMatrix --- .../object/visualization/room/RoomPlane.ts | 6 +- .../animated/LandscapeRasterizer.ts | 4 +- .../rasterizer/basic/PlaneMaterialCell.ts | 2 +- .../basic/PlaneMaterialCellColumn.ts | 98 ++++++++-------- .../basic/PlaneMaterialCellMatrix.ts | 108 +++++++++--------- .../room/rasterizer/basic/PlaneRasterizer.ts | 36 +++--- .../basic/PlaneVisualizationLayer.ts | 4 +- 7 files changed, 129 insertions(+), 129 deletions(-) diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 2f84c822..0ec9413a 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -514,11 +514,11 @@ export class RoomPlane implements IRoomPlane Randomizer.setSeed(this._randomSeed); - for(const column of cm._Str_23721(this.screenWidth(geometry))) + for(const column of cm.getColumns(this.screenWidth(geometry))) { const assetNames: string[] = []; - for(const cell of column._Str_22299()) + for(const cell of column.getCells()) { const name = cell.getAssetName(normal); @@ -527,7 +527,7 @@ export class RoomPlane implements IRoomPlane if(assetNames.length > 0) { - if(!column._Str_24523()) assetNames.push(''); + if(!column.isRepeated()) assetNames.push(''); data.addAssetColumn(assetNames); } diff --git a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts index b93591ee..c3cbae31 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/animated/LandscapeRasterizer.ts @@ -88,7 +88,7 @@ export class LandscapeRasterizer extends PlaneRasterizer if(layer) { let material: PlaneMaterial = null; - let align: number = PlaneVisualizationLayer._Str_6914; + let align: number = PlaneVisualizationLayer.ALIGN_DEFAULT; let color: number = LandscapePlane.DEFAULT_COLOR; let offset: number = PlaneVisualizationLayer.DEFAULT_OFFSET; @@ -102,7 +102,7 @@ export class LandscapeRasterizer extends PlaneRasterizer { if(layer.align === 'bottom') { - align = PlaneVisualizationLayer._Str_3606; + align = PlaneVisualizationLayer.ALIGN_BOTTOM; } else if(layer.align === 'top') align = PlaneVisualizationLayer.ALIGN_TOP; diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts index cc758e3f..943ba74a 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCell.ts @@ -89,7 +89,7 @@ export class PlaneMaterialCell } } - public _Str_9599(k: IVector3D): number + public getHeight(k: IVector3D): number { if(this._texture) { diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts index 46036900..6c747435 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellColumn.ts @@ -1,16 +1,16 @@ -import { Graphics } from 'pixi.js'; +import { Graphics } from 'pixi.js'; import { IVector3D } from '../../../../../../../room/utils/IVector3D'; import { Vector3d } from '../../../../../../../room/utils/Vector3d'; import { PlaneMaterialCell } from './PlaneMaterialCell'; export class PlaneMaterialCellColumn { - public static _Str_9685: number = 0; - public static _Str_7916: number = 1; - public static _Str_6087: number = 2; - public static _Str_6114: number = 3; - public static _Str_6187: number = 4; - public static _Str_6063: number = 5; + public static REPEAT_MODE_NONE: number = 0; + public static REPEAT_MODE_ALL: number = 1; + public static REPEAT_MODE_BORDERS: number = 2; + public static REPEAT_MODE_CENTER: number = 3; + public static REPEAT_MODE_FIRST: number = 4; + public static REPEAT_MODE_LAST: number = 5; private _cells: PlaneMaterialCell[]; private _repeatMode: number; @@ -59,9 +59,9 @@ export class PlaneMaterialCellColumn return this._isStatic; } - public _Str_24523(): boolean + public isRepeated(): boolean { - return !(this._repeatMode === PlaneMaterialCellColumn._Str_9685); + return !(this._repeatMode === PlaneMaterialCellColumn.REPEAT_MODE_NONE); } public get width(): number @@ -128,9 +128,9 @@ export class PlaneMaterialCellColumn { let ht = 0; - if(this._repeatMode == PlaneMaterialCellColumn._Str_9685) + if(this._repeatMode == PlaneMaterialCellColumn.REPEAT_MODE_NONE) { - ht = this._Str_19857(this._cells, normal); + ht = this.getCellsHeight(this._cells, normal); height = ht; } @@ -188,34 +188,34 @@ export class PlaneMaterialCellColumn switch(this._repeatMode) { - case PlaneMaterialCellColumn._Str_9685: - this._Str_25839(normal); + case PlaneMaterialCellColumn.REPEAT_MODE_NONE: + this.renderRepeatNone(normal); break; - case PlaneMaterialCellColumn._Str_6087: + case PlaneMaterialCellColumn.REPEAT_MODE_BORDERS: console.log('tru2'); - // this._Str_18476(normal); + // this.renderRepeatBorders(normal); break; - case PlaneMaterialCellColumn._Str_6114: + case PlaneMaterialCellColumn.REPEAT_MODE_CENTER: console.log('tru3'); - // this._Str_17295(normal); + // this.renderRepeatCenter(normal); break; - case PlaneMaterialCellColumn._Str_6187: + case PlaneMaterialCellColumn.REPEAT_MODE_FIRST: console.log('tru4'); - // this._Str_18019(normal); + // this.renderRepeatFirst(normal); break; - case PlaneMaterialCellColumn._Str_6063: + case PlaneMaterialCellColumn.REPEAT_MODE_LAST: console.log('tru5'); - // this._Str_16099(normal); + // this.renderRepeatLast(normal); break; default: - this._Str_18711(normal, offsetX, offsetY); + this.renderRepeatAll(normal, offsetX, offsetY); break; } return this._cachedBitmapData; } - private _Str_19857(k: PlaneMaterialCell[], _arg_2: IVector3D): number + private getCellsHeight(k: PlaneMaterialCell[], _arg_2: IVector3D): number { if(!k || !k.length) return 0; @@ -226,7 +226,7 @@ export class PlaneMaterialCellColumn { const cell = k[cellIterator]; - if(cell) height += cell._Str_9599(_arg_2); + if(cell) height += cell.getHeight(_arg_2); cellIterator++; } @@ -234,7 +234,7 @@ export class PlaneMaterialCellColumn return height; } - private _Str_4757(k: PlaneMaterialCell[], _arg_2: number, _arg_3: boolean, _arg_4: IVector3D, _arg_5: number = 0, _arg_6: number = 0): number + private renderCells(k: PlaneMaterialCell[], _arg_2: number, _arg_3: boolean, _arg_4: IVector3D, _arg_5: number = 0, _arg_6: number = 0): number { if(((!k || !k.length) || !this._cachedBitmapData)) return _arg_2; @@ -277,14 +277,14 @@ export class PlaneMaterialCellColumn return _arg_2; } - private _Str_25839(k: IVector3D): void + private renderRepeatNone(k: IVector3D): void { if(!this._cells.length || !this._cachedBitmapData) return; - this._Str_4757(this._cells, 0, true, k); + this.renderCells(this._cells, 0, true, k); } - private _Str_18711(k: IVector3D, _arg_2: number, _arg_3: number): void + private renderRepeatAll(k: IVector3D, _arg_2: number, _arg_3: number): void { if(!this._cells.length || !this._cachedBitmapData) return; @@ -292,13 +292,13 @@ export class PlaneMaterialCellColumn while(index < this._cachedBitmapData.height) { - index = this._Str_4757(this._cells, index, true, k, _arg_2, _arg_3); + index = this.renderCells(this._cells, index, true, k, _arg_2, _arg_3); if(!index) return; } } - // private _Str_18476(k:IVector3D): void + // private renderRepeatBorders(k:IVector3D): void // { // if (((this._cells.length == 0) || (this._cachedBitmapData == null))) // { @@ -316,7 +316,7 @@ export class PlaneMaterialCellColumn // _local_2 = (this._cells[_local_7] as PlaneMaterialCell); // if (_local_2 != null) // { - // _local_6 = _local_2._Str_9599(k); + // _local_6 = _local_2.getHeight(k); // if (_local_6 > 0) // { // _local_5 = (_local_5 + _local_6); @@ -330,7 +330,7 @@ export class PlaneMaterialCellColumn // _local_2 = (this._cells[0] as PlaneMaterialCell); // if (_local_2 != null) // { - // _local_6 = _local_2._Str_9599(k); + // _local_6 = _local_2.getHeight(k); // if (_local_6 > 0) // { // _local_5 = (_local_5 + _local_6); @@ -339,14 +339,14 @@ export class PlaneMaterialCellColumn // } // } // var _local_8:* = ((this._cachedBitmapData.height - _local_5) >> 1); - // var _local_9: number = this._Str_4757(_local_4, _local_8, true, k); + // var _local_9: number = this.renderCells(_local_4, _local_8, true, k); // _local_2 = (this._cells[0] as PlaneMaterialCell); // if (_local_2 != null) // { // _local_4 = [_local_2]; // while (_local_8 >= 0) // { - // _local_8 = this._Str_4757(_local_4, _local_8, false, k); + // _local_8 = this.renderCells(_local_4, _local_8, false, k); // } // } // _local_2 = (this._cells[(this._cells.length - 1)] as PlaneMaterialCell); @@ -355,12 +355,12 @@ export class PlaneMaterialCellColumn // _local_4 = [_local_2]; // while (_local_9 < this._cachedBitmapData.height) // { - // _local_9 = this._Str_4757(_local_4, _local_9, true, k); + // _local_9 = this.renderCells(_local_4, _local_9, true, k); // } // } // } - // private _Str_17295(k:IVector3D): void + // private renderRepeatCenter(k:IVector3D): void // { // var _local_13: number; // var _local_14: number; @@ -384,7 +384,7 @@ export class PlaneMaterialCellColumn // _local_2 = (this._cells[_local_9] as PlaneMaterialCell); // if (_local_2 != null) // { - // _local_8 = _local_2._Str_9599(k); + // _local_8 = _local_2.getHeight(k); // if (_local_8 > 0) // { // _local_6 = (_local_6 + _local_8); @@ -399,7 +399,7 @@ export class PlaneMaterialCellColumn // _local_2 = (this._cells[_local_9] as PlaneMaterialCell); // if (_local_2 != null) // { - // _local_8 = _local_2._Str_9599(k); + // _local_8 = _local_2.getHeight(k); // if (_local_8 > 0) // { // _local_7 = (_local_7 + _local_8); @@ -422,7 +422,7 @@ export class PlaneMaterialCellColumn // _local_2 = (this._cells[(this._cells.length >> 1)] as PlaneMaterialCell); // if (_local_2 != null) // { - // _local_8 = _local_2._Str_9599(k); + // _local_8 = _local_2.getHeight(k); // if (_local_8 > 0) // { // _local_13 = (this._cachedBitmapData.height - (_local_6 + _local_7)); @@ -432,17 +432,17 @@ export class PlaneMaterialCellColumn // _local_16 = [_local_2]; // while (_local_11 < _local_15) // { - // _local_11 = this._Str_4757(_local_16, _local_11, true, k); + // _local_11 = this.renderCells(_local_16, _local_11, true, k); // } // } // } // } // _local_11 = 0; - // this._Str_4757(_local_4, _local_11, true, k); - // this._Str_4757(_local_5, _local_12, false, k); + // this.renderCells(_local_4, _local_11, true, k); + // this.renderCells(_local_5, _local_12, false, k); // } - // private _Str_18019(k:IVector3D): void + // private renderRepeatFirst(k:IVector3D): void // { // var _local_4:Array; // if (((this._cells.length == 0) || (this._cachedBitmapData == null))) @@ -451,19 +451,19 @@ export class PlaneMaterialCellColumn // } // var _local_2:PlaneMaterialCell; // var _local_3: number = this._cachedBitmapData.height; - // _local_3 = this._Str_4757(this._cells, _local_3, false, k); + // _local_3 = this.renderCells(this._cells, _local_3, false, k); // _local_2 = (this._cells[0] as PlaneMaterialCell); // if (_local_2 != null) // { // _local_4 = [_local_2]; // while (_local_3 >= 0) // { - // _local_3 = this._Str_4757(_local_4, _local_3, false, k); + // _local_3 = this.renderCells(_local_4, _local_3, false, k); // } // } // } - // private _Str_16099(k: IVector3D): void + // private renderRepeatLast(k: IVector3D): void // { // if(!this._cells.length || !this._cachedBitmapData) return; @@ -471,19 +471,19 @@ export class PlaneMaterialCellColumn // var _local_4:Array; // var _local_2:PlaneMaterialCell; // var _local_3: number; - // _local_3 = this._Str_4757(this._cells, _local_3, true, k); + // _local_3 = this.renderCells(this._cells, _local_3, true, k); // _local_2 = (this._cells[(this._cells.length - 1)] as PlaneMaterialCell); // if (_local_2 != null) // { // _local_4 = [_local_2]; // while (_local_3 < this._cachedBitmapData.height) // { - // _local_3 = this._Str_4757(_local_4, _local_3, true, k); + // _local_3 = this.renderCells(_local_4, _local_3, true, k); // } // } // } - public _Str_22299(): PlaneMaterialCell[] + public getCells(): PlaneMaterialCell[] { return this._cells; } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts index 06dd7ed6..65bbf131 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneMaterialCellMatrix.ts @@ -9,18 +9,18 @@ import { PlaneMaterialCellColumn } from './PlaneMaterialCellColumn'; export class PlaneMaterialCellMatrix { - public static _Str_7916: number = 1; - public static _Str_6087: number = 2; - public static _Str_6114: number = 3; - public static _Str_6187: number = 4; - public static _Str_6063: number = 5; - public static _Str_9127: number = 6; - public static _Str_18632: number = PlaneMaterialCellMatrix._Str_7916;//1 + public static REPEAT_MODE_ALL: number = 1; + public static REPEAT_MODE_BORDERS: number = 2; + public static REPEAT_MODE_CENTER: number = 3; + public static REPEAT_MODE_FIRST: number = 4; + public static REPEAT_MODE_LAST: number = 5; + public static REPEAT_MODE_RANDOM: number = 6; + public static REPEAT_MODE_DEFAULT: number = PlaneMaterialCellMatrix.REPEAT_MODE_ALL;//1 public static MIN_NORMAL_COORDINATE_VALUE: number = -1; public static MAX_NORMAL_COORDINATE_VALUE: number = 1; public static ALIGN_TOP: number = 1; - public static _Str_3606: number = 2; - public static _Str_6914: number = PlaneMaterialCellMatrix.ALIGN_TOP;//1 + public static ALIGN_BOTTOM: number = 2; + public static ALIGN_DEFAULT: number = PlaneMaterialCellMatrix.ALIGN_TOP;//1 private _columns: PlaneMaterialCellColumn[]; private _repeatMode: number = 1; @@ -54,13 +54,13 @@ export class PlaneMaterialCellMatrix this._normalMaxX = _arg_5; this._normalMinY = _arg_6; this._normalMaxY = _arg_7; - if(this._repeatMode == PlaneMaterialCellMatrix._Str_9127) + if(this._repeatMode == PlaneMaterialCellMatrix.REPEAT_MODE_RANDOM) { this._isStatic = false; } } - private static _Str_12526(k: number): number + private static nextRandomColumnIndex(k: number): number { return ((Randomizer.getValues(1, 0, (k * 17631))[0]) % k); } @@ -87,7 +87,7 @@ export class PlaneMaterialCellMatrix public isBottomAligned(): boolean { - return this._align === PlaneMaterialCellMatrix._Str_3606; + return this._align === PlaneMaterialCellMatrix.ALIGN_BOTTOM; } public get isStatic(): boolean @@ -138,7 +138,7 @@ export class PlaneMaterialCellMatrix this._isCached = false; } - public _Str_22372(k: number, _arg_2: number, _arg_3: PlaneMaterialCell[], _arg_4: number=1): boolean + public createColumn(k: number, _arg_2: number, _arg_3: PlaneMaterialCell[], _arg_4: number=1): boolean { if((k < 0) || (k >= this._columns.length)) return false; @@ -172,7 +172,7 @@ export class PlaneMaterialCellMatrix { if(canvas) { - this._Str_17578(canvas, this._cachedBitmapHeight, offsetY, topAlign); + this.copyCachedBitmapOnCanvas(canvas, this._cachedBitmapHeight, offsetY, topAlign); return canvas; } @@ -231,7 +231,7 @@ export class PlaneMaterialCellMatrix if(canvas) { - this._Str_17578(canvas, height, offsetY, topAlign); + this.copyCachedBitmapOnCanvas(canvas, height, offsetY, topAlign); return canvas; } @@ -280,23 +280,23 @@ export class PlaneMaterialCellMatrix switch(this._repeatMode) { - case PlaneMaterialCellMatrix._Str_6087: - // maxColumnHeight = this._Str_18476(this._cachedBitmapData, columns); + case PlaneMaterialCellMatrix.REPEAT_MODE_BORDERS: + // maxColumnHeight = this.renderRepeatBorders(this._cachedBitmapData, columns); break; - case PlaneMaterialCellMatrix._Str_6114: - // maxColumnHeight = this._Str_17295(this._cachedBitmapData, columns); + case PlaneMaterialCellMatrix.REPEAT_MODE_CENTER: + // maxColumnHeight = this.renderRepeatCenter(this._cachedBitmapData, columns); break; - case PlaneMaterialCellMatrix._Str_6187: - // maxColumnHeight = this._Str_18019(this._cachedBitmapData, columns); + case PlaneMaterialCellMatrix.REPEAT_MODE_FIRST: + // maxColumnHeight = this.renderRepeatFirst(this._cachedBitmapData, columns); break; - case PlaneMaterialCellMatrix._Str_6063: - // maxColumnHeight = this._Str_16099(this._cachedBitmapData, columns); + case PlaneMaterialCellMatrix.REPEAT_MODE_LAST: + // maxColumnHeight = this.renderRepeatLast(this._cachedBitmapData, columns); break; - case PlaneMaterialCellMatrix._Str_9127: - // maxColumnHeight = this._Str_25678(this._cachedBitmapData, columns); + case PlaneMaterialCellMatrix.REPEAT_MODE_RANDOM: + // maxColumnHeight = this.renderRepeatRandom(this._cachedBitmapData, columns); break; default: - maxColumnHeight = this._Str_18711(this._cachedBitmapData, columns); + maxColumnHeight = this.renderRepeatAll(this._cachedBitmapData, columns); break; } @@ -304,7 +304,7 @@ export class PlaneMaterialCellMatrix if(canvas) { - this._Str_17578(canvas, maxColumnHeight, offsetY, topAlign); + this.copyCachedBitmapOnCanvas(canvas, maxColumnHeight, offsetY, topAlign); return canvas; } @@ -312,7 +312,7 @@ export class PlaneMaterialCellMatrix return this._cachedBitmapData; } - private _Str_17578(k: Graphics, _arg_2: number, _arg_3: number, _arg_4: boolean): void + private copyCachedBitmapOnCanvas(k: Graphics, _arg_2: number, _arg_3: number, _arg_4: boolean): void { if(!k || !this._cachedBitmapData || (k === this._cachedBitmapData)) return; @@ -340,7 +340,7 @@ export class PlaneMaterialCellMatrix } } - private _Str_25859(k: Graphics[]): number + private getColumnsWidth(k: Graphics[]): number { if(!k || !k.length) return 0; @@ -356,7 +356,7 @@ export class PlaneMaterialCellMatrix return width; } - private _Str_4606(k: Graphics, _arg_2: Graphics[], _arg_3: number, _arg_4: boolean): Point + private renderColumns(k: Graphics, _arg_2: Graphics[], _arg_3: number, _arg_4: boolean): Point { if(!k || !_arg_2 || !_arg_2.length) return new Point(_arg_3, 0); @@ -381,7 +381,7 @@ export class PlaneMaterialCellMatrix _arg_3 = (_arg_3 - _local_6.width); } let _local_8 = 0; - if(this._align == PlaneMaterialCellMatrix._Str_3606) + if(this._align == PlaneMaterialCellMatrix.ALIGN_BOTTOM) { _local_8 = (k.height - _local_6.height); } @@ -417,18 +417,18 @@ export class PlaneMaterialCellMatrix return new Point(_arg_3, height); } - private _Str_18711(k: Graphics, _arg_2: Graphics[]): number + private renderRepeatAll(k: Graphics, _arg_2: Graphics[]): number { if(!k || !_arg_2 || !_arg_2.length) return 0; - const totalWidth: number = this._Str_25859(_arg_2); + const totalWidth: number = this.getColumnsWidth(_arg_2); let x = 0; let y = 0; while(x < k.width) { - const point = this._Str_4606(k, _arg_2, x, true); + const point = this.renderColumns(k, _arg_2, x, true); x = point.x; @@ -440,7 +440,7 @@ export class PlaneMaterialCellMatrix return y; } - // private _Str_18476(k:BitmapData, _arg_2:Array): number + // private renderRepeatBorders(k:BitmapData, _arg_2:Array): number // { // if ((((_arg_2 == null) || (_arg_2.length == 0)) || (k == null))) // { @@ -473,7 +473,7 @@ export class PlaneMaterialCellMatrix // } // var _local_8:* = ((k.width - _local_6) >> 1); // var _local_9:Point; - // _local_9 = this._Str_4606(k, _local_5, _local_8, true); + // _local_9 = this.renderColumns(k, _local_5, _local_8, true); // var _local_10: number = _local_9.x; // if (_local_9.y > _local_3) // { @@ -485,7 +485,7 @@ export class PlaneMaterialCellMatrix // _local_5 = [_local_4]; // while (_local_8 >= 0) // { - // _local_9 = this._Str_4606(k, _local_5, _local_8, false); + // _local_9 = this.renderColumns(k, _local_5, _local_8, false); // _local_8 = _local_9.x; // if (_local_9.y > _local_3) // { @@ -499,7 +499,7 @@ export class PlaneMaterialCellMatrix // _local_5 = [_local_4]; // while (_local_10 < k.height) // { - // _local_9 = this._Str_4606(k, _local_5, _local_10, true); + // _local_9 = this.renderColumns(k, _local_5, _local_10, true); // _local_10 = _local_9.x; // if (_local_9.y > _local_3) // { @@ -510,7 +510,7 @@ export class PlaneMaterialCellMatrix // return _local_3; // } - // private _Str_17295(k:BitmapData, _arg_2:Array): number + // private renderRepeatCenter(k:BitmapData, _arg_2:Array): number // { // var _local_14: number; // var _local_15: number; @@ -573,7 +573,7 @@ export class PlaneMaterialCellMatrix // _local_18 = [_local_4]; // while (_local_12 < _local_17) // { - // _local_10 = this._Str_4606(k, _local_18, _local_12, true); + // _local_10 = this.renderColumns(k, _local_18, _local_12, true); // _local_12 = _local_10.x; // if (_local_10.y > _local_3) // { @@ -583,12 +583,12 @@ export class PlaneMaterialCellMatrix // } // } // _local_12 = 0; - // _local_10 = this._Str_4606(k, _local_5, _local_12, true); + // _local_10 = this.renderColumns(k, _local_5, _local_12, true); // if (_local_10.y > _local_3) // { // _local_3 = _local_10.y; // } - // _local_10 = this._Str_4606(k, _local_6, _local_13, false); + // _local_10 = this.renderColumns(k, _local_6, _local_13, false); // if (_local_10.y > _local_3) // { // _local_3 = _local_10.y; @@ -596,7 +596,7 @@ export class PlaneMaterialCellMatrix // return _local_3; // } - // private _Str_18019(k:BitmapData, _arg_2:Array): number + // private renderRepeatFirst(k:BitmapData, _arg_2:Array): number // { // var _local_7:Array; // if ((((_arg_2 == null) || (_arg_2.length == 0)) || (k == null))) @@ -606,7 +606,7 @@ export class PlaneMaterialCellMatrix // var _local_3: number; // var _local_4:BitmapData; // var _local_5: number = k.width; - // var _local_6:Point = this._Str_4606(k, _arg_2, _local_5, false); + // var _local_6:Point = this.renderColumns(k, _arg_2, _local_5, false); // _local_5 = _local_6.x; // if (_local_6.y > _local_3) // { @@ -618,7 +618,7 @@ export class PlaneMaterialCellMatrix // _local_7 = [_local_4]; // while (_local_5 >= 0) // { - // _local_6 = this._Str_4606(k, _local_7, _local_5, false); + // _local_6 = this.renderColumns(k, _local_7, _local_5, false); // _local_5 = _local_6.x; // if (_local_6.y > _local_3) // { @@ -629,7 +629,7 @@ export class PlaneMaterialCellMatrix // return _local_3; // } - // private _Str_16099(k:BitmapData, _arg_2:Array): number + // private renderRepeatLast(k:BitmapData, _arg_2:Array): number // { // var _local_7:Array; // if ((((_arg_2 == null) || (_arg_2.length == 0)) || (k == null))) @@ -639,7 +639,7 @@ export class PlaneMaterialCellMatrix // var _local_3: number; // var _local_4:BitmapData; // var _local_5: number; - // var _local_6:Point = this._Str_4606(k, _arg_2, _local_5, true); + // var _local_6:Point = this.renderColumns(k, _arg_2, _local_5, true); // _local_5 = _local_6.x; // if (_local_6.y > _local_3) // { @@ -651,7 +651,7 @@ export class PlaneMaterialCellMatrix // _local_7 = [_local_4]; // while (_local_5 < k.width) // { - // _local_6 = this._Str_4606(k, _local_7, _local_5, true); + // _local_6 = this.renderColumns(k, _local_7, _local_5, true); // _local_5 = _local_6.x; // if (_local_6.y > _local_3) // { @@ -662,7 +662,7 @@ export class PlaneMaterialCellMatrix // return _local_3; // } - // private _Str_25678(k:BitmapData, _arg_2:Array): number + // private renderRepeatRandom(k:BitmapData, _arg_2:Array): number // { // var _local_6:Array; // var _local_7:Point; @@ -675,11 +675,11 @@ export class PlaneMaterialCellMatrix // var _local_5: number; // while (_local_5 < k.width) // { - // _local_4 = (_arg_2[_Str_12526(_arg_2.length)] as BitmapData); + // _local_4 = (_arg_2[nextRandomColumnIndex(_arg_2.length)] as BitmapData); // if (_local_4 != null) // { // _local_6 = [_local_4]; - // _local_7 = this._Str_4606(k, _local_6, _local_5, true); + // _local_7 = this.renderColumns(k, _local_6, _local_5, true); // _local_5 = _local_7.x; // if (_local_7.y > _local_3) // { @@ -694,9 +694,9 @@ export class PlaneMaterialCellMatrix // return _local_3; // } - public _Str_23721(k: number): PlaneMaterialCellColumn[] + public getColumns(k: number): PlaneMaterialCellColumn[] { - if(this._repeatMode === PlaneMaterialCellMatrix._Str_9127) + if(this._repeatMode === PlaneMaterialCellMatrix.REPEAT_MODE_RANDOM) { const columns: PlaneMaterialCellColumn[] = []; @@ -704,7 +704,7 @@ export class PlaneMaterialCellMatrix while(columnIndex < k) { - const column = this._columns[PlaneMaterialCellMatrix._Str_12526(this._columns.length)]; + const column = this._columns[PlaneMaterialCellMatrix.nextRandomColumnIndex(this._columns.length)]; if(column) { 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 0889ab26..8b5a45a9 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneRasterizer.ts @@ -298,22 +298,22 @@ export class PlaneRasterizer implements IPlaneRasterizer switch(repeatMode) { case 'borders': - repeatMode = PlaneMaterialCellMatrix._Str_6087; + repeatMode = PlaneMaterialCellMatrix.REPEAT_MODE_BORDERS; break; case 'center': - repeatMode = PlaneMaterialCellMatrix._Str_6114; + repeatMode = PlaneMaterialCellMatrix.REPEAT_MODE_CENTER; break; case 'first': - repeatMode = PlaneMaterialCellMatrix._Str_6187; + repeatMode = PlaneMaterialCellMatrix.REPEAT_MODE_FIRST; break; case 'last': - repeatMode = PlaneMaterialCellMatrix._Str_6063; + repeatMode = PlaneMaterialCellMatrix.REPEAT_MODE_LAST; break; case 'random': - repeatMode = PlaneMaterialCellMatrix._Str_9127; + repeatMode = PlaneMaterialCellMatrix.REPEAT_MODE_RANDOM; break; default: - repeatMode = PlaneMaterialCellMatrix._Str_18632; + repeatMode = PlaneMaterialCellMatrix.REPEAT_MODE_DEFAULT; break; } @@ -323,10 +323,10 @@ export class PlaneRasterizer implements IPlaneRasterizer align = PlaneMaterialCellMatrix.ALIGN_TOP; break; case 'bottom': - align = PlaneMaterialCellMatrix._Str_3606; + align = PlaneMaterialCellMatrix.ALIGN_BOTTOM; break; default: - align = PlaneMaterialCellMatrix._Str_6914; + align = PlaneMaterialCellMatrix.ALIGN_DEFAULT; break; } @@ -356,7 +356,7 @@ export class PlaneRasterizer implements IPlaneRasterizer { if(!k || !_arg_2) return; - let repeatMode = PlaneMaterialCellColumn._Str_7916; + let repeatMode = PlaneMaterialCellColumn.REPEAT_MODE_ALL; const width = k.width; @@ -365,26 +365,26 @@ export class PlaneRasterizer implements IPlaneRasterizer switch(k.repeatMode) { case 'borders': - repeatMode = PlaneMaterialCellColumn._Str_6087; + repeatMode = PlaneMaterialCellColumn.REPEAT_MODE_BORDERS; break; case 'center': - repeatMode = PlaneMaterialCellColumn._Str_6114; + repeatMode = PlaneMaterialCellColumn.REPEAT_MODE_CENTER; break; case 'first': - repeatMode = PlaneMaterialCellColumn._Str_6187; + repeatMode = PlaneMaterialCellColumn.REPEAT_MODE_FIRST; break; case 'last': - repeatMode = PlaneMaterialCellColumn._Str_6063; + repeatMode = PlaneMaterialCellColumn.REPEAT_MODE_LAST; break; case 'none': - repeatMode = PlaneMaterialCellColumn._Str_9685; + repeatMode = PlaneMaterialCellColumn.REPEAT_MODE_NONE; break; default: - repeatMode = PlaneMaterialCellColumn._Str_7916; + repeatMode = PlaneMaterialCellColumn.REPEAT_MODE_ALL; break; } - _arg_2._Str_22372(_arg_3, width, cells, repeatMode); + _arg_2.createColumn(_arg_3, width, cells, repeatMode); } private parsePlaneMaterialCells(k: any): PlaneMaterialCell[] @@ -561,7 +561,7 @@ export class PlaneRasterizer implements IPlaneRasterizer if(layer) { let material: PlaneMaterial = null; - let align: number = PlaneVisualizationLayer._Str_6914; + let align: number = PlaneVisualizationLayer.ALIGN_DEFAULT; let color: number = FloorPlane.DEFAULT_COLOR; let offset: number = PlaneVisualizationLayer.DEFAULT_OFFSET; @@ -573,7 +573,7 @@ export class PlaneRasterizer implements IPlaneRasterizer if(layer.align) { - if(layer.align === 'bottom') align = PlaneVisualizationLayer._Str_3606; + if(layer.align === 'bottom') align = PlaneVisualizationLayer.ALIGN_BOTTOM; else if(layer.align == 'top') align = PlaneVisualizationLayer.ALIGN_TOP; } diff --git a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts index 3b284b3a..0ca795ae 100644 --- a/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts +++ b/src/nitro/room/object/visualization/room/rasterizer/basic/PlaneVisualizationLayer.ts @@ -8,8 +8,8 @@ export class PlaneVisualizationLayer { public static DEFAULT_OFFSET: number = 0; public static ALIGN_TOP: number = 1; - public static _Str_3606: number = 2; - public static _Str_6914: number = PlaneVisualizationLayer.ALIGN_TOP; + public static ALIGN_BOTTOM: number = 2; + public static ALIGN_DEFAULT: number = PlaneVisualizationLayer.ALIGN_TOP; private _material: PlaneMaterial; private _color: number; From 505033a9cb884e42d0dd147e9041d01670167960 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 19 Jun 2021 20:09:44 -0500 Subject: [PATCH 088/155] fixed AvatarVisualization variables --- .../avatar/AvatarVisualization.ts | 115 ++++++------ .../furniture/FurnitureVisualization.ts | 4 +- .../visualization/room/RoomVisualization.ts | 172 +++++++++--------- .../RoomWidgetFurniInfoUsagePolicyEnum.ts | 8 +- .../RoomObjectSpriteVisualization.ts | 2 +- 5 files changed, 150 insertions(+), 151 deletions(-) diff --git a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts index 2b6eaaa1..17e9f397 100644 --- a/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts +++ b/src/nitro/room/object/visualization/avatar/AvatarVisualization.ts @@ -33,19 +33,18 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement private static MUTED_BUBBLE_ID: number = 6; private static OWN_USER_ID: number = 4; private static UPDATE_TIME_INCREASER: number = 41; - private static OFFSET_MULTIPLIER: number = 1000; private static AVATAR_LAYER_ID: number = 0; private static SHADOW_LAYER_ID: number = 1; - private static _Str_17502: number = 97; - private static _Str_11587: number = 2; - private static _Str_14491: number = 2; - private static _Str_18338: number[] = [0, 0, 0]; + private static SNOWBOARDING_EFFECT: number = 97; + private static INITIAL_RESERVED_SPRITES: number = 2; + private static ANIMATION_FRAME_UPDATE_INTERVAL: number = 2; + private static DEFAULT_CANVAS_OFFSETS: number[] = [0, 0, 0]; private static MAX_EFFECT_CACHE: number = 2; - private static _Str_9540: number = 0; - private static _Str_12370: number = 1000; - private static _Str_11358: number = -0.01; - private static _Str_17708: number = 0.001; - private static _Str_9235: number = -0.409; + private static SPRITE_INDEX_AVATAR: number = 0; + private static BASE_Y_SCALE: number = 1000; + private static AVATAR_SPRITE_DEFAULT_DEPTH: number = -0.01; + private static AVATAR_OWN_DEPTH_ADJUST: number = 0.001; + private static AVATAR_SPRITE_LAYING_DEPTH: number = -0.409; protected _data: AvatarVisualizationData; @@ -81,12 +80,12 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement private _useObject: number; private _ownUser: boolean; - private _Str_8935: boolean; - private _Str_17860: boolean; - private _Str_1222: boolean; - private _Str_16697: number; - private _Str_12697: number; - private _Str_14276: number; + private _isLaying: boolean; + private _layInside: boolean; + private _isAnimating: boolean; + private _extraSpritesStartIndex: number; + private _forcedAnimFrames: number; + private _updatesUntilFrameUpdate: number; private _isAvatarReady: boolean; private _needsUpdate: boolean; @@ -105,7 +104,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement this._cachedAvatarEffects = new AdvancedMap(); this._shadow = null; this._lastUpdate = -1000; - this._disposed = false; + this._disposed = false; this._figure = null; this._gender = null; @@ -132,12 +131,12 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement this._useObject = 0; this._ownUser = false; - this._Str_8935 = false; - this._Str_17860 = false; - this._Str_1222 = false; - this._Str_16697 = 2; - this._Str_12697 = 0; - this._Str_14276 = 0; + this._isLaying = false; + this._layInside = false; + this._isAnimating = false; + this._extraSpritesStartIndex = 2; + this._forcedAnimFrames = 0; + this._updatesUntilFrameUpdate = 0; this._isAvatarReady = false; this._needsUpdate = false; @@ -152,7 +151,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement this._data = data; - this.setSpriteCount(AvatarVisualization._Str_11587); + this.createSprites(AvatarVisualization.INITIAL_RESERVED_SPRITES); super.initialize(data); @@ -236,7 +235,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement if(this._additions) { - let index = this._Str_16697; + let index = this._extraSpritesStartIndex; for(const addition of this._additions.values()) { @@ -253,7 +252,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement if(this._additions) { - let index = this._Str_16697; + let index = this._extraSpritesStartIndex; for(const addition of this._additions.values()) { @@ -262,22 +261,22 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement } const update1 = (objectUpdate || updateModel || didScaleUpdate); - const update2 = ((this._Str_1222 || (this._Str_12697 > 0)) && update); + const update2 = ((this._isAnimating || (this._forcedAnimFrames > 0)) && update); - if(update1) this._Str_12697 = AvatarVisualization._Str_14491; + if(update1) this._forcedAnimFrames = AvatarVisualization.ANIMATION_FRAME_UPDATE_INTERVAL; if(update1 || update2) { this.updateSpriteCounter++; - this._Str_12697--; - this._Str_14276--; + this._forcedAnimFrames--; + this._updatesUntilFrameUpdate--; - if((((this._Str_14276 <= 0) || didScaleUpdate) || updateModel) || otherUpdate) + if((((this._updatesUntilFrameUpdate <= 0) || didScaleUpdate) || updateModel) || otherUpdate) { this._avatarImage.updateAnimationByFrames(1); - this._Str_14276 = AvatarVisualization._Str_14491; + this._updatesUntilFrameUpdate = AvatarVisualization.ANIMATION_FRAME_UPDATE_INTERVAL; } else { @@ -286,9 +285,9 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement let _local_20 = this._avatarImage.getCanvasOffsets(); - if(!_local_20 || (_local_20.length < 3)) _local_20 = AvatarVisualization._Str_18338; + if(!_local_20 || (_local_20.length < 3)) _local_20 = AvatarVisualization.DEFAULT_CANVAS_OFFSETS; - const sprite = this.getSprite(AvatarVisualization._Str_9540); + const sprite = this.getSprite(AvatarVisualization.SPRITE_INDEX_AVATAR); if(sprite) { @@ -321,19 +320,19 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement sprite.offsetY = (((-(sprite.texture.height) + (scale / 4)) + _local_20[1]) + this._postureOffset); } - if(this._Str_8935) + if(this._isLaying) { - if(this._Str_17860) sprite.relativeDepth = -0.5; - else sprite.relativeDepth = (AvatarVisualization._Str_9235 + _local_20[2]); + if(this._layInside) sprite.relativeDepth = -0.5; + else sprite.relativeDepth = (AvatarVisualization.AVATAR_SPRITE_LAYING_DEPTH + _local_20[2]); } else { - sprite.relativeDepth = (AvatarVisualization._Str_11358 + _local_20[2]); + sprite.relativeDepth = (AvatarVisualization.AVATAR_SPRITE_DEFAULT_DEPTH + _local_20[2]); } if(this._ownUser) { - sprite.relativeDepth -= AvatarVisualization._Str_17708; + sprite.relativeDepth -= AvatarVisualization.AVATAR_OWN_DEPTH_ADJUST; sprite.spriteType = RoomObjectSpriteType.AVATAR_OWN; } else @@ -346,20 +345,20 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement if(typingBubble) { - if(!this._Str_8935) typingBubble.relativeDepth = ((AvatarVisualization._Str_11358 - 0.01) + _local_20[2]); - else typingBubble.relativeDepth = ((AvatarVisualization._Str_9235 - 0.01) + _local_20[2]); + if(!this._isLaying) typingBubble.relativeDepth = ((AvatarVisualization.AVATAR_SPRITE_DEFAULT_DEPTH - 0.01) + _local_20[2]); + else typingBubble.relativeDepth = ((AvatarVisualization.AVATAR_SPRITE_LAYING_DEPTH - 0.01) + _local_20[2]); } - this._Str_1222 = this._avatarImage.isAnimating(); + this._isAnimating = this._avatarImage.isAnimating(); - let _local_21 = AvatarVisualization._Str_11587; + let _local_21 = AvatarVisualization.INITIAL_RESERVED_SPRITES; const direction = this._avatarImage.getDirection(); for(const spriteData of this._avatarImage.getSprites()) { if(spriteData.id === AvatarVisualization.AVATAR) { - const sprite = this.getSprite(AvatarVisualization._Str_9540); + const sprite = this.getSprite(AvatarVisualization.SPRITE_INDEX_AVATAR); if(sprite) { @@ -439,20 +438,20 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement if(spriteData.hasStaticY) { - sprite.offsetY += ((this._verticalOffset * scale) / (2 * AvatarVisualization._Str_12370)); + sprite.offsetY += ((this._verticalOffset * scale) / (2 * AvatarVisualization.BASE_Y_SCALE)); } else { sprite.offsetY += this._postureOffset; } - if(this._Str_8935) + if(this._isLaying) { - sprite.relativeDepth = (AvatarVisualization._Str_9235 - ((0.001 * this.totalSprites) * offsetZ)); + sprite.relativeDepth = (AvatarVisualization.AVATAR_SPRITE_LAYING_DEPTH - ((0.001 * this.totalSprites) * offsetZ)); } else { - sprite.relativeDepth = (AvatarVisualization._Str_11358 - ((0.001 * this.totalSprites) * offsetZ)); + sprite.relativeDepth = (AvatarVisualization.AVATAR_SPRITE_DEFAULT_DEPTH - ((0.001 * this.totalSprites) * offsetZ)); } if(spriteData.ink === 33) sprite.blendMode = BLEND_MODES.ADD; @@ -641,7 +640,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement needsUpdate = true; } - const verticalOffset = (model.getValue(RoomObjectVariable.FIGURE_VERTICAL_OFFSET) * AvatarVisualization.OFFSET_MULTIPLIER); + const verticalOffset = (model.getValue(RoomObjectVariable.FIGURE_VERTICAL_OFFSET) * AvatarVisualization.BASE_Y_SCALE); if(verticalOffset !== this._verticalOffset) { @@ -879,16 +878,16 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement this._postureOffset = 0; } - this._Str_17860 = false; - this._Str_8935 = false; + this._layInside = false; + this._isLaying = false; if(this._posture === 'lay') { - this._Str_8935 = true; + this._isLaying = true; const _local_2 = parseInt(this._postureParameter); - if(_local_2 < 0) this._Str_17860 = true; + if(_local_2 < 0) this._layInside = true; } } @@ -936,18 +935,18 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement avatar.endActionAppends(); - this._Str_1222 = avatar.isAnimating(); + this._isAnimating = avatar.isAnimating(); - let spriteCount = AvatarVisualization._Str_11587; + let spriteCount = AvatarVisualization.INITIAL_RESERVED_SPRITES; for(const sprite of this._avatarImage.getSprites()) { if(sprite.id !== AvatarVisualization.AVATAR) spriteCount++; } - if(spriteCount !== this.totalSprites) this.setSpriteCount(spriteCount); + if(spriteCount !== this.totalSprites) this.createSprites(spriteCount); - this._Str_16697 = spriteCount; + this._extraSpritesStartIndex = spriteCount; if(this._additions) { @@ -1039,7 +1038,7 @@ export class AvatarVisualization extends RoomObjectSpriteVisualization implement let hasShadow = (((this._posture === 'mv') || (this._posture === 'std')) || ((this._posture === 'sit') && this._canStandUp)); - if(this._effect === AvatarVisualization._Str_17502) hasShadow = false; + if(this._effect === AvatarVisualization.SNOWBOARDING_EFFECT) hasShadow = false; if(hasShadow) { diff --git a/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts index dce042f7..6699aa41 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureVisualization.ts @@ -128,7 +128,7 @@ export class FurnitureVisualization extends RoomObjectSpriteVisualization this._spriteYOffsets = []; this._spriteZOffsets = []; - this.setSpriteCount(0); + this.createSprites(0); } protected resetLayers(scale: number, direction: number): void @@ -244,7 +244,7 @@ export class FurnitureVisualization extends RoomObjectSpriteVisualization protected updateSprites(scale: number, update: boolean, animation: number): void { - if(this._layerCount !== this.totalSprites) this.setSpriteCount(this._layerCount); + if(this._layerCount !== this.totalSprites) this.createSprites(this._layerCount); if(update) { diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index 0b9e594c..0a9bfc48 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -26,17 +26,17 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements public static RENDER_TEXTURE_CACHE: Map> = new Map(); - public static _Str_18544: number = 0xFFFFFF; - public static _Str_18640: number = 0xDDDDDD; - public static _Str_16664: number = 0xBBBBBB; - private static _Str_14503: number = 0xFFFFFF; - private static _Str_15851: number = 0xCCCCCC; - private static _Str_13715: number = 0x999999; - private static _Str_14868: number = 0x999999; - public static _Str_17403: number = 0xFFFFFF; - public static _Str_16113: number = 0xCCCCCC; - public static _Str_18370: number = 0x999999; - private static _Str_8621: number = 1000; + public static FLOOR_COLOR: number = 0xFFFFFF; + public static FLOOR_COLOR_LEFT: number = 0xDDDDDD; + public static FLOOR_COLOR_RIGHT: number = 0xBBBBBB; + private static WALL_COLOR_TOP: number = 0xFFFFFF; + private static WALL_COLOR_SIDE: number = 0xCCCCCC; + private static WALL_COLOR_BOTTOM: number = 0x999999; + private static WALL_COLOR_BORDER: number = 0x999999; + public static LANDSCAPE_COLOR_TOP: number = 0xFFFFFF; + public static LANDSCAPE_COLOR_SIDE: number = 0xCCCCCC; + public static LANDSCAPE_COLOR_BOTTOM: number = 0x999999; + private static ROOM_DEPTH_OFFSET: number = 1000; protected _data: RoomVisualizationData; @@ -51,9 +51,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements private _floorThickness: number; private _wallThickness: number; private _holeUpdateTime: number; - private _Str_2540: RoomPlane[]; - private _Str_4864: RoomPlane[]; - private _Str_6648: number[]; + private _planes: RoomPlane[]; + private _visiblePlanes: RoomPlane[]; + private _visiblePlaneSpriteNumbers: number[]; private _roomScale: number; private _lastUpdateTime: number; private _updateIntervalTime: number; @@ -66,7 +66,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements private _greenColor: number; private _blueColor: number; private _typeVisibility: boolean[]; - private _Str_5928: number; + private _assetUpdateCounter: number; private _maskData: RoomMapMaskData; private _isPlaneSet: boolean; @@ -86,9 +86,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements this._floorThickness = 1; this._wallThickness = 1; this._holeUpdateTime = NaN; - this._Str_2540 = []; - this._Str_4864 = []; - this._Str_6648 = []; + this._planes = []; + this._visiblePlanes = []; + this._visiblePlaneSpriteNumbers = []; this._roomScale = 0; this._lastUpdateTime = -1000; this._updateIntervalTime = 250; @@ -101,7 +101,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements this._greenColor = 0xFF; this._blueColor = 0xFF; this._typeVisibility = []; - this._Str_5928 = 0; + this._assetUpdateCounter = 0; this._maskData = null; this._isPlaneSet = false; @@ -155,9 +155,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements this.clearPlanes(); - this._Str_2540 = null; - this._Str_4864 = null; - this._Str_6648 = null; + this._planes = null; + this._visiblePlanes = null; + this._visiblePlaneSpriteNumbers = null; if(this._roomPlaneParser) { @@ -263,11 +263,11 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { let index = 0; - while(index < this._Str_4864.length) + while(index < this._visiblePlanes.length) { - const spriteIndex = this._Str_6648[index]; + const spriteIndex = this._visiblePlaneSpriteNumbers[index]; const sprite = this.getSprite(spriteIndex); - const plane = this._Str_4864[index]; + const plane = this._visiblePlanes[index]; if(sprite && plane && (plane.type !== RoomPlane.TYPE_LANDSCAPE)) { @@ -424,23 +424,23 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements private clearPlanes(): void { - if(this._Str_2540) + if(this._planes) { - while(this._Str_2540.length) + while(this._planes.length) { - const plane = this._Str_2540[0]; + const plane = this._planes[0]; if(plane) plane.dispose(); - this._Str_2540.pop(); + this._planes.pop(); } - this._Str_2540 = []; - this._Str_2540 = []; + this._planes = []; + this._planes = []; } this._isPlaneSet = false; - this._Str_5928 = (this._Str_5928 + 1); + this._assetUpdateCounter = (this._assetUpdateCounter + 1); this.reset(); } @@ -456,8 +456,8 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(!this._roomPlaneParser.initializeFromMapData(mapData)) return; - const _local_3 = this._Str_23949(); - const _local_4 = this._Str_23063(); + const _local_3 = this.getLandscapeWidth(); + const _local_4 = this.getLandscapeHeight(); let _local_5 = 0; let _local_6 = this.object.model.getValue(RoomObjectVariable.ROOM_RANDOM_SEED); @@ -491,11 +491,11 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(_local_14.z !== 0) { - plane.color = RoomVisualization._Str_18544; + plane.color = RoomVisualization.FLOOR_COLOR; } else { - plane.color = ((_local_14.x !== 0) ? RoomVisualization._Str_16664 : RoomVisualization._Str_18640); + plane.color = ((_local_14.x !== 0) ? RoomVisualization.FLOOR_COLOR_RIGHT : RoomVisualization.FLOOR_COLOR_LEFT); } if(this._data) plane.rasterizer = this._data.floorRasterizer; @@ -512,23 +512,23 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if((_local_14.x === 0) && (_local_14.y === 0)) { - plane.color = RoomVisualization._Str_14868; + plane.color = RoomVisualization.WALL_COLOR_BORDER; } else { if(_local_14.y > 0) { - plane.color = RoomVisualization._Str_14503; + plane.color = RoomVisualization.WALL_COLOR_TOP; } else { if(_local_14.y === 0) { - plane.color = RoomVisualization._Str_15851; + plane.color = RoomVisualization.WALL_COLOR_SIDE; } else { - plane.color = RoomVisualization._Str_13715; + plane.color = RoomVisualization.WALL_COLOR_BOTTOM; } } } @@ -542,17 +542,17 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(_local_14.y > 0) { - plane.color = RoomVisualization._Str_17403; + plane.color = RoomVisualization.LANDSCAPE_COLOR_TOP; } else { if(_local_14.y == 0) { - plane.color = RoomVisualization._Str_16113; + plane.color = RoomVisualization.LANDSCAPE_COLOR_SIDE; } else { - plane.color = RoomVisualization._Str_18370; + plane.color = RoomVisualization.LANDSCAPE_COLOR_BOTTOM; } } @@ -570,23 +570,23 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements } if(((_local_14.x == 0) && (_local_14.y == 0))) { - plane.color = RoomVisualization._Str_14868; + plane.color = RoomVisualization.WALL_COLOR_BORDER; } else { if(_local_14.y > 0) { - plane.color = RoomVisualization._Str_14503; + plane.color = RoomVisualization.WALL_COLOR_TOP; } else { if(_local_14.y == 0) { - plane.color = RoomVisualization._Str_15851; + plane.color = RoomVisualization.WALL_COLOR_SIDE; } else { - plane.color = RoomVisualization._Str_13715; + plane.color = RoomVisualization.WALL_COLOR_BOTTOM; } } } @@ -615,7 +615,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements _local_19++; } - this._Str_2540.push(plane); + this._planes.push(plane); } } else @@ -634,13 +634,13 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements protected _Str_18024(): void { - this.setSpriteCount(this._Str_2540.length); + this.createSprites(this._planes.length); let planeIndex = 0; - while(planeIndex < this._Str_2540.length) + while(planeIndex < this._planes.length) { - const plane = this._Str_2540[planeIndex]; + const plane = this._planes[planeIndex]; const sprite = this.getSprite(planeIndex); if(plane && sprite && plane.leftSide && plane.rightSide) @@ -676,7 +676,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements } } - private _Str_23949(): number + private getLandscapeWidth(): number { let length = 0; let index = 0; @@ -698,7 +698,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements return length; } - private _Str_23063(): number + private getLandscapeHeight(): number { let length = 0; let index = 0; @@ -737,9 +737,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements let index = 0; - while(index < this._Str_2540.length) + while(index < this._planes.length) { - const plane = this._Str_2540[index]; + const plane = this._planes[index]; if(plane) { @@ -773,27 +773,27 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements this._typeVisibility[RoomPlane.TYPE_WALL] = _arg_2; this._typeVisibility[RoomPlane.TYPE_LANDSCAPE] = _arg_3; - this._Str_4864 = []; - this._Str_6648 = []; + this._visiblePlanes = []; + this._visiblePlaneSpriteNumbers = []; } protected _Str_16913(k: IRoomGeometry, _arg_2: boolean, _arg_3: number): boolean { if(!k || !this.object) return; - this._Str_5928++; + this._assetUpdateCounter++; if(_arg_2) { - this._Str_4864 = []; - this._Str_6648 = []; + this._visiblePlanes = []; + this._visiblePlaneSpriteNumbers = []; } - const _local_8 = (this._Str_4864.length > 0); + const _local_8 = (this._visiblePlanes.length > 0); - let _local_6 = this._Str_4864; + let _local_6 = this._visiblePlanes; - if(!this._Str_4864.length) _local_6 = this._Str_2540; + if(!this._visiblePlanes.length) _local_6 = this._planes; let depth = 0; let updated = false; @@ -803,7 +803,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { let _local_10 = index; - if(_local_8) _local_10 = this._Str_6648[index]; + if(_local_8) _local_10 = this._visiblePlaneSpriteNumbers[index]; const _local_11 = this.getSprite(_local_10); @@ -819,21 +819,21 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { if(_local_12.visible) { - depth = ((_local_12.relativeDepth + this._Str_24891) + (_local_10 / 1000)); + depth = ((_local_12.relativeDepth + this.floorRelativeDepth) + (_local_10 / 1000)); if(_local_12.type !== RoomPlane.TYPE_FLOOR) { - depth = ((_local_12.relativeDepth + this._Str_25403) + (_local_10 / 1000)); + depth = ((_local_12.relativeDepth + this.wallRelativeDepth) + (_local_10 / 1000)); if((_local_12.leftSide.length < 1) || (_local_12.rightSide.length < 1)) { - depth = (depth + (RoomVisualization._Str_8621 * 0.5)); + depth = (depth + (RoomVisualization.ROOM_DEPTH_OFFSET * 0.5)); } } const _local_14 = ((('plane ' + _local_10) + ' ') + k.scale); - this._Str_7421(_local_11, _local_12, _local_14, depth); + this.updateSprite(_local_11, _local_12, _local_14, depth); } updated = true; } @@ -846,8 +846,8 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { if(!_local_8) { - this._Str_4864.push(_local_12); - this._Str_6648.push(index); + this._visiblePlanes.push(_local_12); + this._visiblePlaneSpriteNumbers.push(index); } } } @@ -879,9 +879,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements let _local_6 = false; let index = 0; - while(index < this._Str_2540.length) + while(index < this._planes.length) { - const plane = this._Str_2540[index]; + const plane = this._planes[index]; if(plane) { @@ -903,9 +903,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { let i = 0; - while(i < this._Str_2540.length) + while(i < this._planes.length) { - const plane = this._Str_2540[i]; + const plane = this._planes[i]; if((plane.type === RoomPlane.TYPE_WALL) || (plane.type === RoomPlane.TYPE_LANDSCAPE)) { @@ -954,7 +954,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(_local_5.indexOf(planeIndex) < 0) { - const plane = this._Str_2540[planeIndex]; + const plane = this._planes[planeIndex]; plane.canBeVisible = false; _local_6 = true; @@ -965,12 +965,12 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(_local_6) { - this._Str_4864 = []; - this._Str_6648 = []; + this._visiblePlanes = []; + this._visiblePlaneSpriteNumbers = []; } } - private _Str_7421(k: IRoomObjectSprite, _arg_2: RoomPlane, _arg_3: string, _arg_4: number): void + private updateSprite(k: IRoomObjectSprite, _arg_2: RoomPlane, _arg_3: string, _arg_4: number): void { const offset = _arg_2.offset; @@ -978,11 +978,11 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements k.offsetY = -(offset.y); k.relativeDepth = _arg_4; k.color = _arg_2.color; - k.texture = this._Str_22446(_arg_2, _arg_3); - k.name = ((_arg_3 + '_') + this._Str_5928); + k.texture = this.getPlaneBitmap(_arg_2, _arg_3); + k.name = ((_arg_3 + '_') + this._assetUpdateCounter); } - private _Str_22446(k: RoomPlane, _arg_2: string): Texture + private getPlaneBitmap(k: RoomPlane, _arg_2: string): Texture { return k.bitmapData; } @@ -998,18 +998,18 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements { const planes: IRoomPlane[] = []; - for(const plane of this._Str_4864) planes.push(plane); + for(const plane of this._visiblePlanes) planes.push(plane); return planes; } - public get _Str_24891(): number + public get floorRelativeDepth(): number { - return RoomVisualization._Str_8621 + 0.1; + return RoomVisualization.ROOM_DEPTH_OFFSET + 0.1; } - public get _Str_25403(): number + public get wallRelativeDepth(): number { - return RoomVisualization._Str_8621 + 0.5; + return RoomVisualization.ROOM_DEPTH_OFFSET + 0.5; } } diff --git a/src/nitro/ui/widget/enums/RoomWidgetFurniInfoUsagePolicyEnum.ts b/src/nitro/ui/widget/enums/RoomWidgetFurniInfoUsagePolicyEnum.ts index ee2fa451..523205c3 100644 --- a/src/nitro/ui/widget/enums/RoomWidgetFurniInfoUsagePolicyEnum.ts +++ b/src/nitro/ui/widget/enums/RoomWidgetFurniInfoUsagePolicyEnum.ts @@ -1,6 +1,6 @@ export class RoomWidgetFurniInfoUsagePolicyEnum { - public static _Str_21805: number = 0; - public static _Str_18194: number = 1; - public static _Str_18353: number = 2; -} \ No newline at end of file + public static NOBODY: number = 0; + public static CONTROLLER: number = 1; + public static EVERYBODY: number = 2; +} diff --git a/src/room/object/visualization/RoomObjectSpriteVisualization.ts b/src/room/object/visualization/RoomObjectSpriteVisualization.ts index 8a56781e..9f2c205e 100644 --- a/src/room/object/visualization/RoomObjectSpriteVisualization.ts +++ b/src/room/object/visualization/RoomObjectSpriteVisualization.ts @@ -106,7 +106,7 @@ export class RoomObjectSpriteVisualization implements IRoomObjectSpriteVisualiza return sprite; } - protected setSpriteCount(count: number): void + protected createSprites(count: number): void { while(this._sprites.length > count) { From a1827d8cc47dfc62cc30a56e8b6af59a4e7d4aca Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 19 Jun 2021 21:01:58 -0500 Subject: [PATCH 089/155] cleaned RoomVisualization --- .../visualization/room/RoomVisualization.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/nitro/room/object/visualization/room/RoomVisualization.ts b/src/nitro/room/object/visualization/room/RoomVisualization.ts index 0a9bfc48..1d0bfe72 100644 --- a/src/nitro/room/object/visualization/room/RoomVisualization.ts +++ b/src/nitro/room/object/visualization/room/RoomVisualization.ts @@ -228,7 +228,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(this.updateHole(objectModel)) needsUpdate = true; - if(this._Str_25732()) + if(this.initializeRoomPlanes()) { if(existing && removeCount) { @@ -255,9 +255,9 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(((time < (this._lastUpdateTime + this._updateIntervalTime)) && (!geometryUpdate)) && (!needsUpdate)) return; - if(this.updatePlanes(objectModel)) needsUpdate = true; + if(this.updatePlaneTexturesAndVisibilities(objectModel)) needsUpdate = true; - if(this._Str_16913(geometry, geometryUpdate, time)) needsUpdate = true; + if(this.updatePlanes(geometry, geometryUpdate, time)) needsUpdate = true; if(needsUpdate) { @@ -372,7 +372,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements if(planeMask !== this._maskData) { - this._Str_15935(planeMask); + this.updatePlaneMasks(planeMask); this._maskData = planeMask; @@ -403,7 +403,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements return didUpdate; } - private updatePlanes(model: IRoomObjectModel): boolean + private updatePlaneTexturesAndVisibilities(model: IRoomObjectModel): boolean { if(this.updateModelCounter === model.updateCounter) return false; @@ -445,7 +445,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements this.reset(); } - protected _Str_25732(): boolean + protected initializeRoomPlanes(): boolean { if(!this.object || this._isPlaneSet) return false; @@ -627,12 +627,12 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements } this._isPlaneSet = true; - this._Str_18024(); + this.defineSprites(); return true; } - protected _Str_18024(): void + protected defineSprites(): void { this.createSprites(this._planes.length); @@ -777,7 +777,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements this._visiblePlaneSpriteNumbers = []; } - protected _Str_16913(k: IRoomGeometry, _arg_2: boolean, _arg_3: number): boolean + protected updatePlanes(k: IRoomGeometry, _arg_2: boolean, _arg_3: number): boolean { if(!k || !this.object) return; @@ -867,7 +867,7 @@ export class RoomVisualization extends RoomObjectSpriteVisualization implements return updated; } - protected _Str_15935(k: RoomMapMaskData): void + protected updatePlaneMasks(k: RoomMapMaskData): void { if(!k) return; From 09e90a8c932bf26cd70d4217ab87d3e4a5de893b Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 19 Jun 2021 21:11:45 -0500 Subject: [PATCH 090/155] cleaned RoomSessionChatEvent --- .../session/events/RoomSessionChatEvent.ts | 24 +++++++++---------- src/nitro/session/handler/RoomChatHandler.ts | 12 +++++----- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/nitro/session/events/RoomSessionChatEvent.ts b/src/nitro/session/events/RoomSessionChatEvent.ts index 3254262f..d9214e04 100644 --- a/src/nitro/session/events/RoomSessionChatEvent.ts +++ b/src/nitro/session/events/RoomSessionChatEvent.ts @@ -6,17 +6,17 @@ export class RoomSessionChatEvent extends RoomSessionEvent public static CHAT_EVENT: string = 'RSCE_CHAT_EVENT'; public static FLOOD_EVENT: string = 'RSCE_FLOOD_EVENT'; - public static CHAT_NORMAL: number = 0; - public static CHAT_WHISPER: number = 1; - public static CHAT_SHOUT: number = 2; - public static _Str_5821: number = 3; - public static _Str_6081: number = 4; - public static _Str_8971: number = 5; - public static _Str_5958: number = 6; - public static _Str_6065: number = 7; - public static _Str_5998: number = 8; - public static _Str_5904: number = 9; - public static _Str_8909: number = 10; + public static CHAT_TYPE_SPEAK: number = 0; + public static CHAT_TYPE_WHISPER: number = 1; + public static CHAT_TYPE_SHOUT: number = 2; + public static CHAT_TYPE_RESPECT: number = 3; + public static CHAT_TYPE_PETRESPECT: number = 4; + public static CHAT_TYPE_HAND_ITEM_RECEIVED: number = 5; + public static CHAT_TYPE_PETTREAT: number = 6; + public static CHAT_TYPE_PETREVIVE: number = 7; + public static CHAT_TYPE_PET_REBREED_FERTILIZE: number = 8; + public static CHAT_TYPE_PET_SPEED_FERTILIZE: number = 9; + public static CHAT_TYPE_MUTE_REMAINING: number = 10; private _objectId: number; private _message: string; @@ -66,4 +66,4 @@ export class RoomSessionChatEvent extends RoomSessionEvent { return this._style; } -} \ No newline at end of file +} diff --git a/src/nitro/session/handler/RoomChatHandler.ts b/src/nitro/session/handler/RoomChatHandler.ts index 966246a5..14e428a7 100644 --- a/src/nitro/session/handler/RoomChatHandler.ts +++ b/src/nitro/session/handler/RoomChatHandler.ts @@ -38,10 +38,10 @@ export class RoomChatHandler extends BaseHandler if(!parser) return; - let chatType: number = RoomSessionChatEvent.CHAT_NORMAL; + let chatType: number = RoomSessionChatEvent.CHAT_TYPE_SPEAK; - if(event instanceof RoomUnitChatShoutEvent) chatType = RoomSessionChatEvent.CHAT_SHOUT; - else if(event instanceof RoomUnitChatWhisperEvent) chatType = RoomSessionChatEvent.CHAT_WHISPER; + if(event instanceof RoomUnitChatShoutEvent) chatType = RoomSessionChatEvent.CHAT_TYPE_SHOUT; + else if(event instanceof RoomUnitChatWhisperEvent) chatType = RoomSessionChatEvent.CHAT_TYPE_WHISPER; const chatEvent = new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, parser.roomIndex, parser.message, chatType, parser.bubble); @@ -60,7 +60,7 @@ export class RoomChatHandler extends BaseHandler if(!parser) return; - this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, parser.giverUserId, '', RoomSessionChatEvent._Str_8971, SystemChatStyleEnum.GENERIC, null, parser.handItemType)); + this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, parser.giverUserId, '', RoomSessionChatEvent.CHAT_TYPE_HAND_ITEM_RECEIVED, SystemChatStyleEnum.GENERIC, null, parser.handItemType)); } private onRespectReceivedEvent(event: RespectReceivedEvent): void @@ -79,7 +79,7 @@ export class RoomChatHandler extends BaseHandler if(!userData) return; - this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, userData.roomIndex, '', RoomSessionChatEvent._Str_5821, SystemChatStyleEnum.GENERIC)); + this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, userData.roomIndex, '', RoomSessionChatEvent.CHAT_TYPE_RESPECT, SystemChatStyleEnum.GENERIC)); } private onFloodControlEvent(event: FloodControlEvent): void @@ -111,6 +111,6 @@ export class RoomChatHandler extends BaseHandler if(!parser) return; - this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, session.ownRoomIndex, '', RoomSessionChatEvent._Str_8909, SystemChatStyleEnum.GENERIC, null, parser.seconds)); + this.listener.events.dispatchEvent(new RoomSessionChatEvent(RoomSessionChatEvent.CHAT_EVENT, session, session.ownRoomIndex, '', RoomSessionChatEvent.CHAT_TYPE_MUTE_REMAINING, SystemChatStyleEnum.GENERIC, null, parser.seconds)); } } From 191cb16a8d4fc503490c0df13faff75dd1936238 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 20 Jun 2021 06:39:31 -0300 Subject: [PATCH 091/155] Room Widget Camera updates --- src/nitro/camera/IRoomCameraWidgetEffect.ts | 1 + src/nitro/camera/IRoomCameraWidgetManager.ts | 2 +- src/nitro/camera/RoomCameraWidgetEffect.ts | 14 +++++++++++++- src/nitro/camera/RoomCameraWidgetManager.ts | 12 +++++++----- 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/nitro/camera/IRoomCameraWidgetEffect.ts b/src/nitro/camera/IRoomCameraWidgetEffect.ts index 954947b1..e408a24a 100644 --- a/src/nitro/camera/IRoomCameraWidgetEffect.ts +++ b/src/nitro/camera/IRoomCameraWidgetEffect.ts @@ -6,4 +6,5 @@ export interface IRoomCameraWidgetEffect minLevel: number; texture: Texture; colorMatrix: number[]; + blendMode: number; } diff --git a/src/nitro/camera/IRoomCameraWidgetManager.ts b/src/nitro/camera/IRoomCameraWidgetManager.ts index 029f1ee7..886609f5 100644 --- a/src/nitro/camera/IRoomCameraWidgetManager.ts +++ b/src/nitro/camera/IRoomCameraWidgetManager.ts @@ -5,7 +5,7 @@ import { IRoomCameraWidgetSelectedEffect } from './IRoomCameraWidgetSelectedEffe export interface IRoomCameraWidgetManager { init(): void; - applyEffects(image: HTMLImageElement, selectedEffects: IRoomCameraWidgetSelectedEffect[]): HTMLImageElement; + applyEffects(image: HTMLImageElement, selectedEffects: IRoomCameraWidgetSelectedEffect[], isZoomed: boolean): HTMLImageElement; events: IEventDispatcher; effects: Map; isLoaded: boolean; diff --git a/src/nitro/camera/RoomCameraWidgetEffect.ts b/src/nitro/camera/RoomCameraWidgetEffect.ts index 8cd285ea..e081b689 100644 --- a/src/nitro/camera/RoomCameraWidgetEffect.ts +++ b/src/nitro/camera/RoomCameraWidgetEffect.ts @@ -7,13 +7,15 @@ export class RoomCameraWidgetEffect implements IRoomCameraWidgetEffect private _minLevel: number = -1; private _texture: Texture = null; private _colorMatrix: number[] = null; + private _blendMode: number = null; - constructor(name: string, minLevel: number = -1, texture: Texture = null, colorMatrix: number[] = null) + constructor(name: string, minLevel: number = -1, texture: Texture = null, colorMatrix: number[] = null, blendMode: number = null) { this._name = name; this._minLevel = minLevel; this._texture = texture; this._colorMatrix = colorMatrix; + this._blendMode = blendMode; } public get name(): string @@ -41,6 +43,16 @@ export class RoomCameraWidgetEffect implements IRoomCameraWidgetEffect this._colorMatrix = colorMatrix; } + public get blendMode(): number + { + return this._blendMode; + } + + public set blendMode(blendMode: number) + { + this._blendMode = blendMode; + } + public get minLevel(): number { return this._minLevel; diff --git a/src/nitro/camera/RoomCameraWidgetManager.ts b/src/nitro/camera/RoomCameraWidgetManager.ts index 98c818b8..92b938c4 100644 --- a/src/nitro/camera/RoomCameraWidgetManager.ts +++ b/src/nitro/camera/RoomCameraWidgetManager.ts @@ -28,7 +28,7 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager this._isLoaded = true; const imagesUrl = Nitro.instance.getConfiguration('image.library.url') + 'Habbo-Stories/'; - const effects = Nitro.instance.getConfiguration<{ name: string, colorMatrix?: number[], minLevel: number, enabled: boolean }[]>('camera.available.effects'); + const effects = Nitro.instance.getConfiguration<{ name: string, colorMatrix?: number[], minLevel: number, blendMode?: number, enabled: boolean }[]>('camera.available.effects'); for(const effect of effects) { @@ -42,7 +42,8 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager } else { - cameraEffect.texture = Texture.from(imagesUrl + effect.name + '.png'); + cameraEffect.texture = Texture.from(imagesUrl + effect.name + '.png'); + cameraEffect.blendMode = effect.blendMode; } this._effects.set(cameraEffect.name, cameraEffect); @@ -51,7 +52,7 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager this.events.dispatchEvent(new RoomCameraWidgetManagerEvent(RoomCameraWidgetManagerEvent.INITIALIZED)); } - public applyEffects(image: HTMLImageElement, selectedEffects: IRoomCameraWidgetSelectedEffect[]): HTMLImageElement + public applyEffects(image: HTMLImageElement, selectedEffects: IRoomCameraWidgetSelectedEffect[], isZoomed: boolean): HTMLImageElement { const container = new Container(); const texture = Texture.from(image); @@ -78,8 +79,9 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager } else { - const effectSprite = new Sprite(effect.texture); - effectSprite.alpha = selectedEffect.alpha; + const effectSprite = new Sprite(effect.texture); + effectSprite.alpha = selectedEffect.alpha; + effectSprite.blendMode = effect.blendMode; container.addChild(effectSprite); } From 815a1d87304274bb42fb40430d2b3b74b7ac64b9 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 20 Jun 2021 11:04:14 -0300 Subject: [PATCH 092/155] RoomWidgetCamera packets --- src/nitro/communication/NitroMessages.ts | 20 ++++++++- .../messages/incoming/IncomingHeader.ts | 2 + .../RoomWidgetCameraConfigurationEvent.ts | 16 +++++++ .../camera/RoomWidgetCameraPublishedEvent.ts | 16 +++++++ ...RoomWidgetCameraPurchaseSuccessfulEvent.ts | 16 +++++++ .../messages/incoming/room/camera/index.ts | 3 ++ .../messages/incoming/room/index.ts | 1 + .../messages/outgoing/OutgoingHeader.ts | 2 + .../RoomWidgetCameraConfigurationComposer.ts | 21 +++++++++ .../camera/RoomWidgetCameraPublishComposer.ts | 21 +++++++++ .../RoomWidgetCameraPurchaseComposer.ts | 21 +++++++++ .../RoomWidgetCameraRoomPictureComposer.ts | 21 +++++++++ .../RoomWidgetCameraRoomThumbnailComposer.ts | 21 +++++++++ .../messages/outgoing/room/camera/index.ts | 5 +++ .../messages/outgoing/room/index.ts | 1 + .../RoomWidgetCameraConfigurationParser.ts | 44 +++++++++++++++++++ .../camera/RoomWidgetCameraPublishedParser.ts | 44 +++++++++++++++++++ ...oomWidgetCameraPurchaseSuccessfulParser.ts | 17 +++++++ .../messages/parser/room/camera/index.ts | 3 ++ .../messages/parser/room/index.ts | 1 + 20 files changed, 295 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraConfigurationEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraPublishedEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraPurchaseSuccessfulEvent.ts create mode 100644 src/nitro/communication/messages/incoming/room/camera/index.ts create mode 100644 src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraConfigurationComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraPublishComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraPurchaseComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraRoomPictureComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraRoomThumbnailComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/room/camera/index.ts create mode 100644 src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraConfigurationParser.ts create mode 100644 src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPublishedParser.ts create mode 100644 src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPurchaseSuccessfulParser.ts create mode 100644 src/nitro/communication/messages/parser/room/camera/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index cb76d426..f57aeca9 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, RoomUnitGiveHandItemPetComposer, SellablePetPalettesEvent } from './messages'; +import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent'; @@ -120,6 +120,8 @@ import { RoomEnterErrorEvent } from './messages/incoming/room/access/RoomEnterEr import { RoomEnterEvent } from './messages/incoming/room/access/RoomEnterEvent'; import { RoomForwardEvent } from './messages/incoming/room/access/RoomForwardEvent'; import { BotCommandConfigurationEvent } from './messages/incoming/room/bots/BotCommandConfigurationEvent'; +import { RoomWidgetCameraConfigurationEvent } from './messages/incoming/room/camera/RoomWidgetCameraConfigurationEvent'; +import { RoomWidgetCameraPurchaseSuccessfulEvent } from './messages/incoming/room/camera/RoomWidgetCameraPurchaseSuccessfulEvent'; import { RoomBannedUsersEvent } from './messages/incoming/room/data/RoomBannedUsersEvent'; import { RoomChatSettingsEvent } from './messages/incoming/room/data/RoomChatSettingsEvent'; import { RoomInfoEvent } from './messages/incoming/room/data/RoomInfoEvent'; @@ -319,6 +321,10 @@ import { RoomStaffPickComposer } from './messages/outgoing/room/action/RoomStaff import { RoomTakeRightsComposer } from './messages/outgoing/room/action/RoomTakeRightsComposer'; import { RoomUnbanUserComposer } from './messages/outgoing/room/action/RoomUnbanUserComposer'; import { RequestBotCommandConfigurationComposer } from './messages/outgoing/room/bots/RequestBotConfigurationComposer'; +import { RoomWidgetCameraConfigurationComposer } from './messages/outgoing/room/camera/RoomWidgetCameraConfigurationComposer'; +import { RoomWidgetCameraPublishComposer } from './messages/outgoing/room/camera/RoomWidgetCameraPublishComposer'; +import { RoomWidgetCameraRoomPictureComposer } from './messages/outgoing/room/camera/RoomWidgetCameraRoomPictureComposer'; +import { RoomWidgetCameraRoomThumbnailComposer } from './messages/outgoing/room/camera/RoomWidgetCameraRoomThumbnailComposer'; import { RoomBannedUsersComposer } from './messages/outgoing/room/data/RoomBannedUsersComposer'; import { RoomInfoComposer } from './messages/outgoing/room/data/RoomInfoComposer'; import { RoomSettingsComposer } from './messages/outgoing/room/data/RoomSettingsComposer'; @@ -446,6 +452,11 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.CATALOG_RECEIVE_PET_BREEDS, SellablePetPalettesEvent); this._events.set(IncomingHeader.CATALOG_APPROVE_NAME_RESULT, CatalogApproveNameResultEvent); + // CAMERA + this._events.set(IncomingHeader.CAMERA_PRICE, RoomWidgetCameraConfigurationEvent); + this._events.set(IncomingHeader.CAMERA_PUBLISHED, RoomWidgetCameraPublishedEvent); + this._events.set(IncomingHeader.CAMERA_PURCHASE_SUCCESSFUL, RoomWidgetCameraPurchaseSuccessfulEvent); + // CLIENT this._events.set(IncomingHeader.CLIENT_PING, ClientPingEvent); @@ -744,6 +755,13 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.CATALOG_SELECT_VIP_GIFT, CatalogSelectClubGiftComposer); this._composers.set(OutgoingHeader.CATALOG_REQUESET_PET_BREEDS, CatalogRequestPetBreedsComposer); + // CAMERA + this._composers.set(OutgoingHeader.CAMERA_PRICE, RoomWidgetCameraConfigurationComposer); + this._composers.set(OutgoingHeader.CAMERA_PUBLISH, RoomWidgetCameraPublishComposer); + this._composers.set(OutgoingHeader.CAMERA_PURCHASE, RoomWidgetCameraPurchaseComposer); + this._composers.set(OutgoingHeader.CAMERA_SAVE, RoomWidgetCameraRoomPictureComposer); + this._composers.set(OutgoingHeader.CAMERA_THUMBNAIL, RoomWidgetCameraRoomThumbnailComposer); + // CLIENT this._composers.set(OutgoingHeader.CLIENT_PONG, ClientPongComposer); this._composers.set(OutgoingHeader.RELEASE_VERSION, ClientReleaseVersionComposer); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index fac838bb..cc0e5958 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -5,6 +5,8 @@ export class IncomingHeader public static AVAILABILITY_STATUS = 2033; public static BUILDERS_CLUB_EXPIRED = 1452; public static CAMERA_PRICE = 3878; + public static CAMERA_PUBLISHED = 2057; + public static CAMERA_PURCHASE_SUCCESSFUL = 2783; public static CAMERA_THUMBNAIL_SAVED = 3595; public static CAMERA_URL = 3696; public static CATALOG_CLUB = 2405; diff --git a/src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraConfigurationEvent.ts b/src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraConfigurationEvent.ts new file mode 100644 index 00000000..2c7293ef --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraConfigurationEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { RoomWidgetCameraConfigurationParser } from '../../../parser/room/camera/RoomWidgetCameraConfigurationParser'; + +export class RoomWidgetCameraConfigurationEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, RoomWidgetCameraConfigurationParser); + } + + public getParser(): RoomWidgetCameraConfigurationParser + { + return this.parser as RoomWidgetCameraConfigurationParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraPublishedEvent.ts b/src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraPublishedEvent.ts new file mode 100644 index 00000000..dac2a890 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraPublishedEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { RoomWidgetCameraPublishedParser } from '../../../parser/room/camera/RoomWidgetCameraPublishedParser'; + +export class RoomWidgetCameraPublishedEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, RoomWidgetCameraPublishedParser); + } + + public getParser(): RoomWidgetCameraPublishedParser + { + return this.parser as RoomWidgetCameraPublishedParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraPurchaseSuccessfulEvent.ts b/src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraPurchaseSuccessfulEvent.ts new file mode 100644 index 00000000..eb153983 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/camera/RoomWidgetCameraPurchaseSuccessfulEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { RoomWidgetCameraPurchaseSuccessfulParser } from '../../../parser/room/camera/RoomWidgetCameraPurchaseSuccessfulParser'; + +export class RoomWidgetCameraPurchaseSuccessfulEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, RoomWidgetCameraPurchaseSuccessfulParser); + } + + public getParser(): RoomWidgetCameraPurchaseSuccessfulParser + { + return this.parser as RoomWidgetCameraPurchaseSuccessfulParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/camera/index.ts b/src/nitro/communication/messages/incoming/room/camera/index.ts new file mode 100644 index 00000000..b1984472 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/camera/index.ts @@ -0,0 +1,3 @@ +export * from './RoomWidgetCameraConfigurationEvent'; +export * from './RoomWidgetCameraPublishedEvent'; +export * from './RoomWidgetCameraPurchaseSuccessfulEvent'; diff --git a/src/nitro/communication/messages/incoming/room/index.ts b/src/nitro/communication/messages/incoming/room/index.ts index e692b601..0af11081 100644 --- a/src/nitro/communication/messages/incoming/room/index.ts +++ b/src/nitro/communication/messages/incoming/room/index.ts @@ -1,5 +1,6 @@ export * from './access'; export * from './bots'; +export * from './camera'; export * from './data'; export * from './engine'; export * from './furniture'; diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index bf00374a..355ce787 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -6,6 +6,8 @@ export class OutgoingHeader public static BOT_PLACE = 1592; public static BOT_SKILL_SAVE = 2624; public static CAMERA_PRICE = 796; + public static CAMERA_PUBLISH = 2068; + public static CAMERA_PURCHASE = 2408; public static CAMERA_SAVE = 3226; public static CAMERA_THUMBNAIL = 1982; public static CATALOG_CLUB = 3285; diff --git a/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraConfigurationComposer.ts b/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraConfigurationComposer.ts new file mode 100644 index 00000000..6f47811f --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraConfigurationComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class RoomWidgetCameraConfigurationComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraPublishComposer.ts b/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraPublishComposer.ts new file mode 100644 index 00000000..586ce45a --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraPublishComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class RoomWidgetCameraPublishComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraPurchaseComposer.ts b/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraPurchaseComposer.ts new file mode 100644 index 00000000..eaae2502 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraPurchaseComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class RoomWidgetCameraPurchaseComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraRoomPictureComposer.ts b/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraRoomPictureComposer.ts new file mode 100644 index 00000000..e353dc4b --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraRoomPictureComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class RoomWidgetCameraRoomPictureComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(unknownFloat: number, image: number[]) + { + this._data = [ unknownFloat, image ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraRoomThumbnailComposer.ts b/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraRoomThumbnailComposer.ts new file mode 100644 index 00000000..99ca2682 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/camera/RoomWidgetCameraRoomThumbnailComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class RoomWidgetCameraRoomThumbnailComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(unknownFloat: number, image: number[]) + { + this._data = [ unknownFloat, image ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/camera/index.ts b/src/nitro/communication/messages/outgoing/room/camera/index.ts new file mode 100644 index 00000000..bfad4dc9 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/camera/index.ts @@ -0,0 +1,5 @@ +export * from './RoomWidgetCameraConfigurationComposer'; +export * from './RoomWidgetCameraPublishComposer'; +export * from './RoomWidgetCameraPurchaseComposer'; +export * from './RoomWidgetCameraRoomPictureComposer'; +export * from './RoomWidgetCameraRoomThumbnailComposer'; diff --git a/src/nitro/communication/messages/outgoing/room/index.ts b/src/nitro/communication/messages/outgoing/room/index.ts index 4b101b0e..48d479c2 100644 --- a/src/nitro/communication/messages/outgoing/room/index.ts +++ b/src/nitro/communication/messages/outgoing/room/index.ts @@ -1,6 +1,7 @@ export * from './access'; export * from './action'; export * from './bots'; +export * from './camera'; export * from './data'; export * from './engine'; export * from './furniture'; diff --git a/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraConfigurationParser.ts b/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraConfigurationParser.ts new file mode 100644 index 00000000..5c4e809b --- /dev/null +++ b/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraConfigurationParser.ts @@ -0,0 +1,44 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; + +export class RoomWidgetCameraConfigurationParser implements IMessageParser +{ + private _credits: number; + private _points: number; + private _pointsType: number; + + public flush(): boolean + { + this._credits = 0; + this._points = 0; + this._pointsType = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._credits = wrapper.readInt(); + this._points = wrapper.readInt(); + this._pointsType = wrapper.readInt(); + + return true; + } + + public get credits(): number + { + return this._credits; + } + + public get points(): number + { + return this._points; + } + + public get pointsType(): number + { + return this._pointsType; + } +} diff --git a/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPublishedParser.ts b/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPublishedParser.ts new file mode 100644 index 00000000..f68c41b8 --- /dev/null +++ b/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPublishedParser.ts @@ -0,0 +1,44 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; + +export class RoomWidgetCameraPublishedParser implements IMessageParser +{ + private _wasSuccessful: boolean; + private _cooldownSeconds: number; + private _extraDataId: number; + + public flush(): boolean + { + this._wasSuccessful = false; + this._cooldownSeconds = 0; + this._extraDataId = 0; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._wasSuccessful = wrapper.readBoolean(); + this._cooldownSeconds = wrapper.readInt(); + this._extraDataId = wrapper.readInt(); + + return true; + } + + public get wasSuccessful(): boolean + { + return this._wasSuccessful; + } + + public get cooldownSeconds(): number + { + return this._cooldownSeconds; + } + + public get extraDataId(): number + { + return this._extraDataId; + } +} diff --git a/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPurchaseSuccessfulParser.ts b/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPurchaseSuccessfulParser.ts new file mode 100644 index 00000000..33a55829 --- /dev/null +++ b/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPurchaseSuccessfulParser.ts @@ -0,0 +1,17 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; + +export class RoomWidgetCameraPurchaseSuccessfulParser implements IMessageParser +{ + public flush(): boolean + { + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + return true; + } +} diff --git a/src/nitro/communication/messages/parser/room/camera/index.ts b/src/nitro/communication/messages/parser/room/camera/index.ts new file mode 100644 index 00000000..32a976b4 --- /dev/null +++ b/src/nitro/communication/messages/parser/room/camera/index.ts @@ -0,0 +1,3 @@ +export * from './RoomWidgetCameraConfigurationParser'; +export * from './RoomWidgetCameraPublishedParser'; +export * from './RoomWidgetCameraPurchaseSuccessfulParser'; diff --git a/src/nitro/communication/messages/parser/room/index.ts b/src/nitro/communication/messages/parser/room/index.ts index e692b601..0af11081 100644 --- a/src/nitro/communication/messages/parser/room/index.ts +++ b/src/nitro/communication/messages/parser/room/index.ts @@ -1,5 +1,6 @@ export * from './access'; export * from './bots'; +export * from './camera'; export * from './data'; export * from './engine'; export * from './furniture'; From 4cef3ab86b4c451b5e2809cbf8f6370c8b97ad0b Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Mon, 21 Jun 2021 02:00:09 -0300 Subject: [PATCH 093/155] Authentication Packets --- src/nitro/communication/NitroMessages.ts | 8 +++++ .../messages/incoming/IncomingHeader.ts | 1 + .../incoming/handshake/AuthenticationEvent.ts | 16 ++++++++++ .../messages/incoming/handshake/index.ts | 1 + .../messages/outgoing/OutgoingHeader.ts | 1 + .../AuthenticationMessageComposer.ts | 32 +++++++++++++++++++ .../messages/outgoing/handshake/index.ts | 1 + .../parser/handshake/AuthenticationParser.ts | 27 ++++++++++++++++ .../messages/parser/handshake/index.ts | 1 + 9 files changed, 88 insertions(+) create mode 100644 src/nitro/communication/messages/incoming/handshake/AuthenticationEvent.ts create mode 100644 src/nitro/communication/messages/incoming/handshake/index.ts create mode 100644 src/nitro/communication/messages/outgoing/handshake/AuthenticationMessageComposer.ts create mode 100644 src/nitro/communication/messages/parser/handshake/AuthenticationParser.ts create mode 100644 src/nitro/communication/messages/parser/handshake/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index f57aeca9..535a97ba 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -49,6 +49,7 @@ import { GroupConfirmMemberRemoveEvent } from './messages/incoming/group/GroupCo import { GroupInformationEvent } from './messages/incoming/group/GroupInformationEvent'; import { GroupMembersEvent } from './messages/incoming/group/GroupMembersEvent'; import { GroupSettingsEvent } from './messages/incoming/group/GroupSettingsEvent'; +import { AuthenticationEvent } from './messages/incoming/handshake/AuthenticationEvent'; import { CallForHelpResultMessageEvent } from './messages/incoming/help/CallForHelpResultMessageEvent'; import { IncomingHeader } from './messages/incoming/IncomingHeader'; import { AchievementEvent } from './messages/incoming/inventory/achievements/AchievementEvent'; @@ -263,6 +264,7 @@ import { GroupSaveColorsComposer } from './messages/outgoing/group/GroupSaveColo import { GroupSaveInformationComposer } from './messages/outgoing/group/GroupSaveInformationComposer'; import { GroupSavePreferencesComposer } from './messages/outgoing/group/GroupSavePreferencesComposer'; import { GroupSettingsComposer } from './messages/outgoing/group/GroupSettingsComposer'; +import { AuthenticationMessageComposer } from './messages/outgoing/handshake/AuthenticationMessageComposer'; import { InfoRetrieveBaseMessageComposer } from './messages/outgoing/handshake/InfoRetrieveBaseMessageComposer'; import { SecurityTicketComposer } from './messages/outgoing/handshake/SecurityTicketComposer'; import { RequestBadgesComposer } from './messages/outgoing/inventory/badges/RequestBadgesComposer'; @@ -426,6 +428,9 @@ export class NitroMessages implements IMessageConfiguration private registerEvents(): void { + // AUTHENTICATION + this._events.set(IncomingHeader.AUTHENTICATION, AuthenticationEvent); + // AVAILABILITY this._events.set(IncomingHeader.AVAILABILITY_STATUS, AvailabilityStatusMessageEvent); this._events.set(IncomingHeader.GENERIC_ERROR, GenericErrorEvent); @@ -740,6 +745,9 @@ export class NitroMessages implements IMessageConfiguration private registerComposers(): void { + // AUTHENTICATION + this._composers.set(OutgoingHeader.AUTHENTICATION, AuthenticationMessageComposer); + // CATALOG this._composers.set(OutgoingHeader.CATALOG_MODE, CatalogModeComposer); this._composers.set(OutgoingHeader.CATALOG_PAGE, CatalogPageComposer); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index cc0e5958..1088c4f5 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -2,6 +2,7 @@ export class IncomingHeader { public static ACHIEVEMENT_LIST = 305; public static AUTHENTICATED = 2491; + public static AUTHENTICATION = -1; public static AVAILABILITY_STATUS = 2033; public static BUILDERS_CLUB_EXPIRED = 1452; public static CAMERA_PRICE = 3878; diff --git a/src/nitro/communication/messages/incoming/handshake/AuthenticationEvent.ts b/src/nitro/communication/messages/incoming/handshake/AuthenticationEvent.ts new file mode 100644 index 00000000..9583e58e --- /dev/null +++ b/src/nitro/communication/messages/incoming/handshake/AuthenticationEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { AuthenticationParser } from '../../parser/handshake/AuthenticationParser'; + +export class AuthenticationEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, AuthenticationParser); + } + + public getParser(): AuthenticationParser + { + return this.parser as AuthenticationParser; + } +} diff --git a/src/nitro/communication/messages/incoming/handshake/index.ts b/src/nitro/communication/messages/incoming/handshake/index.ts new file mode 100644 index 00000000..e05b5b36 --- /dev/null +++ b/src/nitro/communication/messages/incoming/handshake/index.ts @@ -0,0 +1 @@ +export * from './AuthenticationEvent'; diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 355ce787..c50e95b4 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -1,6 +1,7 @@ export class OutgoingHeader { public static ACHIEVEMENT_LIST = 219; + public static AUTHENTICATION = -1; public static BOT_CONFIGURATION = 1986; public static BOT_PICKUP = 3323; public static BOT_PLACE = 1592; diff --git a/src/nitro/communication/messages/outgoing/handshake/AuthenticationMessageComposer.ts b/src/nitro/communication/messages/outgoing/handshake/AuthenticationMessageComposer.ts new file mode 100644 index 00000000..d52d6cc5 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/handshake/AuthenticationMessageComposer.ts @@ -0,0 +1,32 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class AuthenticationMessageComposer implements IMessageComposer +{ + private _type: string; + private _data: string[]; + + constructor(type: string, keys: string[], values: string[]) + { + this._type = type; + + if(keys.length !== values.length) return; + + this._data = []; + + for(let i = 0; i < keys.length; i++) + { + this._data.push(keys[i]); + this._data.push(values[i]); + } + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/handshake/index.ts b/src/nitro/communication/messages/outgoing/handshake/index.ts index c7ed9a66..d4f561a0 100644 --- a/src/nitro/communication/messages/outgoing/handshake/index.ts +++ b/src/nitro/communication/messages/outgoing/handshake/index.ts @@ -1,2 +1,3 @@ +export * from './AuthenticationMessageComposer'; export * from './InfoRetrieveBaseMessageComposer'; export * from './SecurityTicketComposer'; diff --git a/src/nitro/communication/messages/parser/handshake/AuthenticationParser.ts b/src/nitro/communication/messages/parser/handshake/AuthenticationParser.ts new file mode 100644 index 00000000..c4dd3d1b --- /dev/null +++ b/src/nitro/communication/messages/parser/handshake/AuthenticationParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class AuthenticationParser implements IMessageParser +{ + private _sso: string; + + public flush(): boolean + { + this._sso = null; + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._sso = wrapper.readString(); + + return true; + } + + public get sso(): string + { + return this._sso; + } +} diff --git a/src/nitro/communication/messages/parser/handshake/index.ts b/src/nitro/communication/messages/parser/handshake/index.ts new file mode 100644 index 00000000..88f562dc --- /dev/null +++ b/src/nitro/communication/messages/parser/handshake/index.ts @@ -0,0 +1 @@ +export * from './AuthenticationParser'; From c7f479b641954cf0050f9103fc289cd59725bbd4 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Mon, 21 Jun 2021 11:49:16 -0300 Subject: [PATCH 094/155] Fix ModtoolRoomInfoParser field name --- .../messages/parser/modtool/ModtoolRoomInfoParser.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolRoomInfoParser.ts b/src/nitro/communication/messages/parser/modtool/ModtoolRoomInfoParser.ts index b710e0d3..bc45146b 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolRoomInfoParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModtoolRoomInfoParser.ts @@ -5,7 +5,7 @@ export class ModtoolRoomInfoParser implements IMessageParser { private _id: number; private _playerAmount: number; - private _owner: boolean; + private _ownerInRoom: boolean; private _ownerId: number; private _ownerName: string; private _bool: boolean; @@ -26,7 +26,7 @@ export class ModtoolRoomInfoParser implements IMessageParser this._id = wrapper.readInt(); this._playerAmount = wrapper.readInt(); - this._owner = wrapper.readBoolean(); + this._ownerInRoom = wrapper.readBoolean(); this._ownerId = wrapper.readInt(); this._ownerName = wrapper.readString(); this._bool = wrapper.readBoolean(); @@ -47,9 +47,9 @@ export class ModtoolRoomInfoParser implements IMessageParser return this._playerAmount; } - public get owner(): boolean + public get ownerInRoom(): boolean { - return this._owner; + return this._ownerInRoom; } public get ownerId(): number From c599e913496da67b9ee0cdfa5f9d5941dac3090a Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 03:15:04 -0500 Subject: [PATCH 095/155] cleaned stuff --- .../incoming/catalog/CatalogClubGiftsEvent.ts | 8 +- .../incoming/roomevents/TriggerDefinition.ts | 9 +-- ...ubGiftsParser.ts => ClubGiftInfoParser.ts} | 38 ++++----- .../catalog/MarketplaceItemStatsParser.ts | 79 +++++++++--------- .../messages/parser/catalog/index.ts | 2 +- .../MarketplaceOffersReceivedParser.ts | 39 +++++---- .../marketplace/MarketplaceOwnItemsParser.ts | 25 +++--- .../parser/catalog/utils/ClubGiftData.ts | 48 +++++++++++ ...tplaceOfferItem.ts => MarketPlaceOffer.ts} | 32 ++++---- .../catalog/utils/MarketplaceOfferData.ts | 20 ++--- .../catalog/utils/MarketplaceOwnItem.ts | 80 ------------------- .../parser/catalog/utils/_Str_5178.ts | 64 --------------- .../messages/parser/catalog/utils/index.ts | 5 +- .../room/object/logic/avatar/AvatarLogic.ts | 34 ++++---- .../object/visualization/data/PetSizeData.ts | 10 +-- .../visualization/pet/PetVisualization.ts | 52 ++++++------ .../visualization/pet/PetVisualizationData.ts | 16 ++-- 17 files changed, 221 insertions(+), 340 deletions(-) rename src/nitro/communication/messages/parser/catalog/{CatalogClubGiftsParser.ts => ClubGiftInfoParser.ts} (57%) create mode 100644 src/nitro/communication/messages/parser/catalog/utils/ClubGiftData.ts rename src/nitro/communication/messages/parser/catalog/utils/{MarketplaceOfferItem.ts => MarketPlaceOffer.ts} (58%) delete mode 100644 src/nitro/communication/messages/parser/catalog/utils/MarketplaceOwnItem.ts delete mode 100644 src/nitro/communication/messages/parser/catalog/utils/_Str_5178.ts diff --git a/src/nitro/communication/messages/incoming/catalog/CatalogClubGiftsEvent.ts b/src/nitro/communication/messages/incoming/catalog/CatalogClubGiftsEvent.ts index 29ae3bf7..0a963690 100644 --- a/src/nitro/communication/messages/incoming/catalog/CatalogClubGiftsEvent.ts +++ b/src/nitro/communication/messages/incoming/catalog/CatalogClubGiftsEvent.ts @@ -1,16 +1,16 @@ import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; -import { CatalogClubGiftsParser } from '../../parser/catalog/CatalogClubGiftsParser'; +import { ClubGiftInfoParser } from '../../parser/catalog/ClubGiftInfoParser'; export class CatalogClubGiftsEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, CatalogClubGiftsParser); + super(callBack, ClubGiftInfoParser); } - public getParser(): CatalogClubGiftsParser + public getParser(): ClubGiftInfoParser { - return this.parser as CatalogClubGiftsParser; + return this.parser as ClubGiftInfoParser; } } diff --git a/src/nitro/communication/messages/incoming/roomevents/TriggerDefinition.ts b/src/nitro/communication/messages/incoming/roomevents/TriggerDefinition.ts index 5d159426..10eec522 100644 --- a/src/nitro/communication/messages/incoming/roomevents/TriggerDefinition.ts +++ b/src/nitro/communication/messages/incoming/roomevents/TriggerDefinition.ts @@ -23,18 +23,13 @@ export class TriggerDefinition extends Triggerable } } - public get type(): number - { - return this._triggerConf; - } - public get code(): number { return this._triggerConf; } - public get _Str_21837(): number[] + public get conflictingActions(): number[] { return this._conflictingActions; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/catalog/CatalogClubGiftsParser.ts b/src/nitro/communication/messages/parser/catalog/ClubGiftInfoParser.ts similarity index 57% rename from src/nitro/communication/messages/parser/catalog/CatalogClubGiftsParser.ts rename to src/nitro/communication/messages/parser/catalog/ClubGiftInfoParser.ts index 2e1a2b40..56ae01a2 100644 --- a/src/nitro/communication/messages/parser/catalog/CatalogClubGiftsParser.ts +++ b/src/nitro/communication/messages/parser/catalog/ClubGiftInfoParser.ts @@ -1,15 +1,14 @@ import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; -import { CatalogClubOfferData } from './utils/CatalogClubOfferData'; import { CatalogPageOfferData } from './utils/CatalogPageOfferData'; -import { _Str_5178 } from './utils/_Str_5178'; +import { ClubGiftData } from './utils/ClubGiftData'; -export class CatalogClubGiftsParser implements IMessageParser +export class ClubGiftInfoParser implements IMessageParser { - private _daysUntilNextGift:number; - private _giftsAvailable:number; + private _daysUntilNextGift:number; + private _giftsAvailable:number; private _offers: CatalogPageOfferData[]; - private _Str_5759:Map; + private _giftData:Map; public flush(): boolean { @@ -22,28 +21,23 @@ export class CatalogClubGiftsParser implements IMessageParser if(!wrapper) return false; this._offers = []; - this._Str_5759 = new Map(); + this._giftData = new Map(); this._daysUntilNextGift = wrapper.readInt(); this._giftsAvailable = wrapper.readInt(); - let local2 = wrapper.readInt(); + const offerCount = wrapper.readInt(); - let local3 = 0; - - while(local3 < local2) + for(let i = 0; i < offerCount; i ++) { this._offers.push(new CatalogPageOfferData(wrapper)); - local3++; } - local2 = wrapper.readInt(); - local3 = 0; + const giftDataCount = wrapper.readInt(); - while(local3 < local2) + for(let i = 0; i < giftDataCount; i++) { - const item = new _Str_5178(wrapper); - this._Str_5759.set(item.offerId, item); - local3++; + const item = new ClubGiftData(wrapper); + this._giftData.set(item.offerId, item); } return true; @@ -69,16 +63,16 @@ export class CatalogClubGiftsParser implements IMessageParser this._giftsAvailable = gifts; } - public getOfferExtraData(offerId: number): _Str_5178 + public getOfferExtraData(offerId: number): ClubGiftData { if(!offerId) return null; - return this._Str_5759.get(offerId); + return this._giftData.get(offerId); } - public get _Str_24398():Map + public get giftData():Map { - return this._Str_5759; + return this._giftData; } } diff --git a/src/nitro/communication/messages/parser/catalog/MarketplaceItemStatsParser.ts b/src/nitro/communication/messages/parser/catalog/MarketplaceItemStatsParser.ts index f43354a0..25b5b897 100644 --- a/src/nitro/communication/messages/parser/catalog/MarketplaceItemStatsParser.ts +++ b/src/nitro/communication/messages/parser/catalog/MarketplaceItemStatsParser.ts @@ -3,53 +3,53 @@ import { IMessageParser } from '../../../../../core/communication/messages/IMess export class MarketplaceItemStatsParser implements IMessageParser { - private _Str_5049:number; - private _Str_10039:number; - private _Str_10803:number; - private _Str_8270:number[]; - private _Str_9670:number[]; - private _Str_8961:number[]; - private _Str_10894:number; - private _Str_10644:number; + private _averagePrice:number; + private _currentOfferCount:number; + private _historyLength:number; + private _dayOffsets:number[]; + private _averagePrices:number[]; + private _soldAmounts:number[]; + private _furniTypeId:number; + private _furniCategoryId:number; - public get _Str_3925():number + public get averagePrice():number { - return this._Str_5049; + return this._averagePrice; } - public get _Str_4121():number + public get offerCount():number { - return this._Str_10039; + return this._currentOfferCount; } - public get _Str_10461():number + public get historyLength():number { - return this._Str_10803; + return this._historyLength; } - public get _Str_9174():any[] + public get dayOffsets():any[] { - return this._Str_8270; + return this._dayOffsets; } - public get _Str_11365():any[] + public get averagePrices():any[] { - return this._Str_9670; + return this._averagePrices; } - public get _Str_11956():any[] + public get soldAmounts():any[] { - return this._Str_8961; + return this._soldAmounts; } - public get _Str_8798():number + public get furniTypeId():number { - return this._Str_10894; + return this._furniTypeId; } - public get _Str_9431():number + public get furniCategoryId():number { - return this._Str_10644; + return this._furniCategoryId; } public flush(): boolean @@ -61,23 +61,24 @@ export class MarketplaceItemStatsParser implements IMessageParser { if(!wrapper) return false; - this._Str_5049 = wrapper.readInt(); - this._Str_10039 = wrapper.readInt(); - this._Str_10803 = wrapper.readInt(); - const _local_2:number = wrapper.readInt(); - this._Str_8270 = []; - this._Str_9670 = []; - this._Str_8961 = []; - let _local_3 = 0; - while(_local_3 < _local_2) + this._averagePrice = wrapper.readInt(); + this._currentOfferCount = wrapper.readInt(); + this._historyLength = wrapper.readInt(); + + const count = wrapper.readInt(); + this._dayOffsets = []; + this._averagePrices = []; + this._soldAmounts = []; + + for(let i = 0; i < count; i++) { - this._Str_8270.push(wrapper.readInt()); - this._Str_9670.push(wrapper.readInt()); - this._Str_8961.push(wrapper.readInt()); - _local_3++; + this._dayOffsets.push(wrapper.readInt()); + this._averagePrices.push(wrapper.readInt()); + this._soldAmounts.push(wrapper.readInt()); } - this._Str_10644 = wrapper.readInt(); - this._Str_10894 = wrapper.readInt(); + + this._furniCategoryId = wrapper.readInt(); + this._furniTypeId = wrapper.readInt(); return true; } diff --git a/src/nitro/communication/messages/parser/catalog/index.ts b/src/nitro/communication/messages/parser/catalog/index.ts index dfe50c21..52ac4447 100644 --- a/src/nitro/communication/messages/parser/catalog/index.ts +++ b/src/nitro/communication/messages/parser/catalog/index.ts @@ -1,5 +1,4 @@ export * from './CatalogApproveNameResultParser'; -export * from './CatalogClubGiftsParser'; export * from './CatalogClubParser'; export * from './CatalogGiftConfigurationParser'; export * from './CatalogGiftUsernameUnavailableParser'; @@ -16,6 +15,7 @@ export * from './CatalogRedeemVoucherOkParser'; export * from './CatalogSearchParser'; export * from './CatalogSoldOutParser'; export * from './CatalogUpdatedParser'; +export * from './ClubGiftInfoParser'; export * from './marketplace'; export * from './MarketplaceConfigParser'; export * from './MarketplaceItemStatsParser'; diff --git a/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceOffersReceivedParser.ts b/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceOffersReceivedParser.ts index 11c4ee49..da062e80 100644 --- a/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceOffersReceivedParser.ts +++ b/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceOffersReceivedParser.ts @@ -1,23 +1,22 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { ObjectDataFactory } from '../../../../../room/object/data/ObjectDataFactory'; import { IObjectData } from '../../../../../room/object/data/IObjectData'; +import { ObjectDataFactory } from '../../../../../room/object/data/ObjectDataFactory'; import { LegacyDataType } from '../../../../../room/object/data/type/LegacyDataType'; -import { MarketplaceOwnItem } from '../utils/MarketplaceOwnItem'; -import { MarketplaceOfferItem } from '../utils/MarketplaceOfferItem'; +import { MarketplaceOffer } from '../utils/MarketPlaceOffer'; export class MarketplaceOffersReceivedParser implements IMessageParser { - private readonly _Str_8964 = 1; - private readonly _Str_13000 = 2; - private readonly _Str_14245 = 3; + private static readonly FURNITYPE_STUFF = 1; + private static readonly FURNITYPE_WALL = 2; + private static readonly FAKE_FURNITYPE_UNIQUE = 3; - private readonly _Str_18070 = 500; + private readonly MAX_LIST_LENGTH = 500; - private _offers: MarketplaceOfferItem[]; - private _Str_11687: number; + private _offers: MarketplaceOffer[]; + private _totalItemsFound: number; public flush(): boolean { @@ -33,9 +32,8 @@ export class MarketplaceOffersReceivedParser implements IMessageParser this._offers = []; const offerCount = wrapper.readInt(); - let i = 0; - while(i < offerCount) + for(let i = 0; i < offerCount; i++) { const offerId = wrapper.readInt(); const local3 = wrapper.readInt(); @@ -44,27 +42,27 @@ export class MarketplaceOffersReceivedParser implements IMessageParser let local5: number; let local6: string; let local7: IObjectData; - if(itemId === this._Str_8964) + if(itemId === MarketplaceOffersReceivedParser.FURNITYPE_STUFF) { local5 = wrapper.readInt(); local7 = this.getStuffData(wrapper); } else { - if(itemId == this._Str_13000) + if(itemId == MarketplaceOffersReceivedParser.FURNITYPE_WALL) { local5 = wrapper.readInt(); local6 = wrapper.readString(); } else { - if(itemId == this._Str_14245) + if(itemId == MarketplaceOffersReceivedParser.FAKE_FURNITYPE_UNIQUE) { local5 = wrapper.readInt(); local7 = ObjectDataFactory.getData(LegacyDataType.FORMAT_KEY); local7.uniqueNumber = wrapper.readInt(); local7.uniqueSeries = wrapper.readInt(); - itemId = this._Str_8964; + itemId = MarketplaceOffersReceivedParser.FURNITYPE_STUFF; } } } @@ -74,26 +72,25 @@ export class MarketplaceOffersReceivedParser implements IMessageParser const local10 = wrapper.readInt(); const local11 = wrapper.readInt(); - const offerItem = new MarketplaceOfferItem(offerId, local5, itemId, local6, local7, local8, local3, local9, local10, local11); - if(i < this._Str_18070) + const offerItem = new MarketplaceOffer(offerId, local5, itemId, local6, local7, local8, local3, local9, local10, local11); + if(i < this.MAX_LIST_LENGTH) { this._offers.push(offerItem); } - i++; } - this._Str_11687 = wrapper.readInt(); + this._totalItemsFound = wrapper.readInt(); return true; } - public get offers():MarketplaceOfferItem[] + public get offers():MarketplaceOffer[] { return this._offers; } public get totalItemsFound():number { - return this._Str_11687; + return this._totalItemsFound; } private getStuffData(wrapper: IMessageDataWrapper): IObjectData diff --git a/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceOwnItemsParser.ts b/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceOwnItemsParser.ts index d72d38fd..64c30ac3 100644 --- a/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceOwnItemsParser.ts +++ b/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceOwnItemsParser.ts @@ -1,16 +1,16 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { ObjectDataFactory } from '../../../../../room/object/data/ObjectDataFactory'; import { IObjectData } from '../../../../../room/object/data/IObjectData'; +import { ObjectDataFactory } from '../../../../../room/object/data/ObjectDataFactory'; import { LegacyDataType } from '../../../../../room/object/data/type/LegacyDataType'; -import { MarketplaceOwnItem } from '../utils/MarketplaceOwnItem'; +import { MarketplaceOffer } from '../utils/MarketPlaceOffer'; export class MarketplaceOwnItemsParser implements IMessageParser { - private static _Str_18070 = 500; - private _offers: MarketplaceOwnItem[]; - private _Str_11581: number; + private static MAX_LIST_LENGTH = 500; + private _offers: MarketplaceOffer[]; + private _creditsWaiting: number; public flush(): boolean @@ -25,11 +25,10 @@ export class MarketplaceOwnItemsParser implements IMessageParser if(!wrapper) return false; this._offers = []; - this._Str_11581 = wrapper.readInt(); // SoldPriceTotal + this._creditsWaiting = wrapper.readInt(); // SoldPriceTotal const offerCount = wrapper.readInt(); - let i = 0; - while(i < offerCount) + for(let i = 0; i < offerCount; i++) { const offerId = wrapper.readInt(); const status = wrapper.readInt(); @@ -63,27 +62,25 @@ export class MarketplaceOwnItemsParser implements IMessageParser const price = wrapper.readInt(); const local9 = wrapper.readInt(); const local10 = wrapper.readInt(); - const local13 = new MarketplaceOwnItem(offerId, furniId, furniType, extraData, stuffData, price, status, local9, local10); + const local13 = new MarketplaceOffer(offerId, furniId, furniType, extraData, stuffData, price, status, local9, local10); - if(i < MarketplaceOwnItemsParser._Str_18070) + if(i < MarketplaceOwnItemsParser.MAX_LIST_LENGTH) { this._offers.push(local13); } - i++; } - return true; } - public get offers():MarketplaceOwnItem[] + public get offers():MarketplaceOffer[] { return this._offers; } public get creditsWaiting():number { - return this._Str_11581; + return this._creditsWaiting; } private getStuffData(wrapper: IMessageDataWrapper): IObjectData diff --git a/src/nitro/communication/messages/parser/catalog/utils/ClubGiftData.ts b/src/nitro/communication/messages/parser/catalog/utils/ClubGiftData.ts new file mode 100644 index 00000000..b2268ec2 --- /dev/null +++ b/src/nitro/communication/messages/parser/catalog/utils/ClubGiftData.ts @@ -0,0 +1,48 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; + +export class ClubGiftData +{ + private _offerId:number; + private _isVip:boolean; + private _isSelectable:boolean; + private _daysRequired:number; + + constructor(wrapper: IMessageDataWrapper) + { + if(!wrapper) throw new Error('invalid_wrapper'); + + this.parse(wrapper); + } + + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._offerId = wrapper.readInt(); + this._isVip = wrapper.readBoolean(); + this._daysRequired = wrapper.readInt(); + this._isSelectable = wrapper.readBoolean(); + return true; + } + + public get offerId():number + { + return this._offerId; + } + + public get isVip():boolean + { + return this._isVip; + } + + public get isSelectable():boolean + { + return this._isSelectable; + } + + public get daysRequired():number + { + return this._daysRequired; + } +} diff --git a/src/nitro/communication/messages/parser/catalog/utils/MarketplaceOfferItem.ts b/src/nitro/communication/messages/parser/catalog/utils/MarketPlaceOffer.ts similarity index 58% rename from src/nitro/communication/messages/parser/catalog/utils/MarketplaceOfferItem.ts rename to src/nitro/communication/messages/parser/catalog/utils/MarketPlaceOffer.ts index 7599fa43..7ff8fc16 100644 --- a/src/nitro/communication/messages/parser/catalog/utils/MarketplaceOfferItem.ts +++ b/src/nitro/communication/messages/parser/catalog/utils/MarketPlaceOffer.ts @@ -1,6 +1,6 @@ -import { IObjectData } from '../../../../../room/object/data/IObjectData'; +import { IObjectData } from 'nitro-renderer/src/nitro/room/object/data/IObjectData'; -export class MarketplaceOfferItem +export class MarketplaceOffer { private readonly _offerId:number; private readonly _furniId:number; @@ -9,22 +9,22 @@ export class MarketplaceOfferItem private readonly _stuffData:IObjectData; private readonly _price:number; private readonly _status:number; - private readonly _Str_12399:number = -1; - private readonly _Str_5049:number; - private readonly _Str_4620:number; + private readonly _timeLeftMinutes:number = -1; + private readonly _averagePrice:number; + private readonly _offerCount:number; - constructor(offerId:number, furniId:number, _arg_3:number, extraData:string, stuffData:IObjectData, price:number, status:number, _arg_8:number, _arg_9:number, _arg_10:number=-1) + constructor(offerId:number, furniId:number, furniType:number, extraData:string, stuffData:IObjectData, price:number, status:number, timeLeftMinutes:number, averagePrice:number, offerCount:number=-1) { this._offerId = offerId; this._furniId = furniId; - this._furniType = _arg_3; + this._furniType = furniType; this._extraData = extraData; this._stuffData = stuffData; this._price = price; this._status = status; - this._Str_12399 = _arg_8; - this._Str_5049 = _arg_9; - this._Str_4620 = _arg_10; + this._timeLeftMinutes = timeLeftMinutes; + this._averagePrice = averagePrice; + this._offerCount = offerCount; } public get offerId():number @@ -62,19 +62,19 @@ export class MarketplaceOfferItem return this._status; } - public get _Str_5853():number + public get timeLeftMinutes():number { - return this._Str_12399; + return this._timeLeftMinutes; } - public get _Str_3925():number + public get averagePrice():number { - return this._Str_5049; + return this._averagePrice; } - public get _Str_4121():number + public get offerCount():number { - return this._Str_4620; + return this._offerCount; } public get isUniqueLimitedItem():boolean diff --git a/src/nitro/communication/messages/parser/catalog/utils/MarketplaceOfferData.ts b/src/nitro/communication/messages/parser/catalog/utils/MarketplaceOfferData.ts index 6c12353b..ee2b4d16 100644 --- a/src/nitro/communication/messages/parser/catalog/utils/MarketplaceOfferData.ts +++ b/src/nitro/communication/messages/parser/catalog/utils/MarketplaceOfferData.ts @@ -31,8 +31,6 @@ export class MarketplaceOfferData this._offerCount = offerCount; } - - public get offerId():number { return this._offerId; @@ -73,8 +71,7 @@ export class MarketplaceOfferData this._price = k; } - - public get _Str_3925():number + public get averagePrice():number { return this._averagePrice; } @@ -86,16 +83,15 @@ export class MarketplaceOfferData public set image(k:string) { - this._image = k; } - public set _Str_4774(k:number) + public set imageCallback(k:number) { this._imageCallback = k; } - public get _Str_4774():number + public get imageCallback():number { return this._imageCallback; } @@ -105,24 +101,22 @@ export class MarketplaceOfferData return this._status; } - public get _Str_5853():number + public get timeLeftMinutes():number { return this._timeLeftMinutes; } - public set _Str_5853(k:number) + public set timeLeftMinutes(k:number) { this._timeLeftMinutes = k; } - - - public get _Str_4121():number + public get offerCount():number { return this._offerCount; } - public set _Str_4121(k:number) + public set offerCount(k:number) { this._offerCount = k; } diff --git a/src/nitro/communication/messages/parser/catalog/utils/MarketplaceOwnItem.ts b/src/nitro/communication/messages/parser/catalog/utils/MarketplaceOwnItem.ts deleted file mode 100644 index 90812567..00000000 --- a/src/nitro/communication/messages/parser/catalog/utils/MarketplaceOwnItem.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { IObjectData } from '../../../../../room/object/data/IObjectData'; - -export class MarketplaceOwnItem -{ - private readonly _offerId:number; - private readonly _furniId:number; - private readonly _furniType:number; - private readonly _extraData:string; - private readonly _stuffData:IObjectData; - private readonly _price:number; - private readonly _status:number; - private readonly _Str_12399:number = -1; - private readonly _Str_5049:number; - private readonly _Str_4620:number; - - - constructor(offerId: number, furniId: number, furniType: number, extraData: string, stuffData: IObjectData, price: number, status: number, arg8: number, arg9: number, arg10:number = -1) - { - this._offerId = offerId; - this._furniId = furniId; - this._furniType = furniType; - this._extraData = extraData; - this._stuffData = stuffData; - this._price = price; - this._status = status; - this._Str_12399 = arg8; - this._Str_5049 = arg9; - this._Str_4620 = arg10; - } - - public get offerId():number - { - return this._offerId; - } - - public get furniId():number - { - return this._furniId; - } - - public get furniType():number - { - return this._furniType; - } - - public get extraData():string - { - return this._extraData; - } - - public get stuffData():IObjectData - { - return this._stuffData; - } - - public get price():number - { - return this._price; - } - - public get status():number - { - return this._status; - } - - public get _Str_5853():number - { - return this._Str_12399; - } - - public get _Str_3925():number - { - return this._Str_5049; - } - - public get _Str_4121():number - { - return this._Str_4620; - } -} diff --git a/src/nitro/communication/messages/parser/catalog/utils/_Str_5178.ts b/src/nitro/communication/messages/parser/catalog/utils/_Str_5178.ts deleted file mode 100644 index 71500196..00000000 --- a/src/nitro/communication/messages/parser/catalog/utils/_Str_5178.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; - -export class _Str_5178 -{ - private _Str_2507:number; - private _Str_6052:boolean; - private _Str_693:boolean; - private _Str_19803:number; - - constructor(wrapper: IMessageDataWrapper) - { - if(!wrapper) throw new Error('invalid_wrapper'); - - this.parse(wrapper); - } - - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - this._Str_2507 = wrapper.readInt(); - this._Str_6052 = wrapper.readBoolean(); - this._Str_19803 = wrapper.readInt(); - this._Str_693 = wrapper.readBoolean(); - return true; - } - - public get offerId():number - { - return this._Str_2507; - } - - public get _Str_12313():boolean - { - return this._Str_6052; - } - - public get isClubOnly(): boolean - { - return this._Str_6052; - } - public get isSelectable():boolean - { - return this._Str_693; - } - - public get _Str_21146():number - { - return this._Str_19803; - } - - public get availableInDays(): number - { - return this._Str_19803; - } - - public get isAvailable(): boolean - { - return this._Str_693; - } - - -} diff --git a/src/nitro/communication/messages/parser/catalog/utils/index.ts b/src/nitro/communication/messages/parser/catalog/utils/index.ts index 41e3c62f..49eeb66b 100644 --- a/src/nitro/communication/messages/parser/catalog/utils/index.ts +++ b/src/nitro/communication/messages/parser/catalog/utils/index.ts @@ -7,11 +7,10 @@ export * from './CatalogPageOfferData'; export * from './CatalogProductOfferData'; export * from './CatalogPurchaseData'; export * from './CatalogSearchData'; +export * from './ClubGiftData'; export * from './ICatalogLocalizationData'; export * from './ICatalogPageData'; export * from './ICatalogPageParser'; +export * from './MarketPlaceOffer'; export * from './MarketplaceOfferData'; -export * from './MarketplaceOfferItem'; -export * from './MarketplaceOwnItem'; export * from './SellablePetPaletteData'; -export * from './_Str_5178'; diff --git a/src/nitro/room/object/logic/avatar/AvatarLogic.ts b/src/nitro/room/object/logic/avatar/AvatarLogic.ts index 2930fc97..133c7a1d 100644 --- a/src/nitro/room/object/logic/avatar/AvatarLogic.ts +++ b/src/nitro/room/object/logic/avatar/AvatarLogic.ts @@ -36,11 +36,11 @@ export class AvatarLogic extends MovingObjectLogic { private static MAX_HAND_ID: number = 999999999; private static MAX_HAND_USE_ID: number = 999; - private static _Str_13364: number = 28; - private static _Str_8860: number = 500; - private static _Str_15351: number = 29; - private static _Str_13733: number = 184; - private static _Str_13094: number = 185; + private static EFFECT_TYPE_SPLASH: number = 28; + private static EFFECT_SPLASH_LENGTH: number = 500; + private static EFFECT_TYPE_SWIM: number = 29; + private static EFFECT_TYPE_SPLASH_DARK: number = 184; + private static EFFECT_TYPE_SWIM_DARK: number = 185; private _selected: boolean; private _reportedLocation: Vector3d; @@ -434,32 +434,32 @@ export class AvatarLogic extends MovingObjectLogic private updateAvatarEffect(effect: number, delay: number, model: IRoomObjectModel): void { - if(effect === AvatarLogic._Str_13364) + if(effect === AvatarLogic.EFFECT_TYPE_SPLASH) { - this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic._Str_8860); - this._newEffect = AvatarLogic._Str_15351; + this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic.EFFECT_SPLASH_LENGTH); + this._newEffect = AvatarLogic.EFFECT_TYPE_SWIM; } - else if(effect === AvatarLogic._Str_13733) + else if(effect === AvatarLogic.EFFECT_TYPE_SPLASH_DARK) { - this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic._Str_8860); - this._newEffect = AvatarLogic._Str_13094; + this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic.EFFECT_SPLASH_LENGTH); + this._newEffect = AvatarLogic.EFFECT_TYPE_SWIM_DARK; } - else if(model.getValue(RoomObjectVariable.FIGURE_EFFECT) === AvatarLogic._Str_15351) + else if(model.getValue(RoomObjectVariable.FIGURE_EFFECT) === AvatarLogic.EFFECT_TYPE_SWIM) { - this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic._Str_8860); + this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic.EFFECT_SPLASH_LENGTH); this._newEffect = effect; - effect = AvatarLogic._Str_13364; + effect = AvatarLogic.EFFECT_TYPE_SPLASH; } - else if(model.getValue(RoomObjectVariable.FIGURE_EFFECT) === AvatarLogic._Str_13094) + else if(model.getValue(RoomObjectVariable.FIGURE_EFFECT) === AvatarLogic.EFFECT_TYPE_SWIM_DARK) { - this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic._Str_8860); + this._effectChangeTimeStamp = (Nitro.instance.time + AvatarLogic.EFFECT_SPLASH_LENGTH); this._newEffect = effect; - effect = AvatarLogic._Str_13733; + effect = AvatarLogic.EFFECT_TYPE_SPLASH_DARK; } else if(delay === 0) diff --git a/src/nitro/room/object/visualization/data/PetSizeData.ts b/src/nitro/room/object/visualization/data/PetSizeData.ts index 4fae2e71..48ac9436 100644 --- a/src/nitro/room/object/visualization/data/PetSizeData.ts +++ b/src/nitro/room/object/visualization/data/PetSizeData.ts @@ -65,7 +65,7 @@ export class PetSizeData extends AnimationSizeData return this._posturesToAnimations.get(posture); } - public _Str_18284(k: string): boolean + public getGestureDisabled(k: string): boolean { if(k === 'ded') return true; @@ -79,7 +79,7 @@ export class PetSizeData extends AnimationSizeData return this._gesturesToAnimations.get(gesture); } - public _Str_14207(k: number, _arg_2: boolean): string + public animationToPosture(k: number, _arg_2: boolean): string { if((k >= 0) && (k < this._posturesToAnimations.size)) { @@ -100,7 +100,7 @@ export class PetSizeData extends AnimationSizeData return (_arg_2) ? this._defaultPosture : null; } - public _Str_17844(index: number): string + public animationToGesture(index: number): string { if((index >= 0) && (index < this._gesturesToAnimations.size)) { @@ -121,7 +121,7 @@ export class PetSizeData extends AnimationSizeData return null; } - public _Str_17976(k: number): string + public getGestureForAnimationId(k: number): string { for(const _local_2 of this._gesturesToAnimations.keys()) { @@ -140,4 +140,4 @@ export class PetSizeData extends AnimationSizeData { return this._gesturesToAnimations.size; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/pet/PetVisualization.ts b/src/nitro/room/object/visualization/pet/PetVisualization.ts index 78d3a45c..f6a0bfdd 100644 --- a/src/nitro/room/object/visualization/pet/PetVisualization.ts +++ b/src/nitro/room/object/visualization/pet/PetVisualization.ts @@ -18,12 +18,12 @@ export class PetVisualization extends FurnitureAnimatedVisualization private static HEAD: string = 'head'; private static SADDLE: string = 'saddle'; private static HAIR: string = 'hair'; - private static _Str_7490: number = 1; - private static _Str_13277: number = 1000; + private static ADDITIONAL_SPRITE_COUNT: number = 1; + private static EXPERIENCE_BUBBLE_VISIBLE_IN_MS: number = 1000; private static PET_EXPERIENCE_BUBBLE_PNG: string = 'pet_experience_bubble_png'; - private static _Str_16082: number = 0; - private static _Str_17658: number = 1; - private static _Str_16677: number = 2; + private static POSTURE_ANIMATION_INDEX: number = 0; + private static GESTURE_ANIMATION_INDEX: number = 1; + private static ANIMATION_INDEX_COUNT: number = 2; protected _data: PetVisualizationData; @@ -73,7 +73,7 @@ export class PetVisualization extends FurnitureAnimatedVisualization this._previousAnimationDirection = -1; this._animationStates = []; - while(this._animationStates.length < PetVisualization._Str_16677) this._animationStates.push(new AnimationStateData()); + while(this._animationStates.length < PetVisualization.ANIMATION_INDEX_COUNT) this._animationStates.push(new AnimationStateData()); } public initialize(data: IObjectVisualizationData): boolean @@ -130,7 +130,7 @@ export class PetVisualization extends FurnitureAnimatedVisualization // _local_16 = this._animationData._Str_17398(_Str_3289); // if (_local_16 > 0) // { - // _local_4 = this._animationData._Str_14207(_Str_3289, (_local_6 % _local_16), true); + // _local_4 = this._animationData.animationToPosture(_Str_3289, (_local_6 % _local_16), true); // _local_5 = null; // } // } @@ -140,7 +140,7 @@ export class PetVisualization extends FurnitureAnimatedVisualization // _local_17 = this._animationData._Str_16869(_Str_3289); // if (_local_17 > 0) // { - // _local_5 = this._animationData._Str_17844(_Str_3289, (_local_7 % _local_17)); + // _local_5 = this._animationData.animationToGesture(_Str_3289, (_local_7 % _local_17)); // } // } // this._Str_14314(_local_4, _local_5); @@ -227,29 +227,29 @@ export class PetVisualization extends FurnitureAnimatedVisualization { this._posture = posture; - this._Str_16058(PetVisualization._Str_16082, this._data.postureToAnimation(this._scale, posture)); + this.setAnimationForIndex(PetVisualization.POSTURE_ANIMATION_INDEX, this._data.postureToAnimation(this._scale, posture)); } - if(this._data._Str_18284(this._scale, posture)) gesture = null; + if(this._data.getGestureDisabled(this._scale, posture)) gesture = null; if(gesture !== this._gesture) { this._gesture = gesture; - this._Str_16058(PetVisualization._Str_17658, this._data.gestureToAnimation(this._scale, gesture)); + this.setAnimationForIndex(PetVisualization.GESTURE_ANIMATION_INDEX, this._data.gestureToAnimation(this._scale, gesture)); } } - private _Str_22634(k: number): AnimationStateData + private getAnimationStateData(k: number): AnimationStateData { if((k >= 0) && (k < this._animationStates.length)) return this._animationStates[k]; return null; } - private _Str_16058(k: number, _arg_2: number): void + private setAnimationForIndex(k: number, _arg_2: number): void { - const animationStateData = this._Str_22634(k); + const animationStateData = this.getAnimationStateData(k); if(animationStateData) { @@ -301,7 +301,7 @@ export class PetVisualization extends FurnitureAnimatedVisualization { if(AnimationData.isTransitionFromAnimation(stateData.animationId) || AnimationData.isTransitionToAnimation(stateData.animationId)) { - this._Str_16058(index, stateData.animationAfterTransitionId); + this.setAnimationForIndex(index, stateData.animationAfterTransitionId); animationOver = false; } @@ -319,17 +319,17 @@ export class PetVisualization extends FurnitureAnimatedVisualization protected getSpriteAssetName(scale: number, layerId: number): string { - if(this._headOnly && this._Str_24824(layerId)) return null; + if(this._headOnly && this.isNonHeadSprite(layerId)) return null; if(this._isRiding && this._parser3(layerId)) return null; const totalSprites = this.totalSprites; - if(layerId < (totalSprites - PetVisualization._Str_7490)) + if(layerId < (totalSprites - PetVisualization.ADDITIONAL_SPRITE_COUNT)) { const validScale = this.getValidSize(scale); - if(layerId < (totalSprites - (1 + PetVisualization._Str_7490))) + if(layerId < (totalSprites - (1 + PetVisualization.ADDITIONAL_SPRITE_COUNT))) { if(layerId >= FurnitureVisualizationData.LAYER_LETTERS.length) return null; @@ -348,7 +348,7 @@ export class PetVisualization extends FurnitureAnimatedVisualization protected getLayerColor(scale: number, layerId: number, colorId: number): number { - if(layerId < (this.totalSprites - PetVisualization._Str_7490)) return this._color; + if(layerId < (this.totalSprites - PetVisualization.ADDITIONAL_SPRITE_COUNT)) return this._color; return 0xFFFFFF; } @@ -406,7 +406,7 @@ export class PetVisualization extends FurnitureAnimatedVisualization private getDirection(scale: number, layerId: number): number { - if(!this._Str_23973(layerId)) return this._direction; + if(!this.isHeadSprite(layerId)) return this._direction; return this._data.getValidDirection(scale, this._headDirection); } @@ -432,7 +432,7 @@ export class PetVisualization extends FurnitureAnimatedVisualization return super.getFrameNumber(scale, layerId); } - private _Str_23973(layerId: number): boolean + private isHeadSprite(layerId: number): boolean { if(this._headSprites[layerId] === undefined) { @@ -446,11 +446,11 @@ export class PetVisualization extends FurnitureAnimatedVisualization return this._headSprites[layerId]; } - private _Str_24824(layerId: number): boolean + private isNonHeadSprite(layerId: number): boolean { if(this._nonHeadSprites[layerId] === undefined) { - if(layerId < (this.totalSprites - (1 + PetVisualization._Str_7490))) + if(layerId < (this.totalSprites - (1 + PetVisualization.ADDITIONAL_SPRITE_COUNT))) { const tag = this._data.getLayerTag(this._scale, DirectionData.USE_DEFAULT_DIRECTION, layerId); @@ -515,7 +515,7 @@ export class PetVisualization extends FurnitureAnimatedVisualization protected getAdditionalLayerCount(): number { - return super.getAdditionalLayerCount() + PetVisualization._Str_7490; + return super.getAdditionalLayerCount() + PetVisualization.ADDITIONAL_SPRITE_COUNT; } protected setLayerCount(count: number): void @@ -551,9 +551,9 @@ export class PetVisualization extends FurnitureAnimatedVisualization part = part.split('@')[0]; - posture = this._data._Str_14207(scale, (parseInt(part) / 100), false); + posture = this._data.animationToPosture(scale, (parseInt(part) / 100), false); - if(!posture) posture = this._data._Str_17976(scale, (parseInt(part) / 100)); + if(!posture) posture = this._data.getGestureForAnimationId(scale, (parseInt(part) / 100)); } return posture; diff --git a/src/nitro/room/object/visualization/pet/PetVisualizationData.ts b/src/nitro/room/object/visualization/pet/PetVisualizationData.ts index 100fe79a..d62d5f13 100644 --- a/src/nitro/room/object/visualization/pet/PetVisualizationData.ts +++ b/src/nitro/room/object/visualization/pet/PetVisualizationData.ts @@ -57,13 +57,13 @@ export class PetVisualizationData extends FurnitureAnimatedVisualizationData return size.postureToAnimation(posture); } - public _Str_18284(scale: number, posture: string): boolean + public getGestureDisabled(scale: number, posture: string): boolean { const size = this.getSizeData(scale) as PetSizeData; if(!size) return false; - return size._Str_18284(posture); + return size.getGestureDisabled(posture); } public gestureToAnimation(scale: number, gesture: string): number @@ -75,31 +75,31 @@ export class PetVisualizationData extends FurnitureAnimatedVisualizationData return size.gestureToAnimation(gesture); } - public _Str_14207(scale: number, index: number, useDefault: boolean): string + public animationToPosture(scale: number, index: number, useDefault: boolean): string { const size = this.getSizeData(scale) as PetSizeData; if(!size) return null; - return size._Str_14207(index, useDefault); + return size.animationToPosture(index, useDefault); } - public _Str_17844(scale: number, index: number): string + public animationToGesture(scale: number, index: number): string { const size = this.getSizeData(scale) as PetSizeData; if(!size) return null; - return size._Str_17844(index); + return size.animationToGesture(index); } - public _Str_17976(scale: number, _arg_2: number): string + public getGestureForAnimationId(scale: number, _arg_2: number): string { const size = this.getSizeData(scale) as PetSizeData; if(!size) return null; - return size._Str_17976(_arg_2); + return size.getGestureForAnimationId(_arg_2); } public totalPostures(scale: number): number From 436905d5b62f6d94505b01c7c505ad5c421c487a Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 03:55:45 -0500 Subject: [PATCH 096/155] cleaned PresentOpenedParser --- src/nitro/communication/NitroMessages.ts | 4 +- .../furni/gifts/FurnitureGiftOpenedEvent.ts | 17 ----- .../furni/gifts/PresentOpenedMessageEvent.ts | 16 +++++ .../incoming/inventory/furni/gifts/index.ts | 2 +- .../WiredRewardResultMessageEvent.ts | 6 +- .../parser/catalog/utils/MarketPlaceOffer.ts | 2 +- .../furniture/FurnitureGiftOpenedParser.ts | 72 ------------------- .../furniture/PresentOpenedMessageParser.ts | 71 ++++++++++++++++++ .../parser/inventory/furniture/index.ts | 2 +- .../parser/room/unit/UserMessageData.ts | 4 +- .../events/SessionDataPreferencesEvent.ts | 8 +-- .../session/handler/RoomPresentHandler.ts | 8 +-- 12 files changed, 105 insertions(+), 107 deletions(-) delete mode 100644 src/nitro/communication/messages/incoming/inventory/furni/gifts/FurnitureGiftOpenedEvent.ts create mode 100644 src/nitro/communication/messages/incoming/inventory/furni/gifts/PresentOpenedMessageEvent.ts delete mode 100644 src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts create mode 100644 src/nitro/communication/messages/parser/inventory/furniture/PresentOpenedMessageParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 535a97ba..0b2677f2 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -69,7 +69,7 @@ import { FurnitureListEvent } from './messages/incoming/inventory/furni/Furnitur import { FurnitureListInvalidateEvent } from './messages/incoming/inventory/furni/FurnitureListInvalidateEvent'; import { FurnitureListRemovedEvent } from './messages/incoming/inventory/furni/FurnitureListRemovedEvent'; import { FurniturePostItPlacedEvent } from './messages/incoming/inventory/furni/FurniturePostItPlacedEvent'; -import { FurnitureGiftOpenedEvent } from './messages/incoming/inventory/furni/gifts/FurnitureGiftOpenedEvent'; +import { PresentOpenedMessageEvent } from './messages/incoming/inventory/furni/gifts/PresentOpenedMessageEvent'; import { MarketplaceItemPostedEvent } from './messages/incoming/inventory/marketplace/MarketplaceItemPostedEvent'; import { MarketplaceSellItemEvent } from './messages/incoming/inventory/marketplace/MarketplaceSellItemEvent'; import { PetAddedToInventoryEvent } from './messages/incoming/inventory/pets/PetAddedToInventoryEvent'; @@ -696,7 +696,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.MESSENGER_RELATIONSHIPS, UserRelationshipsEvent); // GIFTS - this._events.set(IncomingHeader.GIFT_OPENED, FurnitureGiftOpenedEvent); + this._events.set(IncomingHeader.GIFT_OPENED, PresentOpenedMessageEvent); // INVENTORY this._events.set(IncomingHeader.GIFT_RECEIVER_NOT_FOUND, CatalogGiftUsernameUnavailableEvent); diff --git a/src/nitro/communication/messages/incoming/inventory/furni/gifts/FurnitureGiftOpenedEvent.ts b/src/nitro/communication/messages/incoming/inventory/furni/gifts/FurnitureGiftOpenedEvent.ts deleted file mode 100644 index b95a8467..00000000 --- a/src/nitro/communication/messages/incoming/inventory/furni/gifts/FurnitureGiftOpenedEvent.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { IMessageEvent } from '../../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../../core/communication/messages/MessageEvent'; -import { FurnitureGiftOpenedParser } from '../../../../parser/inventory/furniture/FurnitureGiftOpenedParser'; - -// see _Str_9591 -export class FurnitureGiftOpenedEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, FurnitureGiftOpenedParser); - } - - public getParser(): FurnitureGiftOpenedParser - { - return this.parser as FurnitureGiftOpenedParser; - } -} diff --git a/src/nitro/communication/messages/incoming/inventory/furni/gifts/PresentOpenedMessageEvent.ts b/src/nitro/communication/messages/incoming/inventory/furni/gifts/PresentOpenedMessageEvent.ts new file mode 100644 index 00000000..f1237c15 --- /dev/null +++ b/src/nitro/communication/messages/incoming/inventory/furni/gifts/PresentOpenedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../../core/communication/messages/MessageEvent'; +import { PresentOpenedMessageParser } from '../../../../parser/inventory/furniture/PresentOpenedMessageParser'; + +export class PresentOpenedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, PresentOpenedMessageParser); + } + + public getParser(): PresentOpenedMessageParser + { + return this.parser as PresentOpenedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/inventory/furni/gifts/index.ts b/src/nitro/communication/messages/incoming/inventory/furni/gifts/index.ts index 4e252833..349aca77 100644 --- a/src/nitro/communication/messages/incoming/inventory/furni/gifts/index.ts +++ b/src/nitro/communication/messages/incoming/inventory/furni/gifts/index.ts @@ -1 +1 @@ -export * from './FurnitureGiftOpenedEvent'; +export * from './PresentOpenedMessageEvent'; diff --git a/src/nitro/communication/messages/incoming/roomevents/WiredRewardResultMessageEvent.ts b/src/nitro/communication/messages/incoming/roomevents/WiredRewardResultMessageEvent.ts index d803f69f..7792f7e2 100644 --- a/src/nitro/communication/messages/incoming/roomevents/WiredRewardResultMessageEvent.ts +++ b/src/nitro/communication/messages/incoming/roomevents/WiredRewardResultMessageEvent.ts @@ -4,8 +4,8 @@ import { WiredRewardResultMessageParser } from '../../parser/roomevents/WiredRew export class WiredRewardResultMessageEvent extends MessageEvent implements IMessageEvent { - public static _Str_18436: number = 6; - public static _Str_17787: number = 7; + public static PRODUCT_DONATED_CODE: number = 6; + public static BADGE_DONATED_CODE: number = 7; constructor(callBack: Function) { @@ -16,4 +16,4 @@ export class WiredRewardResultMessageEvent extends MessageEvent implements IMess { return this.parser as WiredRewardResultMessageParser; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/catalog/utils/MarketPlaceOffer.ts b/src/nitro/communication/messages/parser/catalog/utils/MarketPlaceOffer.ts index 7ff8fc16..872d292d 100644 --- a/src/nitro/communication/messages/parser/catalog/utils/MarketPlaceOffer.ts +++ b/src/nitro/communication/messages/parser/catalog/utils/MarketPlaceOffer.ts @@ -1,4 +1,4 @@ -import { IObjectData } from 'nitro-renderer/src/nitro/room/object/data/IObjectData'; +import { IObjectData } from '../../../../../room/object/data/IObjectData'; export class MarketplaceOffer { diff --git a/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts b/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts deleted file mode 100644 index d20b82f0..00000000 --- a/src/nitro/communication/messages/parser/inventory/furniture/FurnitureGiftOpenedParser.ts +++ /dev/null @@ -1,72 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; - -// see _Str_8104 -export class FurnitureGiftOpenedParser implements IMessageParser -{ - private _Str_2625: string; - private _Str_2825: number; - private _Str_2570: string; - private _Str_3054: number; - private _Str_3970: string; - private _Str_3224: boolean; - private _Str_10229: string; - - public flush(): boolean - { - this._Str_2625 = ''; - this._Str_2825 = 0; - this._Str_2570 = ''; - - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - this._Str_2625 = wrapper.readString(); - this._Str_2825 = wrapper.readInt(); - this._Str_2570 = wrapper.readString(); - this._Str_3054 = wrapper.readInt(); - this._Str_3970 = wrapper.readString(); - this._Str_3224 = wrapper.readBoolean(); - this._Str_10229 = wrapper.readString(); - return true; - } - - public get _Str_2887():string - { - return this._Str_2625; - } - - public get classId():number - { - return this._Str_2825; - } - - public get productCode():string - { - return this._Str_2570; - } - - public get placedItemId():number - { - return this._Str_3054; - } - - public get placedItemType():string - { - return this._Str_3970; - } - - public get placedInRoom():boolean - { - return this._Str_3224; - } - - public get petFigureString():string - { - return this._Str_10229; - } -} diff --git a/src/nitro/communication/messages/parser/inventory/furniture/PresentOpenedMessageParser.ts b/src/nitro/communication/messages/parser/inventory/furniture/PresentOpenedMessageParser.ts new file mode 100644 index 00000000..ff21cb18 --- /dev/null +++ b/src/nitro/communication/messages/parser/inventory/furniture/PresentOpenedMessageParser.ts @@ -0,0 +1,71 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; + +export class PresentOpenedMessageParser implements IMessageParser +{ + private _itemType: string; + private _classId: number; + private _productCode: string; + private _placedItemId: number; + private _placedItemType: string; + private _placedInRoom: boolean; + private _petFigureString: string; + + public flush(): boolean + { + this._itemType = ''; + this._classId = 0; + this._productCode = ''; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._itemType = wrapper.readString(); + this._classId = wrapper.readInt(); + this._productCode = wrapper.readString(); + this._placedItemId = wrapper.readInt(); + this._placedItemType = wrapper.readString(); + this._placedInRoom = wrapper.readBoolean(); + this._petFigureString = wrapper.readString(); + return true; + } + + public get itemType():string + { + return this._itemType; + } + + public get classId():number + { + return this._classId; + } + + public get productCode():string + { + return this._productCode; + } + + public get placedItemId():number + { + return this._placedItemId; + } + + public get placedItemType():string + { + return this._placedItemType; + } + + public get placedInRoom():boolean + { + return this._placedInRoom; + } + + public get petFigureString():string + { + return this._petFigureString; + } +} diff --git a/src/nitro/communication/messages/parser/inventory/furniture/index.ts b/src/nitro/communication/messages/parser/inventory/furniture/index.ts index cc0fe661..b274870f 100644 --- a/src/nitro/communication/messages/parser/inventory/furniture/index.ts +++ b/src/nitro/communication/messages/parser/inventory/furniture/index.ts @@ -1,7 +1,7 @@ -export * from './FurnitureGiftOpenedParser'; export * from './FurnitureListAddOrUpdateParser'; export * from './FurnitureListInvalidateParser'; export * from './FurnitureListParser'; export * from './FurnitureListRemovedParser'; export * from './FurniturePostItPlacedParser'; +export * from './PresentOpenedMessageParser'; export * from './utils'; diff --git a/src/nitro/communication/messages/parser/room/unit/UserMessageData.ts b/src/nitro/communication/messages/parser/room/unit/UserMessageData.ts index 50052c72..e1a8629f 100644 --- a/src/nitro/communication/messages/parser/room/unit/UserMessageData.ts +++ b/src/nitro/communication/messages/parser/room/unit/UserMessageData.ts @@ -39,7 +39,7 @@ export class UserMessageData this._roomIndex = k; } - public _Str_4710(): void + public setReadOnly(): void { this._isReadOnly = true; } @@ -409,4 +409,4 @@ export class UserMessageData this._isModerator = k; } } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/SessionDataPreferencesEvent.ts b/src/nitro/session/events/SessionDataPreferencesEvent.ts index 7fa94849..ae1fbaa6 100644 --- a/src/nitro/session/events/SessionDataPreferencesEvent.ts +++ b/src/nitro/session/events/SessionDataPreferencesEvent.ts @@ -2,19 +2,19 @@ export class SessionDataPreferencesEvent extends NitroEvent { - public static APUE_UPDATED: string = 'APUE_UPDATED'; + public static UPDATED: string = 'APUE_UPDATED'; private _uiFlags: number; constructor(k: number) { - super(SessionDataPreferencesEvent.APUE_UPDATED); + super(SessionDataPreferencesEvent.UPDATED); this._uiFlags = k; } - public get _Str_8444(): number + public get uiFlags(): number { return this._uiFlags; } -} \ No newline at end of file +} diff --git a/src/nitro/session/handler/RoomPresentHandler.ts b/src/nitro/session/handler/RoomPresentHandler.ts index 56892ee7..f24e68b2 100644 --- a/src/nitro/session/handler/RoomPresentHandler.ts +++ b/src/nitro/session/handler/RoomPresentHandler.ts @@ -1,5 +1,5 @@ import { IConnection } from '../../../core/communication/connections/IConnection'; -import { FurnitureGiftOpenedEvent } from '../../communication/messages/incoming/inventory/furni/gifts/FurnitureGiftOpenedEvent'; +import { PresentOpenedMessageEvent } from '../../communication/messages/incoming/inventory/furni/gifts/PresentOpenedMessageEvent'; import { RoomSessionPresentEvent } from '../events/RoomSessionPresentEvent'; import { IRoomHandlerListener } from '../IRoomHandlerListener'; import { BaseHandler } from './BaseHandler'; @@ -12,10 +12,10 @@ export class RoomPresentHandler extends BaseHandler if(!connection) return; - connection.addMessageEvent(new FurnitureGiftOpenedEvent(this.onFurnitureGiftOpenedEvent.bind(this))); + connection.addMessageEvent(new PresentOpenedMessageEvent(this.onFurnitureGiftOpenedEvent.bind(this))); } - private onFurnitureGiftOpenedEvent(event: FurnitureGiftOpenedEvent): void + private onFurnitureGiftOpenedEvent(event: PresentOpenedMessageEvent): void { if(!event) return; @@ -28,7 +28,7 @@ export class RoomPresentHandler extends BaseHandler if(!session) return; if(this.listener && this.listener.events) this.listener.events.dispatchEvent( - new RoomSessionPresentEvent(RoomSessionPresentEvent.RSPE_PRESENT_OPENED, session, parser.classId, parser._Str_2887, + new RoomSessionPresentEvent(RoomSessionPresentEvent.RSPE_PRESENT_OPENED, session, parser.classId, parser.itemType, parser.productCode, parser.placedItemId, parser.placedItemType, parser.placedInRoom, parser.petFigureString)); } From 39b9c2b969e3709db78f46e9a51d378289fc54b7 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 04:24:32 -0500 Subject: [PATCH 097/155] cleaned some variables --- .../logic/furniture/FurnitureScoreLogic.ts | 4 +- .../furniture/FurnitureSoundBlockLogic.ts | 12 ++-- .../furniture/FurnitureVoteCounterLogic.ts | 24 ++++---- .../furniture/FurnitureBottleVisualization.ts | 6 +- .../FurnitureDynamicThumbnailVisualization.ts | 4 +- .../FurnitureHabboWheelVisualization.ts | 6 +- .../FurnitureQueueTileVisualization.ts | 16 ++--- .../FurnitureThumbnailVisualization.ts | 60 +++++++++---------- .../FurnitureValRandomizerVisualization.ts | 6 +- .../FurnitureVoteMajorityVisualization.ts | 2 +- 10 files changed, 70 insertions(+), 70 deletions(-) diff --git a/src/nitro/room/object/logic/furniture/FurnitureScoreLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureScoreLogic.ts index a9cf6297..01fde8ff 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureScoreLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureScoreLogic.ts @@ -6,7 +6,7 @@ import { FurnitureLogic } from './FurnitureLogic'; export class FurnitureScoreLogic extends FurnitureLogic { private static UPDATE_INTERVAL: number = 50; - private static _Str_5967: number = 3000; + private static MAX_UPDATE_TIME: number = 3000; private _score: number; private _scoreIncreaser: number; @@ -40,7 +40,7 @@ export class FurnitureScoreLogic extends FurnitureLogic if(difference < 0) difference = -(difference); - if((difference * FurnitureScoreLogic.UPDATE_INTERVAL) > FurnitureScoreLogic._Str_5967) this._scoreIncreaser = (FurnitureScoreLogic._Str_5967 / difference); + if((difference * FurnitureScoreLogic.UPDATE_INTERVAL) > FurnitureScoreLogic.MAX_UPDATE_TIME) this._scoreIncreaser = (FurnitureScoreLogic.MAX_UPDATE_TIME / difference); else this._scoreIncreaser = FurnitureScoreLogic.UPDATE_INTERVAL; this._scoreTimer = Nitro.instance.time; diff --git a/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts index 6a719c88..8edaa255 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureSoundBlockLogic.ts @@ -77,7 +77,7 @@ export class FurnitureSoundBlockLogic extends FurnitureMultiStateLogic if(this._state === FurnitureSoundBlockLogic.STATE_UNINITIALIZED && model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT) === 1) { this._lastLocZ = location.z; - this.eventDispatcher.dispatchEvent(new RoomObjectSamplePlaybackEvent(RoomObjectSamplePlaybackEvent.ROOM_OBJECT_INITIALIZED, this.object, this._sampleId, this._Str_17428(location.z))); + this.eventDispatcher.dispatchEvent(new RoomObjectSamplePlaybackEvent(RoomObjectSamplePlaybackEvent.ROOM_OBJECT_INITIALIZED, this.object, this._sampleId, this.getPitchForHeight(location.z))); } if(this._state !== FurnitureSoundBlockLogic.STATE_UNINITIALIZED && model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT) === 1) @@ -85,14 +85,14 @@ export class FurnitureSoundBlockLogic extends FurnitureMultiStateLogic if(this._lastLocZ !== location.z) { this._lastLocZ = location.z; - this.eventDispatcher.dispatchEvent(new RoomObjectSamplePlaybackEvent(RoomObjectSamplePlaybackEvent.CHANGE_PITCH, this.object, this._sampleId, this._Str_17428(location.z))); + this.eventDispatcher.dispatchEvent(new RoomObjectSamplePlaybackEvent(RoomObjectSamplePlaybackEvent.CHANGE_PITCH, this.object, this._sampleId, this.getPitchForHeight(location.z))); } } if(this._state !== FurnitureSoundBlockLogic.STATE_UNINITIALIZED && message.state !== this._state) { - this._Str_18183(location.z); + this.playSoundAt(location.z); } this._state = message.state; @@ -107,19 +107,19 @@ export class FurnitureSoundBlockLogic extends FurnitureMultiStateLogic model.setValue(RoomObjectVariable.FURNITURE_SOUNDBLOCK_RELATIVE_ANIMATION_SPEED, 1); } - private _Str_18183(k: number): void + private playSoundAt(k: number): void { const model = this.object && this.object.model; if(!model) return; - const _local_2: number = this._Str_17428(k); + const _local_2: number = this.getPitchForHeight(k); model.setValue(RoomObjectVariable.FURNITURE_SOUNDBLOCK_RELATIVE_ANIMATION_SPEED, _local_2); this.eventDispatcher.dispatchEvent(new RoomObjectSamplePlaybackEvent(RoomObjectSamplePlaybackEvent.PLAY_SAMPLE, this.object, this._sampleId, _local_2)); } - private _Str_17428(k: number): number + private getPitchForHeight(k: number): number { let _local_2: number = (k * 2); if(_local_2 > FurnitureSoundBlockLogic.HIGHEST_SEMITONE) diff --git a/src/nitro/room/object/logic/furniture/FurnitureVoteCounterLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureVoteCounterLogic.ts index a5c9422e..578cbf36 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureVoteCounterLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureVoteCounterLogic.ts @@ -8,7 +8,7 @@ import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; export class FurnitureVoteCounterLogic extends FurnitureMultiStateLogic { private static UPDATE_INTERVAL: number = 33; - private static _Str_5967: number = 1000; + private static MAX_UPDATE_TIME: number = 1000; private _total: number; private _lastUpdate: number; @@ -33,11 +33,11 @@ export class FurnitureVoteCounterLogic extends FurnitureMultiStateLogic if(!stuffData) return; - this._Str_24990(stuffData.result); + this.updateTotal(stuffData.result); } } - private _Str_24990(k: number): void + private updateTotal(k: number): void { this._total = k; @@ -50,13 +50,13 @@ export class FurnitureVoteCounterLogic extends FurnitureMultiStateLogic return; } - if(this._total !== this._Str_8221) + if(this._total !== this.currentTotal) { - const difference = Math.abs((this._total - this._Str_8221)); + const difference = Math.abs((this._total - this.currentTotal)); - if((difference * FurnitureVoteCounterLogic.UPDATE_INTERVAL) > FurnitureVoteCounterLogic._Str_5967) + if((difference * FurnitureVoteCounterLogic.UPDATE_INTERVAL) > FurnitureVoteCounterLogic.MAX_UPDATE_TIME) { - this._interval = (FurnitureVoteCounterLogic._Str_5967 / difference); + this._interval = (FurnitureVoteCounterLogic.MAX_UPDATE_TIME / difference); } else { @@ -73,24 +73,24 @@ export class FurnitureVoteCounterLogic extends FurnitureMultiStateLogic if(this.object) { - if((this._Str_8221 !== this._total) && (time >= (this._lastUpdate + this._interval))) + if((this.currentTotal !== this._total) && (time >= (this._lastUpdate + this._interval))) { const _local_2 = (time - this._lastUpdate); let _local_3 = (_local_2 / this._interval); let _local_4 = 1; - if(this._total < this._Str_8221) _local_4 = -1; + if(this._total < this.currentTotal) _local_4 = -1; - if(_local_3 > (_local_4 * (this._total - this._Str_8221))) _local_3 = (_local_4 * (this._total - this._Str_8221)); + if(_local_3 > (_local_4 * (this._total - this.currentTotal))) _local_3 = (_local_4 * (this._total - this.currentTotal)); - this.object.model.setValue(RoomObjectVariable.FURNITURE_VOTE_COUNTER_COUNT, (this._Str_8221 + (_local_4 * _local_3))); + this.object.model.setValue(RoomObjectVariable.FURNITURE_VOTE_COUNTER_COUNT, (this.currentTotal + (_local_4 * _local_3))); this._lastUpdate = (time - (_local_2 - (_local_3 * this._interval))); } } } - private get _Str_8221(): number + private get currentTotal(): number { return this.object.model.getValue(RoomObjectVariable.FURNITURE_VOTE_COUNTER_COUNT); } diff --git a/src/nitro/room/object/visualization/furniture/FurnitureBottleVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureBottleVisualization.ts index a223f9b6..6a7ecaaf 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureBottleVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureBottleVisualization.ts @@ -4,7 +4,7 @@ export class FurnitureBottleVisualization extends FurnitureAnimatedVisualization { private static ANIMATION_ID_OFFSET_SLOW1: number = 20; private static ANIMATION_ID_OFFSET_SLOW2: number = 9; - private static _Str_4186: number = -1; + private static ANIMATION_ID_ROLL: number = -1; private _stateQueue: number[]; private _running: boolean; @@ -26,7 +26,7 @@ export class FurnitureBottleVisualization extends FurnitureAnimatedVisualization this._running = true; this._stateQueue = []; - this._stateQueue.push(FurnitureBottleVisualization._Str_4186); + this._stateQueue.push(FurnitureBottleVisualization.ANIMATION_ID_ROLL); return; } @@ -59,4 +59,4 @@ export class FurnitureBottleVisualization extends FurnitureAnimatedVisualization return super.updateAnimation(scale); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/furniture/FurnitureDynamicThumbnailVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureDynamicThumbnailVisualization.ts index a54b3195..9d431547 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureDynamicThumbnailVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureDynamicThumbnailVisualization.ts @@ -35,12 +35,12 @@ export class FurnitureDynamicThumbnailVisualization extends FurnitureThumbnailVi texture.baseTexture.scaleMode = SCALE_MODES.LINEAR; - this._Str_6645(texture); + this.setThumbnailImages(texture); }; } else { - this._Str_6645(null); + this.setThumbnailImages(null); } } } diff --git a/src/nitro/room/object/visualization/furniture/FurnitureHabboWheelVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureHabboWheelVisualization.ts index 81bbe1bc..3c3f7b8e 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureHabboWheelVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureHabboWheelVisualization.ts @@ -5,7 +5,7 @@ export class FurnitureHabboWheelVisualization extends FurnitureAnimatedVisualiza private static ANIMATION_ID_OFFSET_SLOW1: number = 10; private static ANIMATION_ID_OFFSET_SLOW2: number = 20; private static _Str_7627: number = 31; - private static _Str_4186: number = 32; + private static ANIMATION_ID_ROLL: number = 32; private _stateQueue: number[]; private _running: boolean; @@ -28,7 +28,7 @@ export class FurnitureHabboWheelVisualization extends FurnitureAnimatedVisualiza this._stateQueue = []; this._stateQueue.push(FurnitureHabboWheelVisualization._Str_7627); - this._stateQueue.push(FurnitureHabboWheelVisualization._Str_4186); + this._stateQueue.push(FurnitureHabboWheelVisualization.ANIMATION_ID_ROLL); return; } @@ -61,4 +61,4 @@ export class FurnitureHabboWheelVisualization extends FurnitureAnimatedVisualiza return super.updateAnimation(scale); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/furniture/FurnitureQueueTileVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureQueueTileVisualization.ts index ea30a559..df47fc52 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureQueueTileVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureQueueTileVisualization.ts @@ -2,10 +2,10 @@ import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization export class FurnitureQueueTileVisualization extends FurnitureAnimatedVisualization { - private static _Str_4186: number = 3; - private static _Str_18395: number = 2; - private static _Str_15915: number = 1; - private static _Str_16054: number = 15; + private static ANIMATION_ID_ROLL: number = 3; + private static ANIMATION_ID_ROLL_ONCE: number = 2; + private static ANIMATION_ID_NORMAL: number = 1; + private static ANIMATION_DURATION: number = 15; private _stateQueue: number[]; private _animationCounter: number; @@ -20,12 +20,12 @@ export class FurnitureQueueTileVisualization extends FurnitureAnimatedVisualizat protected setAnimation(animationId: number): void { - if(animationId === FurnitureQueueTileVisualization._Str_18395) + if(animationId === FurnitureQueueTileVisualization.ANIMATION_ID_ROLL_ONCE) { this._stateQueue = []; - this._stateQueue.push(FurnitureQueueTileVisualization._Str_15915); + this._stateQueue.push(FurnitureQueueTileVisualization.ANIMATION_ID_NORMAL); - this._animationCounter = FurnitureQueueTileVisualization._Str_16054; + this._animationCounter = FurnitureQueueTileVisualization.ANIMATION_DURATION; } return super.setAnimation(animationId); @@ -47,4 +47,4 @@ export class FurnitureQueueTileVisualization extends FurnitureAnimatedVisualizat { return true; } -} \ 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 0971f7c2..3a4813ec 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureThumbnailVisualization.ts @@ -7,61 +7,61 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat { protected static THUMBNAIL: string = 'THUMBNAIL'; - private _Str_22237: string; - private _Str_10040: Texture; - private _Str_21698: number; - private _Str_16232: boolean; + private _thumbnailAssetNameNormal: string; + private _thumbnailImageNormal: Texture; + private _thumbnailDirection: number; + private _thumbnailChanged: boolean; constructor() { super(); - this._Str_22237 = null; - this._Str_10040 = null; - this._Str_21698 = -1; - this._Str_16232 = false; + this._thumbnailAssetNameNormal = null; + this._thumbnailImageNormal = null; + this._thumbnailDirection = -1; + this._thumbnailChanged = false; } - public get _Str_23660(): boolean + public get hasThumbnailImage(): boolean { - return !(this._Str_10040 == null); + return !(this._thumbnailImageNormal == null); } - public _Str_6645(k: Texture): void + public setThumbnailImages(k: Texture): void { - this._Str_10040 = k; - this._Str_16232 = true; + this._thumbnailImageNormal = k; + this._thumbnailChanged = true; } protected updateModel(scale: number): boolean { const flag = super.updateModel(scale); - if(!this._Str_16232 && (this._Str_21698 === this.direction)) return flag; + if(!this._thumbnailChanged && (this._thumbnailDirection === this.direction)) return flag; - this._Str_25236(); + this.refreshThumbnail(); return true; } - private _Str_25236(): void + private refreshThumbnail(): void { if(this.asset == null) return; - if(this._Str_10040) + if(this._thumbnailImageNormal) { - this._Str_20857(this._Str_10040, 64); + this.addThumbnailAsset(this._thumbnailImageNormal, 64); } else { - this.asset.disposeAsset(this._Str_15493(64)); + this.asset.disposeAsset(this.getThumbnailAssetName(64)); } - this._Str_16232 = false; - this._Str_21698 = this.direction; + this._thumbnailChanged = false; + this._thumbnailDirection = this.direction; } - private _Str_20857(k: Texture, scale: number): void + private addThumbnailAsset(k: Texture, scale: number): void { let layerId = 0; @@ -74,8 +74,8 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat if(asset) { - const _local_6 = this._Str_25562(k, asset); - const _local_7 = this._Str_15493(scale); + const _local_6 = this.generateTransformedThumbnail(k, asset); + const _local_7 = this.getThumbnailAssetName(scale); this.asset.disposeAsset(_local_7); this.asset.addAsset(_local_7, _local_6, true, asset.offsetX, asset.offsetY, false, false); @@ -88,7 +88,7 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat } } - private _Str_25562(texture: Texture, asset: IGraphicAsset): Texture + private generateTransformedThumbnail(texture: Texture, asset: IGraphicAsset): Texture { const _local_3 = 1.1; const matrix = new Matrix(); @@ -131,19 +131,19 @@ export class FurnitureThumbnailVisualization extends FurnitureAnimatedVisualizat protected getSpriteAssetName(scale: number, layerId: number): string { - if(this._Str_10040 && (this.getLayerTag(scale, this.direction, layerId) === FurnitureThumbnailVisualization.THUMBNAIL)) return this._Str_15493(scale); + if(this._thumbnailImageNormal && (this.getLayerTag(scale, this.direction, layerId) === FurnitureThumbnailVisualization.THUMBNAIL)) return this.getThumbnailAssetName(scale); return super.getSpriteAssetName(scale, layerId); } - protected _Str_15493(scale: number): string + protected getThumbnailAssetName(scale: number): string { - this._Str_22237 = this._Str_12961(this.object.id, 64); + this._thumbnailAssetNameNormal = this.getFullThumbnailAssetName(this.object.id, 64); - return this._Str_22237; + return this._thumbnailAssetNameNormal; } - protected _Str_12961(k: number, _arg_2: number): string + protected getFullThumbnailAssetName(k: number, _arg_2: number): string { return [this._type, k, 'thumb', _arg_2].join('_'); } diff --git a/src/nitro/room/object/visualization/furniture/FurnitureValRandomizerVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureValRandomizerVisualization.ts index 610620b0..c2eb8cc0 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureValRandomizerVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureValRandomizerVisualization.ts @@ -5,7 +5,7 @@ export class FurnitureValRandomizerVisualization extends FurnitureAnimatedVisual private static ANIMATION_ID_OFFSET_SLOW1: number = 20; private static ANIMATION_ID_OFFSET_SLOW2: number = 10; private static _Str_7627: number = 31; - private static _Str_4186: number = 32; + private static ANIMATION_ID_ROLL: number = 32; private static _Str_11236: number = 30; private _stateQueue: number[]; @@ -31,7 +31,7 @@ export class FurnitureValRandomizerVisualization extends FurnitureAnimatedVisual this._stateQueue = []; this._stateQueue.push(FurnitureValRandomizerVisualization._Str_7627); - this._stateQueue.push(FurnitureValRandomizerVisualization._Str_4186); + this._stateQueue.push(FurnitureValRandomizerVisualization.ANIMATION_ID_ROLL); return; } @@ -73,4 +73,4 @@ export class FurnitureValRandomizerVisualization extends FurnitureAnimatedVisual return super.updateAnimation(scale); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/furniture/FurnitureVoteMajorityVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureVoteMajorityVisualization.ts index 60681cda..9434465c 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureVoteMajorityVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureVoteMajorityVisualization.ts @@ -42,4 +42,4 @@ export class FurnitureVoteMajorityVisualization extends FurnitureAnimatedVisuali return super.getLayerAlpha(scale, direction, layerId); } -} \ No newline at end of file +} From 8fb1ff898a2efa20f741d32fc99e2caabb779aa7 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 04:52:35 -0500 Subject: [PATCH 098/155] cleaned petdata --- .../RoomDimmerPresetsMessageParser.ts | 8 +++---- .../messages/parser/room/pet/PetInfoParser.ts | 12 +++++----- .../FurnitureVoteMajorityVisualization.ts | 6 ++--- src/nitro/session/RoomPetData.ts | 16 ++++++------- .../events/RoomSessionDimmerPresetsEvent.ts | 8 +++---- .../events/RoomSessionWordQuizEvent.ts | 24 +++++++++---------- .../handler/RoomDimmerPresetsHandler.ts | 14 +++++------ src/nitro/session/handler/RoomUsersHandler.ts | 2 +- 8 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts b/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts index abb8aa93..06d4075b 100644 --- a/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts +++ b/src/nitro/communication/messages/parser/room/furniture/RoomDimmerPresetsMessageParser.ts @@ -12,19 +12,19 @@ export class RoomDimmerPresetsMessageParser implements IMessageParser this._presets = []; } - public get _Str_10888(): number + public get presetCount(): number { return this._presets.length; } - public get _Str_6226(): number + public get selectedPresetId(): number { return this._selectedPresetId; } - public _Str_14989(k: number): MoodlightFromServer + public getPreset(k: number): MoodlightFromServer { - if((k < 0) || (k >= this._Str_10888)) return null; + if((k < 0) || (k >= this.presetCount)) return null; return this._presets[k]; } diff --git a/src/nitro/communication/messages/parser/room/pet/PetInfoParser.ts b/src/nitro/communication/messages/parser/room/pet/PetInfoParser.ts index 8c088687..56a08beb 100644 --- a/src/nitro/communication/messages/parser/room/pet/PetInfoParser.ts +++ b/src/nitro/communication/messages/parser/room/pet/PetInfoParser.ts @@ -26,7 +26,7 @@ export class PetInfoParser implements IMessageParser private _maximumTimeToLive: number; private _remainingTimeToLive: number; private _remainingGrowTime: number; - private _Str_4460: number[]; + private _skillTresholds: number[]; private _publiclyRideable: number; private _unknownRarity: number; private _publiclyBreedable: boolean; @@ -34,7 +34,7 @@ export class PetInfoParser implements IMessageParser public flush(): boolean { this._id = -1; - this._Str_4460 = []; + this._skillTresholds = []; return true; } @@ -65,12 +65,12 @@ export class PetInfoParser implements IMessageParser while(total > 0) { - this._Str_4460.push(wrapper.readInt()); + this._skillTresholds.push(wrapper.readInt()); total--; } - this._Str_4460.sort(); + this._skillTresholds.sort(); this._publiclyRideable = wrapper.readInt(); this._breedable = wrapper.readBoolean(); this._fullyGrown = wrapper.readBoolean(); @@ -199,9 +199,9 @@ export class PetInfoParser implements IMessageParser return this._remainingGrowTime; } - public get _Str_3307(): number[] + public get skillTresholds(): number[] { - return this._Str_4460; + return this._skillTresholds; } public get publiclyRideable(): number diff --git a/src/nitro/room/object/visualization/furniture/FurnitureVoteMajorityVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureVoteMajorityVisualization.ts index 9434465c..4bb9ddd1 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureVoteMajorityVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureVoteMajorityVisualization.ts @@ -6,8 +6,8 @@ export class FurnitureVoteMajorityVisualization extends FurnitureAnimatedVisuali private static ONES_SPRITE: string = 'ones_sprite'; private static TENS_SPRITE: string = 'tens_sprite'; private static HUNDREDS_SPRITE: string = 'hundreds_sprite'; - private static _Str_16109: number[] = [-1, 1]; - private static _Str_17618: number = -1; + private static HIDE_RESULTS_STATES: number[] = [-1, 1]; + private static HIDE_RESULTS_VALUE: number = -1; protected getFrameNumber(scale: number, layerId: number): number { @@ -27,7 +27,7 @@ export class FurnitureVoteMajorityVisualization extends FurnitureAnimatedVisuali { const result = this.object.model.getValue(RoomObjectVariable.FURNITURE_VOTE_MAJORITY_RESULT); - if(((!(FurnitureVoteMajorityVisualization._Str_16109.indexOf(this.object.getState(0)) === -1)) || (result === FurnitureVoteMajorityVisualization._Str_17618))) + if(((!(FurnitureVoteMajorityVisualization.HIDE_RESULTS_STATES.indexOf(this.object.getState(0)) === -1)) || (result === FurnitureVoteMajorityVisualization.HIDE_RESULTS_VALUE))) { const tag = this.getLayerTag(scale, direction, layerId); diff --git a/src/nitro/session/RoomPetData.ts b/src/nitro/session/RoomPetData.ts index f99550cc..49e1afbe 100644 --- a/src/nitro/session/RoomPetData.ts +++ b/src/nitro/session/RoomPetData.ts @@ -17,7 +17,7 @@ private _saddle: boolean; private _rider: boolean; private _breedable: boolean; - private _Str_4460: number[]; + private _skillTresholds: number[]; private _publiclyRideable: number; private _fullyGrown: boolean; private _dead: boolean; @@ -26,7 +26,7 @@ private _remainingGrowTime: number; private _rarityLevel: number; private _publiclyBreedable: boolean; - private _Str_24910: number = 7; + private _adultLevel: number = 7; public get id(): number { @@ -188,14 +188,14 @@ this._rider = k; } - public get _Str_3307(): number[] + public get skillTresholds(): number[] { - return this._Str_4460; + return this._skillTresholds; } - public set _Str_3307(k: number[]) + public set skillTresholds(k: number[]) { - this._Str_4460 = k; + this._skillTresholds = k; } public get publiclyRideable(): number @@ -288,8 +288,8 @@ this._publiclyBreedable = k; } - public get _Str_20651(): number + public get adultLevel(): number { - return this._Str_24910; + return this._adultLevel; } } diff --git a/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts b/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts index dbeb0751..dc6ccf9f 100644 --- a/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts +++ b/src/nitro/session/events/RoomSessionDimmerPresetsEvent.ts @@ -4,7 +4,7 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionDimmerPresetsEvent extends RoomSessionEvent { - public static RSDPE_PRESETS: string = 'RSDPE_PRESETS'; + public static ROOM_DIMMER_PRESETS: string = 'RSDPE_PRESETS'; private _selectedPresetId: number = 0; private _presets: RoomSessionDimmerPresetsEventPresetItem[]; @@ -16,7 +16,7 @@ export class RoomSessionDimmerPresetsEvent extends RoomSessionEvent this._presets = []; } - public get _Str_10888(): number + public get presetCount(): number { return this._presets.length; } @@ -31,13 +31,13 @@ export class RoomSessionDimmerPresetsEvent extends RoomSessionEvent this._selectedPresetId = k; } - public _Str_17287(k: number, _arg_2: number, _arg_3: number, _arg_4: number): void + public storePreset(k: number, _arg_2: number, _arg_3: number, _arg_4: number): void { const _local_5:RoomSessionDimmerPresetsEventPresetItem = new RoomSessionDimmerPresetsEventPresetItem(k, _arg_2, _arg_3, _arg_4); this._presets[(k - 1)] = _local_5; } - public _Str_14989(k: number):RoomSessionDimmerPresetsEventPresetItem + public getPreset(k: number):RoomSessionDimmerPresetsEventPresetItem { if(((k < 0) || (k >= this._presets.length))) { diff --git a/src/nitro/session/events/RoomSessionWordQuizEvent.ts b/src/nitro/session/events/RoomSessionWordQuizEvent.ts index 268a5b62..b287188e 100644 --- a/src/nitro/session/events/RoomSessionWordQuizEvent.ts +++ b/src/nitro/session/events/RoomSessionWordQuizEvent.ts @@ -3,9 +3,9 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionWordQuizEvent extends RoomSessionEvent { - public static RWPUW_NEW_QUESTION: string = 'RWPUW_NEW_QUESTION'; - public static RWPUW_QUESION_FINSIHED: string = 'RWPUW_QUESION_FINSIHED'; - public static RWPUW_QUESTION_ANSWERED: string = 'RWPUW_QUESTION_ANSWERED'; + public static QUESTION: string = 'RWPUW_NEW_QUESTION'; + public static FINISHED: string = 'RWPUW_QUESION_FINSIHED'; + public static ANSWERED: string = 'RWPUW_QUESTION_ANSWERED'; private _id: number = -1; private _pollType: string = null; @@ -29,32 +29,32 @@ export class RoomSessionWordQuizEvent extends RoomSessionEvent return this._id; } - public get _Str_5302(): string + public get pollType(): string { return this._pollType; } - public set _Str_5302(k: string) + public set pollType(k: string) { this._pollType = k; } - public get _Str_5213(): number + public get pollId(): number { return this._pollId; } - public set _Str_5213(k: number) + public set pollId(k: number) { this._pollId = k; } - public get _Str_3218(): number + public get questionId(): number { return this._questionId; } - public set _Str_3218(k: number) + public set questionId(k: number) { this._questionId = k; } @@ -99,13 +99,13 @@ export class RoomSessionWordQuizEvent extends RoomSessionEvent this._value = k; } - public get _Str_4036(): Map + public get answerCounts(): Map { return this._answerCounts; } - public set _Str_4036(k: Map) + public set answerCounts(k: Map) { this._answerCounts = k; } -} \ No newline at end of file +} diff --git a/src/nitro/session/handler/RoomDimmerPresetsHandler.ts b/src/nitro/session/handler/RoomDimmerPresetsHandler.ts index c2eab628..3a087bdf 100644 --- a/src/nitro/session/handler/RoomDimmerPresetsHandler.ts +++ b/src/nitro/session/handler/RoomDimmerPresetsHandler.ts @@ -10,10 +10,10 @@ export class RoomDimmerPresetsHandler extends BaseHandler { super(connection, listener); - connection.addMessageEvent(new RoomDimmerPresetsEvent(this._Str_25786.bind(this))); + connection.addMessageEvent(new RoomDimmerPresetsEvent(this.onRoomDimmerPresets.bind(this))); } - private _Str_25786(k: RoomDimmerPresetsEvent): void + private onRoomDimmerPresets(k: RoomDimmerPresetsEvent): void { if(!k) return; @@ -25,19 +25,19 @@ export class RoomDimmerPresetsHandler extends BaseHandler if(!session) return; - const event = new RoomSessionDimmerPresetsEvent(RoomSessionDimmerPresetsEvent.RSDPE_PRESETS, session); + const event = new RoomSessionDimmerPresetsEvent(RoomSessionDimmerPresetsEvent.ROOM_DIMMER_PRESETS, session); - event.selectedPresetId = parser._Str_6226; + event.selectedPresetId = parser.selectedPresetId; let i = 0; - while(i < parser._Str_10888) + while(i < parser.presetCount) { - const preset = parser._Str_14989(i); + const preset = parser.getPreset(i); if(preset) { - event._Str_17287(preset.id, preset.type, preset.color, preset.intensity); + event.storePreset(preset.id, preset.type, preset.color, preset.intensity); } i++; diff --git a/src/nitro/session/handler/RoomUsersHandler.ts b/src/nitro/session/handler/RoomUsersHandler.ts index 7b0e3ed7..33815e9c 100644 --- a/src/nitro/session/handler/RoomUsersHandler.ts +++ b/src/nitro/session/handler/RoomUsersHandler.ts @@ -237,7 +237,7 @@ export class RoomUsersHandler extends BaseHandler petData.fullyGrown = parser.fullyGrown; petData.rarityLevel = parser.rarityLevel; petData.dead = parser.dead; - petData._Str_3307 = parser._Str_3307; + petData.skillTresholds = parser.skillTresholds; petData.publiclyRideable = parser.publiclyRideable; petData.maximumTimeToLive = parser.maximumTimeToLive; petData.remainingTimeToLive = parser.remainingTimeToLive; From 56c60c3e297659012c181d71c252681e3941863b Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 05:17:38 -0500 Subject: [PATCH 099/155] cleaned pet parsers --- .../pets/NestBreedingSuccessParser.ts | 34 +++++++++++++++++++ ...tr_7523.ts => PetBreedingMessageParser.ts} | 30 ++++++++-------- .../parser/inventory/pets/_Str_9220.ts | 34 ------------------- .../messages/parser/inventory/pets/index.ts | 4 +-- .../RoomSessionNestBreedingSuccessEvent.ts | 10 +++--- .../events/RoomSessionPetBreedingEvent.ts | 10 +++--- .../events/RoomSessionPetLevelUpdateEvent.ts | 8 ++--- .../events/RoomSessionPetStatusUpdateEvent.ts | 16 ++++----- 8 files changed, 73 insertions(+), 73 deletions(-) create mode 100644 src/nitro/communication/messages/parser/inventory/pets/NestBreedingSuccessParser.ts rename src/nitro/communication/messages/parser/inventory/pets/{_Str_7523.ts => PetBreedingMessageParser.ts} (52%) delete mode 100644 src/nitro/communication/messages/parser/inventory/pets/_Str_9220.ts diff --git a/src/nitro/communication/messages/parser/inventory/pets/NestBreedingSuccessParser.ts b/src/nitro/communication/messages/parser/inventory/pets/NestBreedingSuccessParser.ts new file mode 100644 index 00000000..795aea44 --- /dev/null +++ b/src/nitro/communication/messages/parser/inventory/pets/NestBreedingSuccessParser.ts @@ -0,0 +1,34 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; + +export class NestBreedingSuccessParser implements IMessageParser +{ + private _rarityCategory: number; + private _petId: number; + + public flush(): boolean + { + this._petId = -1; + this._rarityCategory = -1; + + return true; + } + + public parse(k: IMessageDataWrapper): boolean + { + this._petId = k.readInt(); + this._rarityCategory = k.readInt(); + + return true; + } + + public get rarityCategory(): number + { + return this._rarityCategory; + } + + public get petId(): number + { + return this._petId; + } +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/_Str_7523.ts b/src/nitro/communication/messages/parser/inventory/pets/PetBreedingMessageParser.ts similarity index 52% rename from src/nitro/communication/messages/parser/inventory/pets/_Str_7523.ts rename to src/nitro/communication/messages/parser/inventory/pets/PetBreedingMessageParser.ts index 8d3c0fa6..33aa8db0 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/_Str_7523.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/PetBreedingMessageParser.ts @@ -1,21 +1,21 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -export class _Str_7523 implements IMessageParser +export class PetBreedingMessageParser implements IMessageParser { - public static _Str_8664: number = 1; - public static _Str_9186: number = 2; - public static _Str_22195: number = 3; + public static STATE_CANCEL: number = 1; + public static STATE_ACCEPT: number = 2; + public static STATE_REQUEST: number = 3; private _state: number; - private _Str_6614: number; - private _Str_6649: number; + private _ownPetId: number; + private _otherPetId: number; public flush(): boolean { this._state = 0; - this._Str_6614 = 0; - this._Str_6649 = 0; + this._ownPetId = 0; + this._otherPetId = 0; return true; } @@ -25,8 +25,8 @@ export class _Str_7523 implements IMessageParser if(!wrapper) return false; this._state = wrapper.readInt(); - this._Str_6614 = wrapper.readInt(); - this._Str_6649 = wrapper.readInt(); + this._ownPetId = wrapper.readInt(); + this._otherPetId = wrapper.readInt(); return true; } @@ -36,13 +36,13 @@ export class _Str_7523 implements IMessageParser return this._state; } - public get _Str_7440(): number + public get ownPetId(): number { - return this._Str_6614; + return this._ownPetId; } - public get _Str_7663(): number + public get otherPetId(): number { - return this._Str_6649; + return this._otherPetId; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/_Str_9220.ts b/src/nitro/communication/messages/parser/inventory/pets/_Str_9220.ts deleted file mode 100644 index 611c28c9..00000000 --- a/src/nitro/communication/messages/parser/inventory/pets/_Str_9220.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; - -export class _Str_9220 implements IMessageParser -{ - private _Str_5792: number; - private _Str_2388: number; - - public flush(): boolean - { - this._Str_2388 = -1; - this._Str_5792 = -1; - - return true; - } - - public parse(k: IMessageDataWrapper): boolean - { - this._Str_2388 = k.readInt(); - this._Str_5792 = k.readInt(); - - return true; - } - - public get _Str_16731(): number - { - return this._Str_5792; - } - - public get _Str_2508(): number - { - return this._Str_2388; - } -} \ No newline at end of file diff --git a/src/nitro/communication/messages/parser/inventory/pets/index.ts b/src/nitro/communication/messages/parser/inventory/pets/index.ts index 662abe0c..ad0f5a19 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/index.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/index.ts @@ -1,5 +1,7 @@ +export * from './NestBreedingSuccessParser'; export * from './PetAddedToInventoryParser'; export * from './PetBoughtNotificationMessageParser'; +export * from './PetBreedingMessageParser'; export * from './PetData'; export * from './PetFigureDataParser'; export * from './PetInventoryParser'; @@ -7,5 +9,3 @@ export * from './PetRemovedFromInventoryParser'; export * from './_Str_6256'; export * from './_Str_6719'; export * from './_Str_7486'; -export * from './_Str_7523'; -export * from './_Str_9220'; diff --git a/src/nitro/session/events/RoomSessionNestBreedingSuccessEvent.ts b/src/nitro/session/events/RoomSessionNestBreedingSuccessEvent.ts index 1e4294d1..b7798efa 100644 --- a/src/nitro/session/events/RoomSessionNestBreedingSuccessEvent.ts +++ b/src/nitro/session/events/RoomSessionNestBreedingSuccessEvent.ts @@ -3,26 +3,26 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionNestBreedingSuccessEvent extends RoomSessionEvent { - public static RSPFUE_NEST_BREEDING_SUCCESS: string = 'RSPFUE_NEST_BREEDING_SUCCESS'; + public static NEST_BREEDING_SUCCESS: string = 'RSPFUE_NEST_BREEDING_SUCCESS'; private _rarityCategory: number; private _petId: number; constructor(k: IRoomSession, _arg_2: number, _arg_3: number) { - super(RoomSessionNestBreedingSuccessEvent.RSPFUE_NEST_BREEDING_SUCCESS, k); + super(RoomSessionNestBreedingSuccessEvent.NEST_BREEDING_SUCCESS, k); this._petId = _arg_2; this._rarityCategory = _arg_3; } - public get _Str_16731(): number + public get rarityCategory(): number { return this._rarityCategory; } - public get _Str_2508(): number + public get petId(): number { return this._petId; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionPetBreedingEvent.ts b/src/nitro/session/events/RoomSessionPetBreedingEvent.ts index 63bdb2e2..62f12a31 100644 --- a/src/nitro/session/events/RoomSessionPetBreedingEvent.ts +++ b/src/nitro/session/events/RoomSessionPetBreedingEvent.ts @@ -3,7 +3,7 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionPetBreedingEvent extends RoomSessionEvent { - public static RSPFUE_PET_BREEDING: string = 'RSPFUE_PET_BREEDING'; + public static PET_BREEDING: string = 'RSPFUE_PET_BREEDING'; private _state: number; private _ownPetId: number; @@ -11,7 +11,7 @@ export class RoomSessionPetBreedingEvent extends RoomSessionEvent constructor(k: IRoomSession, _arg_2: number, _arg_3: number, _arg_4: number) { - super(RoomSessionPetBreedingEvent.RSPFUE_PET_BREEDING, k); + super(RoomSessionPetBreedingEvent.PET_BREEDING, k); this._state = _arg_2; this._ownPetId = _arg_3; @@ -23,13 +23,13 @@ export class RoomSessionPetBreedingEvent extends RoomSessionEvent return this._state; } - public get _Str_7440(): number + public get ownPetId(): number { return this._ownPetId; } - public get _Str_7663(): number + public get otherPetId(): number { return this._otherPetId; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionPetLevelUpdateEvent.ts b/src/nitro/session/events/RoomSessionPetLevelUpdateEvent.ts index 46c2b62a..e603c6da 100644 --- a/src/nitro/session/events/RoomSessionPetLevelUpdateEvent.ts +++ b/src/nitro/session/events/RoomSessionPetLevelUpdateEvent.ts @@ -3,20 +3,20 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionPetLevelUpdateEvent extends RoomSessionEvent { - public static RSPLUE_PET_LEVEL_UPDATE: string = 'RSPLUE_PET_LEVEL_UPDATE'; + public static PET_LEVEL_UPDATE: string = 'RSPLUE_PET_LEVEL_UPDATE'; private _petId: number; private _level: number; constructor(k: IRoomSession, _arg_2: number, _arg_3: number) { - super(RoomSessionPetLevelUpdateEvent.RSPLUE_PET_LEVEL_UPDATE, k); + super(RoomSessionPetLevelUpdateEvent.PET_LEVEL_UPDATE, k); this._petId = _arg_2; this._level = _arg_3; } - public get _Str_2508(): number + public get petId(): number { return this._petId; } @@ -25,4 +25,4 @@ export class RoomSessionPetLevelUpdateEvent extends RoomSessionEvent { return this._level; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionPetStatusUpdateEvent.ts b/src/nitro/session/events/RoomSessionPetStatusUpdateEvent.ts index 444f79aa..acbd2d34 100644 --- a/src/nitro/session/events/RoomSessionPetStatusUpdateEvent.ts +++ b/src/nitro/session/events/RoomSessionPetStatusUpdateEvent.ts @@ -3,7 +3,7 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionPetStatusUpdateEvent extends RoomSessionEvent { - public static RSPFUE_PET_STATUS_UPDATE: string = 'RSPFUE_PET_STATUS_UPDATE'; + public static PET_STATUS_UPDATE: string = 'RSPFUE_PET_STATUS_UPDATE'; private _petId: number; private _canBreed: boolean; @@ -13,7 +13,7 @@ export class RoomSessionPetStatusUpdateEvent extends RoomSessionEvent constructor(k: IRoomSession, _arg_2: number, _arg_3: boolean, _arg_4: boolean, _arg_5: boolean, _arg_6: boolean) { - super(RoomSessionPetStatusUpdateEvent.RSPFUE_PET_STATUS_UPDATE, k); + super(RoomSessionPetStatusUpdateEvent.PET_STATUS_UPDATE, k); this._petId = _arg_2; this._canBreed = _arg_3; @@ -22,28 +22,28 @@ export class RoomSessionPetStatusUpdateEvent extends RoomSessionEvent this._hasBreedingPermission = _arg_6; } - public get _Str_2508(): number + public get petId(): number { return this._petId; } - public get _Str_2934(): boolean + public get canBreed(): boolean { return this._canBreed; } - public get _Str_3068(): boolean + public get canHarvest(): boolean { return this._canHarvest; } - public get _Str_2898(): boolean + public get canRevive(): boolean { return this._canRevive; } - public get _Str_2921(): boolean + public get hasBreedingPermission(): boolean { return this._hasBreedingPermission; } -} \ No newline at end of file +} From b6b50baf0064b6ca73ad905f07f1c47f4e92d93c Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 05:50:57 -0500 Subject: [PATCH 100/155] cleaned pet breeding parsers --- .../pet/{_Str_3763.ts => BreedingPetInfo.ts} | 14 ++-- .../{_Str_5753.ts => RarityCategoryData.ts} | 14 ++-- .../messages/incoming/room/pet/index.ts | 4 +- .../pets/ConfirmBreedingRequestParser.ts | 83 +++++++++++++++++++ ...6256.ts => ConfirmBreedingResultParser.ts} | 14 ++-- ...86.ts => GoToBreedingNestFailureParser.ts} | 6 +- .../parser/inventory/pets/_Str_6719.ts | 83 ------------------- .../messages/parser/inventory/pets/index.ts | 6 +- .../RoomSessionConfirmPetBreedingEvent.ts | 18 ++-- ...oomSessionConfirmPetBreedingResultEvent.ts | 4 +- 10 files changed, 123 insertions(+), 123 deletions(-) rename src/nitro/communication/messages/incoming/room/pet/{_Str_3763.ts => BreedingPetInfo.ts} (83%) rename src/nitro/communication/messages/incoming/room/pet/{_Str_5753.ts => RarityCategoryData.ts} (75%) create mode 100644 src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingRequestParser.ts rename src/nitro/communication/messages/parser/inventory/pets/{_Str_6256.ts => ConfirmBreedingResultParser.ts} (66%) rename src/nitro/communication/messages/parser/inventory/pets/{_Str_7486.ts => GoToBreedingNestFailureParser.ts} (80%) delete mode 100644 src/nitro/communication/messages/parser/inventory/pets/_Str_6719.ts diff --git a/src/nitro/communication/messages/incoming/room/pet/_Str_3763.ts b/src/nitro/communication/messages/incoming/room/pet/BreedingPetInfo.ts similarity index 83% rename from src/nitro/communication/messages/incoming/room/pet/_Str_3763.ts rename to src/nitro/communication/messages/incoming/room/pet/BreedingPetInfo.ts index ca1d0f8d..e01b9d75 100644 --- a/src/nitro/communication/messages/incoming/room/pet/_Str_3763.ts +++ b/src/nitro/communication/messages/incoming/room/pet/BreedingPetInfo.ts @@ -1,8 +1,8 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -export class _Str_3763 +export class BreedingPetInfo { - private _Str_7992: number; + private _webId: number; private _name: string; private _level: number; private _figure: string; @@ -12,7 +12,7 @@ export class _Str_3763 { if(!wrapper) throw new Error('invalid_wrapper'); - this._Str_7992 = wrapper.readInt(); + this._webId = wrapper.readInt(); this._name = wrapper.readString(); this._level = wrapper.readInt(); this._figure = wrapper.readString(); @@ -21,16 +21,16 @@ export class _Str_3763 public dispose():void { - this._Str_7992 = 0; + this._webId = 0; this._name = ''; this._level = 0; this._figure = ''; this._owner = ''; } - public get _Str_5277(): number + public get webId(): number { - return this._Str_7992; + return this._webId; } public get name(): string @@ -52,4 +52,4 @@ export class _Str_3763 { return this._owner; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/room/pet/_Str_5753.ts b/src/nitro/communication/messages/incoming/room/pet/RarityCategoryData.ts similarity index 75% rename from src/nitro/communication/messages/incoming/room/pet/_Str_5753.ts rename to src/nitro/communication/messages/incoming/room/pet/RarityCategoryData.ts index a9163d8f..02858ab3 100644 --- a/src/nitro/communication/messages/incoming/room/pet/_Str_5753.ts +++ b/src/nitro/communication/messages/incoming/room/pet/RarityCategoryData.ts @@ -1,15 +1,15 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -export class _Str_5753 +export class RarityCategoryData { - private _Str_16211: number; + private _chance: number; private _breeds: number[]; constructor(wrapper: IMessageDataWrapper) { if(!wrapper) throw new Error('invalid_wrapper'); - this._Str_16211 = wrapper.readInt(); + this._chance = wrapper.readInt(); this._breeds = []; let totalCount = wrapper.readInt(); @@ -24,17 +24,17 @@ export class _Str_5753 public dispose():void { - this._Str_16211 = -1; + this._chance = -1; this._breeds = []; } - public get _Str_12554(): number + public get chance(): number { - return this._Str_16211; + return this._chance; } public get breeds(): number[] { return this._breeds; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/incoming/room/pet/index.ts b/src/nitro/communication/messages/incoming/room/pet/index.ts index 0ef84361..bdc9ea4a 100644 --- a/src/nitro/communication/messages/incoming/room/pet/index.ts +++ b/src/nitro/communication/messages/incoming/room/pet/index.ts @@ -1,4 +1,4 @@ +export * from './BreedingPetInfo'; export * from './PetFigureUpdateEvent'; export * from './PetInfoEvent'; -export * from './_Str_3763'; -export * from './_Str_5753'; +export * from './RarityCategoryData'; diff --git a/src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingRequestParser.ts b/src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingRequestParser.ts new file mode 100644 index 00000000..4840e664 --- /dev/null +++ b/src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingRequestParser.ts @@ -0,0 +1,83 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; +import { BreedingPetInfo } from '../../../incoming/room/pet/BreedingPetInfo'; +import { RarityCategoryData } from '../../../incoming/room/pet/RarityCategoryData'; + +export class ConfirmBreedingRequestParser implements IMessageParser +{ + private _nestId: number; + private _pet1: BreedingPetInfo; + private _pet2: BreedingPetInfo; + private _rarityCategories: RarityCategoryData[]; + private _resultPetType: number; + + public flush(): boolean + { + this._nestId = 0; + + if(this._pet1) + { + this._pet1.dispose(); + this._pet1 = null; + } + + if(this._pet2) + { + this._pet2.dispose(); + this._pet2 = null; + } + + for(const k of this._rarityCategories) k && k.dispose(); + + this._rarityCategories = []; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._nestId = wrapper.readInt(); + this._pet1 = new BreedingPetInfo(wrapper); + this._pet2 = new BreedingPetInfo(wrapper); + + let totalCount = wrapper.readInt(); + + while(totalCount > 0) + { + this._rarityCategories.push(new RarityCategoryData(wrapper)); + + totalCount--; + } + + this._resultPetType = wrapper.readInt(); + + return true; + } + + public get nestId(): number + { + return this._nestId; + } + + public get pet1():BreedingPetInfo + { + return this._pet1; + } + + public get pet2():BreedingPetInfo + { + return this._pet2; + } + + public get rarityCategories(): RarityCategoryData[] + { + return this._rarityCategories; + } + + public get resultPetType(): number + { + return this._resultPetType; + } +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/_Str_6256.ts b/src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingResultParser.ts similarity index 66% rename from src/nitro/communication/messages/parser/inventory/pets/_Str_6256.ts rename to src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingResultParser.ts index effbdcc5..dc397621 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/_Str_6256.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/ConfirmBreedingResultParser.ts @@ -1,14 +1,14 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -export class _Str_6256 implements IMessageParser +export class ConfirmBreedingResultParser implements IMessageParser { - private _Str_6143: number; + private _breedingNestStuffId: number; private _result: number; public flush(): boolean { - this._Str_6143 = 0; + this._breedingNestStuffId = 0; this._result = 0; return true; @@ -18,19 +18,19 @@ export class _Str_6256 implements IMessageParser { if(!wrapper) return false; - this._Str_6143 = wrapper.readInt(); + this._breedingNestStuffId = wrapper.readInt(); this._result = wrapper.readInt(); return true; } - public get _Str_12769(): number + public get breedingNestStuffId(): number { - return this._Str_6143; + return this._breedingNestStuffId; } public get result(): number { return this._result; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/_Str_7486.ts b/src/nitro/communication/messages/parser/inventory/pets/GoToBreedingNestFailureParser.ts similarity index 80% rename from src/nitro/communication/messages/parser/inventory/pets/_Str_7486.ts rename to src/nitro/communication/messages/parser/inventory/pets/GoToBreedingNestFailureParser.ts index 4a8091b9..5d49339b 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/_Str_7486.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/GoToBreedingNestFailureParser.ts @@ -1,9 +1,9 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -export class _Str_7486 implements IMessageParser +export class GoToBreedingNestFailureParser implements IMessageParser { - public static _Str_17785: number = 6; + public static PET_TOO_TIRED_TO_BREED: number = 6; private _reason: number; @@ -23,4 +23,4 @@ export class _Str_7486 implements IMessageParser { return this._reason; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/inventory/pets/_Str_6719.ts b/src/nitro/communication/messages/parser/inventory/pets/_Str_6719.ts deleted file mode 100644 index 7dc784a3..00000000 --- a/src/nitro/communication/messages/parser/inventory/pets/_Str_6719.ts +++ /dev/null @@ -1,83 +0,0 @@ -import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { _Str_3763 } from '../../../incoming/room/pet/_Str_3763'; -import { _Str_5753 } from '../../../incoming/room/pet/_Str_5753'; - -export class _Str_6719 implements IMessageParser -{ - private _Str_5743: number; - private _pet1: _Str_3763; - private _pet2: _Str_3763; - private _Str_4447: _Str_5753[]; - private _Str_21973: number; - - public flush(): boolean - { - this._Str_5743 = 0; - - if(this._pet1) - { - this._pet1.dispose(); - this._pet1 = null; - } - - if(this._pet2) - { - this._pet2.dispose(); - this._pet2 = null; - } - - for(const k of this._Str_4447) k && k.dispose(); - - this._Str_4447 = []; - - return true; - } - - public parse(wrapper: IMessageDataWrapper): boolean - { - if(!wrapper) return false; - - this._Str_5743 = wrapper.readInt(); - this._pet1 = new _Str_3763(wrapper); - this._pet2 = new _Str_3763(wrapper); - - let totalCount = wrapper.readInt(); - - while(totalCount > 0) - { - this._Str_4447.push(new _Str_5753(wrapper)); - - totalCount--; - } - - this._Str_21973 = wrapper.readInt(); - - return true; - } - - public get _Str_12369(): number - { - return this._Str_5743; - } - - public get pet1():_Str_3763 - { - return this._pet1; - } - - public get pet2():_Str_3763 - { - return this._pet2; - } - - public get _Str_10346(): _Str_5753[] - { - return this._Str_4447; - } - - public get _Str_24905(): number - { - return this._Str_21973; - } -} \ No newline at end of file diff --git a/src/nitro/communication/messages/parser/inventory/pets/index.ts b/src/nitro/communication/messages/parser/inventory/pets/index.ts index ad0f5a19..8a829173 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/index.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/index.ts @@ -1,3 +1,6 @@ +export * from './ConfirmBreedingRequestParser'; +export * from './ConfirmBreedingResultParser'; +export * from './GoToBreedingNestFailureParser'; export * from './NestBreedingSuccessParser'; export * from './PetAddedToInventoryParser'; export * from './PetBoughtNotificationMessageParser'; @@ -6,6 +9,3 @@ export * from './PetData'; export * from './PetFigureDataParser'; export * from './PetInventoryParser'; export * from './PetRemovedFromInventoryParser'; -export * from './_Str_6256'; -export * from './_Str_6719'; -export * from './_Str_7486'; diff --git a/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts b/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts index 26eb1ce6..5b6afe1b 100644 --- a/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts +++ b/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts @@ -5,31 +5,31 @@ export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent { public static RSPFUE_CONFIRM_PET_BREEDING: string = 'RSPFUE_CONFIRM_PET_BREEDING'; - private _Str_5743: number; + private _nestId: number; private _pet1: any; private _pet2: any; - private _Str_4447: any[]; + private _rarityCategories: any[]; private _Str_6321: number; constructor(k: IRoomSession, _arg_2: number, _arg_3: any, _arg_4: any, _arg_5: any[], _arg_6: number) { super(RoomSessionConfirmPetBreedingEvent.RSPFUE_CONFIRM_PET_BREEDING, k); - this._Str_5743 = _arg_2; + this._nestId = _arg_2; this._pet1 = _arg_3; this._pet2 = _arg_4; - this._Str_4447 = _arg_5; + this._rarityCategories = _arg_5; this._Str_6321 = _arg_6; } - public get _Str_10346(): any[] + public get rarityCategories(): any[] { - return this._Str_4447; + return this._rarityCategories; } - public get _Str_12369(): number + public get nestId(): number { - return this._Str_5743; + return this._nestId; } public get pet1(): any @@ -46,4 +46,4 @@ export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent { return this._Str_6321; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionConfirmPetBreedingResultEvent.ts b/src/nitro/session/events/RoomSessionConfirmPetBreedingResultEvent.ts index b702457b..c629ca08 100644 --- a/src/nitro/session/events/RoomSessionConfirmPetBreedingResultEvent.ts +++ b/src/nitro/session/events/RoomSessionConfirmPetBreedingResultEvent.ts @@ -16,7 +16,7 @@ export class RoomSessionConfirmPetBreedingResultEvent extends RoomSessionEvent this._result = _arg_3; } - public get _Str_12769(): number + public get breedingNestStuffId(): number { return this._breedingNestStuffId; } @@ -25,4 +25,4 @@ export class RoomSessionConfirmPetBreedingResultEvent extends RoomSessionEvent { return this._result; } -} \ No newline at end of file +} From 98b36b3b7e7cf1f2759fb91e14d4c2e792682e52 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 17:57:52 -0500 Subject: [PATCH 101/155] fixed RoomTradingLevelEnum vars --- .../messages/parser/inventory/pets/PetData.ts | 6 +++--- .../FurnitureVoteCounterVisualization.ts | 6 +++--- src/nitro/session/RoomSession.ts | 2 +- src/nitro/session/enum/GenericErrorEnum.ts | 2 +- src/nitro/session/enum/RoomTradingLevelEnum.ts | 16 ++++++++-------- .../events/RoomSessionConfirmPetBreedingEvent.ts | 12 ++++++------ 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/nitro/communication/messages/parser/inventory/pets/PetData.ts b/src/nitro/communication/messages/parser/inventory/pets/PetData.ts index 43bd457e..9c5b6dad 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/PetData.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/PetData.ts @@ -43,17 +43,17 @@ export class PetData return this._figureData.color; } - public get _Str_3343(): number + public get breedId(): number { return this._figureData.breedId; } - public get _Str_13619(): number + public get customPartCount(): number { return this._figureData.custompartCount; } - public get _Str_4217(): string + public get figureString(): string { return this._figureData.figuredata; } diff --git a/src/nitro/room/object/visualization/furniture/FurnitureVoteCounterVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureVoteCounterVisualization.ts index 8f3d3df6..cc23d3c0 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureVoteCounterVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureVoteCounterVisualization.ts @@ -6,7 +6,7 @@ export class FurnitureVoteCounterVisualization extends FurnitureAnimatedVisualiz private static ONES_SPRITE: string = 'ones_sprite'; private static TENS_SPRITE: string = 'tens_sprite'; private static HUNDREDS_SPRITE: string = 'hundreds_sprite'; - private static _Str_17839: number = -1; + private static HIDE_COUNTER_SCORE: number = -1; protected updateObject(scale: number, direction: number): boolean { @@ -33,7 +33,7 @@ export class FurnitureVoteCounterVisualization extends FurnitureAnimatedVisualiz { const result = this.object.model.getValue(RoomObjectVariable.FURNITURE_VOTE_COUNTER_COUNT); - if(result === FurnitureVoteCounterVisualization._Str_17839) + if(result === FurnitureVoteCounterVisualization.HIDE_COUNTER_SCORE) { const tag = this.getLayerTag(scale, direction, layerId); @@ -48,4 +48,4 @@ export class FurnitureVoteCounterVisualization extends FurnitureAnimatedVisualiz return super.getLayerAlpha(scale, direction, layerId); } -} \ No newline at end of file +} diff --git a/src/nitro/session/RoomSession.ts b/src/nitro/session/RoomSession.ts index bda29ab3..a6c4e031 100644 --- a/src/nitro/session/RoomSession.ts +++ b/src/nitro/session/RoomSession.ts @@ -61,7 +61,7 @@ export class RoomSession extends Disposable implements IRoomSession this._roomId = 0; this._password = null; this._state = RoomSessionEvent.CREATED; - this._tradeMode = RoomTradingLevelEnum._Str_12752; + this._tradeMode = RoomTradingLevelEnum.NO_TRADING; this._doorMode = 0; this._controllerLevel = RoomControllerLevel.NONE; this._ownRoomIndex = -1; diff --git a/src/nitro/session/enum/GenericErrorEnum.ts b/src/nitro/session/enum/GenericErrorEnum.ts index 8b16e148..378f9012 100644 --- a/src/nitro/session/enum/GenericErrorEnum.ts +++ b/src/nitro/session/enum/GenericErrorEnum.ts @@ -1,5 +1,5 @@ export class GenericErrorEnum { public static KICKED_OUT_OF_ROOM: number = 4008; - public static _Str_19451: number = -13001; + public static STRIP_LOCKED_FOR_TRADING: number = -13001; } diff --git a/src/nitro/session/enum/RoomTradingLevelEnum.ts b/src/nitro/session/enum/RoomTradingLevelEnum.ts index d4b73ad5..be0b1e41 100644 --- a/src/nitro/session/enum/RoomTradingLevelEnum.ts +++ b/src/nitro/session/enum/RoomTradingLevelEnum.ts @@ -1,22 +1,22 @@ export class RoomTradingLevelEnum { - public static _Str_12752: number = 0; - public static _Str_14475: number = 1; - public static _Str_9173: number = 2; + public static NO_TRADING: number = 0; + public static ROOM_CONTROLLER_REQUIRED: number = 1; + public static FREE_TRADING: number = 2; - public static _Str_22614(k: number): string + public static getLocalizationKey(k: number): string { switch(k) { - case RoomTradingLevelEnum._Str_9173: + case RoomTradingLevelEnum.FREE_TRADING: return '${trading.mode.free}'; - case RoomTradingLevelEnum._Str_14475: + case RoomTradingLevelEnum.ROOM_CONTROLLER_REQUIRED: return '${trading.mode.controller}'; - case RoomTradingLevelEnum._Str_12752: + case RoomTradingLevelEnum.NO_TRADING: return '${trading.mode.not.allowed}'; } return ''; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts b/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts index 5b6afe1b..2534c6ef 100644 --- a/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts +++ b/src/nitro/session/events/RoomSessionConfirmPetBreedingEvent.ts @@ -3,23 +3,23 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent { - public static RSPFUE_CONFIRM_PET_BREEDING: string = 'RSPFUE_CONFIRM_PET_BREEDING'; + public static CONFIRM_PET_BREEDING: string = 'RSPFUE_CONFIRM_PET_BREEDING'; private _nestId: number; private _pet1: any; private _pet2: any; private _rarityCategories: any[]; - private _Str_6321: number; + private _resultPetTypeId: number; constructor(k: IRoomSession, _arg_2: number, _arg_3: any, _arg_4: any, _arg_5: any[], _arg_6: number) { - super(RoomSessionConfirmPetBreedingEvent.RSPFUE_CONFIRM_PET_BREEDING, k); + super(RoomSessionConfirmPetBreedingEvent.CONFIRM_PET_BREEDING, k); this._nestId = _arg_2; this._pet1 = _arg_3; this._pet2 = _arg_4; this._rarityCategories = _arg_5; - this._Str_6321 = _arg_6; + this._resultPetTypeId = _arg_6; } public get rarityCategories(): any[] @@ -42,8 +42,8 @@ export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent return this._pet2; } - public get _Str_16867(): number + public get resultPetTypeId(): number { - return this._Str_6321; + return this._resultPetTypeId; } } From fd2413d299ca31d90260da942f4ae988c02c3d73 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 18:34:49 -0500 Subject: [PATCH 102/155] fixed RoomSessionPetBreedingResultEvent vars --- .../room/pet/PetBreedingResultData.ts | 56 +++++++++++++++++++ .../messages/incoming/room/pet/index.ts | 1 + ...{RoomChatParser.ts => RoomChatSettings.ts} | 26 ++++----- .../room/data/RoomChatSettingsParser.ts | 10 ++-- .../parser/room/data/RoomInfoParser.ts | 8 +-- .../parser/room/data/RoomSettingsParser.ts | 10 ++-- .../messages/parser/room/data/index.ts | 2 +- .../FurnitureHabboWheelVisualization.ts | 6 +- .../FurnitureMannequinVisualization.ts | 12 ++-- .../FurnitureValRandomizerVisualization.ts | 14 ++--- .../RoomSessionPetBreedingResultEvent.ts | 19 ++++--- .../events/RoomSessionPetInfoUpdateEvent.ts | 4 +- .../RoomSessionUserFigureUpdateEvent.ts | 8 +-- 13 files changed, 117 insertions(+), 59 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/room/pet/PetBreedingResultData.ts rename src/nitro/communication/messages/parser/room/data/{RoomChatParser.ts => RoomChatSettings.ts} (69%) diff --git a/src/nitro/communication/messages/incoming/room/pet/PetBreedingResultData.ts b/src/nitro/communication/messages/incoming/room/pet/PetBreedingResultData.ts new file mode 100644 index 00000000..293d7133 --- /dev/null +++ b/src/nitro/communication/messages/incoming/room/pet/PetBreedingResultData.ts @@ -0,0 +1,56 @@ +export class PetBreedingResultData +{ + private _stuffId: number; + private _classId: number; + private _productCode: string; + private _userId: number; + private _userName: string; + private _rarityLevel: number; + private _hasMutation: boolean; + + constructor(stuffId: number, classId: number, productCode: string, userId: number, userName: string, rarityLevel: number, hasMutation: boolean) + { + this._stuffId = stuffId; + this._classId = classId; + this._productCode = productCode; + this._userId = userId; + this._userName = userName; + this._rarityLevel = rarityLevel; + this._hasMutation = hasMutation; + } + + public get stuffId(): number + { + return this._stuffId; + } + + public get classId(): number + { + return this._classId; + } + + public get productCode(): string + { + return this._productCode; + } + + public get userId(): number + { + return this._userId; + } + + public get userName(): string + { + return this._userName; + } + + public get rarityLevel(): number + { + return this._rarityLevel; + } + + public get hasMutation(): boolean + { + return this._hasMutation; + } +} diff --git a/src/nitro/communication/messages/incoming/room/pet/index.ts b/src/nitro/communication/messages/incoming/room/pet/index.ts index bdc9ea4a..a4e9295d 100644 --- a/src/nitro/communication/messages/incoming/room/pet/index.ts +++ b/src/nitro/communication/messages/incoming/room/pet/index.ts @@ -1,4 +1,5 @@ export * from './BreedingPetInfo'; +export * from './PetBreedingResultData'; export * from './PetFigureUpdateEvent'; export * from './PetInfoEvent'; export * from './RarityCategoryData'; diff --git a/src/nitro/communication/messages/parser/room/data/RoomChatParser.ts b/src/nitro/communication/messages/parser/room/data/RoomChatSettings.ts similarity index 69% rename from src/nitro/communication/messages/parser/room/data/RoomChatParser.ts rename to src/nitro/communication/messages/parser/room/data/RoomChatSettings.ts index 8bbfb177..0d33983f 100644 --- a/src/nitro/communication/messages/parser/room/data/RoomChatParser.ts +++ b/src/nitro/communication/messages/parser/room/data/RoomChatSettings.ts @@ -1,18 +1,18 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -export class RoomChatParser +export class RoomChatSettings { - public static _Str_19408: number = 0; - public static _Str_12787: number = 1; - public static _Str_16907: number = 0; - public static _Str_12581: number = 1; - public static _Str_16484: number = 2; - public static _Str_18404: number = 0; - public static _Str_17874: number = 1; - public static _Str_16469: number = 2; - public static _Str_21099: number = 0; - public static _Str_20763: number = 1; - public static _Str_22060: number = 2; + public static CHAT_MODE_FREE_FLOW: number = 0; + public static CHAT_MODE_LINE_BY_LINE: number = 1; + public static CHAT_BUBBLE_WIDTH_WIDE: number = 0; + public static CHAT_BUBBLE_WIDTH_NORMAL: number = 1; + public static CHAT_BUBBLE_WIDTH_THIN: number = 2; + public static CHAT_SCROLL_SPEED_FAST: number = 0; + public static CHAT_SCROLL_SPEED_NORMAL: number = 1; + public static CHAT_SCROLL_SPEED_SLOW: number = 2; + public static FLOOD_FILTER_STRICT: number = 0; + public static FLOOD_FILTER_NORMAL: number = 1; + public static FLOOD_FILTER_LOOSE: number = 2; private _mode: number; private _weight: number; @@ -75,4 +75,4 @@ export class RoomChatParser { return this._protection; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/room/data/RoomChatSettingsParser.ts b/src/nitro/communication/messages/parser/room/data/RoomChatSettingsParser.ts index 14da2e95..07dac98d 100644 --- a/src/nitro/communication/messages/parser/room/data/RoomChatSettingsParser.ts +++ b/src/nitro/communication/messages/parser/room/data/RoomChatSettingsParser.ts @@ -1,10 +1,10 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { RoomChatParser } from './RoomChatParser'; +import { RoomChatSettings } from './RoomChatSettings'; export class RoomChatSettingsParser implements IMessageParser { - private _chat: RoomChatParser; + private _chat: RoomChatSettings; public flush(): boolean { @@ -17,13 +17,13 @@ export class RoomChatSettingsParser implements IMessageParser { if(!wrapper) return false; - this._chat = new RoomChatParser(wrapper); + this._chat = new RoomChatSettings(wrapper); return true; } - public get chat(): RoomChatParser + public get chat(): RoomChatSettings { return this._chat; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/room/data/RoomInfoParser.ts b/src/nitro/communication/messages/parser/room/data/RoomInfoParser.ts index 73a8dc1f..ea790e81 100644 --- a/src/nitro/communication/messages/parser/room/data/RoomInfoParser.ts +++ b/src/nitro/communication/messages/parser/room/data/RoomInfoParser.ts @@ -1,6 +1,6 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { RoomChatParser } from './RoomChatParser'; +import { RoomChatSettings } from './RoomChatSettings'; import { RoomDataParser } from './RoomDataParser'; import { RoomModerationParser } from './RoomModerationParser'; @@ -12,7 +12,7 @@ export class RoomInfoParser implements IMessageParser private _data: RoomDataParser; private _isGroupMember: boolean; private _moderation: RoomModerationParser; - private _chat: RoomChatParser; + private _chat: RoomChatSettings; public flush(): boolean { @@ -39,7 +39,7 @@ export class RoomInfoParser implements IMessageParser this.data.allInRoomMuted = wrapper.readBoolean(); this._moderation = new RoomModerationParser(wrapper); this.data.canMute = wrapper.readBoolean(); - this._chat = new RoomChatParser(wrapper); + this._chat = new RoomChatSettings(wrapper); return true; } @@ -69,7 +69,7 @@ export class RoomInfoParser implements IMessageParser return this._moderation; } - public get chat(): RoomChatParser + public get chat(): RoomChatSettings { return this._chat; } diff --git a/src/nitro/communication/messages/parser/room/data/RoomSettingsParser.ts b/src/nitro/communication/messages/parser/room/data/RoomSettingsParser.ts index 9c1266d2..c237f445 100644 --- a/src/nitro/communication/messages/parser/room/data/RoomSettingsParser.ts +++ b/src/nitro/communication/messages/parser/room/data/RoomSettingsParser.ts @@ -1,6 +1,6 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -import { RoomChatParser } from './RoomChatParser'; +import { RoomChatSettings } from './RoomChatSettings'; import { RoomModerationParser } from './RoomModerationParser'; export class RoomSettingsParser implements IMessageParser @@ -20,7 +20,7 @@ export class RoomSettingsParser implements IMessageParser private _hideWalls: number; private _thicknessWall: number; private _thicknessFloor: number; - private _chat: RoomChatParser; + private _chat: RoomChatSettings; private _moderation: RoomModerationParser; public flush(): boolean @@ -51,7 +51,7 @@ export class RoomSettingsParser implements IMessageParser this._hideWalls = wrapper.readInt(); this._thicknessWall = wrapper.readInt(); this._thicknessFloor = wrapper.readInt(); - this._chat = new RoomChatParser(wrapper); + this._chat = new RoomChatSettings(wrapper); wrapper.readBoolean(); this._moderation = new RoomModerationParser(wrapper); @@ -151,7 +151,7 @@ export class RoomSettingsParser implements IMessageParser return this._thicknessFloor; } - public get chatSettings(): RoomChatParser + public get chatSettings(): RoomChatSettings { return this._chat; } @@ -160,4 +160,4 @@ export class RoomSettingsParser implements IMessageParser { return this._moderation; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/room/data/index.ts b/src/nitro/communication/messages/parser/room/data/index.ts index 8ae78e3e..c11bdf57 100644 --- a/src/nitro/communication/messages/parser/room/data/index.ts +++ b/src/nitro/communication/messages/parser/room/data/index.ts @@ -1,4 +1,4 @@ -export * from './RoomChatParser'; +export * from './RoomChatSettings'; export * from './RoomChatSettingsParser'; export * from './RoomDataParser'; export * from './RoomInfoOwnerParser'; diff --git a/src/nitro/room/object/visualization/furniture/FurnitureHabboWheelVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureHabboWheelVisualization.ts index 3c3f7b8e..13c14e70 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureHabboWheelVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureHabboWheelVisualization.ts @@ -4,8 +4,8 @@ export class FurnitureHabboWheelVisualization extends FurnitureAnimatedVisualiza { private static ANIMATION_ID_OFFSET_SLOW1: number = 10; private static ANIMATION_ID_OFFSET_SLOW2: number = 20; - private static _Str_7627: number = 31; - private static ANIMATION_ID_ROLL: number = 32; + private static ANIMATION_ID_START_ROLL: number = 31; + private static ANIMATION_ID_ROLL: number = 32; private _stateQueue: number[]; private _running: boolean; @@ -27,7 +27,7 @@ export class FurnitureHabboWheelVisualization extends FurnitureAnimatedVisualiza this._running = true; this._stateQueue = []; - this._stateQueue.push(FurnitureHabboWheelVisualization._Str_7627); + this._stateQueue.push(FurnitureHabboWheelVisualization.ANIMATION_ID_START_ROLL); this._stateQueue.push(FurnitureHabboWheelVisualization.ANIMATION_ID_ROLL); return; diff --git a/src/nitro/room/object/visualization/furniture/FurnitureMannequinVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureMannequinVisualization.ts index 0c9d88a8..c88030bb 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureMannequinVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureMannequinVisualization.ts @@ -112,9 +112,9 @@ export class FurnitureMannequinVisualization extends FurnitureVisualization impl if(this._dynamicAssetName) this.asset.disposeAsset(this._dynamicAssetName); - this.asset.addAsset(this._Str_10185(), avatarImage.getImage(AvatarSetType.FULL, false, 1, false), true); + this.asset.addAsset(this.getAvatarAssetName(), avatarImage.getImage(AvatarSetType.FULL, false, 1, false), true); - this._dynamicAssetName = this._Str_10185(); + this._dynamicAssetName = this.getAvatarAssetName(); this._needsUpdate = true; avatarImage.dispose(); @@ -124,10 +124,10 @@ export class FurnitureMannequinVisualization extends FurnitureVisualization impl private avatarExists(): boolean { - return (this._figure && (this.getAsset(this._Str_10185()) !== null)); + return (this._figure && (this.getAsset(this.getAvatarAssetName()) !== null)); } - private _Str_10185(): string + private getAvatarAssetName(): string { return (((((('mannequin_' + this._figure) + '_') + this._mannequinScale) + '_') + this.direction) + '_') + this.object.id; } @@ -143,7 +143,7 @@ export class FurnitureMannequinVisualization extends FurnitureVisualization impl if(this._figure && (tag === FurnitureMannequinVisualization.AVATAR_IMAGE_SPRITE_TAG) && this.avatarExists()) { - return this._Str_10185(); + return this.getAvatarAssetName(); } return super.getSpriteAssetName(scale, layerId); @@ -171,4 +171,4 @@ export class FurnitureMannequinVisualization extends FurnitureVisualization impl { return this._disposed; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/visualization/furniture/FurnitureValRandomizerVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureValRandomizerVisualization.ts index c2eb8cc0..371418ed 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureValRandomizerVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureValRandomizerVisualization.ts @@ -4,9 +4,9 @@ export class FurnitureValRandomizerVisualization extends FurnitureAnimatedVisual { private static ANIMATION_ID_OFFSET_SLOW1: number = 20; private static ANIMATION_ID_OFFSET_SLOW2: number = 10; - private static _Str_7627: number = 31; - private static ANIMATION_ID_ROLL: number = 32; - private static _Str_11236: number = 30; + private static ANIMATION_ID_START_ROLL: number = 31; + private static ANIMATION_ID_ROLL: number = 32; + private static ANIMATION_ID_OFF: number = 30; private _stateQueue: number[]; private _running: boolean; @@ -18,7 +18,7 @@ export class FurnitureValRandomizerVisualization extends FurnitureAnimatedVisual this._stateQueue = []; this._running = false; - super.setAnimation(FurnitureValRandomizerVisualization._Str_11236); + super.setAnimation(FurnitureValRandomizerVisualization.ANIMATION_ID_OFF); } protected setAnimation(animationId: number): void @@ -30,7 +30,7 @@ export class FurnitureValRandomizerVisualization extends FurnitureAnimatedVisual this._running = true; this._stateQueue = []; - this._stateQueue.push(FurnitureValRandomizerVisualization._Str_7627); + this._stateQueue.push(FurnitureValRandomizerVisualization.ANIMATION_ID_START_ROLL); this._stateQueue.push(FurnitureValRandomizerVisualization.ANIMATION_ID_ROLL); return; @@ -55,12 +55,12 @@ export class FurnitureValRandomizerVisualization extends FurnitureAnimatedVisual this._stateQueue.push(FurnitureValRandomizerVisualization.ANIMATION_ID_OFFSET_SLOW2 + animationId); } - this._stateQueue.push(FurnitureValRandomizerVisualization._Str_11236); + this._stateQueue.push(FurnitureValRandomizerVisualization.ANIMATION_ID_OFF); return; } - super.setAnimation(FurnitureValRandomizerVisualization._Str_11236); + super.setAnimation(FurnitureValRandomizerVisualization.ANIMATION_ID_OFF); } } diff --git a/src/nitro/session/events/RoomSessionPetBreedingResultEvent.ts b/src/nitro/session/events/RoomSessionPetBreedingResultEvent.ts index bef904fc..634eacb4 100644 --- a/src/nitro/session/events/RoomSessionPetBreedingResultEvent.ts +++ b/src/nitro/session/events/RoomSessionPetBreedingResultEvent.ts @@ -1,28 +1,29 @@ -import { IRoomSession } from '../IRoomSession'; +import { PetBreedingResultData } from '../../communication/messages/incoming/room/pet/PetBreedingResultData'; +import { IRoomSession } from '../IRoomSession'; import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionPetBreedingResultEvent extends RoomSessionEvent { - public static RSPFUE_PET_BREEDING_RESULT: string = 'RSPFUE_PET_BREEDING_RESULT'; + public static PET_BREEDING_RESULT: string = 'RSPFUE_PET_BREEDING_RESULT'; - private _resultData: any; //PetInfoMessageParser - private _otherResultData: any; + private _resultData: PetBreedingResultData; + private _otherResultData: PetBreedingResultData; - constructor(k: IRoomSession, _arg_2: any, _arg_3: any) + constructor(k: IRoomSession, _arg_2: PetBreedingResultData, _arg_3: PetBreedingResultData) { - super(RoomSessionPetBreedingResultEvent.RSPFUE_PET_BREEDING_RESULT, k); + super(RoomSessionPetBreedingResultEvent.PET_BREEDING_RESULT, k); this._resultData = _arg_2; this._otherResultData = _arg_3; } - public get _Str_3713(): any + public get resultData(): PetBreedingResultData { return this._resultData; } - public get _Str_5840(): any + public get otherResultData(): PetBreedingResultData { return this._otherResultData; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionPetInfoUpdateEvent.ts b/src/nitro/session/events/RoomSessionPetInfoUpdateEvent.ts index a40f31b3..3be83e79 100644 --- a/src/nitro/session/events/RoomSessionPetInfoUpdateEvent.ts +++ b/src/nitro/session/events/RoomSessionPetInfoUpdateEvent.ts @@ -15,8 +15,8 @@ export class RoomSessionPetInfoUpdateEvent extends RoomSessionEvent this._petInfo = _arg_2; } - public get _Str_24727():RoomPetData + public get petInfo():RoomPetData { return this._petInfo; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionUserFigureUpdateEvent.ts b/src/nitro/session/events/RoomSessionUserFigureUpdateEvent.ts index 15bf7b23..239f8b9e 100644 --- a/src/nitro/session/events/RoomSessionUserFigureUpdateEvent.ts +++ b/src/nitro/session/events/RoomSessionUserFigureUpdateEvent.ts @@ -3,7 +3,7 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent { - public static RSUBE_FIGURE: string = 'RSUBE_FIGURE'; + public static USER_FIGURE: string = 'RSUBE_FIGURE'; private _userId: number = 0; private _figure: string = ''; @@ -13,7 +13,7 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent constructor(k: IRoomSession, _arg_2: number, _arg_3: string, _arg_4: string, _arg_5: string, _arg_6: number) { - super(RoomSessionUserFigureUpdateEvent.RSUBE_FIGURE, k); + super(RoomSessionUserFigureUpdateEvent.USER_FIGURE, k); this._userId = _arg_2; this._figure = _arg_3; this._gender = _arg_4; @@ -36,7 +36,7 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent return this._gender; } - public get _Str_9690(): string + public get customInfo(): string { return this._customInfo; } @@ -45,4 +45,4 @@ export class RoomSessionUserFigureUpdateEvent extends RoomSessionEvent { return this._achievementScore; } -} \ No newline at end of file +} From e6d53aba2569ea579194f88c7ef4fbd4a49e2bbb Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 19:25:48 -0500 Subject: [PATCH 103/155] fixed RoomVisitData vars --- .../modtool/utils/ModtoolRoomVisitedData.ts | 8 ++++---- ...serVisitedRoomsRoom.ts => RoomVisitData.ts} | 18 +++++++++--------- .../messages/parser/modtool/utils/index.ts | 2 +- .../parser/room/data/RoomInfoParser.ts | 8 ++++---- ...tionParser.ts => RoomModerationSettings.ts} | 10 +++++----- .../parser/room/data/RoomSettingsParser.ts | 8 ++++---- .../messages/parser/room/data/index.ts | 2 +- .../furniture/wall/FurnitureWallDataParser.ts | 14 +++++++------- .../subscription/UserSubscriptionParser.ts | 5 ++++- src/nitro/room/RoomMessageHandler.ts | 2 +- src/nitro/session/IRoomSession.ts | 4 ++-- src/nitro/session/RoomSession.ts | 8 ++++---- .../events/MysteryBoxKeysUpdateEvent.ts | 10 +++++----- .../RoomSessionFavouriteGroupUpdateEvent.ts | 12 ++++++------ 14 files changed, 57 insertions(+), 54 deletions(-) rename src/nitro/communication/messages/parser/modtool/utils/{ModtoolUserVisitedRoomsRoom.ts => RoomVisitData.ts} (60%) rename src/nitro/communication/messages/parser/room/data/{RoomModerationParser.ts => RoomModerationSettings.ts} (80%) diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomVisitedData.ts b/src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomVisitedData.ts index a86fe581..e08fdd03 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomVisitedData.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/ModtoolRoomVisitedData.ts @@ -1,12 +1,12 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -import { ModtoolUserVisitedRoomsRoom } from './ModtoolUserVisitedRoomsRoom'; +import { RoomVisitData } from './RoomVisitData'; export class ModtoolRoomVisitedData { private _userId:number; private _userName:string; - private _rooms:ModtoolUserVisitedRoomsRoom[]; + private _rooms:RoomVisitData[]; constructor(k:IMessageDataWrapper) { @@ -17,7 +17,7 @@ export class ModtoolRoomVisitedData let _local_3 = 0; while(_local_3 < _local_2) { - this._rooms.push(new ModtoolUserVisitedRoomsRoom(k)); + this._rooms.push(new RoomVisitData(k)); _local_3++; } } @@ -32,7 +32,7 @@ export class ModtoolRoomVisitedData return this._userName; } - public get rooms():ModtoolUserVisitedRoomsRoom[] + public get rooms():RoomVisitData[] { return this._rooms; } diff --git a/src/nitro/communication/messages/parser/modtool/utils/ModtoolUserVisitedRoomsRoom.ts b/src/nitro/communication/messages/parser/modtool/utils/RoomVisitData.ts similarity index 60% rename from src/nitro/communication/messages/parser/modtool/utils/ModtoolUserVisitedRoomsRoom.ts rename to src/nitro/communication/messages/parser/modtool/utils/RoomVisitData.ts index 7c9d7a59..53e3e279 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/ModtoolUserVisitedRoomsRoom.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/RoomVisitData.ts @@ -1,18 +1,18 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -export class ModtoolUserVisitedRoomsRoom +export class RoomVisitData { private _roomId:number; private _roomName:string; - private _Str_20266:number; - private _Str_20472:number; + private _enterHour:number; + private _enterMinute:number; constructor(k:IMessageDataWrapper) { this._roomId = k.readInt(); this._roomName = k.readString(); - this._Str_20266 = k.readInt(); - this._Str_20472 = k.readInt(); + this._enterHour = k.readInt(); + this._enterMinute = k.readInt(); } public get roomId():number @@ -25,13 +25,13 @@ export class ModtoolUserVisitedRoomsRoom return this._roomName; } - public get _Str_22929():number + public get enterHour():number { - return this._Str_20266; + return this._enterHour; } - public get _Str_25550():number + public get enterMinute():number { - return this._Str_20472; + return this._enterMinute; } } diff --git a/src/nitro/communication/messages/parser/modtool/utils/index.ts b/src/nitro/communication/messages/parser/modtool/utils/index.ts index 9b7176cc..180c8620 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/index.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/index.ts @@ -8,5 +8,5 @@ export * from './ModtoolRoomChatlogLine'; export * from './ModtoolRoomVisitedData'; export * from './ModtoolUserChatlogParserChatlog'; export * from './ModtoolUserChatlogParserVisit'; -export * from './ModtoolUserVisitedRoomsRoom'; export * from './PatternMatchData'; +export * from './RoomVisitData'; diff --git a/src/nitro/communication/messages/parser/room/data/RoomInfoParser.ts b/src/nitro/communication/messages/parser/room/data/RoomInfoParser.ts index ea790e81..9ff7aca6 100644 --- a/src/nitro/communication/messages/parser/room/data/RoomInfoParser.ts +++ b/src/nitro/communication/messages/parser/room/data/RoomInfoParser.ts @@ -2,7 +2,7 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messag import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; import { RoomChatSettings } from './RoomChatSettings'; import { RoomDataParser } from './RoomDataParser'; -import { RoomModerationParser } from './RoomModerationParser'; +import { RoomModerationSettings } from './RoomModerationSettings'; export class RoomInfoParser implements IMessageParser { @@ -11,7 +11,7 @@ export class RoomInfoParser implements IMessageParser private _staffPick: boolean; private _data: RoomDataParser; private _isGroupMember: boolean; - private _moderation: RoomModerationParser; + private _moderation: RoomModerationSettings; private _chat: RoomChatSettings; public flush(): boolean @@ -37,7 +37,7 @@ export class RoomInfoParser implements IMessageParser this.data.roomPicker = wrapper.readBoolean(); this._isGroupMember = wrapper.readBoolean(); this.data.allInRoomMuted = wrapper.readBoolean(); - this._moderation = new RoomModerationParser(wrapper); + this._moderation = new RoomModerationSettings(wrapper); this.data.canMute = wrapper.readBoolean(); this._chat = new RoomChatSettings(wrapper); @@ -64,7 +64,7 @@ export class RoomInfoParser implements IMessageParser return this._isGroupMember; } - public get moderation(): RoomModerationParser + public get moderation(): RoomModerationSettings { return this._moderation; } diff --git a/src/nitro/communication/messages/parser/room/data/RoomModerationParser.ts b/src/nitro/communication/messages/parser/room/data/RoomModerationSettings.ts similarity index 80% rename from src/nitro/communication/messages/parser/room/data/RoomModerationParser.ts rename to src/nitro/communication/messages/parser/room/data/RoomModerationSettings.ts index 4e321b86..2509de1c 100644 --- a/src/nitro/communication/messages/parser/room/data/RoomModerationParser.ts +++ b/src/nitro/communication/messages/parser/room/data/RoomModerationSettings.ts @@ -1,10 +1,10 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; -export class RoomModerationParser +export class RoomModerationSettings { - public static _Str_10707: number = 0; - public static _Str_5047: number = 1; - public static _Str_11537: number = 2; + public static MODERATION_LEVEL_NONE: number = 0; + public static MODERATION_LEVEL_USER_WITH_RIGHTS: number = 1; + public static MODERATION_LEVEL_ALL: number = 2; private _allowMute: number; private _allowKick: number; @@ -44,4 +44,4 @@ export class RoomModerationParser { return this._allowBan; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/room/data/RoomSettingsParser.ts b/src/nitro/communication/messages/parser/room/data/RoomSettingsParser.ts index c237f445..322a4222 100644 --- a/src/nitro/communication/messages/parser/room/data/RoomSettingsParser.ts +++ b/src/nitro/communication/messages/parser/room/data/RoomSettingsParser.ts @@ -1,7 +1,7 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; import { RoomChatSettings } from './RoomChatSettings'; -import { RoomModerationParser } from './RoomModerationParser'; +import { RoomModerationSettings } from './RoomModerationSettings'; export class RoomSettingsParser implements IMessageParser { @@ -21,7 +21,7 @@ export class RoomSettingsParser implements IMessageParser private _thicknessWall: number; private _thicknessFloor: number; private _chat: RoomChatSettings; - private _moderation: RoomModerationParser; + private _moderation: RoomModerationSettings; public flush(): boolean { @@ -53,7 +53,7 @@ export class RoomSettingsParser implements IMessageParser this._thicknessFloor = wrapper.readInt(); this._chat = new RoomChatSettings(wrapper); wrapper.readBoolean(); - this._moderation = new RoomModerationParser(wrapper); + this._moderation = new RoomModerationSettings(wrapper); return true; } @@ -156,7 +156,7 @@ export class RoomSettingsParser implements IMessageParser return this._chat; } - public get moderationSettings(): RoomModerationParser + public get moderationSettings(): RoomModerationSettings { return this._moderation; } diff --git a/src/nitro/communication/messages/parser/room/data/index.ts b/src/nitro/communication/messages/parser/room/data/index.ts index c11bdf57..f509c354 100644 --- a/src/nitro/communication/messages/parser/room/data/index.ts +++ b/src/nitro/communication/messages/parser/room/data/index.ts @@ -3,7 +3,7 @@ export * from './RoomChatSettingsParser'; export * from './RoomDataParser'; export * from './RoomInfoOwnerParser'; export * from './RoomInfoParser'; -export * from './RoomModerationParser'; +export * from './RoomModerationSettings'; export * from './RoomScoreParser'; export * from './RoomSettingsErrorParser'; export * from './RoomSettingsParser'; diff --git a/src/nitro/communication/messages/parser/room/furniture/wall/FurnitureWallDataParser.ts b/src/nitro/communication/messages/parser/room/furniture/wall/FurnitureWallDataParser.ts index cbcf5a0b..2d4439ef 100644 --- a/src/nitro/communication/messages/parser/room/furniture/wall/FurnitureWallDataParser.ts +++ b/src/nitro/communication/messages/parser/room/furniture/wall/FurnitureWallDataParser.ts @@ -19,7 +19,7 @@ export class FurnitureWallDataParser private _y: number; private _z: number; private _direction: string; - private _Str_19875: boolean; + private _isOldFormat: boolean; constructor(wrapper: IMessageDataWrapper) { @@ -48,7 +48,7 @@ export class FurnitureWallDataParser this._y = 0; this._z = 0; this._direction = null; - this._Str_19875 = false; + this._isOldFormat = false; return true; } @@ -72,7 +72,7 @@ export class FurnitureWallDataParser if(this._location.indexOf(':') === 0) { - this._Str_19875 = false; + this._isOldFormat = false; let parts = this._location.split(' '); @@ -113,7 +113,7 @@ export class FurnitureWallDataParser } else { - this._Str_19875 = true; + this._isOldFormat = true; // _local_12 = _local_4.split(" "); // if (_local_12.length >= 2) @@ -221,8 +221,8 @@ export class FurnitureWallDataParser return this._direction; } - public get _Str_22379(): boolean + public get isOldFormat(): boolean { - return this._Str_19875; + return this._isOldFormat; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts b/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts index f47ab7af..6231e6a5 100644 --- a/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts +++ b/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts @@ -3,7 +3,10 @@ import { IMessageParser } from '../../../../../../../core/communication/messages export class UserSubscriptionParser implements IMessageParser { - public static _Str_14729: number = 3; + public static readonly RESPONSE_TYPE_LOGIN:number = 1; + public static readonly RESPONSE_TYPE_PURCHASE:number = 2; + public static readonly RESPONSE_TYPE_DISCOUNT_AVAILABLE:number = 3; + public static readonly RESPONSE_TYPE_CITIZENSHIP_DISCOUNT:number = 4; private _name: string; private _days: number; diff --git a/src/nitro/room/RoomMessageHandler.ts b/src/nitro/room/RoomMessageHandler.ts index 5c72ef59..d7484d56 100644 --- a/src/nitro/room/RoomMessageHandler.ts +++ b/src/nitro/room/RoomMessageHandler.ts @@ -897,7 +897,7 @@ export class RoomMessageHandler extends Disposable let location: IVector3D = null; - if(!data._Str_22379) + if(!data.isOldFormat) { location = wallGeometry.getLocation(data.width, data.height, data.localX, data.localY, data.direction); } diff --git a/src/nitro/session/IRoomSession.ts b/src/nitro/session/IRoomSession.ts index 954131ba..fa87c9a1 100644 --- a/src/nitro/session/IRoomSession.ts +++ b/src/nitro/session/IRoomSession.ts @@ -1,6 +1,6 @@ import { IDisposable } from '../../core/common/disposable/IDisposable'; import { IConnection } from '../../core/communication/connections/IConnection'; -import { RoomModerationParser } from '../communication/messages/parser/room/data/RoomModerationParser'; +import { RoomModerationSettings } from '../communication/messages/parser/room/data/RoomModerationSettings'; import { UserDataManager } from './UserDataManager'; export interface IRoomSession extends IDisposable @@ -47,5 +47,5 @@ export interface IRoomSession extends IDisposable isRoomOwner: boolean; isDecorating: boolean; isSpectator: boolean; - moderationSettings: RoomModerationParser; + moderationSettings: RoomModerationSettings; } diff --git a/src/nitro/session/RoomSession.ts b/src/nitro/session/RoomSession.ts index a6c4e031..ef87fe8c 100644 --- a/src/nitro/session/RoomSession.ts +++ b/src/nitro/session/RoomSession.ts @@ -24,7 +24,7 @@ import { RoomUnitDanceComposer } from '../communication/messages/outgoing/room/u import { RoomUnitPostureComposer } from '../communication/messages/outgoing/room/unit/RoomUnitPostureComposer'; import { RoomUnitSignComposer } from '../communication/messages/outgoing/room/unit/RoomUnitSignComposer'; import { UserMottoComposer } from '../communication/messages/outgoing/user/data/UserMottoComposer'; -import { RoomModerationParser } from '../communication/messages/parser/room/data/RoomModerationParser'; +import { RoomModerationSettings } from '../communication/messages/parser/room/data/RoomModerationSettings'; import { RoomControllerLevel } from './enum/RoomControllerLevel'; import { RoomTradingLevelEnum } from './enum/RoomTradingLevelEnum'; import { RoomSessionEvent } from './events/RoomSessionEvent'; @@ -49,7 +49,7 @@ export class RoomSession extends Disposable implements IRoomSession private _isDecorating: boolean; private _isSpectator: boolean; - private _moderationSettings: RoomModerationParser; + private _moderationSettings: RoomModerationSettings; constructor() { @@ -377,12 +377,12 @@ export class RoomSession extends Disposable implements IRoomSession this._isSpectator = flag; } - public get moderationSettings(): RoomModerationParser + public get moderationSettings(): RoomModerationSettings { return this._moderationSettings; } - public set moderationSettings(parser: RoomModerationParser) + public set moderationSettings(parser: RoomModerationSettings) { this._moderationSettings = parser; } diff --git a/src/nitro/session/events/MysteryBoxKeysUpdateEvent.ts b/src/nitro/session/events/MysteryBoxKeysUpdateEvent.ts index fd7e5bc6..459c946c 100644 --- a/src/nitro/session/events/MysteryBoxKeysUpdateEvent.ts +++ b/src/nitro/session/events/MysteryBoxKeysUpdateEvent.ts @@ -2,26 +2,26 @@ export class MysteryBoxKeysUpdateEvent extends NitroEvent { - public static MBKE_UPDATE: string = 'mbke_update'; + public static MYSTERY_BOX_KEYS_UPDATE: string = 'mbke_update'; private _boxColor: string; private _keyColor: string; constructor(k: string, _arg_2: string) { - super(MysteryBoxKeysUpdateEvent.MBKE_UPDATE); + super(MysteryBoxKeysUpdateEvent.MYSTERY_BOX_KEYS_UPDATE); this._boxColor = k; this._keyColor = _arg_2; } - public get _Str_18286(): string + public get boxColor(): string { return this._boxColor; } - public get _Str_17811(): string + public get keyColor(): string { return this._keyColor; } -} \ No newline at end of file +} diff --git a/src/nitro/session/events/RoomSessionFavouriteGroupUpdateEvent.ts b/src/nitro/session/events/RoomSessionFavouriteGroupUpdateEvent.ts index acdf21cd..ee54bcf8 100644 --- a/src/nitro/session/events/RoomSessionFavouriteGroupUpdateEvent.ts +++ b/src/nitro/session/events/RoomSessionFavouriteGroupUpdateEvent.ts @@ -3,7 +3,7 @@ import { RoomSessionEvent } from './RoomSessionEvent'; export class RoomSessionFavouriteGroupUpdateEvent extends RoomSessionEvent { - public static RSFGUE_FAVOURITE_GROUP_UPDATE: string = 'RSFGUE_FAVOURITE_GROUP_UPDATE'; + public static FAVOURITE_GROUP_UPDATE: string = 'RSFGUE_FAVOURITE_GROUP_UPDATE'; private _roomIndex: number; private _habboGroupId: number; @@ -12,7 +12,7 @@ export class RoomSessionFavouriteGroupUpdateEvent extends RoomSessionEvent constructor(k: IRoomSession, _arg_2: number, _arg_3: number, _arg_4: number, _arg_5: string) { - super(RoomSessionFavouriteGroupUpdateEvent.RSFGUE_FAVOURITE_GROUP_UPDATE, k); + super(RoomSessionFavouriteGroupUpdateEvent.FAVOURITE_GROUP_UPDATE, k); this._roomIndex = _arg_2; this._habboGroupId = _arg_3; @@ -20,17 +20,17 @@ export class RoomSessionFavouriteGroupUpdateEvent extends RoomSessionEvent this._status = _arg_4; } - public get _Str_2707(): number + public get roomIndex(): number { return this._roomIndex; } - public get _Str_3094(): number + public get habboGroupId(): number { return this._habboGroupId; } - public get _Str_14525(): string + public get habboGroupName(): string { return this._habboGroupName; } @@ -39,4 +39,4 @@ export class RoomSessionFavouriteGroupUpdateEvent extends RoomSessionEvent { return this._status; } -} \ No newline at end of file +} From b7a10a578e0d741539c9dae93d996cf0107a8951 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 20:07:18 -0500 Subject: [PATCH 104/155] cleaned marketplace parsers --- src/nitro/communication/NitroMessages.ts | 4 +-- .../MarketplaceAfterOrderStatusEvent.ts | 16 ------------ .../MarketplaceBuyOfferResultEvent.ts | 16 ++++++++++++ .../incoming/catalog/marketplace/index.ts | 2 +- .../marketplace/MarketplaceSellItemEvent.ts | 8 +++--- .../room/access/RoomEnterErrorEvent.ts | 10 ++++---- ....ts => MarketplaceBuyOfferResultParser.ts} | 25 +++++++++---------- .../parser/catalog/marketplace/index.ts | 2 +- .../achievements/AchievementsParser.ts | 10 ++++---- ...=> MarketplaceCanMakeOfferResultParser.ts} | 16 ++++++------ .../parser/inventory/marketplace/index.ts | 2 +- ...rParser.ts => CantConnectMessageParser.ts} | 12 ++++----- .../messages/parser/room/access/index.ts | 2 +- 13 files changed, 61 insertions(+), 64 deletions(-) delete mode 100644 src/nitro/communication/messages/incoming/catalog/marketplace/MarketplaceAfterOrderStatusEvent.ts create mode 100644 src/nitro/communication/messages/incoming/catalog/marketplace/MarketplaceBuyOfferResultEvent.ts rename src/nitro/communication/messages/parser/catalog/marketplace/{MarketplaceAfterOrderParser.ts => MarketplaceBuyOfferResultParser.ts} (54%) rename src/nitro/communication/messages/parser/inventory/marketplace/{MarketplaceSellItemParser.ts => MarketplaceCanMakeOfferResultParser.ts} (65%) rename src/nitro/communication/messages/parser/room/access/{RoomEnterErrorParser.ts => CantConnectMessageParser.ts} (74%) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 0b2677f2..dbcacc86 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -17,7 +17,7 @@ import { CatalogRedeemVoucherOkEvent } from './messages/incoming/catalog/Catalog import { CatalogSearchEvent } from './messages/incoming/catalog/CatalogSearchEvent'; import { CatalogSoldOutEvent } from './messages/incoming/catalog/CatalogSoldOutEvent'; import { CatalogUpdatedEvent } from './messages/incoming/catalog/CatalogUpdatedEvent'; -import { MarketplaceAfterOrderStatusEvent } from './messages/incoming/catalog/marketplace/MarketplaceAfterOrderStatusEvent'; +import { MarketplaceBuyOfferResultEvent } from './messages/incoming/catalog/marketplace/MarketplaceBuyOfferResultEvent'; import { MarketplaceCancelItemEvent } from './messages/incoming/catalog/marketplace/MarketplaceCancelItemEvent'; import { MarketplaceOffersReceivedEvent } from './messages/incoming/catalog/marketplace/MarketplaceOffersReceivedEvent'; import { MarketplaceOwnItemsEvent } from './messages/incoming/catalog/marketplace/MarketplaceOwnItemsEvent'; @@ -740,7 +740,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.MARKETPLACE_CANCEL_SALE, MarketplaceCancelItemEvent); this._events.set(IncomingHeader.MARKETPLACE_ITEM_POSTED, MarketplaceItemPostedEvent); this._events.set(IncomingHeader.MARKETPLACE_ITEMS_SEARCHED, MarketplaceOffersReceivedEvent); - this._events.set(IncomingHeader.MARKETPLACE_AFTER_ORDER_STATUS, MarketplaceAfterOrderStatusEvent); + this._events.set(IncomingHeader.MARKETPLACE_AFTER_ORDER_STATUS, MarketplaceBuyOfferResultEvent); } private registerComposers(): void diff --git a/src/nitro/communication/messages/incoming/catalog/marketplace/MarketplaceAfterOrderStatusEvent.ts b/src/nitro/communication/messages/incoming/catalog/marketplace/MarketplaceAfterOrderStatusEvent.ts deleted file mode 100644 index 4317e90c..00000000 --- a/src/nitro/communication/messages/incoming/catalog/marketplace/MarketplaceAfterOrderStatusEvent.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; -import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { MarketplaceAfterOrderParser } from '../../../parser/catalog/marketplace/MarketplaceAfterOrderParser'; - -export class MarketplaceAfterOrderStatusEvent extends MessageEvent implements IMessageEvent -{ - constructor(callBack: Function) - { - super(callBack, MarketplaceAfterOrderParser); - } - - public getParser(): MarketplaceAfterOrderParser - { - return this.parser as MarketplaceAfterOrderParser; - } -} diff --git a/src/nitro/communication/messages/incoming/catalog/marketplace/MarketplaceBuyOfferResultEvent.ts b/src/nitro/communication/messages/incoming/catalog/marketplace/MarketplaceBuyOfferResultEvent.ts new file mode 100644 index 00000000..1d3531be --- /dev/null +++ b/src/nitro/communication/messages/incoming/catalog/marketplace/MarketplaceBuyOfferResultEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { MarketplaceBuyOfferResultParser } from '../../../parser/catalog/marketplace/MarketplaceBuyOfferResultParser'; + +export class MarketplaceBuyOfferResultEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, MarketplaceBuyOfferResultParser); + } + + public getParser(): MarketplaceBuyOfferResultParser + { + return this.parser as MarketplaceBuyOfferResultParser; + } +} diff --git a/src/nitro/communication/messages/incoming/catalog/marketplace/index.ts b/src/nitro/communication/messages/incoming/catalog/marketplace/index.ts index 47b101da..f8ebd14b 100644 --- a/src/nitro/communication/messages/incoming/catalog/marketplace/index.ts +++ b/src/nitro/communication/messages/incoming/catalog/marketplace/index.ts @@ -1,4 +1,4 @@ -export * from './MarketplaceAfterOrderStatusEvent'; +export * from './MarketplaceBuyOfferResultEvent'; export * from './MarketplaceCancelItemEvent'; export * from './MarketplaceOffersReceivedEvent'; export * from './MarketplaceOwnItemsEvent'; diff --git a/src/nitro/communication/messages/incoming/inventory/marketplace/MarketplaceSellItemEvent.ts b/src/nitro/communication/messages/incoming/inventory/marketplace/MarketplaceSellItemEvent.ts index 3c56c2ce..7c1d5a8f 100644 --- a/src/nitro/communication/messages/incoming/inventory/marketplace/MarketplaceSellItemEvent.ts +++ b/src/nitro/communication/messages/incoming/inventory/marketplace/MarketplaceSellItemEvent.ts @@ -1,16 +1,16 @@ import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { MarketplaceSellItemParser } from '../../../parser/inventory/marketplace/MarketplaceSellItemParser'; +import { MarketplaceCanMakeOfferResultParser } from '../../../parser/inventory/marketplace/MarketplaceCanMakeOfferResultParser'; export class MarketplaceSellItemEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, MarketplaceSellItemParser); + super(callBack, MarketplaceCanMakeOfferResultParser); } - public getParser(): MarketplaceSellItemParser + public getParser(): MarketplaceCanMakeOfferResultParser { - return this.parser as MarketplaceSellItemParser; + return this.parser as MarketplaceCanMakeOfferResultParser; } } diff --git a/src/nitro/communication/messages/incoming/room/access/RoomEnterErrorEvent.ts b/src/nitro/communication/messages/incoming/room/access/RoomEnterErrorEvent.ts index d959a351..7da823f2 100644 --- a/src/nitro/communication/messages/incoming/room/access/RoomEnterErrorEvent.ts +++ b/src/nitro/communication/messages/incoming/room/access/RoomEnterErrorEvent.ts @@ -1,16 +1,16 @@ import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; -import { RoomEnterErrorParser } from '../../../parser/room/access/RoomEnterErrorParser'; +import { CantConnectMessageParser } from '../../../parser/room/access/CantConnectMessageParser'; export class RoomEnterErrorEvent extends MessageEvent implements IMessageEvent { constructor(callBack: Function) { - super(callBack, RoomEnterErrorParser); + super(callBack, CantConnectMessageParser); } - public getParser(): RoomEnterErrorParser + public getParser(): CantConnectMessageParser { - return this.parser as RoomEnterErrorParser; + return this.parser as CantConnectMessageParser; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceAfterOrderParser.ts b/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceBuyOfferResultParser.ts similarity index 54% rename from src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceAfterOrderParser.ts rename to src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceBuyOfferResultParser.ts index 9accf02c..29d4fe69 100644 --- a/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceAfterOrderParser.ts +++ b/src/nitro/communication/messages/parser/catalog/marketplace/MarketplaceBuyOfferResultParser.ts @@ -1,13 +1,12 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -export class MarketplaceAfterOrderParser implements IMessageParser +export class MarketplaceBuyOfferResultParser implements IMessageParser { - private _result: number; - private _offerId: number = -1; - private _Str_20780: number = -1; - private _Str_8508: number = -1; + private _newOfferId: number = -1; + private _newPrice: number = -1; + private _requestedOfferId: number = -1; public flush(): boolean { @@ -19,9 +18,9 @@ export class MarketplaceAfterOrderParser implements IMessageParser if(!wrapper) return false; this._result = wrapper.readInt(); - this._offerId = wrapper.readInt(); - this._Str_20780 = wrapper.readInt(); - this._Str_8508 = wrapper.readInt(); + this._newOfferId = wrapper.readInt(); + this._newPrice = wrapper.readInt(); + this._requestedOfferId = wrapper.readInt(); return true; } @@ -33,16 +32,16 @@ export class MarketplaceAfterOrderParser implements IMessageParser public get offerId():number { - return this._offerId; + return this._newOfferId; } - public get _Str_24839():number + public get newPrice():number { - return this._Str_20780; + return this._newPrice; } - public get _Str_7501():number + public get requestedOfferId():number { - return this._Str_8508; + return this._requestedOfferId; } } diff --git a/src/nitro/communication/messages/parser/catalog/marketplace/index.ts b/src/nitro/communication/messages/parser/catalog/marketplace/index.ts index 73c5c49e..f89a2624 100644 --- a/src/nitro/communication/messages/parser/catalog/marketplace/index.ts +++ b/src/nitro/communication/messages/parser/catalog/marketplace/index.ts @@ -1,4 +1,4 @@ -export * from './MarketplaceAfterOrderParser'; +export * from './MarketplaceBuyOfferResultParser'; export * from './MarketplaceCancelItemParser'; export * from './MarketplaceOffersReceivedParser'; export * from './MarketplaceOwnItemsParser'; diff --git a/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts b/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts index 22b98cf9..cbab053a 100644 --- a/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts +++ b/src/nitro/communication/messages/parser/inventory/achievements/AchievementsParser.ts @@ -6,12 +6,12 @@ import { AchievementData } from '../../../incoming/inventory/achievements/Achiev export class AchievementsParser implements IMessageParser { private _achievements: AchievementData[]; - private _Str_19269: string; + private _defaultCategory: string; public flush(): boolean { this._achievements = []; - this._Str_19269 = null; + this._defaultCategory = null; return true; } @@ -31,7 +31,7 @@ export class AchievementsParser implements IMessageParser totalCount--; } - this._Str_19269 = k.readString(); + this._defaultCategory = k.readString(); return true; } @@ -41,8 +41,8 @@ export class AchievementsParser implements IMessageParser return this._achievements; } - public get _Str_16300(): string + public get defaultCategory(): string { - return this._Str_19269; + return this._defaultCategory; } } diff --git a/src/nitro/communication/messages/parser/inventory/marketplace/MarketplaceSellItemParser.ts b/src/nitro/communication/messages/parser/inventory/marketplace/MarketplaceCanMakeOfferResultParser.ts similarity index 65% rename from src/nitro/communication/messages/parser/inventory/marketplace/MarketplaceSellItemParser.ts rename to src/nitro/communication/messages/parser/inventory/marketplace/MarketplaceCanMakeOfferResultParser.ts index ff1248b8..2cef030c 100644 --- a/src/nitro/communication/messages/parser/inventory/marketplace/MarketplaceSellItemParser.ts +++ b/src/nitro/communication/messages/parser/inventory/marketplace/MarketplaceCanMakeOfferResultParser.ts @@ -1,14 +1,14 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -export class MarketplaceSellItemParser implements IMessageParser +export class MarketplaceCanMakeOfferResultParser implements IMessageParser { - private _Str_19825: number = null; + private _tokenCount: number = null; private _result: number = null; public flush(): boolean { - this._Str_19825 = null; + this._tokenCount = null; this._result = null; return true; @@ -19,20 +19,18 @@ export class MarketplaceSellItemParser implements IMessageParser if(!wrapper) return false; this._result = wrapper.readInt(); - this._Str_19825 = wrapper.readInt(); + this._tokenCount = wrapper.readInt(); return true; } - public get _Str_24601(): number + public get tokenCount(): number { - return this._Str_19825; + return this._tokenCount; } - public get _Str_3278(): number + public get resultCode(): number { return this._result; } - - } diff --git a/src/nitro/communication/messages/parser/inventory/marketplace/index.ts b/src/nitro/communication/messages/parser/inventory/marketplace/index.ts index d3dbc488..320c4a40 100644 --- a/src/nitro/communication/messages/parser/inventory/marketplace/index.ts +++ b/src/nitro/communication/messages/parser/inventory/marketplace/index.ts @@ -1,2 +1,2 @@ +export * from './MarketplaceCanMakeOfferResultParser'; export * from './MarketplaceItemPostedParser'; -export * from './MarketplaceSellItemParser'; diff --git a/src/nitro/communication/messages/parser/room/access/RoomEnterErrorParser.ts b/src/nitro/communication/messages/parser/room/access/CantConnectMessageParser.ts similarity index 74% rename from src/nitro/communication/messages/parser/room/access/RoomEnterErrorParser.ts rename to src/nitro/communication/messages/parser/room/access/CantConnectMessageParser.ts index 1bae004e..5e338468 100644 --- a/src/nitro/communication/messages/parser/room/access/RoomEnterErrorParser.ts +++ b/src/nitro/communication/messages/parser/room/access/CantConnectMessageParser.ts @@ -1,12 +1,12 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; import { IMessageParser } from '../../../../../../core/communication/messages/IMessageParser'; -export class RoomEnterErrorParser implements IMessageParser +export class CantConnectMessageParser implements IMessageParser { - public static FULL_ERROR: number = 1; - public static _Str_19431: number = 2; - public static QUEUE_ERROR: number = 3; - public static BANNED: number = 4; + public static REASON_FULL: number = 1; + public static REASON_CLOSED: number = 2; + public static REASON_QUEUE_ERROR: number = 3; + public static REASON_BANNED: number = 4; private _reason: number; private _parameter: string; @@ -38,4 +38,4 @@ export class RoomEnterErrorParser implements IMessageParser { return this._parameter; } -} \ No newline at end of file +} diff --git a/src/nitro/communication/messages/parser/room/access/index.ts b/src/nitro/communication/messages/parser/room/access/index.ts index 9f8c0bcf..90158a7e 100644 --- a/src/nitro/communication/messages/parser/room/access/index.ts +++ b/src/nitro/communication/messages/parser/room/access/index.ts @@ -1,5 +1,5 @@ +export * from './CantConnectMessageParser'; export * from './doorbell'; export * from './rights'; -export * from './RoomEnterErrorParser'; export * from './RoomEnterParser'; export * from './RoomFowardParser'; From 49d684c3a7a4dfcc6e29d5fb8219179fc034858a Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 23 Jun 2021 20:13:01 -0500 Subject: [PATCH 105/155] cleaned CallForHelpCategoryData --- .../modtool/utils/CallForHelpCategoryData.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/nitro/communication/messages/parser/modtool/utils/CallForHelpCategoryData.ts b/src/nitro/communication/messages/parser/modtool/utils/CallForHelpCategoryData.ts index ae233ce3..2b504d1f 100644 --- a/src/nitro/communication/messages/parser/modtool/utils/CallForHelpCategoryData.ts +++ b/src/nitro/communication/messages/parser/modtool/utils/CallForHelpCategoryData.ts @@ -3,7 +3,7 @@ import { IMessageDataWrapper } from '../../../../../../core/communication/messag export class CallForHelpCategoryData { private _name: string; - private _topics: _Str_3509[]; + private _topics: CallForHelpTopicData[]; constructor(wrapper: IMessageDataWrapper) { @@ -19,21 +19,26 @@ export class CallForHelpCategoryData this._topics.push({ name, id, - _Str_18308: unknown + consequence: unknown }); i++; } } - public get topics(): _Str_3509[] + public get topics(): CallForHelpTopicData[] { return this._topics; } + + public get name(): string + { + return this._name; + } } -interface _Str_3509 { +interface CallForHelpTopicData { name: string; id: number; - _Str_18308: string; + consequence: string; } From f89d122ad78fd210b92e9e1edb1cb07246f466be Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 30 Jun 2021 05:02:09 -0400 Subject: [PATCH 106/155] Updates --- src/{room => core}/utils/INitroPoint.ts | 0 src/core/utils/NitroFilter.ts | 4 +++ src/{room => core}/utils/NitroPoint.ts | 0 src/{room => core}/utils/NitroRectangle.ts | 0 src/core/utils/index.ts | 4 +++ src/nitro/Nitro.ts | 1 + .../communication/messages/incoming/index.ts | 33 +++++++++++++++++++ .../messages/parser/room/pet/PetInfoParser.ts | 12 +++---- .../logic/furniture/FurnitureFriendLogic.ts | 23 +++++-------- src/nitro/session/RoomPetData.ts | 6 ++-- src/nitro/session/handler/RoomUsersHandler.ts | 2 +- src/room/utils/index.ts | 3 -- 12 files changed, 61 insertions(+), 27 deletions(-) rename src/{room => core}/utils/INitroPoint.ts (100%) create mode 100644 src/core/utils/NitroFilter.ts rename src/{room => core}/utils/NitroPoint.ts (100%) rename src/{room => core}/utils/NitroRectangle.ts (100%) diff --git a/src/room/utils/INitroPoint.ts b/src/core/utils/INitroPoint.ts similarity index 100% rename from src/room/utils/INitroPoint.ts rename to src/core/utils/INitroPoint.ts diff --git a/src/core/utils/NitroFilter.ts b/src/core/utils/NitroFilter.ts new file mode 100644 index 00000000..53928e14 --- /dev/null +++ b/src/core/utils/NitroFilter.ts @@ -0,0 +1,4 @@ +import { Filter } from 'pixi.js'; + +export class NitroFilter extends Filter +{} diff --git a/src/room/utils/NitroPoint.ts b/src/core/utils/NitroPoint.ts similarity index 100% rename from src/room/utils/NitroPoint.ts rename to src/core/utils/NitroPoint.ts diff --git a/src/room/utils/NitroRectangle.ts b/src/core/utils/NitroRectangle.ts similarity index 100% rename from src/room/utils/NitroRectangle.ts rename to src/core/utils/NitroRectangle.ts diff --git a/src/core/utils/index.ts b/src/core/utils/index.ts index c13372a0..208df2f9 100644 --- a/src/core/utils/index.ts +++ b/src/core/utils/index.ts @@ -1,3 +1,7 @@ export * from './AdvancedMap'; +export * from './INitroPoint'; export * from './NitroAdjustmentFilter'; +export * from './NitroFilter'; +export * from './NitroPoint'; +export * from './NitroRectangle'; export * from './NitroTimer'; diff --git a/src/nitro/Nitro.ts b/src/nitro/Nitro.ts index 651b0c3f..a2fd3f6a 100644 --- a/src/nitro/Nitro.ts +++ b/src/nitro/Nitro.ts @@ -34,6 +34,7 @@ LegacyExternalInterface.available; settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = false; settings.SCALE_MODE = SCALE_MODES.NEAREST; +settings.ROUND_PIXELS = true; export class Nitro extends Application implements INitro { diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index 5a4e12ef..3e838189 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -1,20 +1,53 @@ export * from './availability'; export * from './avatar'; export * from './catalog'; +export * from './catalog/marketplace'; export * from './client'; export * from './desktop'; export * from './friendlist'; export * from './game'; export * from './generic'; export * from './group'; +export * from './handshake'; export * from './help'; export * from './IncomingHeader'; export * from './inventory'; +export * from './inventory/achievements'; +export * from './inventory/avatareffect'; +export * from './inventory/badges'; +export * from './inventory/bots'; +export * from './inventory/clothes'; +export * from './inventory/furni'; +export * from './inventory/furni/gifts'; +export * from './inventory/marketplace'; +export * from './inventory/pets'; +export * from './inventory/trading'; export * from './moderation'; export * from './modtool'; export * from './navigator'; export * from './notifications'; export * from './room'; +export * from './room/access'; +export * from './room/access/doorbell'; +export * from './room/access/rights'; +export * from './room/bots'; +export * from './room/camera'; +export * from './room/data'; +export * from './room/engine'; +export * from './room/furniture'; +export * from './room/furniture/floor'; +export * from './room/furniture/wall'; +export * from './room/mapping'; +export * from './room/pet'; +export * from './room/session'; +export * from './room/unit'; +export * from './room/unit/chat'; export * from './roomevents'; export * from './security'; export * from './user'; +export * from './user/access'; +export * from './user/data'; +export * from './user/inventory'; +export * from './user/inventory/currency'; +export * from './user/inventory/subscription'; +export * from './user/wardrobe'; diff --git a/src/nitro/communication/messages/parser/room/pet/PetInfoParser.ts b/src/nitro/communication/messages/parser/room/pet/PetInfoParser.ts index 56a08beb..a5861c03 100644 --- a/src/nitro/communication/messages/parser/room/pet/PetInfoParser.ts +++ b/src/nitro/communication/messages/parser/room/pet/PetInfoParser.ts @@ -26,15 +26,15 @@ export class PetInfoParser implements IMessageParser private _maximumTimeToLive: number; private _remainingTimeToLive: number; private _remainingGrowTime: number; - private _skillTresholds: number[]; + private _skillThresholds: number[]; private _publiclyRideable: number; private _unknownRarity: number; private _publiclyBreedable: boolean; public flush(): boolean { - this._id = -1; - this._skillTresholds = []; + this._id = -1; + this._skillThresholds = []; return true; } @@ -65,12 +65,12 @@ export class PetInfoParser implements IMessageParser while(total > 0) { - this._skillTresholds.push(wrapper.readInt()); + this._skillThresholds.push(wrapper.readInt()); total--; } - this._skillTresholds.sort(); + this._skillThresholds.sort(); this._publiclyRideable = wrapper.readInt(); this._breedable = wrapper.readBoolean(); this._fullyGrown = wrapper.readBoolean(); @@ -201,7 +201,7 @@ export class PetInfoParser implements IMessageParser public get skillTresholds(): number[] { - return this._skillTresholds; + return this._skillThresholds; } public get publiclyRideable(): number diff --git a/src/nitro/room/object/logic/furniture/FurnitureFriendLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureFriendLogic.ts index 527ea0f0..8d95ba93 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureFriendLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureFriendLogic.ts @@ -1,11 +1,10 @@ -import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; -import { RoomObjectBadgeAssetEvent } from '../../../events/RoomObjectBadgeAssetEvent'; -import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { IAssetData } from '../../../../../core/asset/interfaces'; -import { RoomObjectVariable } from '../../RoomObjectVariable'; import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage'; +import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage'; import { StringDataType } from '../../data/type/StringDataType'; +import { RoomObjectVariable } from '../../RoomObjectVariable'; +import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; export class FurnitureFriendLogic extends FurnitureMultiStateLogic { @@ -23,25 +22,24 @@ export class FurnitureFriendLogic extends FurnitureMultiStateLogic public initialize(asset: IAssetData): void { super.initialize(asset); + if(this.object) this.object.model.setValue(RoomObjectVariable.FURNITURE_FRIENDFURNI_ENGRAVING, this.engravingDialogType); } public processUpdateMessage(message: RoomObjectUpdateMessage): void { - // chheck if not ObjectSelectedMessage - const dataMessage = message; if(message instanceof ObjectDataUpdateMessage) { - const local4 = dataMessage.data; - if(local4) + const data = (message.data as StringDataType); + + if(data) { - this._state = local4.state; + this._state = data.state; } else { - this._state =dataMessage.state; + this._state = message.state; } - } super.processUpdateMessage(message); @@ -65,8 +63,5 @@ export class FurnitureFriendLogic extends FurnitureMultiStateLogic { super.useObject(); } - } } - - diff --git a/src/nitro/session/RoomPetData.ts b/src/nitro/session/RoomPetData.ts index 49e1afbe..828ffb21 100644 --- a/src/nitro/session/RoomPetData.ts +++ b/src/nitro/session/RoomPetData.ts @@ -17,7 +17,7 @@ private _saddle: boolean; private _rider: boolean; private _breedable: boolean; - private _skillTresholds: number[]; + private _skillThresholds: number[]; private _publiclyRideable: number; private _fullyGrown: boolean; private _dead: boolean; @@ -190,12 +190,12 @@ public get skillTresholds(): number[] { - return this._skillTresholds; + return this._skillThresholds; } public set skillTresholds(k: number[]) { - this._skillTresholds = k; + this._skillThresholds = k; } public get publiclyRideable(): number diff --git a/src/nitro/session/handler/RoomUsersHandler.ts b/src/nitro/session/handler/RoomUsersHandler.ts index 33815e9c..3fb25a16 100644 --- a/src/nitro/session/handler/RoomUsersHandler.ts +++ b/src/nitro/session/handler/RoomUsersHandler.ts @@ -237,7 +237,7 @@ export class RoomUsersHandler extends BaseHandler petData.fullyGrown = parser.fullyGrown; petData.rarityLevel = parser.rarityLevel; petData.dead = parser.dead; - petData.skillTresholds = parser.skillTresholds; + petData.skillTresholds = parser.skillTresholds; petData.publiclyRideable = parser.publiclyRideable; petData.maximumTimeToLive = parser.maximumTimeToLive; petData.remainingTimeToLive = parser.remainingTimeToLive; diff --git a/src/room/utils/index.ts b/src/room/utils/index.ts index c4341a71..9f3fe904 100644 --- a/src/room/utils/index.ts +++ b/src/room/utils/index.ts @@ -1,9 +1,6 @@ export * from './ColorConverter'; -export * from './INitroPoint'; export * from './IRoomGeometry'; export * from './IVector3D'; -export * from './NitroPoint'; -export * from './NitroRectangle'; export * from './NumberBank'; export * from './PointMath'; export * from './Rasterizer'; From d9ea7a898365aac8d191031549e34d2522cdf274 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 30 Jun 2021 05:22:08 -0400 Subject: [PATCH 107/155] Add RoomDragEvent --- src/nitro/room/RoomEngine.ts | 3 +++ src/nitro/room/events/RoomDragEvent.ts | 27 ++++++++++++++++++++++++++ src/nitro/room/events/index.ts | 1 + 3 files changed, 31 insertions(+) create mode 100644 src/nitro/room/events/RoomDragEvent.ts diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index b06af370..28c49e1b 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -41,6 +41,7 @@ import { IRoomSessionManager } from '../session/IRoomSessionManager'; import { ISessionDataManager } from '../session/ISessionDataManager'; import { MouseEventType } from '../ui/MouseEventType'; import { FurniId } from '../utils/FurniId'; +import { RoomDragEvent } from './events'; import { RoomBackgroundColorEvent } from './events/RoomBackgroundColorEvent'; import { RoomEngineEvent } from './events/RoomEngineEvent'; import { RoomEngineObjectEvent } from './events/RoomEngineObjectEvent'; @@ -2567,6 +2568,8 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._activeRoomDragX += offsetX; this._activeRoomDragY += offsetY; + this.events.dispatchEvent(new RoomDragEvent(this.activeRoomId, offsetX, offsetY)); + this._activeRoomWasDragged = true; } } diff --git a/src/nitro/room/events/RoomDragEvent.ts b/src/nitro/room/events/RoomDragEvent.ts new file mode 100644 index 00000000..c51e1cba --- /dev/null +++ b/src/nitro/room/events/RoomDragEvent.ts @@ -0,0 +1,27 @@ +import { RoomEngineEvent } from './RoomEngineEvent'; + +export class RoomDragEvent extends RoomEngineEvent +{ + public static ROOM_DRAG: string = 'RDE_ROOM_DRAG'; + + private _offsetX: number; + private _offsetY: number; + + constructor(roomId: number, offsetX: number, offsetY: number) + { + super(RoomDragEvent.ROOM_DRAG, roomId); + + this._offsetX = offsetX; + this._offsetY = offsetY; + } + + public get offsetX(): number + { + return this._offsetX; + } + + public get offsetY(): number + { + return this._offsetY; + } +} diff --git a/src/nitro/room/events/index.ts b/src/nitro/room/events/index.ts index 18ba5258..d69e26a3 100644 --- a/src/nitro/room/events/index.ts +++ b/src/nitro/room/events/index.ts @@ -1,4 +1,5 @@ export * from './RoomBackgroundColorEvent'; +export * from './RoomDragEvent'; export * from './RoomEngineDimmerStateEvent'; export * from './RoomEngineEvent'; export * from './RoomEngineObjectEvent'; From c2f2694cf5ee70337db79c5ac5b9ba678a3f53d4 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 30 Jun 2021 05:59:28 -0400 Subject: [PATCH 108/155] Fix RoomDragEvent --- src/nitro/room/RoomEngine.ts | 23 ++--- src/nitro/ui/IRoomWidgetHandler.ts | 16 ---- src/nitro/ui/IRoomWidgetHandlerContainer.ts | 27 ------ src/nitro/ui/index.ts | 2 - .../ui/widget/ConversionTrackingWidget.ts | 85 ------------------- src/nitro/ui/widget/IRoomWidget.ts | 13 --- .../ui/widget/IRoomWidgetMessageListener.ts | 7 -- .../ui/widget/events/RoomWidgetUpdateEvent.ts | 9 -- src/nitro/ui/widget/events/index.ts | 1 - src/nitro/ui/widget/index.ts | 5 -- .../ui/widget/messages/RoomWidgetMessage.ts | 14 --- src/nitro/ui/widget/messages/index.ts | 1 - 12 files changed, 9 insertions(+), 194 deletions(-) delete mode 100644 src/nitro/ui/IRoomWidgetHandler.ts delete mode 100644 src/nitro/ui/IRoomWidgetHandlerContainer.ts delete mode 100644 src/nitro/ui/widget/ConversionTrackingWidget.ts delete mode 100644 src/nitro/ui/widget/IRoomWidget.ts delete mode 100644 src/nitro/ui/widget/IRoomWidgetMessageListener.ts delete mode 100644 src/nitro/ui/widget/events/RoomWidgetUpdateEvent.ts delete mode 100644 src/nitro/ui/widget/events/index.ts delete mode 100644 src/nitro/ui/widget/messages/RoomWidgetMessage.ts delete mode 100644 src/nitro/ui/widget/messages/index.ts diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 28c49e1b..c8f52b92 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -662,6 +662,8 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!renderingCanvas || !point) return false; + this.events.dispatchEvent(new RoomDragEvent(roomId, -(renderingCanvas.screenOffsetX - point.x), -(renderingCanvas.screenOffsetY - point.y))); + renderingCanvas.screenOffsetX = point.x; renderingCanvas.screenOffsetY = point.y; @@ -1175,18 +1177,14 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato } } - const canvas = this.getRoomInstanceRenderingCanvas(this._activeRoomId, 1); - - if(canvas) + if(this._activeRoomIsDragged) { - if(this._activeRoomIsDragged) - { - canvas.screenOffsetX = (canvas.screenOffsetX + this._activeRoomDragX); - canvas.screenOffsetY = (canvas.screenOffsetY + this._activeRoomDragY); + const renderingCanvas = this.getRoomInstanceRenderingCanvas(this._activeRoomId, 1); - this._activeRoomDragX = 0; - this._activeRoomDragY = 0; - } + if(renderingCanvas) this.setRoomInstanceRenderingCanvasOffset(this._activeRoomId, 1, new Point((renderingCanvas.screenOffsetX + this._activeRoomDragX), (renderingCanvas.screenOffsetY + this._activeRoomDragY))); + + this._activeRoomDragX = 0; + this._activeRoomDragY = 0; } } @@ -1460,8 +1458,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(this.useOffsetScrolling) { - renderingCanvas.screenOffsetX = -(roomCamera.location.x); - renderingCanvas.screenOffsetY = -(roomCamera.location.y); + this.setRoomInstanceRenderingCanvasOffset(this.activeRoomId, 1, new Point(-(roomCamera.location.x), -(roomCamera.location.y))); } else { @@ -2568,8 +2565,6 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._activeRoomDragX += offsetX; this._activeRoomDragY += offsetY; - this.events.dispatchEvent(new RoomDragEvent(this.activeRoomId, offsetX, offsetY)); - this._activeRoomWasDragged = true; } } diff --git a/src/nitro/ui/IRoomWidgetHandler.ts b/src/nitro/ui/IRoomWidgetHandler.ts deleted file mode 100644 index 8256ed7b..00000000 --- a/src/nitro/ui/IRoomWidgetHandler.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IDisposable } from '../../core/common/disposable/IDisposable'; -import { NitroEvent } from '../../core/events/NitroEvent'; -import { IRoomWidgetHandlerContainer } from './IRoomWidgetHandlerContainer'; -import { RoomWidgetUpdateEvent } from './widget/events/RoomWidgetUpdateEvent'; -import { RoomWidgetMessage } from './widget/messages/RoomWidgetMessage'; - -export interface IRoomWidgetHandler extends IDisposable -{ - update(): void; - processWidgetMessage(message: RoomWidgetMessage): RoomWidgetUpdateEvent; - processEvent(event: NitroEvent): void; - type: string; - messageTypes: string[]; - eventTypes: string[]; - container: IRoomWidgetHandlerContainer; -} \ No newline at end of file diff --git a/src/nitro/ui/IRoomWidgetHandlerContainer.ts b/src/nitro/ui/IRoomWidgetHandlerContainer.ts deleted file mode 100644 index 3d1268de..00000000 --- a/src/nitro/ui/IRoomWidgetHandlerContainer.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { Rectangle } from 'pixi.js'; -import { IConnection } from '../../core/communication/connections/IConnection'; -import { IEventDispatcher } from '../../core/events/IEventDispatcher'; -import { IRoomObject } from '../../room/object/IRoomObject'; -import { IAvatarRenderManager } from '../avatar/IAvatarRenderManager'; -import { IRoomEngine } from '../room/IRoomEngine'; -import { IRoomSession } from '../session/IRoomSession'; -import { IRoomSessionManager } from '../session/IRoomSessionManager'; -import { ISessionDataManager } from '../session/ISessionDataManager'; -import { RoomWidgetUpdateEvent } from './widget/events/RoomWidgetUpdateEvent'; -import { RoomWidgetMessage } from './widget/messages/RoomWidgetMessage'; - -export interface IRoomWidgetHandlerContainer -{ - getFirstCanvasId(): number; - getRoomViewRect(): Rectangle; - checkFurniManipulationRights(roomId: number, objectId: number, category: number): boolean; - isOwnerOfFurniture(roomObject: IRoomObject): boolean; - processWidgetMessage(message: RoomWidgetMessage): RoomWidgetUpdateEvent; - events: IEventDispatcher; - connection: IConnection; - roomEngine: IRoomEngine; - avatarRenderManager: IAvatarRenderManager; - roomSession: IRoomSession; - roomSessionManager: IRoomSessionManager; - sessionDataManager: ISessionDataManager; -} diff --git a/src/nitro/ui/index.ts b/src/nitro/ui/index.ts index ae0270bf..cd1b8dfa 100644 --- a/src/nitro/ui/index.ts +++ b/src/nitro/ui/index.ts @@ -1,5 +1,3 @@ -export * from './IRoomWidgetHandler'; -export * from './IRoomWidgetHandlerContainer'; export * from './MouseEventType'; export * from './TouchEventType'; export * from './widget'; diff --git a/src/nitro/ui/widget/ConversionTrackingWidget.ts b/src/nitro/ui/widget/ConversionTrackingWidget.ts deleted file mode 100644 index 7105cc63..00000000 --- a/src/nitro/ui/widget/ConversionTrackingWidget.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { IEventDispatcher } from '../../../core/events/IEventDispatcher'; -import { IRoomWidgetHandler } from '../IRoomWidgetHandler'; -import { IRoomWidget } from './IRoomWidget'; -import { IRoomWidgetMessageListener } from './IRoomWidgetMessageListener'; - -export class ConversionTrackingWidget implements IRoomWidget -{ - private _widgetHandler: IRoomWidgetHandler; - private _messageListener: IRoomWidgetMessageListener; - private _events: IEventDispatcher; - private _disposed: boolean; - - constructor() - { - this._widgetHandler = null; - this._messageListener = null; - this._events = null; - this._disposed = false; - } - - public initialize(k: number = 0): void - { - - } - - public dispose(): void - { - if(this.disposed) return; - - this._messageListener = null; - - if(this._events && !this._events.disposed) - { - this.unregisterUpdateEvents(this._events); - } - - if(this._widgetHandler) - { - this._widgetHandler.dispose(); - - this._widgetHandler = null; - } - - this._events = null; - this._disposed = true; - } - - public registerUpdateEvents(eventDispatcher: IEventDispatcher): void - { - this._events = eventDispatcher; - } - - public unregisterUpdateEvents(eventDispatcher: IEventDispatcher): void - { - this._events = null; - } - - public get disposed(): boolean - { - return this._disposed; - } - - public get widgetHandler(): IRoomWidgetHandler - { - return this._widgetHandler; - } - - public set widgetHandler(handler: IRoomWidgetHandler) - { - this._widgetHandler = handler; - - //@ts-ignore - if(!this._widgetHandler.widget) this._widgetHandler.widget = this; - } - - public get messageListener(): IRoomWidgetMessageListener - { - return this._messageListener; - } - - public set messageListener(listener: IRoomWidgetMessageListener) - { - this._messageListener = listener; - } -} \ No newline at end of file diff --git a/src/nitro/ui/widget/IRoomWidget.ts b/src/nitro/ui/widget/IRoomWidget.ts deleted file mode 100644 index b549ce23..00000000 --- a/src/nitro/ui/widget/IRoomWidget.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { IEventDispatcher } from '../../../core/events/IEventDispatcher'; -import { IRoomWidgetHandler } from '../IRoomWidgetHandler'; -import { IRoomWidgetMessageListener } from './IRoomWidgetMessageListener'; - -export interface IRoomWidget -{ - initialize(_arg_1?: number): void; - dispose(): void; - registerUpdateEvents(eventDispatcher: IEventDispatcher): void; - unregisterUpdateEvents(eventDispatcher: IEventDispatcher): void; - widgetHandler: IRoomWidgetHandler; - messageListener: IRoomWidgetMessageListener; -} \ No newline at end of file diff --git a/src/nitro/ui/widget/IRoomWidgetMessageListener.ts b/src/nitro/ui/widget/IRoomWidgetMessageListener.ts deleted file mode 100644 index c3d0b74e..00000000 --- a/src/nitro/ui/widget/IRoomWidgetMessageListener.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { RoomWidgetUpdateEvent } from './events/RoomWidgetUpdateEvent'; -import { RoomWidgetMessage } from './messages/RoomWidgetMessage'; - -export interface IRoomWidgetMessageListener -{ - processWidgetMessage(message: RoomWidgetMessage): RoomWidgetUpdateEvent; -} \ No newline at end of file diff --git a/src/nitro/ui/widget/events/RoomWidgetUpdateEvent.ts b/src/nitro/ui/widget/events/RoomWidgetUpdateEvent.ts deleted file mode 100644 index be3aa8df..00000000 --- a/src/nitro/ui/widget/events/RoomWidgetUpdateEvent.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { NitroEvent } from '../../../../core/events/NitroEvent'; - -export class RoomWidgetUpdateEvent extends NitroEvent -{ - constructor(type: string) - { - super(type); - } -} \ No newline at end of file diff --git a/src/nitro/ui/widget/events/index.ts b/src/nitro/ui/widget/events/index.ts deleted file mode 100644 index f7151dcd..00000000 --- a/src/nitro/ui/widget/events/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './RoomWidgetUpdateEvent'; diff --git a/src/nitro/ui/widget/index.ts b/src/nitro/ui/widget/index.ts index 8ecbd800..14790857 100644 --- a/src/nitro/ui/widget/index.ts +++ b/src/nitro/ui/widget/index.ts @@ -1,6 +1 @@ -export * from './ConversionTrackingWidget'; export * from './enums'; -export * from './events'; -export * from './IRoomWidget'; -export * from './IRoomWidgetMessageListener'; -export * from './messages'; diff --git a/src/nitro/ui/widget/messages/RoomWidgetMessage.ts b/src/nitro/ui/widget/messages/RoomWidgetMessage.ts deleted file mode 100644 index 4f201426..00000000 --- a/src/nitro/ui/widget/messages/RoomWidgetMessage.ts +++ /dev/null @@ -1,14 +0,0 @@ -export class RoomWidgetMessage -{ - private _type: string; - - constructor(type: string) - { - this._type = type; - } - - public get type(): string - { - return this._type; - } -} \ No newline at end of file diff --git a/src/nitro/ui/widget/messages/index.ts b/src/nitro/ui/widget/messages/index.ts deleted file mode 100644 index 42b264c7..00000000 --- a/src/nitro/ui/widget/messages/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './RoomWidgetMessage'; From 2735af953d7e9aa76b999b343f053b012004ed7e Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sat, 3 Jul 2021 23:09:59 -0300 Subject: [PATCH 109/155] Fix ModtoolRoomInfoParser --- .../parser/modtool/ModtoolRoomInfoParser.ts | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/src/nitro/communication/messages/parser/modtool/ModtoolRoomInfoParser.ts b/src/nitro/communication/messages/parser/modtool/ModtoolRoomInfoParser.ts index bc45146b..84fe6673 100644 --- a/src/nitro/communication/messages/parser/modtool/ModtoolRoomInfoParser.ts +++ b/src/nitro/communication/messages/parser/modtool/ModtoolRoomInfoParser.ts @@ -8,14 +8,20 @@ export class ModtoolRoomInfoParser implements IMessageParser private _ownerInRoom: boolean; private _ownerId: number; private _ownerName: string; - private _bool: boolean; private _name: string; private _description: string; - private _tagsTotal: number; + private _tags: string[]; public flush(): boolean { this._id = null; + this._playerAmount = 0; + this._ownerInRoom = false; + this._ownerId = 0; + this._ownerName = null; + this._name = null; + this._description = null; + this._tags = []; return true; } @@ -24,15 +30,22 @@ export class ModtoolRoomInfoParser implements IMessageParser { if(!wrapper) return false; - this._id = wrapper.readInt(); + this._id = wrapper.readInt(); this._playerAmount = wrapper.readInt(); this._ownerInRoom = wrapper.readBoolean(); this._ownerId = wrapper.readInt(); this._ownerName = wrapper.readString(); - this._bool = wrapper.readBoolean(); + wrapper.readBoolean(); this._name = wrapper.readString(); this._description = wrapper.readString(); - this._tagsTotal = wrapper.readInt(); + const tagsTotal = wrapper.readInt(); + + this._tags = []; + + for(let i = 0; i < tagsTotal; i++) + { + this._tags.push(wrapper.readString()); + } return true; } @@ -71,4 +84,9 @@ export class ModtoolRoomInfoParser implements IMessageParser { return this._description; } + + public get tags(): string[] + { + return this._tags; + } } From 89f13aeb89451dac2deef868a97589ea60111ac5 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 4 Jul 2021 01:24:09 -0300 Subject: [PATCH 110/155] Sound Manager --- src/nitro/Nitro.ts | 13 ++ src/nitro/events/NitroSoundEvent.ts | 19 +++ src/nitro/sound/SoundManager.ts | 208 ++++++++++++++++++++++++++++ 3 files changed, 240 insertions(+) create mode 100644 src/nitro/events/NitroSoundEvent.ts create mode 100644 src/nitro/sound/SoundManager.ts diff --git a/src/nitro/Nitro.ts b/src/nitro/Nitro.ts index a2fd3f6a..3b0f6119 100644 --- a/src/nitro/Nitro.ts +++ b/src/nitro/Nitro.ts @@ -1,4 +1,5 @@ import { Application, SCALE_MODES, settings } from 'pixi.js'; +import { INitroManager } from '..'; import { ConfigurationEvent } from '../core/configuration/ConfigurationEvent'; import { EventDispatcher } from '../core/events/EventDispatcher'; import { IEventDispatcher } from '../core/events/IEventDispatcher'; @@ -28,6 +29,7 @@ import { IRoomSessionManager } from './session/IRoomSessionManager'; import { ISessionDataManager } from './session/ISessionDataManager'; import { RoomSessionManager } from './session/RoomSessionManager'; import { SessionDataManager } from './session/SessionDataManager'; +import { SoundManager } from './sound/SoundManager'; import { HabboWebTools } from './utils/HabboWebTools'; LegacyExternalInterface.available; @@ -57,6 +59,7 @@ export class Nitro extends Application implements INitro private _roomSessionManager: IRoomSessionManager; private _roomManager: IRoomManager; private _cameraManager: IRoomCameraWidgetManager; + private _soundManager: INitroManager; private _linkTrackers: ILinkEventTracker[]; private _workerTrackers: IWorkerEventTracker[]; @@ -98,6 +101,7 @@ export class Nitro extends Application implements INitro this._roomSessionManager = new RoomSessionManager(this._communication, this._roomEngine); this._roomManager = new RoomManager(this._roomEngine, this._roomEngine.visualizationFactory, this._roomEngine.logicFactory); this._cameraManager = new RoomCameraWidgetManager(); + this._soundManager = new SoundManager(); this._linkTrackers = []; this._workerTrackers = []; @@ -147,6 +151,8 @@ export class Nitro extends Application implements INitro if(this._avatar) this._avatar.init(); + if(this._soundManager) this._soundManager.init(); + if(this._roomEngine) { this._roomEngine.sessionDataManager = this._sessionDataManager; @@ -208,6 +214,13 @@ export class Nitro extends Application implements INitro this._avatar = null; } + if(this._soundManager) + { + this._soundManager.dispose(); + + this._soundManager = null; + } + if(this._communication) { this._communication.dispose(); diff --git a/src/nitro/events/NitroSoundEvent.ts b/src/nitro/events/NitroSoundEvent.ts new file mode 100644 index 00000000..02a56d9d --- /dev/null +++ b/src/nitro/events/NitroSoundEvent.ts @@ -0,0 +1,19 @@ +import { NitroEvent } from '../../core/events/NitroEvent'; + +export class NitroSoundEvent extends NitroEvent +{ + public static PLAY_SOUND: string = 'NSOE_PLAY_SOUND'; + + private _sampleCode: string; + + constructor(type: string, sampleCode: string) + { + super(type); + this._sampleCode = sampleCode; + } + + public get sampleCode(): string + { + return this._sampleCode; + } +} diff --git a/src/nitro/sound/SoundManager.ts b/src/nitro/sound/SoundManager.ts new file mode 100644 index 00000000..6e370067 --- /dev/null +++ b/src/nitro/sound/SoundManager.ts @@ -0,0 +1,208 @@ +import { AdvancedMap, Nitro, NitroSettingsEvent, RoomEngineEvent, RoomEngineObjectEvent, RoomEngineSamplePlaybackEvent } from '../..'; +import { NitroManager } from '../../core/common/NitroManager'; +import { NitroSoundEvent } from '../events/NitroSoundEvent'; +import { NitroEvent } from './../../core/events/NitroEvent'; + +export class SoundManager extends NitroManager +{ + private _volumeSystem: number; + private _volumeFurni: number; + private _volumeTrax: number; + + private _internalSamples: AdvancedMap; + private _furniSamples: AdvancedMap; + private _furnitureBeingPlayed: AdvancedMap; + + constructor() + { + super(); + + this._volumeSystem = 0.5; + this._volumeFurni = 0.5; + this._volumeTrax = 0.5; + + this._internalSamples = new AdvancedMap(); + this._furniSamples = new AdvancedMap(); + this._furnitureBeingPlayed = new AdvancedMap(); + + this.onEvent = this.onEvent.bind(this); + } + + private onEvent(event: NitroEvent) + { + switch(event.type) + { + case RoomEngineSamplePlaybackEvent.PLAY_SAMPLE: { + const castedEvent = (event as RoomEngineSamplePlaybackEvent); + + this.playFurniSample(castedEvent.objectId, castedEvent.sampleId, castedEvent.pitch); + return; + } + case RoomEngineObjectEvent.REMOVED: { + const castedEvent = (event as RoomEngineObjectEvent); + + this.stopFurniSample(castedEvent.objectId); + return; + } + case RoomEngineEvent.DISPOSED: { + this._furnitureBeingPlayed.getKeys().forEach((objectId: number) => + { + this.stopFurniSample(objectId); + }); + return; + } + case NitroSettingsEvent.SETTINGS_UPDATED: { + const castedEvent = (event as NitroSettingsEvent); + + const volumeFurniUpdated = castedEvent.volumeFurni !== this._volumeFurni; + + this._volumeSystem = castedEvent.volumeSystem; + this._volumeFurni = castedEvent.volumeFurni; + this._volumeTrax = castedEvent.volumeTrax; + + if(volumeFurniUpdated) this.updateFurniSamplesVolume(this._volumeFurni); + return; + } + case NitroSoundEvent.PLAY_SOUND: { + const castedEvent = (event as NitroSoundEvent); + + this.playInternalSample(castedEvent.sampleCode); + return; + } + } + } + + public onInit(): void + { + Nitro.instance.roomEngine.events.addEventListener(RoomEngineSamplePlaybackEvent.PLAY_SAMPLE, this.onEvent); + Nitro.instance.roomEngine.events.addEventListener(RoomEngineObjectEvent.REMOVED, this.onEvent); + Nitro.instance.roomEngine.events.addEventListener(RoomEngineEvent.DISPOSED, this.onEvent); + Nitro.instance.events.addEventListener(NitroSettingsEvent.SETTINGS_UPDATED, this.onEvent); + Nitro.instance.events.addEventListener(NitroSoundEvent.PLAY_SOUND, this.onEvent); + } + + public onDispose(): void + { + Nitro.instance.roomEngine.events.removeEventListener(RoomEngineSamplePlaybackEvent.PLAY_SAMPLE, this.onEvent); + Nitro.instance.roomEngine.events.removeEventListener(RoomEngineObjectEvent.REMOVED, this.onEvent); + Nitro.instance.roomEngine.events.removeEventListener(RoomEngineEvent.DISPOSED, this.onEvent); + Nitro.instance.events.removeEventListener(NitroSettingsEvent.SETTINGS_UPDATED, this.onEvent); + Nitro.instance.events.removeEventListener(NitroSoundEvent.PLAY_SOUND, this.onEvent); + } + + private playSample(sample: HTMLAudioElement, volume: number, pitch: number = 1): void + { + sample.volume = volume; + sample.currentTime = 0; + + try + { + sample.play(); + } + catch (e) + { + console.log(e); + } + } + + private playInternalSample(code: string): void + { + let sample = this._internalSamples.getValue(code); + + if(!sample) + { + const sampleUrl = Nitro.instance.getConfiguration('internal.samples.url'); + + sample = new Audio(sampleUrl.replace('%sample%', code)); + this._internalSamples.add(code, sample); + } + + this.playSample(sample, this._volumeSystem); + } + + private playFurniSample(objectId: number, code: number, pitch: number): void + { + let sample = this._furniSamples.getValue(code); + + if(!sample) + { + const sampleUrl = Nitro.instance.getConfiguration('external.samples.url'); + + sample = new Audio(sampleUrl.replace('%sample%', code.toString())); + this._furniSamples.add(code, sample); + } + + if(!this._furnitureBeingPlayed.hasKey(objectId)) this._furnitureBeingPlayed.add(objectId, code); + + sample.onended = (event) => + { + this.stopFurniSample(objectId); + }; + + sample.onpause = (event) => + { + this.stopFurniSample(objectId); + }; + + sample.onerror = (event) => + { + this.stopFurniSample(objectId); + }; + + this.playSample(sample, this._volumeFurni, pitch); + } + + private stopInternalSample(code: string): void + { + const sample = this._internalSamples.getValue(code); + + if(!sample) return; + + try + { + sample.pause(); + } + catch (e) + { + console.log(e); + } + } + + private stopFurniSample(objectId: number): void + { + const furnitureBeingPlayed = this._furnitureBeingPlayed.getValue(objectId); + + if(!furnitureBeingPlayed) return; + + const sample = this._furniSamples.getValue(furnitureBeingPlayed); + + this._furnitureBeingPlayed.remove(objectId); + + if(!sample) return; + + try + { + sample.pause(); + } + catch (e) + { + console.log(e); + } + } + + private updateInternalSamplesVolume(volume: number): void + { + this._internalSamples.getValues().forEach((sample: HTMLAudioElement) => + { + sample.volume = volume; + }); + } + + private updateFurniSamplesVolume(volume: number): void + { + this._furniSamples.getValues().forEach((sample: HTMLAudioElement) => + { + sample.volume = volume; + }); + } +} From 43f25ac47201abd0d635574d7a005e8acda67533 Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 4 Jul 2021 17:08:15 -0300 Subject: [PATCH 111/155] SoundManager updates --- src/nitro/sound/SoundManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/sound/SoundManager.ts b/src/nitro/sound/SoundManager.ts index 6e370067..061cce65 100644 --- a/src/nitro/sound/SoundManager.ts +++ b/src/nitro/sound/SoundManager.ts @@ -111,7 +111,7 @@ export class SoundManager extends NitroManager if(!sample) { - const sampleUrl = Nitro.instance.getConfiguration('internal.samples.url'); + const sampleUrl = Nitro.instance.core.configuration.interpolate(Nitro.instance.getConfiguration('sounds.url')); sample = new Audio(sampleUrl.replace('%sample%', code)); this._internalSamples.add(code, sample); @@ -126,7 +126,7 @@ export class SoundManager extends NitroManager if(!sample) { - const sampleUrl = Nitro.instance.getConfiguration('external.samples.url'); + const sampleUrl = Nitro.instance.core.configuration.interpolate(Nitro.instance.getConfiguration('external.samples.url')); sample = new Audio(sampleUrl.replace('%sample%', code.toString())); this._furniSamples.add(code, sample); From 80daebc87455e10fe590c4e3f4ac2f9bf1edefcb Mon Sep 17 00:00:00 2001 From: MyNameIsBatman Date: Sun, 4 Jul 2021 18:18:44 -0300 Subject: [PATCH 112/155] Remove unecessary interpolate --- src/nitro/sound/SoundManager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/sound/SoundManager.ts b/src/nitro/sound/SoundManager.ts index 061cce65..fead605d 100644 --- a/src/nitro/sound/SoundManager.ts +++ b/src/nitro/sound/SoundManager.ts @@ -111,7 +111,7 @@ export class SoundManager extends NitroManager if(!sample) { - const sampleUrl = Nitro.instance.core.configuration.interpolate(Nitro.instance.getConfiguration('sounds.url')); + const sampleUrl = Nitro.instance.getConfiguration('sounds.url'); sample = new Audio(sampleUrl.replace('%sample%', code)); this._internalSamples.add(code, sample); @@ -126,7 +126,7 @@ export class SoundManager extends NitroManager if(!sample) { - const sampleUrl = Nitro.instance.core.configuration.interpolate(Nitro.instance.getConfiguration('external.samples.url')); + const sampleUrl = Nitro.instance.getConfiguration('external.samples.url'); sample = new Audio(sampleUrl.replace('%sample%', code.toString())); this._furniSamples.add(code, sample); From be1c8bc90ba72baa11703828e637b1eccf00ed32 Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 6 Jul 2021 09:19:35 -0400 Subject: [PATCH 113/155] Updates --- src/core/utils/NitroContainer.ts | 4 ++++ src/core/utils/NitroSprite.ts | 4 ++++ src/core/utils/index.ts | 2 ++ src/nitro/room/RoomEngine.ts | 8 ++++++-- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 src/core/utils/NitroContainer.ts create mode 100644 src/core/utils/NitroSprite.ts diff --git a/src/core/utils/NitroContainer.ts b/src/core/utils/NitroContainer.ts new file mode 100644 index 00000000..978aed21 --- /dev/null +++ b/src/core/utils/NitroContainer.ts @@ -0,0 +1,4 @@ +import { Container } from 'pixi.js'; + +export class NitroContainer extends Container +{} diff --git a/src/core/utils/NitroSprite.ts b/src/core/utils/NitroSprite.ts new file mode 100644 index 00000000..92954964 --- /dev/null +++ b/src/core/utils/NitroSprite.ts @@ -0,0 +1,4 @@ +import { Sprite } from 'pixi.js'; + +export class NitroSprite extends Sprite +{} diff --git a/src/core/utils/index.ts b/src/core/utils/index.ts index 208df2f9..1ea96255 100644 --- a/src/core/utils/index.ts +++ b/src/core/utils/index.ts @@ -1,7 +1,9 @@ export * from './AdvancedMap'; export * from './INitroPoint'; export * from './NitroAdjustmentFilter'; +export * from './NitroContainer'; export * from './NitroFilter'; export * from './NitroPoint'; export * from './NitroRectangle'; +export * from './NitroSprite'; export * from './NitroTimer'; diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index c8f52b92..fb813924 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -1167,13 +1167,17 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(!camera) continue; + let location: IVector3D = null; + const object = this.getRoomObject(instanceData.roomId, camera.targetId, camera.targetCategory); - if(!object) continue; + if(object) location = object.getLocation(); + + if(!location) continue; if((instanceData.roomId !== this._activeRoomId) || !this._activeRoomIsDragged) { - this.updateRoomCamera(instanceData.roomId, 1, object.getLocation(), time); + this.updateRoomCamera(instanceData.roomId, 1, location, time); } } From 161e1454117157bbdb654b437571aea3d4a34bdb Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 8 Jul 2021 04:25:17 -0400 Subject: [PATCH 114/155] Updates --- src/nitro/communication/NitroMessages.ts | 5 +- .../messages/outgoing/OutgoingHeader.ts | 4 + .../messages/outgoing/pet/PetMountComposer.ts | 21 +++ .../outgoing/pet/PetSupplementComposer.ts | 21 +++ .../messages/outgoing/pet/index.ts | 2 + .../furniture/FurnitureGuildInfoComposer.ts | 21 +++ .../messages/outgoing/room/furniture/index.ts | 1 + src/nitro/room/RoomObjectEventHandler.ts | 125 ++++++++++++------ src/nitro/room/RoomObjectLogicFactory.ts | 23 +++- .../events/RoomEngineSamplePlaybackEvent.ts | 2 +- .../events/RoomEngineTriggerWidgetEvent.ts | 7 +- .../room/events/RoomEngineUseProductEvent.ts | 28 ++++ .../events/RoomObjectWidgetRequestEvent.ts | 6 +- src/nitro/room/events/index.ts | 1 + .../furniture/FurnitureCraftingGizmoLogic.ts | 10 ++ .../furniture/FurnitureEffectBoxLogic.ts | 27 ++++ ...dLogic.ts => FurnitureFriendFurniLogic.ts} | 25 ++-- .../logic/furniture/FurnitureLoveLockLogic.ts | 10 ++ .../FurnitureMonsterplantSeedLogic.ts | 25 ++++ .../furniture/FurnitureMysteryTrophyLogic.ts | 25 ++++ .../FurniturePurchaseableClothingLogic.ts | 10 +- .../furniture/FurnitureRandomTeleportLogic.ts | 10 ++ .../furniture/FurnitureRentableSpaceLogic.ts | 48 +++++++ .../room/object/logic/furniture/index.ts | 9 +- src/nitro/session/IRoomSession.ts | 2 + src/nitro/session/RoomSession.ts | 11 ++ src/nitro/ui/widget/enums/ContextMenuEnum.ts | 12 ++ src/nitro/ui/widget/enums/index.ts | 1 + 28 files changed, 433 insertions(+), 59 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/pet/PetMountComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/pet/PetSupplementComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/room/furniture/FurnitureGuildInfoComposer.ts create mode 100644 src/nitro/room/events/RoomEngineUseProductEvent.ts create mode 100644 src/nitro/room/object/logic/furniture/FurnitureCraftingGizmoLogic.ts create mode 100644 src/nitro/room/object/logic/furniture/FurnitureEffectBoxLogic.ts rename src/nitro/room/object/logic/furniture/{FurnitureFriendLogic.ts => FurnitureFriendFurniLogic.ts} (75%) create mode 100644 src/nitro/room/object/logic/furniture/FurnitureLoveLockLogic.ts create mode 100644 src/nitro/room/object/logic/furniture/FurnitureMonsterplantSeedLogic.ts create mode 100644 src/nitro/room/object/logic/furniture/FurnitureMysteryTrophyLogic.ts create mode 100644 src/nitro/room/object/logic/furniture/FurnitureRandomTeleportLogic.ts create mode 100644 src/nitro/room/object/logic/furniture/FurnitureRentableSpaceLogic.ts create mode 100644 src/nitro/ui/widget/enums/ContextMenuEnum.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index dbcacc86..cc8eef45 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, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent } from './messages'; +import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, FurnitureGuildInfoComposer, PetMountComposer, PetSupplementComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent'; @@ -856,7 +856,9 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.ACHIEVEMENT_LIST, RequestAchievementsMessageComposer); // PET + this._composers.set(OutgoingHeader.PET_MOUNT, PetMountComposer); this._composers.set(OutgoingHeader.PET_RESPECT, PetRespectComposer); + this._composers.set(OutgoingHeader.PET_SUPPLEMENT, PetSupplementComposer); this._composers.set(OutgoingHeader.PET_INFO, RequestPetInfoComposer); // ROOM @@ -902,6 +904,7 @@ export class NitroMessages implements IMessageConfiguration // FURNITURE this._composers.set(OutgoingHeader.FURNITURE_ALIASES, FurnitureAliasesComposer); + this._composers.set(OutgoingHeader.FURNITURE_GUILD_INFO, FurnitureGuildInfoComposer); this._composers.set(OutgoingHeader.FURNITURE_PICKUP, FurniturePickupComposer); this._composers.set(OutgoingHeader.FURNITURE_PLACE, FurniturePlaceComposer); this._composers.set(OutgoingHeader.ITEM_PAINT, FurniturePlacePaintComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index c50e95b4..b8e02e65 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -236,4 +236,8 @@ export class OutgoingHeader public static CATALOG_REQUESET_PET_BREEDS = 1756; public static APPROVE_NAME = 2109; public static UNIT_GIVE_HANDITEM_PET = 2768; + public static PET_MOUNT = 1036; + public static PET_SUPPLEMENT = 749; + public static FURNITURE_GUILD_INFO = 2651; + public static ACHIEVEMENT_RESOLUTION_OPEN = 359; } diff --git a/src/nitro/communication/messages/outgoing/pet/PetMountComposer.ts b/src/nitro/communication/messages/outgoing/pet/PetMountComposer.ts new file mode 100644 index 00000000..65d0e3e3 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/pet/PetMountComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class PetMountComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(petId: number, flag: boolean) + { + this._data = [ petId, flag]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/pet/PetSupplementComposer.ts b/src/nitro/communication/messages/outgoing/pet/PetSupplementComposer.ts new file mode 100644 index 00000000..62d426ba --- /dev/null +++ b/src/nitro/communication/messages/outgoing/pet/PetSupplementComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class PetSupplementComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(petId: number, supplement: number) + { + this._data = [ petId, supplement ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/pet/index.ts b/src/nitro/communication/messages/outgoing/pet/index.ts index 156eb381..aae5687f 100644 --- a/src/nitro/communication/messages/outgoing/pet/index.ts +++ b/src/nitro/communication/messages/outgoing/pet/index.ts @@ -1,2 +1,4 @@ +export * from './PetMountComposer'; export * from './PetRespectComposer'; +export * from './PetSupplementComposer'; export * from './RequestPetInfoComposer'; diff --git a/src/nitro/communication/messages/outgoing/room/furniture/FurnitureGuildInfoComposer.ts b/src/nitro/communication/messages/outgoing/room/furniture/FurnitureGuildInfoComposer.ts new file mode 100644 index 00000000..c14028ef --- /dev/null +++ b/src/nitro/communication/messages/outgoing/room/furniture/FurnitureGuildInfoComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class FurnitureGuildInfoComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(objectId: number, guildId: number) + { + this._data = [ objectId, guildId ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/room/furniture/index.ts b/src/nitro/communication/messages/outgoing/room/furniture/index.ts index de495f39..db3a223a 100644 --- a/src/nitro/communication/messages/outgoing/room/furniture/index.ts +++ b/src/nitro/communication/messages/outgoing/room/furniture/index.ts @@ -2,6 +2,7 @@ export * from './ads'; export * from './dimmer'; export * from './floor'; export * from './FurnitureAliasesComposer'; +export * from './FurnitureGuildInfoComposer'; export * from './FurniturePickupComposer'; export * from './FurniturePlaceComposer'; export * from './FurniturePlacePaintComposer'; diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 0ebf04b2..469ae481 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -11,6 +11,7 @@ import { IRoomGeometry } from '../../room/utils/IRoomGeometry'; import { IVector3D } from '../../room/utils/IVector3D'; import { RoomEnterEffect } from '../../room/utils/RoomEnterEffect'; import { Vector3d } from '../../room/utils/Vector3d'; +import { FurnitureGuildInfoComposer } from '../communication'; import { BotPlaceComposer } from '../communication/messages/outgoing/room/engine/BotPlaceComposer'; import { GetItemDataComposer } from '../communication/messages/outgoing/room/engine/GetItemDataComposer'; import { ModifyWallItemDataComposer } from '../communication/messages/outgoing/room/engine/ModifyWallItemDataComposer'; @@ -34,6 +35,7 @@ import { RoomUnitWalkComposer } from '../communication/messages/outgoing/room/un import { Nitro } from '../Nitro'; import { MouseEventType } from '../ui/MouseEventType'; import { RoomObjectPlacementSource } from './enums/RoomObjectPlacementSource'; +import { RoomEngineUseProductEvent } from './events'; import { RoomEngineDimmerStateEvent } from './events/RoomEngineDimmerStateEvent'; import { RoomEngineObjectEvent } from './events/RoomEngineObjectEvent'; import { RoomEngineObjectPlacedEvent } from './events/RoomEngineObjectPlacedEvent'; @@ -743,17 +745,90 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou case RoomObjectWidgetRequestEvent.CLOSE_WIDGET: eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.CLOSE_WIDGET, roomId, objectId, objectCategory, ((event.object as IRoomObjectController).logic.widget))); return; - case RoomObjectWidgetRequestEvent.TROPHY: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_TROPHY, roomId, objectId, objectCategory)); + case RoomObjectWidgetRequestEvent.OPEN_FURNI_CONTEXT_MENU: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU, roomId, objectId, objectCategory, ((event.object as IRoomObjectController).logic.contextMenu))); + return; + case RoomObjectWidgetRequestEvent.CLOSE_FURNI_CONTEXT_MENU: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.PLACEHOLDER: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PLACEHOLDER, roomId, objectId, objectCategory)); return; case RoomObjectWidgetRequestEvent.CREDITFURNI: eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_CREDITFURNI, roomId, objectId, objectCategory)); return; - case RoomObjectWidgetRequestEvent.INERNAL_LINK: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_INTERNAL_LINK, roomId, objectId, objectCategory)); + case RoomObjectWidgetRequestEvent.STICKIE: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_STICKIE, roomId, objectId, objectCategory)); return; - case RoomObjectWidgetRequestEvent.ROOM_LINK: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ROOM_LINK, roomId, objectId, objectCategory)); + case RoomObjectWidgetRequestEvent.PRESENT: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PRESENT, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.TROPHY: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_TROPHY, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.TEASER: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_TEASER, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.ECOTRONBOX: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ECOTRONBOX, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.DIMMER: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_DIMMER, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.WIDGET_REMOVE_DIMMER: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_DIMMER, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.CLOTHING_CHANGE: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_CLOTHING_CHANGE, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.JUKEBOX_PLAYLIST_EDITOR: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PLAYLIST_EDITOR, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.MANNEQUIN: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MANNEQUIN, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.PET_PRODUCT_MENU: + eventDispatcher.dispatchEvent(new RoomEngineUseProductEvent(RoomEngineUseProductEvent.USE_PRODUCT_FROM_ROOM, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.GUILD_FURNI_CONTEXT_MENU: + this._roomEngine.connection.send(new FurnitureGuildInfoComposer(event.objectId, event.object.model.getValue(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_GUILD_ID))); + return; + case RoomObjectWidgetRequestEvent.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.BACKGROUND_COLOR: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_BACKGROUND_COLOR, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.MYSTERYBOX_OPEN_DIALOG: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MYSTERYBOX_OPEN_DIALOG, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.EFFECTBOX_OPEN_DIALOG: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_EFFECTBOX_OPEN_DIALOG, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.MYSTERYTROPHY_OPEN_DIALOG: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MYSTERYTROPHY_OPEN_DIALOG, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_OPEN: + //this._roomEngine.connection.send(); + // new _Str_4406(k._Str_1577, 0) + return; + case RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_ENGRAVING: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ACHIEVEMENT_RESOLUTION_ENGRAVING, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_FAILED: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ACHIEVEMENT_RESOLUTION_FAILED, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_CONFIRM: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_CONFIRM, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_ENGRAVING: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_ENGRAVING, roomId, objectId, objectCategory)); + return; + case RoomObjectWidgetRequestEvent.BADGE_DISPLAY_ENGRAVING: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_BADGE_DISPLAY_ENGRAVING, roomId, objectId, objectCategory)); return; case RoomObjectWidgetRequestEvent.HIGH_SCORE_DISPLAY: eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_HIGH_SCORE_DISPLAY, roomId, objectId, objectCategory)); @@ -761,42 +836,12 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou case RoomObjectWidgetRequestEvent.HIDE_HIGH_SCORE_DISPLAY: eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_HIDE_HIGH_SCORE_DISPLAY, roomId, objectId, objectCategory)); return; - case RoomObjectWidgetRequestEvent.STICKIE: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_STICKIE, roomId, objectId, objectCategory)); + case RoomObjectWidgetRequestEvent.INERNAL_LINK: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_INTERNAL_LINK, roomId, objectId, objectCategory)); return; - case RoomObjectWidgetRequestEvent.DIMMER: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_DIMMER, roomId, objectId, objectCategory)); + case RoomObjectWidgetRequestEvent.ROOM_LINK: + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ROOM_LINK, roomId, objectId, objectCategory)); return; - case RoomObjectWidgetRequestEvent.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG, roomId, objectId, objectCategory)); - break; - case RoomObjectWidgetRequestEvent.MYSTERYBOX_OPEN_DIALOG: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MYSTERYBOX_OPEN_DIALOG, roomId, objectId, objectCategory)); - break; - case RoomObjectWidgetRequestEvent.MYSTERYTROPHY_OPEN_DIALOG: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MYSTERYTROPHY_OPEN_DIALOG, roomId, objectId, objectCategory)); - break; - case RoomObjectWidgetRequestEvent.EFFECTBOX_OPEN_DIALOG: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_EFFECTBOX_OPEN_DIALOG, roomId, objectId, objectCategory)); - break; - case RoomObjectWidgetRequestEvent.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG, roomId, objectId, objectCategory)); - break; - case RoomObjectWidgetRequestEvent.MANNEQUIN: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MANNEQUIN, roomId, objectId, objectCategory)); - break; - - case RoomObjectWidgetRequestEvent.BACKGROUND_COLOR: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_BACKGROUND_COLOR, roomId, objectId, objectCategory)); - break; - case RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_ENGRAVING: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_ENGRAVING, roomId, objectId, objectCategory)); - break; - case RoomObjectWidgetRequestEvent.PRESENT: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PRESENT, roomId, objectId, objectCategory)); - break; - - } } diff --git a/src/nitro/room/RoomObjectLogicFactory.ts b/src/nitro/room/RoomObjectLogicFactory.ts index 6d428e19..a283179f 100644 --- a/src/nitro/room/RoomObjectLogicFactory.ts +++ b/src/nitro/room/RoomObjectLogicFactory.ts @@ -4,11 +4,13 @@ import { IEventDispatcher } from '../../core/events/IEventDispatcher'; import { IRoomObjectEventHandler } from '../../room/object/logic/IRoomObjectEventHandler'; import { IRoomObjectLogicFactory } from '../../room/object/logic/IRoomObjectLogicFactory'; import { RoomObjectLogicBase } from '../../room/object/logic/RoomObjectLogicBase'; +import { FurnitureEffectBoxLogic, FurnitureLoveLockLogic, FurnitureMonsterplantSeedLogic, FurnitureMysteryTrophyLogic, FurnitureRandomTeleportLogic, FurnitureRentableSpaceLogic } from './object'; import { AvatarLogic } from './object/logic/avatar/AvatarLogic'; import { FurnitureBadgeDisplayLogic } from './object/logic/furniture/FurnitureBadgeDisplayLogic'; import { FurnitureChangeStateWhenStepOnLogic } from './object/logic/furniture/FurnitureChangeStateWhenStepOnLogic'; import { FurnitureCounterClockLogic } from './object/logic/furniture/FurnitureCounterClockLogic'; import { FurnitureCrackableLogic } from './object/logic/furniture/FurnitureCrackableLogic'; +import { FurnitureCraftingGizmoLogic } from './object/logic/furniture/FurnitureCraftingGizmoLogic'; import { FurnitureCreditLogic } from './object/logic/furniture/FurnitureCreditLogic'; import { FurnitureCustomStackHeightLogic } from './object/logic/furniture/FurnitureCustomStackHeightLogic'; import { FurnitureDiceLogic } from './object/logic/furniture/FurnitureDiceLogic'; @@ -17,7 +19,6 @@ import { FurnitureEditableRoomLinkLogic } from './object/logic/furniture/Furnitu import { FurnitureExternalImageLogic } from './object/logic/furniture/FurnitureExternalImageLogic'; import { FurnitureFireworksLogic } from './object/logic/furniture/FurnitureFireworksLogic'; import { FurnitureFloorHoleLogic } from './object/logic/furniture/FurnitureFloorHoleLogic'; -import { FurnitureFriendLogic } from './object/logic/furniture/FurnitureFriendLogic'; import { FurnitureGuildCustomizedLogic } from './object/logic/furniture/FurnitureGuildCustomizedLogic'; import { FurnitureHighScoreLogic } from './object/logic/furniture/FurnitureHighScoreLogic'; import { FurnitureHockeyScoreLogic } from './object/logic/furniture/FurnitureHockeyScoreLogic'; @@ -277,11 +278,29 @@ export class RoomObjectLogicFactory implements IRoomObjectLogicFactory logic = FurnitureWindowLogic; break; case RoomObjectLogicType.FURNITURE_LOVELOCK: - logic = FurnitureFriendLogic; + logic = FurnitureLoveLockLogic; break; case RoomObjectLogicType.FURNITURE_YOUTUBE: logic = FurnitureYoutubeLogic; break; + case RoomObjectLogicType.FURNITURE_CRAFTING_GIZMO: + logic = FurnitureCraftingGizmoLogic; + break; + case RoomObjectLogicType.FURNITURE_RENTABLE_SPACE: + logic = FurnitureRentableSpaceLogic; + break; + case RoomObjectLogicType.FURNITURE_EFFECTBOX: + logic = FurnitureEffectBoxLogic; + break; + case RoomObjectLogicType.FURNITURE_MONSTERPLANT_SEED: + logic = FurnitureMonsterplantSeedLogic; + break; + case RoomObjectLogicType.FURNITURE_MYSTERYTROPHY: + logic = FurnitureMysteryTrophyLogic; + break; + case RoomObjectLogicType.FURNITURE_RANDOM_TELEPORT: + logic = FurnitureRandomTeleportLogic; + break; default: logic = FurnitureLogic; break; diff --git a/src/nitro/room/events/RoomEngineSamplePlaybackEvent.ts b/src/nitro/room/events/RoomEngineSamplePlaybackEvent.ts index 5c017f51..e0ad285e 100644 --- a/src/nitro/room/events/RoomEngineSamplePlaybackEvent.ts +++ b/src/nitro/room/events/RoomEngineSamplePlaybackEvent.ts @@ -1,6 +1,6 @@ import { RoomEngineObjectEvent } from './RoomEngineObjectEvent'; -export class RoomEngineSamplePlaybackEvent extends RoomEngineObjectEvent +export class RoomEngineSamplePlaybackEvent extends RoomEngineObjectEvent { public static ROOM_OBJECT_INITIALIZED: string = 'ROPSPE_ROOM_OBJECT_INITIALIZED'; public static ROOM_OBJECT_DISPOSED: string = 'ROPSPE_ROOM_OBJECT_DISPOSED'; diff --git a/src/nitro/room/events/RoomEngineTriggerWidgetEvent.ts b/src/nitro/room/events/RoomEngineTriggerWidgetEvent.ts index 3c84908d..398a71ab 100644 --- a/src/nitro/room/events/RoomEngineTriggerWidgetEvent.ts +++ b/src/nitro/room/events/RoomEngineTriggerWidgetEvent.ts @@ -47,4 +47,9 @@ export class RoomEngineTriggerWidgetEvent extends RoomEngineObjectEvent { return this._widget; } -} \ No newline at end of file + + public get contextMenu(): string + { + return this._widget; + } +} diff --git a/src/nitro/room/events/RoomEngineUseProductEvent.ts b/src/nitro/room/events/RoomEngineUseProductEvent.ts new file mode 100644 index 00000000..c8e78aa6 --- /dev/null +++ b/src/nitro/room/events/RoomEngineUseProductEvent.ts @@ -0,0 +1,28 @@ +import { RoomEngineObjectEvent } from './RoomEngineObjectEvent'; + +export class RoomEngineUseProductEvent extends RoomEngineObjectEvent +{ + public static USE_PRODUCT_FROM_ROOM: string = 'REUPE_USE_PRODUCT_FROM_ROOM'; + public static USE_PRODUCT_FROM_INVENTORY: string = 'REUPE_USE_PRODUCT_FROM_INVENTORY'; + + private _inventoryStripId: number; + private _furnitureTypeId: number; + + constructor(type: string, roomId: number, objectId: number, category: number, inventoryStripId = -1, furnitureTypeId = -1) + { + super(type, roomId, objectId, category); + + this._inventoryStripId = inventoryStripId; + this._furnitureTypeId = furnitureTypeId; + } + + public get inventoryStripId(): number + { + return this._inventoryStripId; + } + + public get furnitureTypeId(): number + { + return this._furnitureTypeId; + } +} diff --git a/src/nitro/room/events/RoomObjectWidgetRequestEvent.ts b/src/nitro/room/events/RoomObjectWidgetRequestEvent.ts index 3b77259f..fcae8888 100644 --- a/src/nitro/room/events/RoomObjectWidgetRequestEvent.ts +++ b/src/nitro/room/events/RoomObjectWidgetRequestEvent.ts @@ -38,8 +38,8 @@ export class RoomObjectWidgetRequestEvent extends RoomObjectEvent public static INERNAL_LINK: string = 'ROWRE_INTERNAL_LINK'; public static ROOM_LINK: string = 'ROWRE_ROOM_LINK'; - constructor(k: string, _arg_2: IRoomObject) + constructor(type: string, roomObject: IRoomObject) { - super(k, _arg_2); + super(type, roomObject); } -} \ No newline at end of file +} diff --git a/src/nitro/room/events/index.ts b/src/nitro/room/events/index.ts index d69e26a3..54ea2f56 100644 --- a/src/nitro/room/events/index.ts +++ b/src/nitro/room/events/index.ts @@ -7,6 +7,7 @@ export * from './RoomEngineObjectPlacedEvent'; export * from './RoomEngineObjectPlacedOnUserEvent'; export * from './RoomEngineSamplePlaybackEvent'; export * from './RoomEngineTriggerWidgetEvent'; +export * from './RoomEngineUseProductEvent'; export * from './RoomObjectBadgeAssetEvent'; export * from './RoomObjectDataRequestEvent'; export * from './RoomObjectDimmerStateUpdateEvent'; diff --git a/src/nitro/room/object/logic/furniture/FurnitureCraftingGizmoLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureCraftingGizmoLogic.ts new file mode 100644 index 00000000..e3d4147b --- /dev/null +++ b/src/nitro/room/object/logic/furniture/FurnitureCraftingGizmoLogic.ts @@ -0,0 +1,10 @@ +import { RoomWidgetEnum } from '../../../../ui'; +import { FurnitureLogic } from './FurnitureLogic'; + +export class FurnitureCraftingGizmoLogic extends FurnitureLogic +{ + public get widget(): string + { + return RoomWidgetEnum.CRAFTING; + } +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureEffectBoxLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureEffectBoxLogic.ts new file mode 100644 index 00000000..e0a45fad --- /dev/null +++ b/src/nitro/room/object/logic/furniture/FurnitureEffectBoxLogic.ts @@ -0,0 +1,27 @@ +import { ContextMenuEnum } from '../../../../ui/widget/enums/ContextMenuEnum'; +import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; +import { FurnitureLogic } from './FurnitureLogic'; + +export class FurnitureEffectBoxLogic extends FurnitureLogic +{ + private _timer: any; + + public getEventTypes(): string[] + { + const types = [ RoomObjectWidgetRequestEvent.EFFECTBOX_OPEN_DIALOG ]; + + return this.mergeTypes(super.getEventTypes(), types); + } + + public useObject(): void + { + if(!this.eventDispatcher || !this.object) return; + + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.EFFECTBOX_OPEN_DIALOG, this.object)); + } + + public get contextMenu(): string + { + return ContextMenuEnum.EFFECT_BOX; + } +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureFriendLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts similarity index 75% rename from src/nitro/room/object/logic/furniture/FurnitureFriendLogic.ts rename to src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts index 8d95ba93..e2f438ce 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureFriendLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts @@ -1,12 +1,13 @@ import { IAssetData } from '../../../../../core/asset/interfaces'; import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage'; +import { ContextMenuEnum } from '../../../../ui'; import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage'; import { StringDataType } from '../../data/type/StringDataType'; import { RoomObjectVariable } from '../../RoomObjectVariable'; import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; -export class FurnitureFriendLogic extends FurnitureMultiStateLogic +export class FurnitureFriendFurniLogic extends FurnitureMultiStateLogic { private static readonly STATE_UNINITIALIZED: number = -1; private static readonly STATE_UNLOCKED: number = 0; @@ -14,11 +15,6 @@ export class FurnitureFriendLogic extends FurnitureMultiStateLogic private _state: number = -1; - public get engravingDialogType(): number - { - return 0; - } - public initialize(asset: IAssetData): void { super.initialize(asset); @@ -43,7 +39,6 @@ export class FurnitureFriendLogic extends FurnitureMultiStateLogic } super.processUpdateMessage(message); - } public getEventTypes(): string[] @@ -55,13 +50,25 @@ export class FurnitureFriendLogic extends FurnitureMultiStateLogic public useObject(): void { - if(this._state == FurnitureFriendLogic.STATE_LOCKED) + if(!this.eventDispatcher || !this.object) return; + + if(this._state == FurnitureFriendFurniLogic.STATE_LOCKED) { - (this.object && this.eventDispatcher && this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_ENGRAVING, this.object))); + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_ENGRAVING, this.object)); } else { super.useObject(); } } + + public get engravingDialogType(): number + { + return 0; + } + + public get contextMenu(): string + { + return ((this._state === FurnitureFriendFurniLogic.STATE_UNLOCKED) ? ContextMenuEnum.FRIEND_FURNITURE : ContextMenuEnum.DUMMY); + } } diff --git a/src/nitro/room/object/logic/furniture/FurnitureLoveLockLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLoveLockLogic.ts new file mode 100644 index 00000000..eedba580 --- /dev/null +++ b/src/nitro/room/object/logic/furniture/FurnitureLoveLockLogic.ts @@ -0,0 +1,10 @@ +import { FriendFurniEngravingWidgetType } from '../../../enums'; +import { FurnitureFriendFurniLogic } from './FurnitureFriendFurniLogic'; + +export class FurnitureLoveLockLogic extends FurnitureFriendFurniLogic +{ + public get engravingDialogType(): number + { + return FriendFurniEngravingWidgetType.LOVE_LOCK; + } +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureMonsterplantSeedLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureMonsterplantSeedLogic.ts new file mode 100644 index 00000000..bae36660 --- /dev/null +++ b/src/nitro/room/object/logic/furniture/FurnitureMonsterplantSeedLogic.ts @@ -0,0 +1,25 @@ +import { ContextMenuEnum } from '../../../../ui'; +import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; +import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; + +export class FurnitureMonsterplantSeedLogic extends FurnitureMultiStateLogic +{ + public getEventTypes(): string[] + { + const types = [ RoomObjectWidgetRequestEvent.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG ]; + + return this.mergeTypes(super.getEventTypes(), types); + } + + public useObject(): void + { + if(!this.eventDispatcher || !this.object) return; + + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG, this.object)); + } + + public get contextMenu(): string + { + return ContextMenuEnum.MONSTERPLANT_SEED; + } +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureMysteryTrophyLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureMysteryTrophyLogic.ts new file mode 100644 index 00000000..0083a2e9 --- /dev/null +++ b/src/nitro/room/object/logic/furniture/FurnitureMysteryTrophyLogic.ts @@ -0,0 +1,25 @@ +import { ContextMenuEnum } from '../../../../ui'; +import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; +import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; + +export class FurnitureMysteryTrophyLogic extends FurnitureMultiStateLogic +{ + public getEventTypes(): string[] + { + const types = [ RoomObjectWidgetRequestEvent.MYSTERYTROPHY_OPEN_DIALOG ]; + + return this.mergeTypes(super.getEventTypes(), types); + } + + public useObject(): void + { + if(!this.eventDispatcher || !this.object) return; + + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.MYSTERYTROPHY_OPEN_DIALOG, this.object)); + } + + public get contextMenu(): string + { + return ContextMenuEnum.MYSTERY_TROPHY; + } +} diff --git a/src/nitro/room/object/logic/furniture/FurniturePurchaseableClothingLogic.ts b/src/nitro/room/object/logic/furniture/FurniturePurchaseableClothingLogic.ts index a835f7b0..41cf4cdb 100644 --- a/src/nitro/room/object/logic/furniture/FurniturePurchaseableClothingLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurniturePurchaseableClothingLogic.ts @@ -1,3 +1,4 @@ +import { ContextMenuEnum } from '../../../../ui'; import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; @@ -15,6 +16,13 @@ export class FurniturePurchaseableClothingLogic extends FurnitureMultiStateLogic public useObject(): void { + if(!this.eventDispatcher || !this.object) return; + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG, this.object)); } -} \ No newline at end of file + + public get contextMenu(): string + { + return ContextMenuEnum.PURCHASABLE_CLOTHING; + } +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureRandomTeleportLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRandomTeleportLogic.ts new file mode 100644 index 00000000..169958de --- /dev/null +++ b/src/nitro/room/object/logic/furniture/FurnitureRandomTeleportLogic.ts @@ -0,0 +1,10 @@ +import { ContextMenuEnum } from '../../../../ui'; +import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; + +export class FurnitureRandomTeleportLogic extends FurnitureMultiStateLogic +{ + public get contextMenu(): string + { + return ContextMenuEnum.RANDOM_TELEPORT; + } +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureRentableSpaceLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRentableSpaceLogic.ts new file mode 100644 index 00000000..17706197 --- /dev/null +++ b/src/nitro/room/object/logic/furniture/FurnitureRentableSpaceLogic.ts @@ -0,0 +1,48 @@ +import { AdvancedMap } from '../../../../../core'; +import { RoomWidgetEnum } from '../../../../ui'; +import { RoomObjectDataRequestEvent } from '../../../events'; +import { RoomObjectVariable } from '../../RoomObjectVariable'; +import { FurnitureLogic } from './FurnitureLogic'; + +export class FurnitureRentableSpaceLogic extends FurnitureLogic +{ + public getEventTypes(): string[] + { + const types = [ + RoomObjectDataRequestEvent.RODRE_CURRENT_USER_ID, + ]; + + return this.mergeTypes(super.getEventTypes(), types); + } + + public update(time: number): void + { + super.update(time); + + if(this.object && this.object.model) + { + if(!this.object.model.getValue(RoomObjectVariable.SESSION_CURRENT_USER_ID)) + { + this.eventDispatcher.dispatchEvent(new RoomObjectDataRequestEvent(RoomObjectDataRequestEvent.RODRE_CURRENT_USER_ID, this.object)); + } + + const renterId = this.object.model.getValue>(RoomObjectVariable.FURNITURE_DATA).getValue('renterId'); + const userId = this.object.model.getValue(RoomObjectVariable.SESSION_CURRENT_USER_ID); + + if(renterId) + { + if(parseInt(renterId) === userId) this.object.setState(2, 0); + else this.object.setState(1, 0); + } + else + { + this.object.setState(0, 0); + } + } + } + + public get widget(): string + { + return RoomWidgetEnum.RENTABLESPACE; + } +} diff --git a/src/nitro/room/object/logic/furniture/index.ts b/src/nitro/room/object/logic/furniture/index.ts index f6fc17be..16cc63b8 100644 --- a/src/nitro/room/object/logic/furniture/index.ts +++ b/src/nitro/room/object/logic/furniture/index.ts @@ -2,29 +2,36 @@ export * from './FurnitureBadgeDisplayLogic'; export * from './FurnitureChangeStateWhenStepOnLogic'; export * from './FurnitureCounterClockLogic'; export * from './FurnitureCrackableLogic'; +export * from './FurnitureCraftingGizmoLogic'; export * from './FurnitureCreditLogic'; export * from './FurnitureCustomStackHeightLogic'; export * from './FurnitureDiceLogic'; export * from './FurnitureEditableInternalLinkLogic'; export * from './FurnitureEditableRoomLinkLogic'; +export * from './FurnitureEffectBoxLogic'; export * from './FurnitureExternalImageLogic'; export * from './FurnitureFireworksLogic'; export * from './FurnitureFloorHoleLogic'; -export * from './FurnitureFriendLogic'; +export * from './FurnitureFriendFurniLogic'; export * from './FurnitureGuildCustomizedLogic'; export * from './FurnitureHabboWheelLogic'; export * from './FurnitureHighScoreLogic'; export * from './FurnitureHockeyScoreLogic'; export * from './FurnitureIceStormLogic'; export * from './FurnitureLogic'; +export * from './FurnitureLoveLockLogic'; export * from './FurnitureMannequinLogic'; +export * from './FurnitureMonsterplantSeedLogic'; export * from './FurnitureMultiHeightLogic'; export * from './FurnitureMultiStateLogic'; +export * from './FurnitureMysteryTrophyLogic'; export * from './FurnitureOneWayDoorLogic'; export * from './FurniturePetCustomizationLogic'; export * from './FurniturePresentLogic'; export * from './FurniturePurchaseableClothingLogic'; export * from './FurniturePushableLogic'; +export * from './FurnitureRandomTeleportLogic'; +export * from './FurnitureRentableSpaceLogic'; export * from './FurnitureRoomBackgroundColorLogic'; export * from './FurnitureRoomBackgroundLogic'; export * from './FurnitureRoomBillboardLogic'; diff --git a/src/nitro/session/IRoomSession.ts b/src/nitro/session/IRoomSession.ts index fa87c9a1..9a265e16 100644 --- a/src/nitro/session/IRoomSession.ts +++ b/src/nitro/session/IRoomSession.ts @@ -33,6 +33,8 @@ export interface IRoomSession extends IDisposable pickupPet(id: number): void; pickupBot(id: number): void; requestMoodlightSettings(): void; + mountPet(id: number): void; + dismountPet(id: number): void; connection: IConnection; userDataManager: UserDataManager; roomId: number; diff --git a/src/nitro/session/RoomSession.ts b/src/nitro/session/RoomSession.ts index ef87fe8c..7223fd58 100644 --- a/src/nitro/session/RoomSession.ts +++ b/src/nitro/session/RoomSession.ts @@ -1,5 +1,6 @@ import { Disposable } from '../../core/common/disposable/Disposable'; import { IConnection } from '../../core/communication/connections/IConnection'; +import { PetMountComposer } from '../communication'; import { RoomDoorbellAccessComposer } from '../communication/messages/outgoing/room/access/RoomDoorbellAccessComposer'; import { RoomEnterComposer } from '../communication/messages/outgoing/room/access/RoomEnterComposer'; import { RoomAmbassadorAlertComposer } from '../communication/messages/outgoing/room/action/RoomAmbassadorAlertComposer'; @@ -262,6 +263,16 @@ export class RoomSession extends Disposable implements IRoomSession this._connection.send(new OpenPresentComposer(objectId)); } + public mountPet(id: number): void + { + this._connection.send(new PetMountComposer(id, true)); + } + + public dismountPet(id: number): void + { + this._connection.send(new PetMountComposer(id, false)); + } + public get connection(): IConnection { return this._connection; diff --git a/src/nitro/ui/widget/enums/ContextMenuEnum.ts b/src/nitro/ui/widget/enums/ContextMenuEnum.ts new file mode 100644 index 00000000..94896ffa --- /dev/null +++ b/src/nitro/ui/widget/enums/ContextMenuEnum.ts @@ -0,0 +1,12 @@ +export class ContextMenuEnum +{ + public static DUMMY: string = 'DUMMY'; + public static FRIEND_FURNITURE: string = 'FRIEND_FURNITURE'; + public static MONSTERPLANT_SEED: string = 'MONSTERPLANT_SEED'; + public static MYSTERY_BOX: string = 'MYSTERY_BOX'; + public static EFFECT_BOX: string = 'EFFECT_BOX'; + public static MYSTERY_TROPHY: string = 'MYSTERY_TROPHY'; + public static RANDOM_TELEPORT: string = 'RANDOM_TELEPORT'; + public static PURCHASABLE_CLOTHING: string = 'PURCHASABLE_CLOTHING'; + public static GENERIC_USABLE: string = 'GENERIC_USABLE'; +} diff --git a/src/nitro/ui/widget/enums/index.ts b/src/nitro/ui/widget/enums/index.ts index c2fe8f5e..48f242d9 100644 --- a/src/nitro/ui/widget/enums/index.ts +++ b/src/nitro/ui/widget/enums/index.ts @@ -1,4 +1,5 @@ export * from './AvatarExpressionEnum'; +export * from './ContextMenuEnum'; export * from './FriendWidgetEngravingWidgetTypeEnum'; export * from './RoomWidgetEnum'; export * from './RoomWidgetEnumItemExtradataParameter'; From 4490edde132f1e19b26f8a604ff68bc9c5b6521f Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 8 Jul 2021 12:18:01 -0400 Subject: [PATCH 115/155] Update logic --- .../FurniturePetCustomizationLogic.ts | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/nitro/room/object/logic/furniture/FurniturePetCustomizationLogic.ts b/src/nitro/room/object/logic/furniture/FurniturePetCustomizationLogic.ts index 35f5d66d..d8c9db43 100644 --- a/src/nitro/room/object/logic/furniture/FurniturePetCustomizationLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurniturePetCustomizationLogic.ts @@ -1,6 +1,49 @@ +import { IRoomGeometry, RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room'; +import { MouseEventType, RoomWidgetEnumItemExtradataParameter } from '../../../../ui'; +import { RoomObjectWidgetRequestEvent } from '../../../events'; +import { RoomObjectVariable } from '../../RoomObjectVariable'; import { FurnitureLogic } from './FurnitureLogic'; export class FurniturePetCustomizationLogic extends FurnitureLogic { + public getEventTypes(): string[] + { + const types = [ RoomObjectWidgetRequestEvent.PET_PRODUCT_MENU ]; -} \ No newline at end of file + return this.mergeTypes(super.getEventTypes(), types); + } + + public processUpdateMessage(message: RoomObjectUpdateMessage): void + { + super.processUpdateMessage(message); + + if(!this.object) return; + + if(this.object.model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT) === 1) + { + this.object.model.setValue(RoomWidgetEnumItemExtradataParameter.INFOSTAND_EXTRA_PARAM, RoomWidgetEnumItemExtradataParameter.USABLE_PRODUCT); + } + } + + public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void + { + if(!event || !geometry || !this.object) return; + + switch(event.type) + { + case MouseEventType.DOUBLE_CLICK: + this.useObject(); + + return; + } + + super.mouseEvent(event, geometry); + } + + public useObject(): void + { + if(!this.eventDispatcher || !this.object) return; + + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.PET_PRODUCT_MENU, this.object)); + } +} From a62df1f59a7de2183f6d34a4ce92938aed27a371 Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 9 Jul 2021 13:29:20 -0400 Subject: [PATCH 116/155] Pet updates --- src/nitro/communication/NitroMessages.ts | 6 ++++- .../messages/outgoing/OutgoingHeader.ts | 4 ++++ .../outgoing/pet/RemovePetSaddleComposer.ts | 21 ++++++++++++++++++ .../outgoing/pet/TogglePetBreedingComposer.ts | 21 ++++++++++++++++++ .../outgoing/pet/TogglePetRidingComposer.ts | 21 ++++++++++++++++++ .../outgoing/pet/UsePetProductComposer.ts | 21 ++++++++++++++++++ .../messages/outgoing/pet/index.ts | 4 ++++ .../messages/parser/inventory/pets/PetData.ts | 2 +- src/nitro/room/IRoomEngine.ts | 2 ++ src/nitro/room/RoomEngine.ts | 6 ++--- src/nitro/session/IRoomSession.ts | 4 ++++ src/nitro/session/RoomSession.ts | 22 ++++++++++++++++++- .../events/RoomSessionPetFigureUpdateEvent.ts | 6 ++--- src/nitro/session/handler/RoomUsersHandler.ts | 22 +++++++++++++++++++ 14 files changed, 153 insertions(+), 9 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/pet/RemovePetSaddleComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/pet/TogglePetBreedingComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/pet/TogglePetRidingComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/pet/UsePetProductComposer.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index cc8eef45..c4d37cf4 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, PetMountComposer, PetSupplementComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent } from './messages'; +import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, FurnitureGuildInfoComposer, 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'; @@ -859,7 +859,11 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.PET_MOUNT, PetMountComposer); this._composers.set(OutgoingHeader.PET_RESPECT, PetRespectComposer); this._composers.set(OutgoingHeader.PET_SUPPLEMENT, PetSupplementComposer); + this._composers.set(OutgoingHeader.REMOVE_PET_SADDLE, RemovePetSaddleComposer); this._composers.set(OutgoingHeader.PET_INFO, RequestPetInfoComposer); + this._composers.set(OutgoingHeader.TOGGLE_PET_BREEDING, TogglePetBreedingComposer); + this._composers.set(OutgoingHeader.TOGGLE_PET_RIDING, TogglePetRidingComposer); + this._composers.set(OutgoingHeader.USE_PET_PRODUCT, UsePetProductComposer); // ROOM this._composers.set(OutgoingHeader.ROOM_CREATE, RoomCreateComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index b8e02e65..0a3c1d80 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -240,4 +240,8 @@ export class OutgoingHeader public static PET_SUPPLEMENT = 749; public static FURNITURE_GUILD_INFO = 2651; public static ACHIEVEMENT_RESOLUTION_OPEN = 359; + public static USE_PET_PRODUCT = 1328; + public static REMOVE_PET_SADDLE = 186; + public static TOGGLE_PET_RIDING = 1472; + public static TOGGLE_PET_BREEDING = 3379; } diff --git a/src/nitro/communication/messages/outgoing/pet/RemovePetSaddleComposer.ts b/src/nitro/communication/messages/outgoing/pet/RemovePetSaddleComposer.ts new file mode 100644 index 00000000..081ce960 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/pet/RemovePetSaddleComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class RemovePetSaddleComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(petId: number) + { + this._data = [ petId ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/pet/TogglePetBreedingComposer.ts b/src/nitro/communication/messages/outgoing/pet/TogglePetBreedingComposer.ts new file mode 100644 index 00000000..dc6f1ad3 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/pet/TogglePetBreedingComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class TogglePetBreedingComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(petId: number) + { + this._data = [ petId ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/pet/TogglePetRidingComposer.ts b/src/nitro/communication/messages/outgoing/pet/TogglePetRidingComposer.ts new file mode 100644 index 00000000..4c9178eb --- /dev/null +++ b/src/nitro/communication/messages/outgoing/pet/TogglePetRidingComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class TogglePetRidingComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(petId: number) + { + this._data = [ petId ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/pet/UsePetProductComposer.ts b/src/nitro/communication/messages/outgoing/pet/UsePetProductComposer.ts new file mode 100644 index 00000000..306246f0 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/pet/UsePetProductComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class UsePetProductComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(itemId: number, petId: number) + { + this._data = [ itemId, petId ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/pet/index.ts b/src/nitro/communication/messages/outgoing/pet/index.ts index aae5687f..68896188 100644 --- a/src/nitro/communication/messages/outgoing/pet/index.ts +++ b/src/nitro/communication/messages/outgoing/pet/index.ts @@ -1,4 +1,8 @@ export * from './PetMountComposer'; export * from './PetRespectComposer'; export * from './PetSupplementComposer'; +export * from './RemovePetSaddleComposer'; export * from './RequestPetInfoComposer'; +export * from './TogglePetBreedingComposer'; +export * from './TogglePetRidingComposer'; +export * from './UsePetProductComposer'; diff --git a/src/nitro/communication/messages/parser/inventory/pets/PetData.ts b/src/nitro/communication/messages/parser/inventory/pets/PetData.ts index 9c5b6dad..cf4c4a8c 100644 --- a/src/nitro/communication/messages/parser/inventory/pets/PetData.ts +++ b/src/nitro/communication/messages/parser/inventory/pets/PetData.ts @@ -58,7 +58,7 @@ export class PetData return this._figureData.figuredata; } - public get figureData():PetFigureDataParser + public get figureData(): PetFigureDataParser { return this._figureData; } diff --git a/src/nitro/room/IRoomEngine.ts b/src/nitro/room/IRoomEngine.ts index 9d11d2fa..26190908 100644 --- a/src/nitro/room/IRoomEngine.ts +++ b/src/nitro/room/IRoomEngine.ts @@ -1,5 +1,6 @@ import { DisplayObject, Point, Rectangle } from 'pixi.js'; import { INitroManager } from '../../core/common/INitroManager'; +import { IRoomObject } from '../../room'; import { IRoomManager } from '../../room/IRoomManager'; import { IRoomObjectController } from '../../room/object/IRoomObjectController'; import { IRoomObjectLogicFactory } from '../../room/object/logic/IRoomObjectLogicFactory'; @@ -46,6 +47,7 @@ export interface IRoomEngine extends INitroManager removeRoomObjectFloor(roomId: number, objectId: number, userId?: number, _arg_4?: boolean): void; removeRoomObjectWall(roomId: number, objectId: number, userId?: number): void; removeRoomObjectUser(roomId: number, objectId: number): void; + getRoomObjects(roomId: number, category: number): IRoomObject[]; getRoomObjectCount(roomId: number, categoryId: number): number; getRoomObjectBoundingRectangle(roomId: number, objectId: number, category: number, canvasId: number): Rectangle; getRoomObjectScreenLocation(roomId: number, objectId: number, objectType: number, canvasId?: number): Point; diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index fb813924..ccfcf329 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -3366,15 +3366,15 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return null; } - public getRoomObjects(k: number, _arg_2: number): IRoomObject[] + public getRoomObjects(roomId: number, category: number): IRoomObject[] { if(this._ready) { - const _local_3 = this.getRoomId(k); + const _local_3 = this.getRoomId(roomId); const _local_4 = this._roomManager.getRoomInstance(_local_3); - if(_local_4) return _local_4.getRoomObjectsForCategory(_arg_2); + if(_local_4) return _local_4.getRoomObjectsForCategory(category); } return []; diff --git a/src/nitro/session/IRoomSession.ts b/src/nitro/session/IRoomSession.ts index 9a265e16..c8c3bdba 100644 --- a/src/nitro/session/IRoomSession.ts +++ b/src/nitro/session/IRoomSession.ts @@ -35,6 +35,10 @@ export interface IRoomSession extends IDisposable requestMoodlightSettings(): void; mountPet(id: number): void; dismountPet(id: number): void; + usePetProduct(itemId: number, petId: number): void; + removePetSaddle(id: number): void; + togglePetBreeding(id: number): void; + togglePetRiding(id: number): void; connection: IConnection; userDataManager: UserDataManager; roomId: number; diff --git a/src/nitro/session/RoomSession.ts b/src/nitro/session/RoomSession.ts index 7223fd58..754762dc 100644 --- a/src/nitro/session/RoomSession.ts +++ b/src/nitro/session/RoomSession.ts @@ -1,6 +1,6 @@ import { Disposable } from '../../core/common/disposable/Disposable'; import { IConnection } from '../../core/communication/connections/IConnection'; -import { PetMountComposer } from '../communication'; +import { PetMountComposer, RemovePetSaddleComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from '../communication'; import { RoomDoorbellAccessComposer } from '../communication/messages/outgoing/room/access/RoomDoorbellAccessComposer'; import { RoomEnterComposer } from '../communication/messages/outgoing/room/access/RoomEnterComposer'; import { RoomAmbassadorAlertComposer } from '../communication/messages/outgoing/room/action/RoomAmbassadorAlertComposer'; @@ -273,6 +273,26 @@ export class RoomSession extends Disposable implements IRoomSession this._connection.send(new PetMountComposer(id, false)); } + public usePetProduct(itemId: number, petId: number): void + { + this._connection.send(new UsePetProductComposer(itemId, petId)); + } + + public removePetSaddle(id: number): void + { + this._connection.send(new RemovePetSaddleComposer(id)); + } + + public togglePetBreeding(id: number): void + { + this._connection.send(new TogglePetBreedingComposer(id)); + } + + public togglePetRiding(id: number): void + { + this._connection.send(new TogglePetRidingComposer(id)); + } + public get connection(): IConnection { return this._connection; diff --git a/src/nitro/session/events/RoomSessionPetFigureUpdateEvent.ts b/src/nitro/session/events/RoomSessionPetFigureUpdateEvent.ts index a1eda948..1402995f 100644 --- a/src/nitro/session/events/RoomSessionPetFigureUpdateEvent.ts +++ b/src/nitro/session/events/RoomSessionPetFigureUpdateEvent.ts @@ -8,9 +8,9 @@ export class RoomSessionPetFigureUpdateEvent extends RoomSessionEvent private _petId: number; private _figure: string; - constructor(k: IRoomSession, id: number, figure: string) + constructor(roomSession: IRoomSession, id: number, figure: string) { - super(RoomSessionPetFigureUpdateEvent.PET_FIGURE_UPDATE, k); + super(RoomSessionPetFigureUpdateEvent.PET_FIGURE_UPDATE, roomSession); this._petId = id; this._figure = figure; @@ -25,4 +25,4 @@ export class RoomSessionPetFigureUpdateEvent extends RoomSessionEvent { return this._figure; } -} \ No newline at end of file +} diff --git a/src/nitro/session/handler/RoomUsersHandler.ts b/src/nitro/session/handler/RoomUsersHandler.ts index 3fb25a16..81a12ea8 100644 --- a/src/nitro/session/handler/RoomUsersHandler.ts +++ b/src/nitro/session/handler/RoomUsersHandler.ts @@ -1,4 +1,5 @@ import { IConnection } from '../../../core/communication/connections/IConnection'; +import { PetFigureUpdateEvent } from '../../communication'; import { NewFriendRequestEvent } from '../../communication/messages/incoming/friendlist/NewFriendRequestEvent'; import { BotErrorEvent } from '../../communication/messages/incoming/notifications/BotErrorEvent'; import { PetPlacingErrorEvent } from '../../communication/messages/incoming/notifications/PetPlacingErrorEvent'; @@ -10,6 +11,7 @@ import { RoomUnitInfoEvent } from '../../communication/messages/incoming/room/un import { RoomUnitRemoveEvent } from '../../communication/messages/incoming/room/unit/RoomUnitRemoveEvent'; import { UserCurrentBadgesEvent } from '../../communication/messages/incoming/user/data/UserCurrentBadgesEvent'; import { UserNameChangeMessageEvent } from '../../communication/messages/incoming/user/data/UserNameChangeMessageEvent'; +import { RoomSessionPetFigureUpdateEvent } from '../events'; import { RoomSessionDanceEvent } from '../events/RoomSessionDanceEvent'; import { RoomSessionDoorbellEvent } from '../events/RoomSessionDoorbellEvent'; import { RoomSessionErrorMessageEvent } from '../events/RoomSessionErrorMessageEvent'; @@ -37,6 +39,7 @@ export class RoomUsersHandler extends BaseHandler connection.addMessageEvent(new UserNameChangeMessageEvent(this.onUserNameChangeMessageEvent.bind(this))); connection.addMessageEvent(new NewFriendRequestEvent(this.onNewFriendRequestEvent.bind(this))); connection.addMessageEvent(new PetInfoEvent(this.onPetInfoEvent.bind(this))); + connection.addMessageEvent(new PetFigureUpdateEvent(this.onPetFigureUpdateEvent.bind(this))); connection.addMessageEvent(new PetPlacingErrorEvent(this.onPetPlacingError.bind(this))); connection.addMessageEvent(new BotErrorEvent(this.onBotError.bind(this))); } @@ -247,6 +250,25 @@ export class RoomUsersHandler extends BaseHandler this.listener.events.dispatchEvent(new RoomSessionPetInfoUpdateEvent(session, petData)); } + private onPetFigureUpdateEvent(event: PetFigureUpdateEvent): void + { + if(!this.listener) return; + + const parser = event.getParser(); + + if(!parser) return; + + const session = this.listener.getSession(this.roomId); + + if(!session) return; + + const figure = parser.figureData.figuredata; + + session.userDataManager.updateFigure(parser.roomIndex, figure, '', parser.hasSaddle, parser.isRiding); + + this.listener.events.dispatchEvent(new RoomSessionPetFigureUpdateEvent(session, parser.petId, figure)); + } + private onPetPlacingError(event: PetPlacingErrorEvent): void { if(!event) return; From 17062cb786484c5b1d00cbca24834de41adfa2f7 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 10 Jul 2021 22:45:05 -0400 Subject: [PATCH 117/155] Add missing pet data --- src/core/asset/interfaces/IAssetPalette.ts | 4 ++++ src/nitro/room/IRoomEngine.ts | 1 + src/nitro/room/RoomContentLoader.ts | 24 ++++++++++++++++++++-- src/nitro/room/RoomEngine.ts | 7 +++++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/core/asset/interfaces/IAssetPalette.ts b/src/core/asset/interfaces/IAssetPalette.ts index 5102e95f..9b0384b3 100644 --- a/src/core/asset/interfaces/IAssetPalette.ts +++ b/src/core/asset/interfaces/IAssetPalette.ts @@ -2,6 +2,10 @@ export interface IAssetPalette { id?: number; source?: string; + master?: boolean; + tags?: string[]; + breed?: number; + colorTag?: number; color1?: string; color2?: string; rgb?: [ number, number, number ][]; diff --git a/src/nitro/room/IRoomEngine.ts b/src/nitro/room/IRoomEngine.ts index 26190908..049981ea 100644 --- a/src/nitro/room/IRoomEngine.ts +++ b/src/nitro/room/IRoomEngine.ts @@ -77,6 +77,7 @@ export interface IRoomEngine extends INitroManager selectRoomObject(roomId: number, objectId: number, objectCategory: number): void; cancelRoomObjectInsert(): void; getPetColorResult(petIndex: number, paletteIndex: number): PetColorResult; + getPetColorResultsForTag(petIndex: number, tagName: string): PetColorResult[]; cancelRoomObjectPlacement(): void; getFurnitureFloorName(typeId: number): string; useRoomObject(objectId: number, category: number): boolean; diff --git a/src/nitro/room/RoomContentLoader.ts b/src/nitro/room/RoomContentLoader.ts index ecfaac32..96893aec 100644 --- a/src/nitro/room/RoomContentLoader.ts +++ b/src/nitro/room/RoomContentLoader.ts @@ -262,6 +262,22 @@ export class RoomContentLoader implements IFurnitureDataListener return colorResults.get(paletteIndex); } + public getPetColorResultsForTag(petIndex: number, tagName: string): PetColorResult[] + { + const colorResults = this._petColors.get(petIndex); + const results: PetColorResult[] = []; + + if(colorResults) + { + for(const result of colorResults.values()) + { + if(result.tag === tagName) results.push(result); + } + } + + return results; + } + public getCollection(name: string): IGraphicAssetCollection { if(!name) return null; @@ -327,12 +343,16 @@ export class RoomContentLoader implements IFurnitureDataListener for(const key of keys) { const palette = collection.getPalette(key); + const paletteData = data.palettes[key]; - const breed = 0; const primaryColor = palette.primaryColor; const secondaryColor = palette.secondaryColor; + const breed = ((paletteData.breed !== undefined) ? paletteData.breed : 0); + const tag = ((paletteData.colorTag !== undefined) ? paletteData.colorTag : -1); + const master = ((paletteData.master !== undefined) ? paletteData.master : false); + const layerTags = ((paletteData.tags !== undefined) ? paletteData.tags : []); - palettes.set(parseInt(key), new PetColorResult(primaryColor, secondaryColor, breed, -1, key, false, [])); + palettes.set(parseInt(key), new PetColorResult(primaryColor, secondaryColor, breed, tag, key, master, layerTags)); } this._petColors.set(petIndex, palettes); diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index ccfcf329..92192309 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -3551,6 +3551,13 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato return this._roomContentLoader.getPetColorResult(petIndex, paletteIndex); } + public getPetColorResultsForTag(petIndex: number, tagName: string): PetColorResult[] + { + if(!this._roomContentLoader) return null; + + return this._roomContentLoader.getPetColorResultsForTag(petIndex, tagName); + } + public modifyRoomObjectData(objectId: number, objectCategory: number, colorHex: string, text: string): boolean { if(!this._roomObjectEventHandler || (objectCategory !== RoomObjectCategory.WALL)) return false; From f3d633458a6b22e18603d34b727b32b6eddee8be Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 11 Jul 2021 00:53:30 -0400 Subject: [PATCH 118/155] Fixes --- src/nitro/room/RoomObjectEventHandler.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index 469ae481..e948c081 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -749,7 +749,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU, roomId, objectId, objectCategory, ((event.object as IRoomObjectController).logic.contextMenu))); return; case RoomObjectWidgetRequestEvent.CLOSE_FURNI_CONTEXT_MENU: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU, roomId, objectId, objectCategory)); + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.CLOSE_FURNI_CONTEXT_MENU, roomId, objectId, objectCategory)); return; case RoomObjectWidgetRequestEvent.PLACEHOLDER: eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PLACEHOLDER, roomId, objectId, objectCategory)); @@ -776,7 +776,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_DIMMER, roomId, objectId, objectCategory)); return; case RoomObjectWidgetRequestEvent.WIDGET_REMOVE_DIMMER: - eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_DIMMER, roomId, objectId, objectCategory)); + eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REMOVE_DIMMER, roomId, objectId, objectCategory)); return; case RoomObjectWidgetRequestEvent.CLOTHING_CHANGE: eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_CLOTHING_CHANGE, roomId, objectId, objectCategory)); @@ -1909,11 +1909,11 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou { this.deselectObject(roomId); - const _local_5 = this._roomEngine.getRoomObject(roomId, objectId, category); + const roomObject = this._roomEngine.getRoomObject(roomId, objectId, category); - if(_local_5 && _local_5.logic) + if(roomObject && roomObject.logic) { - _local_5.logic.processUpdateMessage(new ObjectSelectedMessage(true)); + roomObject.logic.processUpdateMessage(new ObjectSelectedMessage(true)); this._selectedObjectId = objectId; this._selectedObjectCategory = category; @@ -1927,11 +1927,11 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } - private deselectObject(k: number): void + private deselectObject(roomId: number): void { if(this._selectedObjectId === -1) return; - const object = this._roomEngine.getRoomObject(k, this._selectedObjectId, this._selectedObjectCategory); + const object = this._roomEngine.getRoomObject(roomId, this._selectedObjectId, this._selectedObjectCategory); if(object && object.logic) { From 380087cc8bbf8a4d29da68aec9b3842b8c97dff9 Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 11 Jul 2021 13:11:36 -0400 Subject: [PATCH 119/155] Add rarity level to stuff data --- src/nitro/room/object/data/IObjectData.ts | 3 ++- src/nitro/room/object/data/ObjectDataBase.ts | 7 ++++++- src/nitro/room/object/data/type/MapDataType.ts | 11 +++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/nitro/room/object/data/IObjectData.ts b/src/nitro/room/object/data/IObjectData.ts index f158baad..1df0cc76 100644 --- a/src/nitro/room/object/data/IObjectData.ts +++ b/src/nitro/room/object/data/IObjectData.ts @@ -7,10 +7,11 @@ export interface IObjectData isUnique: boolean; uniqueNumber: number; uniqueSeries: number; + rarityLevel: number; flags: number; parseWrapper(wrapper: IMessageDataWrapper): void; initializeFromRoomObjectModel(model: IRoomObjectModel): void; writeRoomObjectModel(model: IRoomObjectModel): void; getLegacyString(): string; compare(data: IObjectData): boolean; -} \ No newline at end of file +} diff --git a/src/nitro/room/object/data/ObjectDataBase.ts b/src/nitro/room/object/data/ObjectDataBase.ts index f04d41f6..a5cc3350 100644 --- a/src/nitro/room/object/data/ObjectDataBase.ts +++ b/src/nitro/room/object/data/ObjectDataBase.ts @@ -72,6 +72,11 @@ export class ObjectDataBase implements IObjectData return this._uniqueSeries; } + public get rarityLevel(): number + { + return -1; + } + public get flags(): number { return this._flags; @@ -81,4 +86,4 @@ export class ObjectDataBase implements IObjectData { this._flags = flags; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/data/type/MapDataType.ts b/src/nitro/room/object/data/type/MapDataType.ts index 824f46f1..578549b3 100644 --- a/src/nitro/room/object/data/type/MapDataType.ts +++ b/src/nitro/room/object/data/type/MapDataType.ts @@ -70,6 +70,17 @@ export class MapDataType extends ObjectDataBase return this._data[key]; } + public get rarityLevel(): number + { + if(!this._data || !this._data.length) return -1; + + const state = this._data[MapDataType.RARITY]; + + if(state === undefined || state === null) return -1; + + return parseInt(state); + } + // TODO: How to get the keys? public get data() { From 95be1d99bf3623b491aacebfba20a159e283caaf Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 12 Jul 2021 00:17:01 -0400 Subject: [PATCH 120/155] Fix stuff data --- src/nitro/room/object/data/type/MapDataType.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/room/object/data/type/MapDataType.ts b/src/nitro/room/object/data/type/MapDataType.ts index 578549b3..b90dbe83 100644 --- a/src/nitro/room/object/data/type/MapDataType.ts +++ b/src/nitro/room/object/data/type/MapDataType.ts @@ -51,7 +51,7 @@ export class MapDataType extends ObjectDataBase public getLegacyString(): string { - if(!this._data || !this._data.length) return ''; + if(!this._data) return ''; const state = this._data[MapDataType.STATE]; @@ -72,7 +72,7 @@ export class MapDataType extends ObjectDataBase public get rarityLevel(): number { - if(!this._data || !this._data.length) return -1; + if(!this._data) return -1; const state = this._data[MapDataType.RARITY]; From 16949ce7539cd4aaf3b2d187cd7058b9a548cfca Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 12 Jul 2021 00:17:14 -0400 Subject: [PATCH 121/155] Update pets --- .../visualization/pet/PetVisualization.ts | 49 +++++++++---------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/src/nitro/room/object/visualization/pet/PetVisualization.ts b/src/nitro/room/object/visualization/pet/PetVisualization.ts index f6a0bfdd..3051ea03 100644 --- a/src/nitro/room/object/visualization/pet/PetVisualization.ts +++ b/src/nitro/room/object/visualization/pet/PetVisualization.ts @@ -122,34 +122,33 @@ export class PetVisualization extends FurnitureAnimatedVisualization if(this.updateModelCounter === model.updateCounter) return false; - // _local_4 = _local_3.getString(RoomObjectVariableEnum.FIGURE_POSTURE); - // _local_5 = _local_3.getString(RoomObjectVariableEnum.FIGURE_GESTURE); - // _local_6 = _local_3.getNumber(RoomObjectVariableEnum.FIGURE_POSTURE); - // if (!isNaN(_local_6)) - // { - // _local_16 = this._animationData._Str_17398(_Str_3289); - // if (_local_16 > 0) - // { - // _local_4 = this._animationData.animationToPosture(_Str_3289, (_local_6 % _local_16), true); - // _local_5 = null; - // } - // } - // _local_7 = _local_3.getNumber(RoomObjectVariableEnum.FIGURE_GESTURE); - // if (!isNaN(_local_7)) - // { - // _local_17 = this._animationData._Str_16869(_Str_3289); - // if (_local_17 > 0) - // { - // _local_5 = this._animationData.animationToGesture(_Str_3289, (_local_7 % _local_17)); - // } - // } - // this._Str_14314(_local_4, _local_5); + let posture = model.getValue(RoomObjectVariable.FIGURE_POSTURE); + let gesture = model.getValue(RoomObjectVariable.FIGURE_GESTURE); + const tempPosture = model.getValue(RoomObjectVariable.FIGURE_POSTURE); + if(!isNaN(tempPosture)) + { + const totalPostures = this._data.totalPostures(this._scale); - const posture = model.getValue(RoomObjectVariable.FIGURE_POSTURE); - const gesture = model.getValue(RoomObjectVariable.FIGURE_GESTURE); - const tempPosture = model.getValue(RoomObjectVariable.FIGURE_POSTURE); + if(totalPostures > 0) + { + posture = this._data.animationToPosture(this._scale, (tempPosture % totalPostures), true); + gesture = null; + } + } + + const tempGesture = model.getValue(RoomObjectVariable.FIGURE_GESTURE); + + if(!isNaN(tempGesture)) + { + const totalGestures = this._data.totalGestures(this._scale); + + if(totalGestures > 0) + { + gesture = this._data.animationToGesture(this._scale, (tempGesture % totalGestures)); + } + } this.setPostureAndGesture(posture, gesture); From 1e6252b6ab8a7ea6aa24fdd08df35faad95a22fb Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 12 Jul 2021 00:17:31 -0400 Subject: [PATCH 122/155] Fix busted furni logic --- .../room/object/logic/furniture/FurnitureLogic.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index ce836f53..215caef2 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -302,11 +302,6 @@ export class FurnitureLogic extends MovingObjectLogic this.eventDispatcher.dispatchEvent(mouseEvent); } - - if(this.eventDispatcher && this.object && this.contextMenu) - { - this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.OPEN_FURNI_CONTEXT_MENU, this.object)); - } return; case MouseEventType.MOUSE_DOWN: if(this.eventDispatcher) @@ -372,9 +367,11 @@ export class FurnitureLogic extends MovingObjectLogic public tearDown(): void { - if(this.widget && (this.object.model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT) === 1)) + if(this.object.model.getValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT) === 1) { - this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.CLOSE_WIDGET, this.object)); + if(this.widget) this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.CLOSE_WIDGET, this.object)); + + if(this.contextMenu) this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.CLOSE_FURNI_CONTEXT_MENU, this.object)); } super.tearDown(); From ec85047bd3a0ddb7f64edba18830a733f87a8098 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 12 Jul 2021 00:17:47 -0400 Subject: [PATCH 123/155] Update room session --- src/nitro/session/IRoomSession.ts | 1 + src/nitro/session/RoomSession.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nitro/session/IRoomSession.ts b/src/nitro/session/IRoomSession.ts index c8c3bdba..682a11b8 100644 --- a/src/nitro/session/IRoomSession.ts +++ b/src/nitro/session/IRoomSession.ts @@ -39,6 +39,7 @@ export interface IRoomSession extends IDisposable removePetSaddle(id: number): void; togglePetBreeding(id: number): void; togglePetRiding(id: number): void; + useMultistateItem(id: number): void; connection: IConnection; userDataManager: UserDataManager; roomId: number; diff --git a/src/nitro/session/RoomSession.ts b/src/nitro/session/RoomSession.ts index 754762dc..3858d63e 100644 --- a/src/nitro/session/RoomSession.ts +++ b/src/nitro/session/RoomSession.ts @@ -1,6 +1,6 @@ import { Disposable } from '../../core/common/disposable/Disposable'; import { IConnection } from '../../core/communication/connections/IConnection'; -import { PetMountComposer, RemovePetSaddleComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from '../communication'; +import { FurnitureMultiStateComposer, PetMountComposer, RemovePetSaddleComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from '../communication'; import { RoomDoorbellAccessComposer } from '../communication/messages/outgoing/room/access/RoomDoorbellAccessComposer'; import { RoomEnterComposer } from '../communication/messages/outgoing/room/access/RoomEnterComposer'; import { RoomAmbassadorAlertComposer } from '../communication/messages/outgoing/room/action/RoomAmbassadorAlertComposer'; @@ -293,6 +293,11 @@ export class RoomSession extends Disposable implements IRoomSession this._connection.send(new TogglePetRidingComposer(id)); } + public useMultistateItem(id: number): void + { + this._connection.send(new FurnitureMultiStateComposer(id)); + } + public get connection(): IConnection { return this._connection; From 3f025a030e3aee41c0add0c565f3897c8f6695b7 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 12 Jul 2021 00:48:44 -0400 Subject: [PATCH 124/155] Add MysteryBoxKeysEvent --- src/nitro/communication/NitroMessages.ts | 5 ++- .../messages/incoming/IncomingHeader.ts | 2 +- .../communication/messages/incoming/index.ts | 1 + .../mysterybox/MysteryBoxKeysEvent.ts | 16 +++++++++ .../messages/incoming/mysterybox/index.ts | 1 + .../communication/messages/parser/index.ts | 1 + .../parser/mysterybox/MysteryBoxKeysParser.ts | 36 +++++++++++++++++++ .../messages/parser/mysterybox/index.ts | 1 + src/nitro/session/SessionDataManager.ts | 14 ++++++++ .../events/MysteryBoxKeysUpdateEvent.ts | 6 ++-- 10 files changed, 78 insertions(+), 5 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/mysterybox/MysteryBoxKeysEvent.ts create mode 100644 src/nitro/communication/messages/incoming/mysterybox/index.ts create mode 100644 src/nitro/communication/messages/parser/mysterybox/MysteryBoxKeysParser.ts create mode 100644 src/nitro/communication/messages/parser/mysterybox/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index c4d37cf4..2eb4cde2 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, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from './messages'; +import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, FurnitureGuildInfoComposer, MysteryBoxKeysEvent, 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'; @@ -541,6 +541,9 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.MODTOOL_USER_CHATLOG, ModtoolUserChatlogEvent); this._events.set(IncomingHeader.MODTOOL_ROOM_CHATLOG, ModtoolRoomChatlogEvent); + // MYSTERY BOX + this._events.set(IncomingHeader.MYSTERY_BOX_KEYS, MysteryBoxKeysEvent); + // NAVIGATOR this._events.set(IncomingHeader.NAVIGATOR_CATEGORIES, NavigatorCategoriesEvent); this._events.set(IncomingHeader.NAVIGATOR_COLLAPSED, NavigatorCollapsedEvent); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 1088c4f5..775f22f8 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -141,7 +141,7 @@ export class IncomingHeader public static ROOM_THICKNESS = 3547; public static SECURITY_DEBUG = 3284; public static SECURITY_MACHINE = 1488; - public static SECURITY_UNKNOWN2 = 2833; + public static MYSTERY_BOX_KEYS = 2833; public static TRADE_ACCEPTED = 2568; public static TRADE_CLOSED = 1373; public static TRADE_COMPLETED = 1001; diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index 3e838189..5b2529cb 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -24,6 +24,7 @@ export * from './inventory/pets'; export * from './inventory/trading'; export * from './moderation'; export * from './modtool'; +export * from './mysterybox'; export * from './navigator'; export * from './notifications'; export * from './room'; diff --git a/src/nitro/communication/messages/incoming/mysterybox/MysteryBoxKeysEvent.ts b/src/nitro/communication/messages/incoming/mysterybox/MysteryBoxKeysEvent.ts new file mode 100644 index 00000000..e14442bc --- /dev/null +++ b/src/nitro/communication/messages/incoming/mysterybox/MysteryBoxKeysEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { MysteryBoxKeysParser } from '../../parser'; + +export class MysteryBoxKeysEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, MysteryBoxKeysParser); + } + + public getParser(): MysteryBoxKeysParser + { + return this.parser as MysteryBoxKeysParser; + } +} diff --git a/src/nitro/communication/messages/incoming/mysterybox/index.ts b/src/nitro/communication/messages/incoming/mysterybox/index.ts new file mode 100644 index 00000000..15a621fc --- /dev/null +++ b/src/nitro/communication/messages/incoming/mysterybox/index.ts @@ -0,0 +1 @@ +export * from './MysteryBoxKeysEvent'; diff --git a/src/nitro/communication/messages/parser/index.ts b/src/nitro/communication/messages/parser/index.ts index 6b2d0ec4..1614562a 100644 --- a/src/nitro/communication/messages/parser/index.ts +++ b/src/nitro/communication/messages/parser/index.ts @@ -11,6 +11,7 @@ export * from './help'; export * from './inventory'; export * from './moderation'; export * from './modtool'; +export * from './mysterybox'; export * from './navigator'; export * from './notifications'; export * from './room'; diff --git a/src/nitro/communication/messages/parser/mysterybox/MysteryBoxKeysParser.ts b/src/nitro/communication/messages/parser/mysterybox/MysteryBoxKeysParser.ts new file mode 100644 index 00000000..385a4fa2 --- /dev/null +++ b/src/nitro/communication/messages/parser/mysterybox/MysteryBoxKeysParser.ts @@ -0,0 +1,36 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; + +export class MysteryBoxKeysParser implements IMessageParser +{ + private _boxColor: string; + private _keyColor: string; + + public flush(): boolean + { + this._boxColor = null; + this._keyColor = null; + + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._boxColor = wrapper.readString(); + this._keyColor = wrapper.readString(); + + return true; + } + + public get boxColor(): string + { + return this._boxColor; + } + + public get keyColor(): string + { + return this._keyColor; + } +} diff --git a/src/nitro/communication/messages/parser/mysterybox/index.ts b/src/nitro/communication/messages/parser/mysterybox/index.ts new file mode 100644 index 00000000..f9b3ed82 --- /dev/null +++ b/src/nitro/communication/messages/parser/mysterybox/index.ts @@ -0,0 +1 @@ +export * from './MysteryBoxKeysParser'; diff --git a/src/nitro/session/SessionDataManager.ts b/src/nitro/session/SessionDataManager.ts index 330af27f..ca7c6f53 100644 --- a/src/nitro/session/SessionDataManager.ts +++ b/src/nitro/session/SessionDataManager.ts @@ -2,6 +2,7 @@ import { Texture } from 'pixi.js'; import { NitroManager } from '../../core/common/NitroManager'; import { IMessageComposer } from '../../core/communication/messages/IMessageComposer'; import { NitroEvent } from '../../core/events/NitroEvent'; +import { MysteryBoxKeysEvent } from '../communication'; import { INitroCommunicationManager } from '../communication/INitroCommunicationManager'; import { AvailabilityStatusMessageEvent } from '../communication/messages/incoming/availability/AvailabilityStatusMessageEvent'; import { ChangeUserNameResultMessageEvent } from '../communication/messages/incoming/avatar/ChangeUserNameResultMessageEvent'; @@ -20,6 +21,7 @@ import { Nitro } from '../Nitro'; import { HabboWebTools } from '../utils/HabboWebTools'; import { BadgeImageManager } from './BadgeImageManager'; import { SecurityLevel } from './enum/SecurityLevel'; +import { MysteryBoxKeysUpdateEvent } from './events'; import { SessionDataPreferencesEvent } from './events/SessionDataPreferencesEvent'; import { UserNameUpdateEvent } from './events/UserNameUpdateEvent'; import { FurnitureDataLoader } from './furniture/FurnitureDataLoader'; @@ -127,6 +129,7 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana this._communication.registerMessageEvent(new UserNameChangeMessageEvent(this.onUserNameChangeMessageEvent.bind(this))); this._communication.registerMessageEvent(new RoomModelNameEvent(this.onRoomModelNameEvent.bind(this))); this._communication.registerMessageEvent(new InClientLinkEvent(this.onInClientLinkEvent.bind(this))); + this._communication.registerMessageEvent(new MysteryBoxKeysEvent(this.onMysteryBoxKeysEvent.bind(this))); Nitro.instance.events.addEventListener(NitroSettingsEvent.SETTINGS_UPDATED, this.onNitroSettingsEvent); } @@ -372,6 +375,17 @@ export class SessionDataManager extends NitroManager implements ISessionDataMana Nitro.instance.createLinkEvent(parser.link); } + private onMysteryBoxKeysEvent(event: MysteryBoxKeysEvent): void + { + if(!event) return; + + const parser = event.getParser(); + + if(!parser) return; + + this.events.dispatchEvent(new MysteryBoxKeysUpdateEvent(parser.boxColor, parser.keyColor)); + } + private onNitroSettingsEvent(event: NitroSettingsEvent): void { this._isRoomCameraFollowDisabled = event.cameraFollow; diff --git a/src/nitro/session/events/MysteryBoxKeysUpdateEvent.ts b/src/nitro/session/events/MysteryBoxKeysUpdateEvent.ts index 459c946c..5ad409fe 100644 --- a/src/nitro/session/events/MysteryBoxKeysUpdateEvent.ts +++ b/src/nitro/session/events/MysteryBoxKeysUpdateEvent.ts @@ -7,12 +7,12 @@ export class MysteryBoxKeysUpdateEvent extends NitroEvent private _boxColor: string; private _keyColor: string; - constructor(k: string, _arg_2: string) + constructor(boxColor: string, keyColor: string) { super(MysteryBoxKeysUpdateEvent.MYSTERY_BOX_KEYS_UPDATE); - this._boxColor = k; - this._keyColor = _arg_2; + this._boxColor = boxColor; + this._keyColor = keyColor; } public get boxColor(): string From 471c171d47982399cbf9902dfc704374137b5628 Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 12 Jul 2021 00:51:03 -0400 Subject: [PATCH 125/155] Add FurnitureMysteryBoxLogic --- src/nitro/room/RoomObjectLogicFactory.ts | 5 +++- .../furniture/FurnitureMysteryBoxLogic.ts | 25 +++++++++++++++++++ .../room/object/logic/furniture/index.ts | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 src/nitro/room/object/logic/furniture/FurnitureMysteryBoxLogic.ts diff --git a/src/nitro/room/RoomObjectLogicFactory.ts b/src/nitro/room/RoomObjectLogicFactory.ts index a283179f..24ba2a42 100644 --- a/src/nitro/room/RoomObjectLogicFactory.ts +++ b/src/nitro/room/RoomObjectLogicFactory.ts @@ -4,7 +4,7 @@ import { IEventDispatcher } from '../../core/events/IEventDispatcher'; import { IRoomObjectEventHandler } from '../../room/object/logic/IRoomObjectEventHandler'; import { IRoomObjectLogicFactory } from '../../room/object/logic/IRoomObjectLogicFactory'; import { RoomObjectLogicBase } from '../../room/object/logic/RoomObjectLogicBase'; -import { FurnitureEffectBoxLogic, FurnitureLoveLockLogic, FurnitureMonsterplantSeedLogic, FurnitureMysteryTrophyLogic, FurnitureRandomTeleportLogic, FurnitureRentableSpaceLogic } from './object'; +import { FurnitureEffectBoxLogic, FurnitureLoveLockLogic, FurnitureMonsterplantSeedLogic, FurnitureMysteryBoxLogic, FurnitureMysteryTrophyLogic, FurnitureRandomTeleportLogic, FurnitureRentableSpaceLogic } from './object'; import { AvatarLogic } from './object/logic/avatar/AvatarLogic'; import { FurnitureBadgeDisplayLogic } from './object/logic/furniture/FurnitureBadgeDisplayLogic'; import { FurnitureChangeStateWhenStepOnLogic } from './object/logic/furniture/FurnitureChangeStateWhenStepOnLogic'; @@ -295,6 +295,9 @@ export class RoomObjectLogicFactory implements IRoomObjectLogicFactory case RoomObjectLogicType.FURNITURE_MONSTERPLANT_SEED: logic = FurnitureMonsterplantSeedLogic; break; + case RoomObjectLogicType.FURNITURE_MYSTERYBOX: + logic = FurnitureMysteryBoxLogic; + break; case RoomObjectLogicType.FURNITURE_MYSTERYTROPHY: logic = FurnitureMysteryTrophyLogic; break; diff --git a/src/nitro/room/object/logic/furniture/FurnitureMysteryBoxLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureMysteryBoxLogic.ts new file mode 100644 index 00000000..0733706a --- /dev/null +++ b/src/nitro/room/object/logic/furniture/FurnitureMysteryBoxLogic.ts @@ -0,0 +1,25 @@ +import { ContextMenuEnum } from '../../../../ui'; +import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; +import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; + +export class FurnitureMysteryBoxLogic extends FurnitureMultiStateLogic +{ + public getEventTypes(): string[] + { + const types = [ RoomObjectWidgetRequestEvent.MYSTERYBOX_OPEN_DIALOG ]; + + return this.mergeTypes(super.getEventTypes(), types); + } + + public useObject(): void + { + if(!this.eventDispatcher || !this.object) return; + + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.MYSTERYBOX_OPEN_DIALOG, this.object)); + } + + public get contextMenu(): string + { + return ContextMenuEnum.MYSTERY_BOX; + } +} diff --git a/src/nitro/room/object/logic/furniture/index.ts b/src/nitro/room/object/logic/furniture/index.ts index 16cc63b8..21de5e59 100644 --- a/src/nitro/room/object/logic/furniture/index.ts +++ b/src/nitro/room/object/logic/furniture/index.ts @@ -24,6 +24,7 @@ export * from './FurnitureMannequinLogic'; export * from './FurnitureMonsterplantSeedLogic'; export * from './FurnitureMultiHeightLogic'; export * from './FurnitureMultiStateLogic'; +export * from './FurnitureMysteryBoxLogic'; export * from './FurnitureMysteryTrophyLogic'; export * from './FurnitureOneWayDoorLogic'; export * from './FurniturePetCustomizationLogic'; From 85c34e4f06685ec7781242268b1da94b9c5afa7f Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 13 Jul 2021 13:31:34 -0400 Subject: [PATCH 126/155] Add texture proxy --- src/core/utils/NitroTexture.ts | 4 ++++ src/core/utils/index.ts | 1 + 2 files changed, 5 insertions(+) create mode 100644 src/core/utils/NitroTexture.ts diff --git a/src/core/utils/NitroTexture.ts b/src/core/utils/NitroTexture.ts new file mode 100644 index 00000000..dd70aebe --- /dev/null +++ b/src/core/utils/NitroTexture.ts @@ -0,0 +1,4 @@ +import { Texture } from 'pixi.js'; + +export class NitroTexture extends Texture +{} diff --git a/src/core/utils/index.ts b/src/core/utils/index.ts index 1ea96255..258fa761 100644 --- a/src/core/utils/index.ts +++ b/src/core/utils/index.ts @@ -6,4 +6,5 @@ export * from './NitroFilter'; export * from './NitroPoint'; export * from './NitroRectangle'; export * from './NitroSprite'; +export * from './NitroTexture'; export * from './NitroTimer'; From 907d51bac1c7273d0e5fbe08134f82033ea088a2 Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 13 Jul 2021 13:31:54 -0400 Subject: [PATCH 127/155] Update dependencies --- package-lock.json | 117 +++++++++++++++++++++++++--------------------- package.json | 2 +- 2 files changed, 65 insertions(+), 54 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3cbd8bc4..267469e6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,18 +14,18 @@ } }, "@babel/helper-validator-identifier": { - "version": "7.12.11", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", - "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", + "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", "dev": true }, "@babel/highlight": { - "version": "7.13.10", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.13.10.tgz", - "integrity": "sha512-5aPpe5XQPzflQrFwL1/QoeHkP2MsA4JCntcXHRhEsdsfPVkvPi2w7Qix4iV7t5S/oC9OodGrggd8aco1g3SZFg==", + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.5.tgz", + "integrity": "sha512-qf9u2WFWVV0MppaL877j2dBtQIDgmidgjGk5VIMw3OadXvYaXn66U1BFlH2t4+t3i+8PhedppRv+i40ABzd+gg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.12.11", + "@babel/helper-validator-identifier": "^7.14.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -44,15 +44,15 @@ } }, "@eslint/eslintrc": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", - "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", + "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.1.1", "espree": "^7.3.0", - "globals": "^12.1.0", + "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", "js-yaml": "^3.13.1", @@ -60,15 +60,6 @@ "strip-json-comments": "^3.1.1" }, "dependencies": { - "globals": { - "version": "12.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", - "dev": true, - "requires": { - "type-fest": "^0.8.1" - } - }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -656,9 +647,9 @@ "dev": true }, "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -878,28 +869,30 @@ "dev": true }, "eslint": { - "version": "7.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.22.0.tgz", - "integrity": "sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==", + "version": "7.29.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.29.0.tgz", + "integrity": "sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.0", + "@eslint/eslintrc": "^0.4.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", "enquirer": "^2.3.5", + "escape-string-regexp": "^4.0.0", "eslint-scope": "^5.1.1", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^2.0.0", "espree": "^7.3.1", "esquery": "^1.4.0", "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "functional-red-black-tree": "^1.0.1", - "glob-parent": "^5.0.0", + "glob-parent": "^5.1.2", "globals": "^13.6.0", "ignore": "^4.0.6", "import-fresh": "^3.0.0", @@ -908,7 +901,7 @@ "js-yaml": "^3.13.1", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", - "lodash": "^4.17.21", + "lodash.merge": "^4.6.2", "minimatch": "^3.0.4", "natural-compare": "^1.4.0", "optionator": "^0.9.1", @@ -917,11 +910,17 @@ "semver": "^7.2.1", "strip-ansi": "^6.0.0", "strip-json-comments": "^3.1.0", - "table": "^6.0.4", + "table": "^6.0.9", "text-table": "^0.2.0", "v8-compile-cache": "^2.0.3" }, "dependencies": { + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -1171,20 +1170,12 @@ } }, "globals": { - "version": "13.6.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.6.0.tgz", - "integrity": "sha512-YFKCX0SiPg7l5oKYCJ2zZGxcXprVXHcSnVuvzrT3oSENQonVLqM5pf9fN5dLGZGyCjhw8TN8Btwe/jKnZ0pjvQ==", + "version": "13.9.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", + "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", "dev": true, "requires": { "type-fest": "^0.20.2" - }, - "dependencies": { - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - } } }, "globby": { @@ -1345,6 +1336,24 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, "lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -1779,21 +1788,23 @@ } }, "table": { - "version": "6.0.7", - "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", - "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", + "version": "6.7.1", + "resolved": "https://registry.npmjs.org/table/-/table-6.7.1.tgz", + "integrity": "sha512-ZGum47Yi6KOOFDE8m223td53ath2enHcYLgOCjGr5ngu8bdIARQk6mN/wRMv4yMRcHnCSnHbCEha4sobQx5yWg==", "dev": true, "requires": { - "ajv": "^7.0.2", - "lodash": "^4.17.20", + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.truncate": "^4.4.2", "slice-ansi": "^4.0.0", - "string-width": "^4.2.0" + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" }, "dependencies": { "ajv": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.2.1.tgz", - "integrity": "sha512-+nu0HDv7kNSOua9apAVc979qd932rrZeb3WOvoiD31A/p1mIE5/9bN2027pE2rOPYEdS3UHzsvof4hY+lM9/WQ==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", + "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -1857,9 +1868,9 @@ } }, "type-fest": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true }, "typescript": { diff --git a/package.json b/package.json index 624c2dae..a2d7a73a 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "@typescript-eslint/eslint-plugin": "^4.15.0", "@typescript-eslint/parser": "^4.15.0", "create-ts-index": "^1.13.6", - "eslint": "^7.19.0", + "eslint": "^7.29.0", "typescript": "~4.2.3" } } From 6c308e0611155014dee23cb8311f5c482813c1ff Mon Sep 17 00:00:00 2001 From: Bill Date: Tue, 13 Jul 2021 16:34:41 -0400 Subject: [PATCH 128/155] Update pixijs to v6 --- package-lock.json | 801 ++++++++++-------- package.json | 18 +- src/core/asset/AssetManager.ts | 40 +- src/core/asset/IAssetManager.ts | 5 +- src/core/asset/interfaces/IAssetData.ts | 4 +- .../interfaces/spritesheet/ISpritesheet.ts | 7 + .../spritesheet/ISpritesheetData.ts | 8 - .../spritesheet/ISpritesheetFrame.ts | 25 - .../asset/interfaces/spritesheet/index.ts | 3 +- src/nitro/Nitro.ts | 27 +- src/nitro/avatar/AvatarImage.ts | 7 +- src/nitro/camera/IRoomCameraWidgetEffect.ts | 3 +- src/nitro/camera/RoomCameraWidgetEffect.ts | 9 +- src/nitro/camera/RoomCameraWidgetManager.ts | 3 +- src/nitro/room/RoomContentLoader.ts | 32 +- src/nitro/room/RoomEngine.ts | 4 +- .../object/visualization/room/RoomPlane.ts | 5 +- .../pixi-tilemap/CanvasTileRenderer.ts | 23 +- .../pixi-tilemap/CompositeRectTileLayer.ts | 1 - .../pixi-tilemap/MultiTextureResource.ts | 11 +- .../floorplan/pixi-tilemap/RectTileLayer.ts | 8 +- .../floorplan/pixi-tilemap/RectTileShader.ts | 7 +- .../floorplan/pixi-tilemap/TileRenderer.ts | 6 +- .../utils/GraphicAssetCollection.ts | 5 +- .../utils/GraphicAssetPalette.ts | 4 +- src/room/renderer/RoomSpriteCanvas.ts | 6 +- src/room/renderer/utils/ExtendedSprite.ts | 6 +- src/room/utils/TextureUtils.ts | 22 +- tsconfig.json | 8 +- 29 files changed, 579 insertions(+), 529 deletions(-) create mode 100644 src/core/asset/interfaces/spritesheet/ISpritesheet.ts delete mode 100644 src/core/asset/interfaces/spritesheet/ISpritesheetData.ts delete mode 100644 src/core/asset/interfaces/spritesheet/ISpritesheetFrame.ts diff --git a/package-lock.json b/package-lock.json index 267469e6..603f71e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -68,6 +68,23 @@ } } }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "dev": true + }, "@nodelib/fs.scandir": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", @@ -95,451 +112,493 @@ } }, "@pixi/accessibility": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/accessibility/-/accessibility-5.3.8.tgz", - "integrity": "sha512-DBkUUPIDfaw1hXFLTOsmZ401JSyu286rS2UB79ClxvVtDfGI7pR+Hgq1PuNeoQSiO9Db32W4grvuxYTulO2jkQ==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/accessibility/-/accessibility-6.0.4.tgz", + "integrity": "sha512-S0Co6M+BIx+Yk3INCwGp5Xif0jIv/uj5JPMbctpMV7fSsE3x0nYvcOOAfBjkGhYcXG7fNOGrYLgs5XQOBIWGtA==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/canvas-renderer": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/app": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/app/-/app-5.3.8.tgz", - "integrity": "sha512-eekP/tIPlERZOiWOCVKgOCc66JoAHDP7yT9DBw2LtCKswvP83iwN0PX5YR/u6Z05kUW5y8t4bigfLqEqc4uChw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/app/-/app-6.0.4.tgz", + "integrity": "sha512-+BiuaQtnOBR5/Q8+nXnHE2tuZyuBnqy/cwbIR1ImPnKAs7UaCcRLf1R0RvnRFu4KMP4ozTd810p0k84TzIguTA==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8" + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4" + } + }, + "@pixi/canvas-renderer": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/canvas-renderer/-/canvas-renderer-6.0.4.tgz", + "integrity": "sha512-z2r1nzYsAp9+gipvlFCj0rd0yfjVq1hTQkyWuMbo5TrePdEo3NLRrCUGo1dHJNbeSERpgGNN05OAiGQbAI+AUg==", + "requires": { + "@pixi/constants": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/settings": "6.0.4", + "@pixi/utils": "6.0.4" + } + }, + "@pixi/compressed-textures": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/compressed-textures/-/compressed-textures-6.0.4.tgz", + "integrity": "sha512-AqQPuuXcNrR28YT69SZhRxRRwzqQcQ/QrlexAR9Fohpe+jfDnvlNaIvQQoXU7HxD7huRiQ/dm3nwsLiKPqVoTg==", + "requires": { + "@pixi/constants": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/loaders": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/constants": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-5.3.8.tgz", - "integrity": "sha512-vTkgBgiox2pLj2ZK/X37O6rFjsLic6CYa+rSCCMo8lCwipG/dgizYoAVIsmZy30tFgg1xYzI6qOw3MSVXupp8Q==" + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/constants/-/constants-6.0.4.tgz", + "integrity": "sha512-khwRMfuHVdFk93L+bf0mmCwtSloYlfBfjdseIAbJL+VSpeMG1S2DzCYlMCPdp4mvDLU9LvkH2U2leZGEIx5j7g==" }, "@pixi/core": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/core/-/core-5.3.8.tgz", - "integrity": "sha512-mbl7//UbNaIZJbS8R8g5o6cHAMW7xaJWW/dNazSJ9057Fpq5g3e3E2rreNTEILfC29cxm2sXDmgK5a9agoqJaA==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/core/-/core-6.0.4.tgz", + "integrity": "sha512-r1ceyAz0z3usUs0uj4u2986vVT2tQixGNin2o9FNhPFDXbN5EaoKHLtrjGBt1iylK/EUH/nfL5zq0SGa/loW0A==", "requires": { - "@pixi/constants": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/runner": "5.3.8", - "@pixi/settings": "5.3.8", - "@pixi/ticker": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/constants": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/runner": "6.0.4", + "@pixi/settings": "6.0.4", + "@pixi/ticker": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/display": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/display/-/display-5.3.8.tgz", - "integrity": "sha512-ch7g63ox3iow/NEGbrArLfUMJVLVF+FpdFAp72uEweIzlcyzOQV6AcQTHtiRy4+tM6LdlcLSJXJISqGKt2R0Dg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/display/-/display-6.0.4.tgz", + "integrity": "sha512-v6hjx5Gm5aIlLQ7xrsZ2lstI1cv/MtbWXJOhU8LXckkrHHUvAuJgml3+0pcHw8YLuOlepZngUuiqy/XjceVk8A==", "requires": { - "@pixi/math": "5.3.8", - "@pixi/settings": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/math": "6.0.4", + "@pixi/settings": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/extract": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/extract/-/extract-5.3.8.tgz", - "integrity": "sha512-z09D+5qmGQilbBXhR3xlZCixkTb6+1bSo6jGsbQxpu3xaF0ogh1HB76SJ2Wi1vwba9Q/PMb6RlawdEAg+sRFMg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/extract/-/extract-6.0.4.tgz", + "integrity": "sha512-xf/pnc5od7YJ8zCVIrv1km7i+P+rxYcSrrBI/hqX+qoVsI5EySKInf2GhCKHz4UjOHdSL5aPDnNYvzssNdIpdQ==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/core": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/filter-adjustment": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@pixi/filter-adjustment/-/filter-adjustment-3.1.1.tgz", - "integrity": "sha512-N+qbkofBn5tiGn2Ubg52AEoPOM69VIO5TEHsBtm5oh2S4m/rb6FnnqPji/FzwK89iLvtYmJdbwWAYi87PWnE3Q==" + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/@pixi/filter-adjustment/-/filter-adjustment-4.1.3.tgz", + "integrity": "sha512-W+NhPiZRYKoRToa5+tkU95eOw8gnS5dfIp3ZP+pLv2mdER9RI+4xHxp1uLHMqUYZViTaMdZIIoVOuCgHFPYCbQ==" }, "@pixi/filter-alpha": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/filter-alpha/-/filter-alpha-5.3.8.tgz", - "integrity": "sha512-4vOmuWDLBiMbdQ2S3PmxzrzpPOrlzZVZ8iPEkQrBCYZ4dIuZY7NaV+9tneIK66dDfVI6OA8Ai304LH22nhC81Q==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/filter-alpha/-/filter-alpha-6.0.4.tgz", + "integrity": "sha512-MZEfvNPfH2NfrwgqKhwwzurnbLujphx4KNQmS63MEZTvXuQJy16DEOs459APYF6PmeGAGuDPKd5Onk/VbLRUwQ==", "requires": { - "@pixi/core": "5.3.8" + "@pixi/core": "6.0.4" } }, "@pixi/filter-blur": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/filter-blur/-/filter-blur-5.3.8.tgz", - "integrity": "sha512-biNqbfFIDbvOJJ+NiE9G0XojnuMQqtbcaDIiOScRoY3o3yCMjjcUxUMYrZ4xnTGGtEH23OKGUTZVf53qTQ4wiw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/filter-blur/-/filter-blur-6.0.4.tgz", + "integrity": "sha512-Hb14geh8ZKc8jZ4lfKyeWThLMqIvha6DdRUTfiSdKe3L7Q6qwqsb7LPtIrZHAPEQCyFLWbcOvRMy6ZFy0YkpLA==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/settings": "5.3.8" + "@pixi/core": "6.0.4", + "@pixi/settings": "6.0.4" } }, "@pixi/filter-color-matrix": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/filter-color-matrix/-/filter-color-matrix-5.3.8.tgz", - "integrity": "sha512-0Ag08uPKVoHWQSAIhS27Bs/b50NVMZ+3fUdNg9jgyrRthD/Uc2ljfkIJRa95Mj31YJBS15Giu4BGfefpe1i3zw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/filter-color-matrix/-/filter-color-matrix-6.0.4.tgz", + "integrity": "sha512-31Rf9VBo2gqoxiAbD/Z1i+mu1C7uehecoelYQqCIzLjsWisICDTZZjUkMB5GrGzjeSpSqLfB34tlutBSh/r1wg==", "requires": { - "@pixi/core": "5.3.8" + "@pixi/core": "6.0.4" } }, "@pixi/filter-displacement": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/filter-displacement/-/filter-displacement-5.3.8.tgz", - "integrity": "sha512-OQYBK3oOId8VZV7KRYYdt196EYsG0cjAmQQT7P3/IETLIP6Mba+Bd/GtyxGEIBHcb7R5DebuvN4sVQtNgkRKlw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/filter-displacement/-/filter-displacement-6.0.4.tgz", + "integrity": "sha512-Oyk/WbzxlN46d/uB5NtPLfEW2G6ob5XRP+mPVd8yhK38m9Y9rKlcH4jJoWB2niQ+ewkdRfZhuIB+JRdhc9eevg==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/math": "5.3.8" + "@pixi/core": "6.0.4", + "@pixi/math": "6.0.4" } }, "@pixi/filter-fxaa": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/filter-fxaa/-/filter-fxaa-5.3.8.tgz", - "integrity": "sha512-eOfrp46AEjkAM1U+6k9Ga/5ezEwr1+7yGS3VijZBHntZTYKFhmGGOXrQxxL4KuslrfTV/smAflEr22U+A2H98A==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/filter-fxaa/-/filter-fxaa-6.0.4.tgz", + "integrity": "sha512-cO5XuEIq//Wsk4MjrCYuXff+1/Gfc4bkFkMTO5JKvUaDlZzHNykZd5CeAouD2fz7/6/1z0gdWKbBY9IoameBew==", "requires": { - "@pixi/core": "5.3.8" + "@pixi/core": "6.0.4" } }, "@pixi/filter-noise": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/filter-noise/-/filter-noise-5.3.8.tgz", - "integrity": "sha512-+MOz3GpB9XpH7d0B/HAz8zOp164UMKnE64Q9QI094X4KjXWj24RKZea8xFcOaOy9xKi57qqyo+3pLwqFB8ffsw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/filter-noise/-/filter-noise-6.0.4.tgz", + "integrity": "sha512-Fpex0tpKCwZIsN03zAmN7hAOCocFF/w4XVVIkuNgYR5A90OkK+omR6p/fDtlJtlAjWarsWq0y+c5wvvUMfqsmg==", "requires": { - "@pixi/core": "5.3.8" + "@pixi/core": "6.0.4" } }, "@pixi/graphics": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/graphics/-/graphics-5.3.8.tgz", - "integrity": "sha512-auqwS6ZnDlNoerddLCoMpEzgq0o09WHH7XxwfTK75hJwBaFX1RO/nasfvCx2wAtWZxAYCaABfR8WnWZfrsBSqA==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/graphics/-/graphics-6.0.4.tgz", + "integrity": "sha512-CybR+DBkGB5llypPeib2A0J13mnPQwlQDqLRhlhXKkYxXQKXlPk5MWA7ZEg+4wKeqUUlrC+k70e5ZFYLC3AgEQ==", "requires": { - "@pixi/constants": "5.3.8", - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/sprite": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/constants": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/sprite": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/interaction": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/interaction/-/interaction-5.3.8.tgz", - "integrity": "sha512-i9KS9TNVK/PEwyjZH2iqui9xroy0R48u/QL4Q8+VQpwbeDlz+WlPWoW5R7rpUwtHd9H6mLWpGR3sdWOmS7fMsA==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/interaction/-/interaction-6.0.4.tgz", + "integrity": "sha512-4+FOKDpiF/+F9r3+y81xTBElcLqI3OpeeI9bkIw9pPHA41riXRQv+m0HWz76bGQK7zDAimAV9K2xff7Wa5nSeg==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/ticker": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/ticker": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/loaders": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/loaders/-/loaders-5.3.8.tgz", - "integrity": "sha512-0M2e/gkBBqJW695wz9DcsYN7IY992FKqb9uOEhFFjCn2bkK9WsR6M/JBvTlTk4LOvEg81b1/J51bkucpXWx1Cg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/loaders/-/loaders-6.0.4.tgz", + "integrity": "sha512-cw8QSkn8l8P06fINfwCZW+vUdhtOJ5G+T2qQm3HIDgI/J1tAsiRj3ufHop8xkHwYXrUeTf1LTqw+QdlZEVpJfg==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/utils": "5.3.8", + "@pixi/constants": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/utils": "6.0.4", "resource-loader": "^3.0.1" + }, + "dependencies": { + "resource-loader": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/resource-loader/-/resource-loader-3.0.1.tgz", + "integrity": "sha512-fBuCRbEHdLCI1eglzQhUv9Rrdcmqkydr1r6uHE2cYHvRBrcLXeSmbE/qI/urFt8rPr/IGxir3BUwM5kUK8XoyA==", + "requires": { + "mini-signals": "^1.2.0", + "parse-uri": "^1.0.0" + } + } } }, "@pixi/math": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/math/-/math-5.3.8.tgz", - "integrity": "sha512-MZekzC9W391KU2NyzbRHrgYfjPKguzU5cRLbaEw9dgDabLh3/Yzob1KVg8dngIITPbi5yBmoX7zh7ZHEA1NRPQ==" + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/math/-/math-6.0.4.tgz", + "integrity": "sha512-UwZ72CeZ2KsS4IlcEXgNiuD88omPk42Dct74+1G+R2+yPI+XRZq+hGQRTle/BbFYjxh9ccdQVyX9ToGv1XTd6Q==" }, "@pixi/mesh": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/mesh/-/mesh-5.3.8.tgz", - "integrity": "sha512-/CQdTypiLgSZqKx9z89cJlLQ8/FaUrc8M3HjmL8Vy5F320ERCR1YLDc6gOzyohK71wDxkUud5VbNz5woQVSBxw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/mesh/-/mesh-6.0.4.tgz", + "integrity": "sha512-uE1Qs4mXy0QVV3yjxlNeqthkXGS6Hkt5uR1fwrvdqxlQRkX69nRq+GZfInuRYDWqwAsl8eZWs7f+pLRDT+HFbA==", "requires": { - "@pixi/constants": "5.3.8", - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/settings": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/constants": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/settings": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/mesh-extras": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/mesh-extras/-/mesh-extras-5.3.8.tgz", - "integrity": "sha512-+lHcmvslKsmlixiJW87/t5diRy7p+tvqQbXMG4/3Vzv3dBEGq453hMIknlLr2xLGyzBtboCHObzwKfeE4tvHTw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/mesh-extras/-/mesh-extras-6.0.4.tgz", + "integrity": "sha512-2fGM8j2NBwPV71SSmMfke1N1oEQ34+J19rdaAb+p1fXex0FafqtXVO49Q8rPMvungKDplMKElzQoaC1G6JGKqA==", "requires": { - "@pixi/constants": "5.3.8", - "@pixi/core": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/mesh": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/constants": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/mesh": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/mixin-cache-as-bitmap": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/mixin-cache-as-bitmap/-/mixin-cache-as-bitmap-5.3.8.tgz", - "integrity": "sha512-Y4z3yvMldRUU99I+FBOl+j+TCq7CXN2ysNED/vMD2YpfilS2/8dQcAqRNEOBXCdSixd6+QHBuc0+PWR6M7irKg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/mixin-cache-as-bitmap/-/mixin-cache-as-bitmap-6.0.4.tgz", + "integrity": "sha512-b1G5AWsxnw3CxNyaxCWJ1cWPnRECknJQ9B4D8Dy7u/gI2gABVjqz17nNFYnVpcggLlgMTkjX8+/HWnD/vZQkTg==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/settings": "5.3.8", - "@pixi/sprite": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/canvas-renderer": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/settings": "6.0.4", + "@pixi/sprite": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/mixin-get-child-by-name": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/mixin-get-child-by-name/-/mixin-get-child-by-name-5.3.8.tgz", - "integrity": "sha512-6Z4C2SucwC1w2xa260VxU+uIkP8FhwnZWDfY0rxyxecWxvkM7ULsIU9szoUYUJvLJnpxRi4Xb6rXNPxXyzis9Q==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/mixin-get-child-by-name/-/mixin-get-child-by-name-6.0.4.tgz", + "integrity": "sha512-scUMBHlOmW0hpjltn4UCihJZvz3ysDYIW35ma9p9Lso2D9qKjsZpojQ6mc75FVWz53T0BjUmLW8LHA86Jic6MQ==", "requires": { - "@pixi/display": "5.3.8" + "@pixi/display": "6.0.4" } }, "@pixi/mixin-get-global-position": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/mixin-get-global-position/-/mixin-get-global-position-5.3.8.tgz", - "integrity": "sha512-o2ZKmTxDvoibGBZ8LP3qJZ3cHe7L447qsuHPPLYOPmA5hqG49YchwmKMwV6tn96C8yDECaVn429Hu5hZEI7UlA==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/mixin-get-global-position/-/mixin-get-global-position-6.0.4.tgz", + "integrity": "sha512-HzaFTMZEZTr6+WYuT9crTjjBYl7/Y/VDB7pWmjnntEdQsa1m0+by7Mnl67L6OSUPsAgW3MMlWirb5tL2zGFC7g==", "requires": { - "@pixi/display": "5.3.8", - "@pixi/math": "5.3.8" + "@pixi/display": "6.0.4", + "@pixi/math": "6.0.4" } }, "@pixi/particles": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/particles/-/particles-5.3.8.tgz", - "integrity": "sha512-XAehJJ9SsLwlZF1Qkkir0ejPZ0YgCg8MbxzmrxBUbhH1NyHJLFm+K2S7Bp12FdR/hZwTENF7GMGVRH+o86u3hw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/particles/-/particles-6.0.4.tgz", + "integrity": "sha512-/57nd+icuPFMNc+SxeUqGoO8ZXEKu9u8h+UI856XF1Rc1jlXzGanGAbp43Llq2LphYqBI8YVftP0QXhewCVjjA==", "requires": { - "@pixi/constants": "5.3.8", - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/constants": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/polyfill": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/polyfill/-/polyfill-5.3.8.tgz", - "integrity": "sha512-AIXfAjYD7dfP2C+TX3482YterwGE876amqmk6EzMZCI3vvsvDJUGT/Dx6lSOU5zbcUbJ9t3Ybz81xQYpaEhv/Q==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/polyfill/-/polyfill-6.0.4.tgz", + "integrity": "sha512-HM27pSl8iduFqUC4Waa9mt/gRKHi8Pr679it84+U4CwXmJ2lw9DL5dZuyU+QzCp2nPEVGMqx8Ig8c7WLUMvnWA==", "requires": { - "es6-promise-polyfill": "^1.2.0", - "object-assign": "^4.1.1" + "object-assign": "^4.1.1", + "promise-polyfill": "^8.2.0" } }, "@pixi/prepare": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/prepare/-/prepare-5.3.8.tgz", - "integrity": "sha512-DbYxQdziypsdQJaRKwdmODkIy2mQHETEFlVWou0XwVy+WB8VBlSnHZ57cVEY8l6Z0hJ93Vo4K6j5qIRi9MRjJA==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/prepare/-/prepare-6.0.4.tgz", + "integrity": "sha512-BrOeKC6eZ+sdiqpefUMGXIt/VDiYDqPDP7XUCRmaI8rGTFT6ZAg/XJQENb9TsVen/4dUp+9/1u7HCFO1TEhaWQ==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/graphics": "5.3.8", - "@pixi/settings": "5.3.8", - "@pixi/text": "5.3.8", - "@pixi/ticker": "5.3.8" + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/graphics": "6.0.4", + "@pixi/settings": "6.0.4", + "@pixi/text": "6.0.4", + "@pixi/ticker": "6.0.4" } }, "@pixi/runner": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-5.3.8.tgz", - "integrity": "sha512-6Y9v9OHd5FFv6s0M4AGHnG3qvLiTBM5T5RnlEqMNMsqH6CWSDq0mNJA5HQD65q5ViK8HM6MYPm2nwwkYq5AICQ==" + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/runner/-/runner-6.0.4.tgz", + "integrity": "sha512-ta6r36r2vC+fPB27URpSacPGQDtbJbdUoeGCJWAEwX+QI4vx4C9NYAcB0bIg8TLXiigCfA6by/RMnJ0dBiemFA==" }, "@pixi/settings": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-5.3.8.tgz", - "integrity": "sha512-/NSd9v6+IbG3GjzIoNwy7rgPg6kwwWy54pcaiM3Wv3zjkwhkVySK4m3h892Wa2z5lFvrHEH9zewGJwEpUH/FMA==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/settings/-/settings-6.0.4.tgz", + "integrity": "sha512-djiIsmULDwcHWNmEiZKm4zyVopu1NL+fClnbBmtDkGZw7nm37y6dOcdpYawJcxvE4/KLm6pspBiRTnrzdlqW7Q==", "requires": { "ismobilejs": "^1.1.0" } }, "@pixi/sprite": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/sprite/-/sprite-5.3.8.tgz", - "integrity": "sha512-r+WeX5cti3VKu6U+hZeSiY4UC8912FjNU7M5bA/gev9CfUKv3fNwKYshPfzOkTPua8dFwI1U6tplYu5rSPMBmw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/sprite/-/sprite-6.0.4.tgz", + "integrity": "sha512-6yMoHmfFhSRERLM1PUXceq9e6e1UH0YJkLoPVLv6gxMunfk6jPXeO8p9dDS2FQ8ZMSkO/16BKq27HIMKvF6Cvg==", "requires": { - "@pixi/constants": "5.3.8", - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/settings": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/constants": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/settings": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/sprite-animated": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/sprite-animated/-/sprite-animated-5.3.8.tgz", - "integrity": "sha512-zLnzmCJJ++Hyyy1LPh5Lt4icPuy8C+vL59yVj3nAYzqq/G26rFuHELexB0iwKBPE9yQYuaUQhFgOPgW4vFqLAw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/sprite-animated/-/sprite-animated-6.0.4.tgz", + "integrity": "sha512-uzNeJiZqcnuRc7HH/HdWxrkU7S3/D57rEGK+AuoaWEE2e2HlBWILGkf78mtqmeIrEChxe2qkOVkf4y3BZkzJVw==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/sprite": "5.3.8", - "@pixi/ticker": "5.3.8" + "@pixi/core": "6.0.4", + "@pixi/sprite": "6.0.4", + "@pixi/ticker": "6.0.4" } }, "@pixi/sprite-tiling": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/sprite-tiling/-/sprite-tiling-5.3.8.tgz", - "integrity": "sha512-SvCAvajihsaNx/xX4s6waEqPLVkI5W86h31kpoqdPj3zXhoLbpZh6t2TWbcRJmgjM1GvBNy14gWtelBq8UF7Mg==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/sprite-tiling/-/sprite-tiling-6.0.4.tgz", + "integrity": "sha512-4TBsKMeGhwmfsVELorSs+zWWBih37Kd0lPQu0uhcHVV1RKtZxZpkgNoyzKS4d+WInNek5F0E592bYsXkbE6Gag==", "requires": { - "@pixi/constants": "5.3.8", - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/sprite": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/constants": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/sprite": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/spritesheet": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/spritesheet/-/spritesheet-5.3.8.tgz", - "integrity": "sha512-KqTsW2LViI1UjZTycfI0x3m+yZqV8zfIm/CiDAmtujUPAu8sU78jzByc8ke7FaFC6waDsfAKTKu4fBqSu7aH1w==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/spritesheet/-/spritesheet-6.0.4.tgz", + "integrity": "sha512-WgOBoi9KvLkHtfSyKSEzjIq6BkLwC+Ckllh+vWgfjfFDhtm7NdOfxW5WVIoCLfyfv5/NSwEMEEffZrcw4zYA/A==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/loaders": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/core": "6.0.4", + "@pixi/loaders": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/text": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/text/-/text-5.3.8.tgz", - "integrity": "sha512-qarv4kXSrtroJy5dbmF0Vld7L8teeQxsV5N1g1Fjhi4uUCb43ioR9euBHIjju33kOLDYYXXw6L78XIe/cW6nIw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/text/-/text-6.0.4.tgz", + "integrity": "sha512-r9UJg8ivWvvS7nNyBaZBKX5zg5UCU37dIYbKXcHyiXnOvXO22tiQBfkPBrZCueeLXRouC9sHmDFya8rb5TE9HA==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/settings": "5.3.8", - "@pixi/sprite": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/core": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/settings": "6.0.4", + "@pixi/sprite": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/text-bitmap": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/text-bitmap/-/text-bitmap-5.3.8.tgz", - "integrity": "sha512-jJVAc/y7Mo/DLw8n14A1AFmhQe8rw5d+vCg/1k4hw0Oru4l2QU/8AA940kPeuky4Sj0hMLf9UWAS6A3gOo5ZTA==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/text-bitmap/-/text-bitmap-6.0.4.tgz", + "integrity": "sha512-Nh2PXixqF0LFJ0xwmTib2HVWdhgsHn+dSYMVIec8LndDFQMTBw+X2XP1iHjVm0xhqOVdZI+Qfb2Trc0j2lINrw==", "requires": { - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/loaders": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/mesh": "5.3.8", - "@pixi/settings": "5.3.8", - "@pixi/text": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/loaders": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/mesh": "6.0.4", + "@pixi/settings": "6.0.4", + "@pixi/text": "6.0.4", + "@pixi/utils": "6.0.4" } }, "@pixi/ticker": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-5.3.8.tgz", - "integrity": "sha512-WoVi8btR0X2/fXJgt/oRy2gm32ECnibqUkxl0MOcLuxg7cHDZKFA5PwNK/eIx5hZZ2xM/ztoPtEohWV6LqLryw==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/ticker/-/ticker-6.0.4.tgz", + "integrity": "sha512-PkFfPP5vHlgnApLks0Ia0okmFu6KPqBdIyquDqHJAcBdgljedm32KS6K2EH37xelBOzYHScjZ2SQGiiebVfClw==", "requires": { - "@pixi/settings": "5.3.8" + "@pixi/settings": "6.0.4" } }, "@pixi/utils": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-5.3.8.tgz", - "integrity": "sha512-LljIFFOFcXLyLzXqIYwcXUqz6NsAUbwxb7Som9Gm3i1usGIqPRX4R08Iaf4L6OKA7417gSrRmbYdT0Hje/0ikA==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@pixi/utils/-/utils-6.0.4.tgz", + "integrity": "sha512-35JTWsAJ8Va0vvtUSQvyOr3kGedGKVuJnHDO89B8C8tSFtMpJYrR44vp1b1p1vOjNak+ulGehZc8LzlCqymViQ==", "requires": { - "@pixi/constants": "5.3.8", - "@pixi/settings": "5.3.8", - "earcut": "^2.1.5", + "@pixi/constants": "6.0.4", + "@pixi/settings": "6.0.4", + "@types/earcut": "^2.1.0", + "earcut": "^2.2.2", "eventemitter3": "^3.1.0", "url": "^0.11.0" } }, + "@types/earcut": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@types/earcut/-/earcut-2.1.1.tgz", + "integrity": "sha512-w8oigUCDjElRHRRrMvn/spybSMyX8MTkKA5Dv+tS1IE/TgmNZPqUYtvYBXGY8cieSE66gm+szeK+bnbxC2xHTQ==" + }, "@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "version": "7.0.8", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", + "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==", "dev": true }, "@types/node": { - "version": "14.14.35", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.35.tgz", - "integrity": "sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag==", + "version": "14.17.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.17.5.tgz", + "integrity": "sha512-bjqH2cX/O33jXT/UmReo2pM7DIJREPMnarixbQ57DOOzzFaI6D2+IcwaJQaJpv0M1E9TIhPCYVxrkcityLjlqA==", "dev": true }, "@types/pako": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@types/pako/-/pako-1.0.1.tgz", - "integrity": "sha512-GdZbRSJ3Cv5fiwT6I0SQ3ckeN2PWNqxd26W9Z2fCK1tGrrasGy4puvNFtnddqH9UJFMQYXxEuuB7B8UK+LLwSg==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@types/pako/-/pako-1.0.2.tgz", + "integrity": "sha512-8UJl2MjkqqS6ncpLZqRZ5LmGiFBkbYxocD4e4jmBqGvfRG1RS23gKsBQbdtV9O9GvRyjFTiRHRByjSlKCLlmZw==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.18.0.tgz", - "integrity": "sha512-Lzkc/2+7EoH7+NjIWLS2lVuKKqbEmJhtXe3rmfA8cyiKnZm3IfLf51irnBcmow8Q/AptVV0XBZmBJKuUJTe6cQ==", + "version": "4.28.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.28.3.tgz", + "integrity": "sha512-jW8sEFu1ZeaV8xzwsfi6Vgtty2jf7/lJmQmDkDruBjYAbx5DA8JtbcMnP0rNPUG+oH5GoQBTSp+9613BzuIpYg==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "4.18.0", - "@typescript-eslint/scope-manager": "4.18.0", - "debug": "^4.1.1", + "@typescript-eslint/experimental-utils": "4.28.3", + "@typescript-eslint/scope-manager": "4.28.3", + "debug": "^4.3.1", "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.15", - "regexpp": "^3.0.0", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "regexpp": "^3.1.0", + "semver": "^7.3.5", + "tsutils": "^3.21.0" } }, "@typescript-eslint/experimental-utils": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.18.0.tgz", - "integrity": "sha512-92h723Kblt9JcT2RRY3QS2xefFKar4ZQFVs3GityOKWQYgtajxt/tuXIzL7sVCUlM1hgreiV5gkGYyBpdOwO6A==", + "version": "4.28.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.28.3.tgz", + "integrity": "sha512-zZYl9TnrxwEPi3FbyeX0ZnE8Hp7j3OCR+ELoUfbwGHGxWnHg9+OqSmkw2MoCVpZksPCZYpQzC559Ee9pJNHTQw==", "dev": true, "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.18.0", - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/typescript-estree": "4.18.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.28.3", + "@typescript-eslint/types": "4.28.3", + "@typescript-eslint/typescript-estree": "4.28.3", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.18.0.tgz", - "integrity": "sha512-W3z5S0ZbecwX3PhJEAnq4mnjK5JJXvXUDBYIYGoweCyWyuvAKfGHvzmpUzgB5L4cRBb+cTu9U/ro66dx7dIimA==", + "version": "4.28.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.28.3.tgz", + "integrity": "sha512-ZyWEn34bJexn/JNYvLQab0Mo5e+qqQNhknxmc8azgNd4XqspVYR5oHq9O11fLwdZMRcj4by15ghSlIEq+H5ltQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "4.18.0", - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/typescript-estree": "4.18.0", - "debug": "^4.1.1" + "@typescript-eslint/scope-manager": "4.28.3", + "@typescript-eslint/types": "4.28.3", + "@typescript-eslint/typescript-estree": "4.28.3", + "debug": "^4.3.1" } }, "@typescript-eslint/scope-manager": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.18.0.tgz", - "integrity": "sha512-olX4yN6rvHR2eyFOcb6E4vmhDPsfdMyfQ3qR+oQNkAv8emKKlfxTWUXU5Mqxs2Fwe3Pf1BoPvrwZtwngxDzYzQ==", + "version": "4.28.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.28.3.tgz", + "integrity": "sha512-/8lMisZ5NGIzGtJB+QizQ5eX4Xd8uxedFfMBXOKuJGP0oaBBVEMbJVddQKDXyyB0bPlmt8i6bHV89KbwOelJiQ==", "dev": true, "requires": { - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/visitor-keys": "4.18.0" + "@typescript-eslint/types": "4.28.3", + "@typescript-eslint/visitor-keys": "4.28.3" } }, "@typescript-eslint/types": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.18.0.tgz", - "integrity": "sha512-/BRociARpj5E+9yQ7cwCF/SNOWwXJ3qhjurMuK2hIFUbr9vTuDeu476Zpu+ptxY2kSxUHDGLLKy+qGq2sOg37A==", + "version": "4.28.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.28.3.tgz", + "integrity": "sha512-kQFaEsQBQVtA9VGVyciyTbIg7S3WoKHNuOp/UF5RG40900KtGqfoiETWD/v0lzRXc+euVE9NXmfer9dLkUJrkA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.18.0.tgz", - "integrity": "sha512-wt4xvF6vvJI7epz+rEqxmoNQ4ZADArGQO9gDU+cM0U5fdVv7N+IAuVoVAoZSOZxzGHBfvE3XQMLdy+scsqFfeg==", + "version": "4.28.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.28.3.tgz", + "integrity": "sha512-YAb1JED41kJsqCQt1NcnX5ZdTA93vKFCMP4lQYG6CFxd0VzDJcKttRlMrlG+1qiWAw8+zowmHU1H0OzjWJzR2w==", "dev": true, "requires": { - "@typescript-eslint/types": "4.18.0", - "@typescript-eslint/visitor-keys": "4.18.0", - "debug": "^4.1.1", - "globby": "^11.0.1", + "@typescript-eslint/types": "4.28.3", + "@typescript-eslint/visitor-keys": "4.28.3", + "debug": "^4.3.1", + "globby": "^11.0.3", "is-glob": "^4.0.1", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "semver": "^7.3.5", + "tsutils": "^3.21.0" } }, "@typescript-eslint/visitor-keys": { - "version": "4.18.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.18.0.tgz", - "integrity": "sha512-Q9t90JCvfYaN0OfFUgaLqByOfz8yPeTAdotn/XYNm5q9eHax90gzdb+RJ6E9T5s97Kv/UHWKERTmqA0jTKAEHw==", + "version": "4.28.3", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.28.3.tgz", + "integrity": "sha512-ri1OzcLnk1HH4gORmr1dllxDzzrN6goUIz/P4MHFV0YZJDCADPR3RvYNp0PW2SetKTThar6wlbFTL00hV2Q+fg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.18.0", + "@typescript-eslint/types": "4.28.3", "eslint-visitor-keys": "^2.0.0" } }, @@ -550,9 +609,9 @@ "dev": true }, "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true }, "ajv": { @@ -838,9 +897,9 @@ } }, "earcut": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.2.tgz", - "integrity": "sha512-eZoZPPJcUHnfRZ0PjLvx2qBordSiO8ofC3vt+qACLM95u+4DovnbYNpQtJh0DNsWj8RnxrQytD4WA8gj5cRIaQ==" + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.3.tgz", + "integrity": "sha512-iRDI1QeCQIhMCZk48DRDMVgQSSBDmbzzNhnxIo+pwx3swkfjMh6vh0nWLq1NdvGHLKH6wIrAM3vQWeTj6qeoug==" }, "emoji-regex": { "version": "8.0.0", @@ -857,11 +916,6 @@ "ansi-colors": "^4.1.1" } }, - "es6-promise-polyfill": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/es6-promise-polyfill/-/es6-promise-polyfill-1.2.0.tgz", - "integrity": "sha1-84kl8jyz4+jObNqP93T867sJDN4=" - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -869,13 +923,14 @@ "dev": true }, "eslint": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.29.0.tgz", - "integrity": "sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==", + "version": "7.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz", + "integrity": "sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.2", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -921,6 +976,23 @@ "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -940,26 +1012,18 @@ } }, "eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", "dev": true, "requires": { - "eslint-visitor-keys": "^1.1.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true - } + "eslint-visitor-keys": "^2.0.0" } }, "eslint-visitor-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", - "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", "dev": true }, "espree": { @@ -1123,9 +1187,9 @@ } }, "flatted": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", - "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.1.tgz", + "integrity": "sha512-OMQjaErSFHmHqZe+PSidH5n8j3O0F2DdnVh8JB4j4eUQ2k6KvB0qGfrKIhapvez5JerBbmWkaLYUYWISaESoXg==", "dev": true }, "fs.realpath": { @@ -1170,18 +1234,18 @@ } }, "globals": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", - "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz", + "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==", "dev": true, "requires": { "type-fest": "^0.20.2" } }, "globby": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.2.tgz", - "integrity": "sha512-2ZThXDvvV8fYFRVIxnrMQBipZQDr7MxKAmQK1vujaj9/7eF0efG7BPUKJ7jP7G5SLF37xKDXvO4S/KKLj/Z0og==", + "version": "11.0.4", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.4.tgz", + "integrity": "sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==", "dev": true, "requires": { "array-union": "^2.1.0", @@ -1330,12 +1394,6 @@ "p-locate": "^4.1.0" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -1537,44 +1595,45 @@ "dev": true }, "pixi.js": { - "version": "5.3.8", - "resolved": "https://registry.npmjs.org/pixi.js/-/pixi.js-5.3.8.tgz", - "integrity": "sha512-kDqkWhuAkc42lD+ldVTaS439q7D7uo9FM/wCP26jUNAFlYAp75IcALEgXuBh6HEjp51enGkRvwX9+fIiA5F9ug==", + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/pixi.js/-/pixi.js-6.0.4.tgz", + "integrity": "sha512-zAlwr5x9xytaflmZiZWl/ZhlSf+lZzeJG+Hexa7Buf7cvEhHPfSITy4NNk0+qnMXKooQidikBmypShDsj2jAdg==", "requires": { - "@pixi/accessibility": "5.3.8", - "@pixi/app": "5.3.8", - "@pixi/constants": "5.3.8", - "@pixi/core": "5.3.8", - "@pixi/display": "5.3.8", - "@pixi/extract": "5.3.8", - "@pixi/filter-alpha": "5.3.8", - "@pixi/filter-blur": "5.3.8", - "@pixi/filter-color-matrix": "5.3.8", - "@pixi/filter-displacement": "5.3.8", - "@pixi/filter-fxaa": "5.3.8", - "@pixi/filter-noise": "5.3.8", - "@pixi/graphics": "5.3.8", - "@pixi/interaction": "5.3.8", - "@pixi/loaders": "5.3.8", - "@pixi/math": "5.3.8", - "@pixi/mesh": "5.3.8", - "@pixi/mesh-extras": "5.3.8", - "@pixi/mixin-cache-as-bitmap": "5.3.8", - "@pixi/mixin-get-child-by-name": "5.3.8", - "@pixi/mixin-get-global-position": "5.3.8", - "@pixi/particles": "5.3.8", - "@pixi/polyfill": "5.3.8", - "@pixi/prepare": "5.3.8", - "@pixi/runner": "5.3.8", - "@pixi/settings": "5.3.8", - "@pixi/sprite": "5.3.8", - "@pixi/sprite-animated": "5.3.8", - "@pixi/sprite-tiling": "5.3.8", - "@pixi/spritesheet": "5.3.8", - "@pixi/text": "5.3.8", - "@pixi/text-bitmap": "5.3.8", - "@pixi/ticker": "5.3.8", - "@pixi/utils": "5.3.8" + "@pixi/accessibility": "6.0.4", + "@pixi/app": "6.0.4", + "@pixi/compressed-textures": "6.0.4", + "@pixi/constants": "6.0.4", + "@pixi/core": "6.0.4", + "@pixi/display": "6.0.4", + "@pixi/extract": "6.0.4", + "@pixi/filter-alpha": "6.0.4", + "@pixi/filter-blur": "6.0.4", + "@pixi/filter-color-matrix": "6.0.4", + "@pixi/filter-displacement": "6.0.4", + "@pixi/filter-fxaa": "6.0.4", + "@pixi/filter-noise": "6.0.4", + "@pixi/graphics": "6.0.4", + "@pixi/interaction": "6.0.4", + "@pixi/loaders": "6.0.4", + "@pixi/math": "6.0.4", + "@pixi/mesh": "6.0.4", + "@pixi/mesh-extras": "6.0.4", + "@pixi/mixin-cache-as-bitmap": "6.0.4", + "@pixi/mixin-get-child-by-name": "6.0.4", + "@pixi/mixin-get-global-position": "6.0.4", + "@pixi/particles": "6.0.4", + "@pixi/polyfill": "6.0.4", + "@pixi/prepare": "6.0.4", + "@pixi/runner": "6.0.4", + "@pixi/settings": "6.0.4", + "@pixi/sprite": "6.0.4", + "@pixi/sprite-animated": "6.0.4", + "@pixi/sprite-tiling": "6.0.4", + "@pixi/spritesheet": "6.0.4", + "@pixi/text": "6.0.4", + "@pixi/text-bitmap": "6.0.4", + "@pixi/ticker": "6.0.4", + "@pixi/utils": "6.0.4" } }, "prelude-ls": { @@ -1589,6 +1648,11 @@ "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, + "promise-polyfill": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.2.0.tgz", + "integrity": "sha512-k/TC0mIcPVF6yHhUvwAp7cvL6I2fFV7TzF1DuGPI8mBh4QQazf36xCKEHKTZKRysEoTQoQdKyP25J8MPJp7j5g==" + }, "punycode": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", @@ -1606,9 +1670,9 @@ "dev": true }, "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, "require-directory": { @@ -1635,15 +1699,6 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, - "resource-loader": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/resource-loader/-/resource-loader-3.0.1.tgz", - "integrity": "sha512-fBuCRbEHdLCI1eglzQhUv9Rrdcmqkydr1r6uHE2cYHvRBrcLXeSmbE/qI/urFt8rPr/IGxir3BUwM5kUK8XoyA==", - "requires": { - "mini-signals": "^1.2.0", - "parse-uri": "^1.0.0" - } - }, "reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -1674,9 +1729,9 @@ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -1802,9 +1857,9 @@ }, "dependencies": { "ajv": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.0.tgz", - "integrity": "sha512-cnUG4NSBiM4YFBxgZIj/In3/6KX+rQ2l2YPRVcvAMQGWEPKuXoPIhxzwqh31jA3IPbI4qEOp/5ILI4ynioXsGQ==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.1.tgz", + "integrity": "sha512-42VLtQUOLefAvKFAQIxIZDaThq6om/PrfP0CYk3/vn+y4BMNkKnbli8ON2QCiHov4KkzOSJ/xSoBJdayiiYvVQ==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -1837,9 +1892,9 @@ } }, "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", + "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" }, "tsutils": { "version": "3.21.0", @@ -1874,9 +1929,9 @@ "dev": true }, "typescript": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz", - "integrity": "sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==", + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.3.5.tgz", + "integrity": "sha512-DqQgihaQ9cUrskJo9kIyW/+g0Vxsk8cDtZ52a3NGh0YNTfpUSArXSohyUGnvbPazEPLu398C0UxmKSOrPumUzA==", "dev": true }, "uri-js": { diff --git a/package.json b/package.json index a2d7a73a..b1c54dde 100644 --- a/package.json +++ b/package.json @@ -6,20 +6,20 @@ }, "private": true, "dependencies": { - "@pixi/filter-adjustment": "^3.1.1", + "@pixi/filter-adjustment": "^4.1.3", "events": "^3.3.0", "pako": "^2.0.3", - "pixi.js": "^5.3.3", - "tslib": "^2.0.0", + "pixi.js": "^6.0.4", + "tslib": "^2.3.0", "xml2js": "^0.4.23" }, "devDependencies": { - "@types/node": "^14.14.35", - "@types/pako": "^1.0.1", - "@typescript-eslint/eslint-plugin": "^4.15.0", - "@typescript-eslint/parser": "^4.15.0", + "@types/node": "^14.17.5", + "@types/pako": "^1.0.2", + "@typescript-eslint/eslint-plugin": "^4.28.3", + "@typescript-eslint/parser": "^4.28.3", "create-ts-index": "^1.13.6", - "eslint": "^7.29.0", - "typescript": "~4.2.3" + "eslint": "^7.30.0", + "typescript": "^4.3.5" } } diff --git a/src/core/asset/AssetManager.ts b/src/core/asset/AssetManager.ts index 8b0ec9cb..7bf6d22d 100644 --- a/src/core/asset/AssetManager.ts +++ b/src/core/asset/AssetManager.ts @@ -1,4 +1,4 @@ -import { BaseTexture, ILoaderOptions, Loader, LoaderResource, Spritesheet, Texture } from 'pixi.js'; +import { BaseTexture, ILoaderResource, Loader, LoaderResource, Spritesheet, Texture } from 'pixi.js'; import { GraphicAssetCollection } from '../../room/object/visualization/utils/GraphicAssetCollection'; import { IGraphicAsset } from '../../room/object/visualization/utils/IGraphicAsset'; import { IGraphicAssetCollection } from '../../room/object/visualization/utils/IGraphicAssetCollection'; @@ -13,8 +13,7 @@ export class AssetManager extends Disposable implements IAssetManager { private _logger: INitroLogger; private _textures: Map; - private _collections: Map; - private _pendingUrls: Map; + private _collections: Map; constructor() { @@ -23,7 +22,6 @@ export class AssetManager extends Disposable implements IAssetManager this._logger = new NitroLogger(this.constructor.name); this._textures = new Map(); this._collections = new Map(); - this._pendingUrls = new Map(); } public static removeFileExtension(name: string): string @@ -90,6 +88,8 @@ export class AssetManager extends Disposable implements IAssetManager this._collections.set(collection.name, collection); } + + return collection; } public downloadAsset(assetUrl: string, cb: Function): boolean @@ -110,7 +110,7 @@ export class AssetManager extends Disposable implements IAssetManager let totalDownloaded = 0; - const onDownloaded = (loader: Loader, resource: LoaderResource, flag: boolean) => + const onDownloaded = (loader: Loader, resource: ILoaderResource, flag: boolean) => { if(loader) loader.destroy(); @@ -134,21 +134,25 @@ export class AssetManager extends Disposable implements IAssetManager const loader = new Loader(); - const options: ILoaderOptions = { - crossOrigin: false, - xhrType: url.endsWith('.nitro') ? 'arraybuffer' : 'json' - }; - loader - .use((resource: LoaderResource, next: Function) => this.assetLoader(loader, resource, next, onDownloaded)) - .add(url, options) + .add({ + url, + crossOrigin: 'anonymous', + xhrType: url.endsWith('.nitro') ? LoaderResource.XHR_RESPONSE_TYPE.BUFFER : LoaderResource.XHR_RESPONSE_TYPE.JSON + }) + .use((resource: ILoaderResource, next: Function) => + { + this.assetLoader(loader, resource, onDownloaded); + + next(); + }) .load(); } return true; } - private assetLoader(loader: Loader, resource: LoaderResource, next: Function, onDownloaded: Function): void + private assetLoader(loader: Loader, resource: ILoaderResource, onDownloaded: Function): void { if(!resource || resource.error) { @@ -186,7 +190,7 @@ export class AssetManager extends Disposable implements IAssetManager { const spritesheet = new Spritesheet(baseTexture, assetData.spritesheet); - spritesheet.parse(textures => + spritesheet.parse(() => { this.createCollection(assetData, spritesheet); @@ -201,7 +205,7 @@ export class AssetManager extends Disposable implements IAssetManager const spritesheet = new Spritesheet(baseTexture, assetData.spritesheet); - spritesheet.parse(textures => + spritesheet.parse(() => { this.createCollection(assetData, spritesheet); @@ -254,7 +258,7 @@ export class AssetManager extends Disposable implements IAssetManager { const spritesheet = new Spritesheet(baseTexture, assetData.spritesheet); - spritesheet.parse(textures => + spritesheet.parse(() => { this.createCollection(assetData, spritesheet); @@ -269,7 +273,7 @@ export class AssetManager extends Disposable implements IAssetManager const spritesheet = new Spritesheet(baseTexture, assetData.spritesheet); - spritesheet.parse(textures => + spritesheet.parse(() => { this.createCollection(assetData, spritesheet); @@ -312,7 +316,7 @@ export class AssetManager extends Disposable implements IAssetManager } } - public get collections(): Map + public get collections(): Map { return this._collections; } diff --git a/src/core/asset/IAssetManager.ts b/src/core/asset/IAssetManager.ts index 7745c71d..4bd63332 100644 --- a/src/core/asset/IAssetManager.ts +++ b/src/core/asset/IAssetManager.ts @@ -1,6 +1,5 @@ import { Spritesheet, Texture } from 'pixi.js'; -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 { IAssetData } from './interfaces'; @@ -15,5 +14,5 @@ export interface IAssetManager createCollection(data: IAssetData, spritesheet: Spritesheet): IGraphicAssetCollection; downloadAssets(urls: string[], cb: Function): void; downloadAsset(url: string, cb: Function): void; - collections: Map; -} \ No newline at end of file + collections: Map; +} diff --git a/src/core/asset/interfaces/IAssetData.ts b/src/core/asset/interfaces/IAssetData.ts index 2af33ca5..0e5003ec 100644 --- a/src/core/asset/interfaces/IAssetData.ts +++ b/src/core/asset/interfaces/IAssetData.ts @@ -3,7 +3,7 @@ import { IAsset } from './IAsset'; import { IAssetAlias } from './IAssetAlias'; import { IAssetDimension } from './IAssetDimension'; import { IAssetPalette } from './IAssetPalette'; -import { ISpritesheetData } from './spritesheet'; +import { ISpritesheet } from './spritesheet'; import { IAssetVisualizationData } from './visualization'; export interface IAssetData { @@ -15,7 +15,7 @@ export interface IAssetData { credits?: string; soundSample?: number; action?: { link?: string, startState?: number }; - spritesheet?: ISpritesheetData; + spritesheet?: ISpritesheet; dimensions?: IAssetDimension; directions?: number[]; assets?: { [index: string]: IAsset }; diff --git a/src/core/asset/interfaces/spritesheet/ISpritesheet.ts b/src/core/asset/interfaces/spritesheet/ISpritesheet.ts new file mode 100644 index 00000000..ff1900a8 --- /dev/null +++ b/src/core/asset/interfaces/spritesheet/ISpritesheet.ts @@ -0,0 +1,7 @@ +import { ISpritesheetData } from '@pixi/spritesheet'; +import { ISpritesheetMeta } from './ISpritesheetMeta'; + +export interface ISpritesheet extends ISpritesheetData +{ + meta: ISpritesheetMeta; +} diff --git a/src/core/asset/interfaces/spritesheet/ISpritesheetData.ts b/src/core/asset/interfaces/spritesheet/ISpritesheetData.ts deleted file mode 100644 index 24389cc7..00000000 --- a/src/core/asset/interfaces/spritesheet/ISpritesheetData.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { ISpritesheetFrame } from './ISpritesheetFrame'; -import { ISpritesheetMeta } from './ISpritesheetMeta'; - -export interface ISpritesheetData -{ - meta?: ISpritesheetMeta; - frames?: { [index: string]: ISpritesheetFrame }; -} diff --git a/src/core/asset/interfaces/spritesheet/ISpritesheetFrame.ts b/src/core/asset/interfaces/spritesheet/ISpritesheetFrame.ts deleted file mode 100644 index 0833b502..00000000 --- a/src/core/asset/interfaces/spritesheet/ISpritesheetFrame.ts +++ /dev/null @@ -1,25 +0,0 @@ -export interface ISpritesheetFrame -{ - frame: { - x: number; - y: number; - w: number; - h: number; - }; - rotated: boolean; - trimmed: boolean; - spriteSourceSize: { - x: number; - y: number; - w: number; - h: number; - }; - sourceSize: { - w: number; - h: number; - }; - pivot: { - x: number; - y: number; - }; -} diff --git a/src/core/asset/interfaces/spritesheet/index.ts b/src/core/asset/interfaces/spritesheet/index.ts index 9c94e8ba..e3f8d384 100644 --- a/src/core/asset/interfaces/spritesheet/index.ts +++ b/src/core/asset/interfaces/spritesheet/index.ts @@ -1,3 +1,2 @@ -export * from './ISpritesheetData'; -export * from './ISpritesheetFrame'; +export * from './ISpritesheet'; export * from './ISpritesheetMeta'; diff --git a/src/nitro/Nitro.ts b/src/nitro/Nitro.ts index 3b0f6119..4715385d 100644 --- a/src/nitro/Nitro.ts +++ b/src/nitro/Nitro.ts @@ -1,4 +1,4 @@ -import { Application, SCALE_MODES, settings } from 'pixi.js'; +import { Application, IApplicationOptions, SCALE_MODES, settings } from 'pixi.js'; import { INitroManager } from '..'; import { ConfigurationEvent } from '../core/configuration/ConfigurationEvent'; import { EventDispatcher } from '../core/events/EventDispatcher'; @@ -34,7 +34,6 @@ import { HabboWebTools } from './utils/HabboWebTools'; LegacyExternalInterface.available; -settings.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT = false; settings.SCALE_MODE = SCALE_MODES.NEAREST; settings.ROUND_PIXELS = true; @@ -42,10 +41,10 @@ export class Nitro extends Application implements INitro { public static WEBGL_CONTEXT_LOST: string = 'NE_WEBGL_CONTEXT_LOST'; public static WEBGL_UNAVAILABLE: string = 'NE_WEBGL_UNAVAILABLE'; - public static RELEASE_VERSION: string = 'NITRO-0-4-0'; + public static RELEASE_VERSION: string = 'NITRO-2-0-0'; public static READY: string = 'NE_READY'; - private static INSTANCE: INitro = null; + private static INSTANCE: INitro = null; private _nitroTimer: NitroTimer; private _worker: Worker; @@ -66,24 +65,7 @@ export class Nitro extends Application implements INitro private _isReady: boolean; private _isDisposed: boolean; - constructor(core: INitroCore, options?: { - autoStart?: boolean; - width?: number; - height?: number; - view?: HTMLCanvasElement; - transparent?: boolean; - autoDensity?: boolean; - antialias?: boolean; - preserveDrawingBuffer?: boolean; - resolution?: number; - forceCanvas?: boolean; - backgroundColor?: number; - clearBeforeRender?: boolean; - powerPreference?: string; - sharedTicker?: boolean; - sharedLoader?: boolean; - resizeTo?: Window | HTMLElement; - }) + constructor(core: INitroCore, options?: IApplicationOptions) { super(options); @@ -129,7 +111,6 @@ export class Nitro extends Application implements INitro canvas.className = 'client-canvas'; const instance = new this(new NitroCore(), { - transparent: true, autoDensity: true, resolution: window.devicePixelRatio, width: window.innerWidth, diff --git a/src/nitro/avatar/AvatarImage.ts b/src/nitro/avatar/AvatarImage.ts index 79f12228..96e695fd 100644 --- a/src/nitro/avatar/AvatarImage.ts +++ b/src/nitro/avatar/AvatarImage.ts @@ -395,7 +395,10 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(this._reusableTexture) { - Nitro.instance.renderer.render(container, this._reusableTexture, true); + Nitro.instance.renderer.render(container, { + renderTexture: this._reusableTexture, + clear: true + }); } else { @@ -568,7 +571,7 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener partCount--; } - const image = Nitro.instance.renderer.extract.image(container); + const image = TextureUtils.generateImage(container); if(!image) return null; diff --git a/src/nitro/camera/IRoomCameraWidgetEffect.ts b/src/nitro/camera/IRoomCameraWidgetEffect.ts index e408a24a..c6c37afc 100644 --- a/src/nitro/camera/IRoomCameraWidgetEffect.ts +++ b/src/nitro/camera/IRoomCameraWidgetEffect.ts @@ -1,3 +1,4 @@ +import { ColorMatrix } from '@pixi/filter-color-matrix'; import { Texture } from 'pixi.js'; export interface IRoomCameraWidgetEffect @@ -5,6 +6,6 @@ export interface IRoomCameraWidgetEffect name: string; minLevel: number; texture: Texture; - colorMatrix: number[]; + colorMatrix: ColorMatrix; blendMode: number; } diff --git a/src/nitro/camera/RoomCameraWidgetEffect.ts b/src/nitro/camera/RoomCameraWidgetEffect.ts index e081b689..2209a619 100644 --- a/src/nitro/camera/RoomCameraWidgetEffect.ts +++ b/src/nitro/camera/RoomCameraWidgetEffect.ts @@ -1,3 +1,4 @@ +import { ColorMatrix } from '@pixi/filter-color-matrix'; import { Texture } from 'pixi.js'; import { IRoomCameraWidgetEffect } from './IRoomCameraWidgetEffect'; @@ -6,10 +7,10 @@ export class RoomCameraWidgetEffect implements IRoomCameraWidgetEffect private _name: string; private _minLevel: number = -1; private _texture: Texture = null; - private _colorMatrix: number[] = null; + private _colorMatrix: ColorMatrix = null; private _blendMode: number = null; - constructor(name: string, minLevel: number = -1, texture: Texture = null, colorMatrix: number[] = 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; @@ -33,12 +34,12 @@ export class RoomCameraWidgetEffect implements IRoomCameraWidgetEffect this._texture = texture; } - public get colorMatrix(): number[] + public get colorMatrix(): ColorMatrix { return this._colorMatrix; } - public set colorMatrix(colorMatrix: number[]) + public set colorMatrix(colorMatrix: ColorMatrix) { this._colorMatrix = colorMatrix; } diff --git a/src/nitro/camera/RoomCameraWidgetManager.ts b/src/nitro/camera/RoomCameraWidgetManager.ts index 92b938c4..ce95bf58 100644 --- a/src/nitro/camera/RoomCameraWidgetManager.ts +++ b/src/nitro/camera/RoomCameraWidgetManager.ts @@ -1,3 +1,4 @@ +import { ColorMatrix } from '@pixi/filter-color-matrix'; import { Container, filters, Sprite, Texture } from 'pixi.js'; import { EventDispatcher, IEventDispatcher } from '../../core'; import { TextureUtils } from '../../room'; @@ -28,7 +29,7 @@ export class RoomCameraWidgetManager implements IRoomCameraWidgetManager this._isLoaded = true; const imagesUrl = Nitro.instance.getConfiguration('image.library.url') + 'Habbo-Stories/'; - const effects = Nitro.instance.getConfiguration<{ name: string, colorMatrix?: number[], minLevel: number, blendMode?: number, enabled: boolean }[]>('camera.available.effects'); + const effects = Nitro.instance.getConfiguration<{ name: string, colorMatrix?: ColorMatrix, minLevel: number, blendMode?: number, enabled: boolean }[]>('camera.available.effects'); for(const effect of effects) { diff --git a/src/nitro/room/RoomContentLoader.ts b/src/nitro/room/RoomContentLoader.ts index 96893aec..dde2c370 100644 --- a/src/nitro/room/RoomContentLoader.ts +++ b/src/nitro/room/RoomContentLoader.ts @@ -1,4 +1,4 @@ -import { BaseTexture, ILoaderOptions, Loader, LoaderResource, Spritesheet, Texture } from 'pixi.js'; +import { BaseTexture, ILoaderResource, Loader, LoaderResource, Spritesheet, Texture } from 'pixi.js'; import { IAssetData } from '../../core/asset/interfaces'; import { NitroBundle } from '../../core/asset/NitroBundle'; import { INitroLogger } from '../../core/common/logger/INitroLogger'; @@ -483,7 +483,7 @@ export class RoomContentLoader implements IFurnitureDataListener const totalToDownload = assetUrls.length; let totalDownloaded = 0; - const onDownloaded = (loader: Loader, resource: LoaderResource, flag: boolean) => + const onDownloaded = (loader: Loader, resource: ILoaderResource, flag: boolean) => { if(loader) loader.destroy(); @@ -514,21 +514,25 @@ export class RoomContentLoader implements IFurnitureDataListener const loader = new Loader(); - const options: ILoaderOptions = { - crossOrigin: false, - xhrType: url.endsWith('.nitro') ? 'arraybuffer' : 'json' - }; - loader - .use((resource: LoaderResource, next: Function) => this.assetLoader(loader, resource, next, onDownloaded)) - .add(url, options) + .add({ + url, + crossOrigin: 'anonymous', + xhrType: url.endsWith('.nitro') ? LoaderResource.XHR_RESPONSE_TYPE.BUFFER : LoaderResource.XHR_RESPONSE_TYPE.JSON + }) + .use((resource: ILoaderResource, next: Function) => + { + this.assetLoader(loader, resource, onDownloaded); + + next(); + }) .load(); } return true; } - private assetLoader(loader: Loader, resource: LoaderResource, next: Function, onDownloaded: Function): void + private assetLoader(loader: Loader, resource: ILoaderResource, onDownloaded: Function): void { if(!resource || resource.error) { @@ -566,7 +570,7 @@ export class RoomContentLoader implements IFurnitureDataListener { const spritesheet = new Spritesheet(baseTexture, assetData.spritesheet); - spritesheet.parse(textures => + spritesheet.parse(() => { this.createCollection(assetData, spritesheet); @@ -581,7 +585,7 @@ export class RoomContentLoader implements IFurnitureDataListener const spritesheet = new Spritesheet(baseTexture, assetData.spritesheet); - spritesheet.parse(textures => + spritesheet.parse(() => { this.createCollection(assetData, spritesheet); @@ -634,7 +638,7 @@ export class RoomContentLoader implements IFurnitureDataListener { const spritesheet = new Spritesheet(baseTexture, assetData.spritesheet); - spritesheet.parse(textures => + spritesheet.parse(() => { this.createCollection(assetData, spritesheet); @@ -649,7 +653,7 @@ export class RoomContentLoader implements IFurnitureDataListener const spritesheet = new Spritesheet(baseTexture, assetData.spritesheet); - spritesheet.parse(textures => + spritesheet.parse(() => { this.createCollection(assetData, spritesheet); diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 92192309..40ac3c0b 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -1829,7 +1829,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(icon) { - const image = Nitro.instance.renderer.extract.image(icon); + const image = TextureUtils.generateImage(icon); if(this.events) { @@ -1874,7 +1874,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato if(icon) { - const image = Nitro.instance.renderer.extract.image(icon); + const image = TextureUtils.generateImage(icon); if(this.events) { diff --git a/src/nitro/room/object/visualization/room/RoomPlane.ts b/src/nitro/room/object/visualization/room/RoomPlane.ts index 0ec9413a..e66e15ed 100644 --- a/src/nitro/room/object/visualization/room/RoomPlane.ts +++ b/src/nitro/room/object/visualization/room/RoomPlane.ts @@ -4,7 +4,6 @@ import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; import { IVector3D } from '../../../../../room/utils/IVector3D'; import { TextureUtils } from '../../../../../room/utils/TextureUtils'; import { Vector3d } from '../../../../../room/utils/Vector3d'; -import { Nitro } from '../../../../Nitro'; import { PlaneMaskManager } from './mask/PlaneMaskManager'; import { PlaneDrawingData } from './PlaneDrawingData'; import { PlaneVisualizationLayer } from './rasterizer/basic/PlaneVisualizationLayer'; @@ -987,8 +986,8 @@ export class RoomPlane implements IRoomPlane { if(!texture || !mask) return; - const maskCanvas = Nitro.instance.renderer.extract.canvas(mask); - const textureCanvas = Nitro.instance.renderer.extract.canvas(texture); + const maskCanvas = TextureUtils.generateCanvas(mask); + const textureCanvas = TextureUtils.generateCanvas(texture); const textureCtx = textureCanvas.getContext('2d'); textureCtx.drawImage(maskCanvas, 0, 0); diff --git a/src/room/floorplan/pixi-tilemap/CanvasTileRenderer.ts b/src/room/floorplan/pixi-tilemap/CanvasTileRenderer.ts index 031940a5..8d490134 100644 --- a/src/room/floorplan/pixi-tilemap/CanvasTileRenderer.ts +++ b/src/room/floorplan/pixi-tilemap/CanvasTileRenderer.ts @@ -1,21 +1,22 @@ -import * as PIXI from 'pixi.js'; -window.PIXI = PIXI; +import { CanvasRenderer } from '@pixi/canvas-renderer'; +import { IRendererPlugin } from '@pixi/core'; -export class CanvasTileRenderer +export class CanvasTileRenderer implements IRendererPlugin { - renderer: PIXI.Renderer; + renderer: CanvasRenderer; tileAnim = [0, 0]; dontUseTransform = false; - constructor(renderer: PIXI.Renderer) + constructor(renderer: CanvasRenderer, options: any = null) { this.renderer = renderer; this.tileAnim = [0, 0]; } + + public destroy(): void + { + + } } -const cr = (window.PIXI as any).CanvasRenderer; -if(cr) -{ - console.warn('REGISTER'); - cr.registerPlugin('tilemap', CanvasTileRenderer); -} + +CanvasRenderer.registerPlugin('tilemap', CanvasTileRenderer); diff --git a/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts b/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts index 163741c6..19a6146c 100644 --- a/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts +++ b/src/room/floorplan/pixi-tilemap/CompositeRectTileLayer.ts @@ -12,7 +12,6 @@ export class CompositeRectTileLayer extends Container } z: number; - zIndex: number; modificationMarker = 0; shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]); _globalMat: Matrix = null; diff --git a/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts b/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts index 19e26afb..b35e2165 100644 --- a/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts +++ b/src/room/floorplan/pixi-tilemap/MultiTextureResource.ts @@ -1,5 +1,4 @@ -import { resources } from '@pixi/core'; -import { BaseTexture, Sprite, Texture } from 'pixi.js'; +import { BaseTexture, GLTexture, IAutoDetectOptions, Renderer, Resource, Sprite, Texture } from 'pixi.js'; export interface IMultiTextureOptions { boundCountPerBuffer: number; @@ -8,7 +7,7 @@ export interface IMultiTextureOptions { DO_CLEAR?: boolean; } -export class MultiTextureResource extends resources.Resource +export class MultiTextureResource extends Resource { constructor(options: IMultiTextureOptions) { @@ -58,4 +57,10 @@ export class MultiTextureResource extends resources.Resource this.dirties[ind] = (this.baseTex as any).dirtyId; } + // required ??? + public upload(renderer: Renderer, baseTexture: BaseTexture, glTexture: GLTexture): boolean + { + return false; + } + } diff --git a/src/room/floorplan/pixi-tilemap/RectTileLayer.ts b/src/room/floorplan/pixi-tilemap/RectTileLayer.ts index ad6e2bda..da61e7b9 100644 --- a/src/room/floorplan/pixi-tilemap/RectTileLayer.ts +++ b/src/room/floorplan/pixi-tilemap/RectTileLayer.ts @@ -1,4 +1,4 @@ -import { Container, DRAW_MODES, groupD8, Matrix, Renderer, Texture } from 'pixi.js'; +import { Bounds, Container, DRAW_MODES, groupD8, Matrix, Rectangle, Renderer, Texture } from 'pixi.js'; import { Constant } from './Constant'; import { RectTileGeom } from './RectTileShader'; import { TileRenderer } from './TileRenderer'; @@ -30,9 +30,9 @@ export class RectTileLayer extends Container this.initialize(zIndex, texture); } - zIndex = 0; + //zIndex = 0; modificationMarker = 0; - _$_localBounds = new PIXI.Bounds(); + _$_localBounds = new Bounds(); shadowColor = new Float32Array([0.0, 0.0, 0.0, 0.5]); _globalMat: Matrix = null; @@ -472,7 +472,7 @@ export class RectTileLayer extends Container this._bounds.addFrame(this.transform, minX, minY, maxX, maxY); } - public getLocalBounds(rect?: PIXI.Rectangle): PIXI.Rectangle + public getLocalBounds(rect?: Rectangle): Rectangle { // we can do a fast local bounds if the sprite has no children! if(this.children.length === 0) diff --git a/src/room/floorplan/pixi-tilemap/RectTileShader.ts b/src/room/floorplan/pixi-tilemap/RectTileShader.ts index 8dcf5123..2fd04a8c 100644 --- a/src/room/floorplan/pixi-tilemap/RectTileShader.ts +++ b/src/room/floorplan/pixi-tilemap/RectTileShader.ts @@ -1,4 +1,4 @@ -import { Buffer, Geometry, Matrix, Shader } from 'pixi.js'; +import { Buffer, Geometry, Matrix, Program, Shader } from 'pixi.js'; import * as shaderGenerator from './shaderGenerator'; const rectShaderFrag = ` @@ -58,7 +58,7 @@ export abstract class TilemapShader extends Shader constructor(maxTextures: number, shaderVert: string, shaderFrag: string) { super( - new PIXI.Program( + new Program( shaderVert, shaderFrag), { @@ -92,6 +92,7 @@ export class RectTileGeom extends Geometry vertPerQuad = 4; stride = this.vertSize * 4; lastTimeAccess = 0; + buf: Buffer; constructor() { @@ -105,6 +106,4 @@ export class RectTileGeom extends Geometry .addAttribute('aTextureId', buf, 0, false, 0, this.stride, 10 * 4) .addAttribute('aAlpha', buf, 0, false, 0, this.stride, 11 * 4); } - - buf: PIXI.Buffer; } diff --git a/src/room/floorplan/pixi-tilemap/TileRenderer.ts b/src/room/floorplan/pixi-tilemap/TileRenderer.ts index cb961e3e..5383e598 100644 --- a/src/room/floorplan/pixi-tilemap/TileRenderer.ts +++ b/src/room/floorplan/pixi-tilemap/TileRenderer.ts @@ -1,3 +1,4 @@ +import { createIndicesForQuads } from '@pixi/utils'; import { BaseTexture, Buffer, ObjectRenderer, Renderer, Texture, WRAP_MODES } from 'pixi.js'; import { Constant } from './Constant'; import { MultiTextureResource } from './MultiTextureResource'; @@ -12,7 +13,7 @@ export class TileRenderer extends ObjectRenderer renderer: Renderer; gl: WebGLRenderingContext; sn: number = -1; - indexBuffer: PIXI.Buffer = null; + indexBuffer: Buffer = null; ibLen: number = 0; tileAnim = [0, 0]; texLoc: Array = []; @@ -127,8 +128,7 @@ export class TileRenderer extends ObjectRenderer } this.ibLen = totalIndices; - this.indexBuffer.update((PIXI as any).utils.createIndicesForQuads(size, - Constant.use32bitIndex ? new Uint32Array(size * 6) : undefined)); + this.indexBuffer.update(createIndicesForQuads(size, Constant.use32bitIndex ? new Uint32Array(size * 6) : undefined)); // TODO: create new index buffer instead? // if (vb) { diff --git a/src/room/object/visualization/utils/GraphicAssetCollection.ts b/src/room/object/visualization/utils/GraphicAssetCollection.ts index 0b582a0b..7f0a4f19 100644 --- a/src/room/object/visualization/utils/GraphicAssetCollection.ts +++ b/src/room/object/visualization/utils/GraphicAssetCollection.ts @@ -1,4 +1,5 @@ -import { Spritesheet, Texture } from 'pixi.js'; +import { Dict } from '@pixi/utils'; +import { Resource, Spritesheet, Texture } from 'pixi.js'; import { AssetManager } from '../../../../core/asset/AssetManager'; import { IAsset, IAssetData, IAssetPalette } from '../../../../core/asset/interfaces'; import { Nitro } from '../../../../nitro/Nitro'; @@ -313,7 +314,7 @@ export class GraphicAssetCollection implements IGraphicAssetCollection return texture; } - private addLibraryAsset(textures: Texture[]): void + private addLibraryAsset(textures: Dict>): void { if(!textures) return; diff --git a/src/room/object/visualization/utils/GraphicAssetPalette.ts b/src/room/object/visualization/utils/GraphicAssetPalette.ts index 101d3001..29a1cc70 100644 --- a/src/room/object/visualization/utils/GraphicAssetPalette.ts +++ b/src/room/object/visualization/utils/GraphicAssetPalette.ts @@ -1,5 +1,5 @@ import { Sprite, Texture } from 'pixi.js'; -import { Nitro } from '../../../../nitro/Nitro'; +import { TextureUtils } from '../../../utils'; export class GraphicAssetPalette { @@ -25,7 +25,7 @@ export class GraphicAssetPalette public applyPalette(texture: Texture): Texture { const sprite = Sprite.from(texture); - const textureCanvas = Nitro.instance.renderer.extract.canvas(sprite); + const textureCanvas = TextureUtils.generateCanvas(sprite); const textureCtx = textureCanvas.getContext('2d'); const textureImageData = textureCtx.getImageData(0, 0, textureCanvas.width, textureCanvas.height); const data = textureImageData.data; diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 79a1987a..5ca61f46 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -1014,7 +1014,11 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas height: this._display.height }); - Nitro.instance.renderer.render(this._display, renderTexture, true, new Matrix(1, 0, 0, 1, -(bounds.x), -(bounds.y))); + Nitro.instance.renderer.render(this._display, { + renderTexture, + clear: true, + transform: new Matrix(1, 0, 0, 1, -(bounds.x), -(bounds.y)) + }); this._noSpriteVisibilityChecking = false; this.setScale(k, null, null, true); diff --git a/src/room/renderer/utils/ExtendedSprite.ts b/src/room/renderer/utils/ExtendedSprite.ts index 658bba94..fd86fe9a 100644 --- a/src/room/renderer/utils/ExtendedSprite.ts +++ b/src/room/renderer/utils/ExtendedSprite.ts @@ -1,5 +1,5 @@ import { BaseTexture, BLEND_MODES, Point, RenderTexture, Sprite, Texture } from 'pixi.js'; -import { Nitro } from '../../../nitro/Nitro'; +import { TextureUtils } from '../../utils'; export class ExtendedSprite extends Sprite { @@ -95,13 +95,13 @@ export class ExtendedSprite extends Sprite { const tempSprite = Sprite.from(texture); - canvas = Nitro.instance.renderer.extract.canvas(tempSprite); + canvas = TextureUtils.generateCanvas(tempSprite); tempSprite.destroy(); } else { - canvas = Nitro.instance.renderer.extract.canvas(texture as RenderTexture); + canvas = TextureUtils.generateCanvas(texture as RenderTexture); } } diff --git a/src/room/utils/TextureUtils.ts b/src/room/utils/TextureUtils.ts index 08c1f940..9a86c11b 100644 --- a/src/room/utils/TextureUtils.ts +++ b/src/room/utils/TextureUtils.ts @@ -1,4 +1,5 @@ -import { DisplayObject, Rectangle, Renderer, RenderTexture, SCALE_MODES, Texture } from 'pixi.js'; +import { Extract } from '@pixi/extract'; +import { AbstractRenderer, DisplayObject, Rectangle, Renderer, RenderTexture, SCALE_MODES, Texture } from 'pixi.js'; import { Nitro } from '../../nitro/Nitro'; export class TextureUtils @@ -23,17 +24,30 @@ export class TextureUtils { if(!target) return null; - return TextureUtils.getRenderer().extract.image(target); + const extract = (TextureUtils.getRenderer().plugins.extract as Extract); + + return extract.image(target); } public static generateImageUrl(target: DisplayObject | RenderTexture): string { if(!target) return null; - return TextureUtils.getRenderer().extract.base64(target); + const extract = (TextureUtils.getRenderer().plugins.extract as Extract); + + return extract.base64(target); } - public static getRenderer(): Renderer + public static generateCanvas(target: DisplayObject | RenderTexture): HTMLCanvasElement + { + if(!target) return null; + + const extract = (TextureUtils.getRenderer().plugins.extract as Extract); + + return extract.canvas(target); + } + + public static getRenderer(): Renderer | AbstractRenderer { if(!TextureUtils._renderer) return Nitro.instance.renderer; diff --git a/tsconfig.json b/tsconfig.json index 71ddb774..38e3129e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,6 +7,7 @@ "declaration": true, "experimentalDecorators": true, "moduleResolution": "node", + "esModuleInterop": true, "importHelpers": true, "resolveJsonModule": true, "allowSyntheticDefaultImports": true, @@ -15,6 +16,11 @@ "lib": [ "es2018", "dom" - ] + ], + "paths": { + "mini-signals": [ + "node_modules/resource-loader/typings/mini-signals.d.ts" + ] + }, } } From a1a55038b92285de87c6797231245cc8c7af76d6 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 14 Jul 2021 01:35:34 -0400 Subject: [PATCH 129/155] Updates --- src/nitro/room/events/RoomObjectWidgetRequestEvent.ts | 4 ++-- src/nitro/room/object/logic/furniture/FurnitureCreditLogic.ts | 4 +++- .../object/logic/furniture/FurnitureCustomStackHeightLogic.ts | 4 ++-- .../room/object/logic/furniture/FurnitureFriendFurniLogic.ts | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/nitro/room/events/RoomObjectWidgetRequestEvent.ts b/src/nitro/room/events/RoomObjectWidgetRequestEvent.ts index fcae8888..5f1508f0 100644 --- a/src/nitro/room/events/RoomObjectWidgetRequestEvent.ts +++ b/src/nitro/room/events/RoomObjectWidgetRequestEvent.ts @@ -8,8 +8,8 @@ export class RoomObjectWidgetRequestEvent extends RoomObjectEvent public static OPEN_FURNI_CONTEXT_MENU: string = 'ROWRE_OPEN_FURNI_CONTEXT_MENU'; public static CLOSE_FURNI_CONTEXT_MENU: string = 'ROWRE_CLOSE_FURNI_CONTEXT_MENU'; public static PLACEHOLDER: string = 'ROWRE_PLACEHOLDER'; - public static CREDITFURNI: string = 'ROWRE__CREDITFURNI'; - public static STICKIE: string = 'ROWRE__STICKIE'; + public static CREDITFURNI: string = 'ROWRE_CREDITFURNI'; + public static STICKIE: string = 'ROWRE_STICKIE'; public static PRESENT: string = 'ROWRE_PRESENT'; public static TROPHY: string = 'ROWRE_TROPHY'; public static TEASER: string = 'ROWRE_TEASER'; diff --git a/src/nitro/room/object/logic/furniture/FurnitureCreditLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureCreditLogic.ts index d74ae5a3..a6ecb0e8 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureCreditLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureCreditLogic.ts @@ -45,5 +45,7 @@ export class FurnitureCreditLogic extends FurnitureLogic public useObject(): void { (this.object && this.eventDispatcher && this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.CREDITFURNI, this.object))); + + super.useObject(); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureCustomStackHeightLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureCustomStackHeightLogic.ts index 81ca33b2..ea236a73 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureCustomStackHeightLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureCustomStackHeightLogic.ts @@ -1,5 +1,5 @@ import { IAssetData } from '../../../../../core/asset/interfaces'; -import { RoomWidgetEnum } from '../../../../ui/widget/enums/RoomWidgetEnum'; +import { RoomWidgetEnum } from '../../../../ui'; import { RoomObjectVariable } from '../../RoomObjectVariable'; import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; @@ -16,4 +16,4 @@ export class FurnitureCustomStackHeightLogic extends FurnitureMultiStateLogic { return RoomWidgetEnum.CUSTOM_STACK_HEIGHT; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts index e2f438ce..7a7dff5d 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts @@ -52,7 +52,7 @@ export class FurnitureFriendFurniLogic extends FurnitureMultiStateLogic { if(!this.eventDispatcher || !this.object) return; - if(this._state == FurnitureFriendFurniLogic.STATE_LOCKED) + if(this._state === FurnitureFriendFurniLogic.STATE_LOCKED) { this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_ENGRAVING, this.object)); } From 114b560bdc6241890b2b5c26ba5b083420bd6ed5 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 14 Jul 2021 01:49:54 -0400 Subject: [PATCH 130/155] Update logics --- .../furniture/FurnitureBadgeDisplayLogic.ts | 22 ++------ .../furniture/FurnitureCounterClockLogic.ts | 2 +- .../logic/furniture/FurnitureCreditLogic.ts | 21 ++------ .../FurnitureEditableInternalLinkLogic.ts | 4 +- .../FurnitureEditableRoomLinkLogic.ts | 4 +- .../furniture/FurnitureEffectBoxLogic.ts | 2 +- .../furniture/FurnitureExternalImageLogic.ts | 19 +------ .../furniture/FurnitureFriendFurniLogic.ts | 2 +- .../furniture/FurnitureHabboWheelLogic.ts | 27 ++-------- .../furniture/FurnitureHighScoreLogic.ts | 19 +------ .../object/logic/furniture/FurnitureLogic.ts | 9 ++-- .../furniture/FurnitureMannequinLogic.ts | 21 +------- .../FurnitureMonsterplantSeedLogic.ts | 2 +- .../furniture/FurnitureMysteryBoxLogic.ts | 2 +- .../furniture/FurnitureMysteryTrophyLogic.ts | 2 +- .../furniture/FurnitureOneWayDoorLogic.ts | 24 ++------- .../FurniturePetCustomizationLogic.ts | 21 ++------ .../logic/furniture/FurniturePresentLogic.ts | 11 ++-- .../FurniturePurchaseableClothingLogic.ts | 2 +- .../FurnitureRoomBackgroundColorLogic.ts | 5 +- .../furniture/FurnitureRoomDimmerLogic.ts | 4 +- .../logic/furniture/FurnitureStickieLogic.ts | 23 ++------ .../logic/furniture/FurnitureTrophyLogic.ts | 21 +------- src/nitro/room/object/logic/pet/PetLogic.ts | 2 +- src/nitro/room/object/logic/room/RoomLogic.ts | 52 +++++++++---------- 25 files changed, 77 insertions(+), 246 deletions(-) diff --git a/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts index 6d96fc67..7f90bb19 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts @@ -1,8 +1,5 @@ -import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent'; import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage'; -import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; import { Nitro } from '../../../../Nitro'; -import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomObjectBadgeAssetEvent } from '../../../events/RoomObjectBadgeAssetEvent'; import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage'; @@ -49,24 +46,11 @@ export class FurnitureBadgeDisplayLogic extends FurnitureLogic } } - public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void - { - if(!event || !geometry || !this.object) return; - - switch(event.type) - { - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - return; - default: - super.mouseEvent(event, geometry); - return; - } - } - public useObject(): void { - (this.object && this.eventDispatcher && this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.BADGE_DISPLAY_ENGRAVING, this.object))); + if(!this.object || !this.eventDispatcher) return; + + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.BADGE_DISPLAY_ENGRAVING, this.object)); } protected updateBadge(badgeId: string): void diff --git a/src/nitro/room/object/logic/furniture/FurnitureCounterClockLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureCounterClockLogic.ts index b15ee4af..b027816f 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureCounterClockLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureCounterClockLogic.ts @@ -51,4 +51,4 @@ export class FurnitureCounterClockLogic extends FurnitureLogic this.eventDispatcher.dispatchEvent(new RoomObjectStateChangedEvent(RoomObjectStateChangedEvent.STATE_CHANGE, this.object, 1)); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureCreditLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureCreditLogic.ts index a6ecb0e8..2fc654ee 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureCreditLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureCreditLogic.ts @@ -1,7 +1,4 @@ import { IAssetData } from '../../../../../core/asset/interfaces'; -import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent'; -import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; -import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { RoomObjectVariable } from '../../RoomObjectVariable'; import { FurnitureLogic } from './FurnitureLogic'; @@ -28,23 +25,11 @@ export class FurnitureCreditLogic extends FurnitureLogic this.object.model.setValue(RoomObjectVariable.FURNITURE_CREDIT_VALUE, creditValue); } - public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void - { - if(!event || !geometry || !this.object) return; - - switch(event.type) - { - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - return; - default: - super.mouseEvent(event, geometry); - } - } - public useObject(): void { - (this.object && this.eventDispatcher && this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.CREDITFURNI, this.object))); + if(!this.object || !this.eventDispatcher) return; + + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.CREDITFURNI, this.object)); super.useObject(); } diff --git a/src/nitro/room/object/logic/furniture/FurnitureEditableInternalLinkLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureEditableInternalLinkLogic.ts index d98c3875..0795392d 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureEditableInternalLinkLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureEditableInternalLinkLogic.ts @@ -76,8 +76,8 @@ export class FurnitureEditableInternalLinkLogic extends FurnitureLogic public useObject(): void { - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.INERNAL_LINK, this.object)); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureEditableRoomLinkLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureEditableRoomLinkLogic.ts index b8e99806..b88ff93c 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureEditableRoomLinkLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureEditableRoomLinkLogic.ts @@ -67,8 +67,8 @@ export class FurnitureEditableRoomLinkLogic extends FurnitureLogic this._timer = null; }, 2500); - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.ROOM_LINK, this.object)); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureEffectBoxLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureEffectBoxLogic.ts index e0a45fad..a7b70ef6 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureEffectBoxLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureEffectBoxLogic.ts @@ -15,7 +15,7 @@ export class FurnitureEffectBoxLogic extends FurnitureLogic public useObject(): void { - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.EFFECTBOX_OPEN_DIALOG, this.object)); } diff --git a/src/nitro/room/object/logic/furniture/FurnitureExternalImageLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureExternalImageLogic.ts index cfa887d5..4d06306a 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureExternalImageLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureExternalImageLogic.ts @@ -1,7 +1,4 @@ import { IAssetData } from '../../../../../core/asset/interfaces'; -import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent'; -import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; -import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomWidgetEnum } from '../../../../ui/widget/enums/RoomWidgetEnum'; import { RoomObjectVariable } from '../../RoomObjectVariable'; import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic'; @@ -25,22 +22,8 @@ export class FurnitureExternalImageLogic extends FurnitureMultiStateLogic } } - public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void - { - if(!event || !geometry || !this.object) return; - - switch(event.type) - { - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - break; - } - - super.mouseEvent(event, geometry); - } - public get widget(): string { return RoomWidgetEnum.EXTERNAL_IMAGE; } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts index 7a7dff5d..1fcbdaee 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureFriendFurniLogic.ts @@ -50,7 +50,7 @@ export class FurnitureFriendFurniLogic extends FurnitureMultiStateLogic public useObject(): void { - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; if(this._state === FurnitureFriendFurniLogic.STATE_LOCKED) { diff --git a/src/nitro/room/object/logic/furniture/FurnitureHabboWheelLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureHabboWheelLogic.ts index 49b4c0c5..9b0be170 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureHabboWheelLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureHabboWheelLogic.ts @@ -1,6 +1,3 @@ -import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent'; -import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; -import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomObjectFurnitureActionEvent } from '../../../events/RoomObjectFurnitureActionEvent'; import { FurnitureLogic } from './FurnitureLogic'; @@ -13,28 +10,10 @@ export class FurnitureHabboWheelLogic extends FurnitureLogic return this.mergeTypes(super.getEventTypes(), types); } - public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void - { - if(!event || !geometry || !this.object) return; - - switch(event.type) - { - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - return; - default: - super.mouseEvent(event, geometry); - return; - } - } - public useObject(): void { - if(!this.object) return; + if(!this.object || !this.eventDispatcher) return; - if(this.eventDispatcher) - { - this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.USE_HABBOWHEEL, this.object)); - } + this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.USE_HABBOWHEEL, this.object)); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureHighScoreLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureHighScoreLogic.ts index 5ccc5fdc..5c946ea4 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureHighScoreLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureHighScoreLogic.ts @@ -1,7 +1,4 @@ -import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent'; import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage'; -import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; -import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage'; import { RoomObjectVariable } from '../../RoomObjectVariable'; @@ -48,18 +45,4 @@ export class FurnitureHighScoreLogic extends FurnitureLogic this._state = message.state; } } - - public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void - { - if(!event || !geometry || !this.object) return; - - switch(event.type) - { - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - return; - default: - super.mouseEvent(event, geometry); - } - } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index 215caef2..13e7c49a 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -353,16 +353,13 @@ export class FurnitureLogic extends MovingObjectLogic public useObject(): void { - if(!this.object) return; + if(!this.object || !this.eventDispatcher) return; const adUrl = this.getAdClickUrl(this.object.model); - if(this.eventDispatcher) - { - if(this.widget) this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.OPEN_WIDGET, this.object)); + if(this.widget) this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.OPEN_WIDGET, this.object)); - this.eventDispatcher.dispatchEvent(new RoomObjectStateChangedEvent(RoomObjectStateChangedEvent.STATE_CHANGE, this.object)); - } + this.eventDispatcher.dispatchEvent(new RoomObjectStateChangedEvent(RoomObjectStateChangedEvent.STATE_CHANGE, this.object)); } public tearDown(): void diff --git a/src/nitro/room/object/logic/furniture/FurnitureMannequinLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureMannequinLogic.ts index 9e0b57c9..ce5f1d76 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureMannequinLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureMannequinLogic.ts @@ -1,7 +1,4 @@ -import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent'; import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage'; -import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; -import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage'; import { MapDataType } from '../../data/type/MapDataType'; @@ -46,24 +43,10 @@ export class FurnitureMannequinLogic extends FurnitureLogic this.object.model.setValue(RoomObjectVariable.FURNITURE_MANNEQUIN_NAME, data.getValue(FurnitureMannequinLogic.OUTFIT_NAME)); } - public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void - { - if(!event || !geometry || !this.object) return; - - switch(event.type) - { - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - return; - } - - super.mouseEvent(event, geometry); - } - public useObject(): void { - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.MANNEQUIN, this.object)); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureMonsterplantSeedLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureMonsterplantSeedLogic.ts index bae36660..bbc90afa 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureMonsterplantSeedLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureMonsterplantSeedLogic.ts @@ -13,7 +13,7 @@ export class FurnitureMonsterplantSeedLogic extends FurnitureMultiStateLogic public useObject(): void { - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG, this.object)); } diff --git a/src/nitro/room/object/logic/furniture/FurnitureMysteryBoxLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureMysteryBoxLogic.ts index 0733706a..20754c25 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureMysteryBoxLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureMysteryBoxLogic.ts @@ -13,7 +13,7 @@ export class FurnitureMysteryBoxLogic extends FurnitureMultiStateLogic public useObject(): void { - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.MYSTERYBOX_OPEN_DIALOG, this.object)); } diff --git a/src/nitro/room/object/logic/furniture/FurnitureMysteryTrophyLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureMysteryTrophyLogic.ts index 0083a2e9..45869c88 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureMysteryTrophyLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureMysteryTrophyLogic.ts @@ -13,7 +13,7 @@ export class FurnitureMysteryTrophyLogic extends FurnitureMultiStateLogic public useObject(): void { - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.MYSTERYTROPHY_OPEN_DIALOG, this.object)); } diff --git a/src/nitro/room/object/logic/furniture/FurnitureOneWayDoorLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureOneWayDoorLogic.ts index 5e3a8b14..64fe0257 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureOneWayDoorLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureOneWayDoorLogic.ts @@ -1,6 +1,3 @@ -import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent'; -import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; -import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomObjectFurnitureActionEvent } from '../../../events/RoomObjectFurnitureActionEvent'; import { FurnitureLogic } from './FurnitureLogic'; @@ -13,25 +10,10 @@ export class FurnitureOneWayDoorLogic extends FurnitureLogic return this.mergeTypes(super.getEventTypes(), types); } - public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void - { - if(!event || !geometry || !this.object) return; - - switch(event.type) - { - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - - return; - } - - super.mouseEvent(event, geometry); - } - public useObject(): void { - if(!this.object) return; + if(!this.object || !this.eventDispatcher) return; - if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.ENTER_ONEWAYDOOR, this.object)); + this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.ENTER_ONEWAYDOOR, this.object)); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurniturePetCustomizationLogic.ts b/src/nitro/room/object/logic/furniture/FurniturePetCustomizationLogic.ts index d8c9db43..aa3633ea 100644 --- a/src/nitro/room/object/logic/furniture/FurniturePetCustomizationLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurniturePetCustomizationLogic.ts @@ -1,5 +1,5 @@ -import { IRoomGeometry, RoomObjectUpdateMessage, RoomSpriteMouseEvent } from '../../../../../room'; -import { MouseEventType, RoomWidgetEnumItemExtradataParameter } from '../../../../ui'; +import { RoomObjectUpdateMessage } from '../../../../../room'; +import { RoomWidgetEnumItemExtradataParameter } from '../../../../ui'; import { RoomObjectWidgetRequestEvent } from '../../../events'; import { RoomObjectVariable } from '../../RoomObjectVariable'; import { FurnitureLogic } from './FurnitureLogic'; @@ -25,24 +25,9 @@ export class FurniturePetCustomizationLogic extends FurnitureLogic } } - public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void - { - if(!event || !geometry || !this.object) return; - - switch(event.type) - { - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - - return; - } - - super.mouseEvent(event, geometry); - } - public useObject(): void { - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.PET_PRODUCT_MENU, this.object)); } diff --git a/src/nitro/room/object/logic/furniture/FurniturePresentLogic.ts b/src/nitro/room/object/logic/furniture/FurniturePresentLogic.ts index 80a72839..571a5472 100644 --- a/src/nitro/room/object/logic/furniture/FurniturePresentLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurniturePresentLogic.ts @@ -99,16 +99,15 @@ export class FurniturePresentLogic extends FurnitureLogic case MouseEventType.ROLL_OUT: this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.MOUSE_ARROW, this.object)); break; - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - return; - default: - super.mouseEvent(event, geometry); } + + super.mouseEvent(event, geometry); } public useObject(): void { - (this.object && this.eventDispatcher && this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.PRESENT, this.object))); + if(!this.object || !this.eventDispatcher) return; + + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.PRESENT, this.object)); } } diff --git a/src/nitro/room/object/logic/furniture/FurniturePurchaseableClothingLogic.ts b/src/nitro/room/object/logic/furniture/FurniturePurchaseableClothingLogic.ts index 41cf4cdb..76e0974c 100644 --- a/src/nitro/room/object/logic/furniture/FurniturePurchaseableClothingLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurniturePurchaseableClothingLogic.ts @@ -16,7 +16,7 @@ export class FurniturePurchaseableClothingLogic extends FurnitureMultiStateLogic public useObject(): void { - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG, this.object)); } diff --git a/src/nitro/room/object/logic/furniture/FurnitureRoomBackgroundColorLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRoomBackgroundColorLogic.ts index f33be885..93a269bf 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureRoomBackgroundColorLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureRoomBackgroundColorLogic.ts @@ -98,13 +98,14 @@ export class FurnitureRoomBackgroundColorLogic extends FurnitureMultiStateLogic public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void { if(!event || !geometry || !this.object) return; + switch(event.type) { case MouseEventType.DOUBLE_CLICK: (this.eventDispatcher && this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.BACKGROUND_COLOR, this.object))); return; - default: - super.mouseEvent(event, geometry); } + + super.mouseEvent(event, geometry); } } diff --git a/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts index 35d850fd..95cbe9eb 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureRoomDimmerLogic.ts @@ -113,6 +113,8 @@ export class FurnitureRoomDimmerLogic extends FurnitureLogic public useObject(): void { + if(!this.object || !this.eventDispatcher) return; + this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.DIMMER, this.object)); } @@ -137,4 +139,4 @@ export class FurnitureRoomDimmerLogic extends FurnitureLogic } } } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureStickieLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureStickieLogic.ts index eea8fe3d..f6bd9c40 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureStickieLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureStickieLogic.ts @@ -1,8 +1,5 @@ import { IAssetData } from '../../../../../core/asset/interfaces'; -import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent'; import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage'; -import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; -import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomObjectFurnitureActionEvent } from '../../../events/RoomObjectFurnitureActionEvent'; import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { ObjectItemDataUpdateMessage } from '../../../messages/ObjectItemDataUpdateMessage'; @@ -57,22 +54,10 @@ export class FurnitureStickieLogic extends FurnitureLogic this.object.model.setValue(RoomObjectVariable.FURNITURE_COLOR, (colorIndex + 1)); } - public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void - { - if(!event || !geometry || !this.object) return; - - switch(event.type) - { - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - return; - default: - super.mouseEvent(event, geometry); - } - } - public useObject(): void { - (this.object && this.eventDispatcher && this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.STICKIE, this.object))); + if(!this.object || !this.eventDispatcher) return; + + this.eventDispatcher.dispatchEvent(new RoomObjectFurnitureActionEvent(RoomObjectFurnitureActionEvent.STICKIE, this.object)); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/furniture/FurnitureTrophyLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureTrophyLogic.ts index 726302dd..0ed0c8c5 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureTrophyLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureTrophyLogic.ts @@ -1,6 +1,3 @@ -import { RoomSpriteMouseEvent } from '../../../../../room/events/RoomSpriteMouseEvent'; -import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; -import { MouseEventType } from '../../../../ui/MouseEventType'; import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { FurnitureLogic } from './FurnitureLogic'; @@ -13,24 +10,10 @@ export class FurnitureTrophyLogic extends FurnitureLogic return this.mergeTypes(super.getEventTypes(), types); } - public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void - { - if(!event || !geometry || !this.object) return; - - switch(event.type) - { - case MouseEventType.DOUBLE_CLICK: - this.useObject(); - return; - } - - super.mouseEvent(event, geometry); - } - public useObject(): void { - if(!this.eventDispatcher || !this.object) return; + if(!this.object || !this.eventDispatcher) return; this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.TROPHY, this.object)); } -} \ No newline at end of file +} diff --git a/src/nitro/room/object/logic/pet/PetLogic.ts b/src/nitro/room/object/logic/pet/PetLogic.ts index 0b8779e9..e234da40 100644 --- a/src/nitro/room/object/logic/pet/PetLogic.ts +++ b/src/nitro/room/object/logic/pet/PetLogic.ts @@ -229,7 +229,7 @@ export class PetLogic extends MovingObjectLogic case MouseEventType.MOUSE_DOWN: { const petType = this.object.model.getValue(RoomObjectVariable.PET_TYPE); - if(petType == PetType.MONSTERPLANT) + if(petType === PetType.MONSTERPLANT) { if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_DOWN, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown)); } diff --git a/src/nitro/room/object/logic/room/RoomLogic.ts b/src/nitro/room/object/logic/room/RoomLogic.ts index c9ef0e50..b1ed6f05 100644 --- a/src/nitro/room/object/logic/room/RoomLogic.ts +++ b/src/nitro/room/object/logic/room/RoomLogic.ts @@ -365,44 +365,44 @@ export class RoomLogic extends RoomObjectLogicBase planeId--; - let _local_7: Point = null; + let planePosition: Point = null; - const _local_8 = this._planeParser.getPlaneLocation(planeId); - const _local_9 = this._planeParser.getPlaneLeftSide(planeId); - const _local_10 = this._planeParser.getPlaneRightSide(planeId); - const _local_11 = this._planeParser.getPlaneNormalDirection(planeId); - const _local_12 = this._planeParser.getPlaneType(planeId); + const planeLocation = this._planeParser.getPlaneLocation(planeId); + const planeLeftSide = this._planeParser.getPlaneLeftSide(planeId); + const planeRightSide = this._planeParser.getPlaneRightSide(planeId); + const planeNormalDirection = this._planeParser.getPlaneNormalDirection(planeId); + const planeType = this._planeParser.getPlaneType(planeId); - if(((((_local_8 == null) || (_local_9 == null)) || (_local_10 == null)) || (_local_11 == null))) return; + if(((((planeLocation == null) || (planeLeftSide == null)) || (planeRightSide == null)) || (planeNormalDirection == null))) return; - const _local_13 = _local_9.length; - const _local_14 = _local_10.length; + const leftSideLength = planeLeftSide.length; + const rightSideLength = planeRightSide.length; - if(((_local_13 == 0) || (_local_14 == 0))) return; + if(((leftSideLength == 0) || (rightSideLength == 0))) return; - const _local_15 = event.screenX; - const _local_16 = event.screenY; - const _local_17 = new Point(_local_15, _local_16); + const screenX = event.screenX; + const screenY = event.screenY; + const screenPoint = new Point(screenX, screenY); - _local_7 = geometry.getPlanePosition(_local_17, _local_8, _local_9, _local_10); + planePosition = geometry.getPlanePosition(screenPoint, planeLocation, planeLeftSide, planeRightSide); - if(!_local_7) + if(!planePosition) { this.object.model.setValue(RoomObjectVariable.ROOM_SELECTED_PLANE, 0); return; } - const _local_18 = Vector3d.product(_local_9, (_local_7.x / _local_13)); + const _local_18 = Vector3d.product(planeLeftSide, (planePosition.x / leftSideLength)); - _local_18.add(Vector3d.product(_local_10, (_local_7.y / _local_14))); - _local_18.add(_local_8); + _local_18.add(Vector3d.product(planeRightSide, (planePosition.y / rightSideLength))); + _local_18.add(planeLocation); const _local_19 = _local_18.x; const _local_20 = _local_18.y; const _local_21 = _local_18.z; - if(((((_local_7.x >= 0) && (_local_7.x < _local_13)) && (_local_7.y >= 0)) && (_local_7.y < _local_14))) + if(((((planePosition.x >= 0) && (planePosition.x < leftSideLength)) && (planePosition.y >= 0)) && (planePosition.y < rightSideLength))) { this.object.model.setValue(RoomObjectVariable.ROOM_SELECTED_X, _local_19); this.object.model.setValue(RoomObjectVariable.ROOM_SELECTED_Y, _local_20); @@ -428,26 +428,26 @@ export class RoomLogic extends RoomObjectLogicBase case MouseEventType.MOUSE_CLICK: { let newEvent: RoomObjectEvent = null; - if(_local_12 === RoomPlaneData.PLANE_FLOOR) + if(planeType === RoomPlaneData.PLANE_FLOOR) { newEvent = new RoomObjectTileMouseEvent(eventType, this.object, event.eventId, _local_19, _local_20, _local_21, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); } - else if((_local_12 === RoomPlaneData.PLANE_WALL) || (_local_12 === RoomPlaneData.PLANE_LANDSCAPE)) + else if((planeType === RoomPlaneData.PLANE_WALL) || (planeType === RoomPlaneData.PLANE_LANDSCAPE)) { let direction = 90; - if(_local_11) + if(planeNormalDirection) { - direction = (_local_11.x + 90); + direction = (planeNormalDirection.x + 90); if(direction > 360) direction -= 360; } - const _local_27 = ((_local_9.length * _local_7.x) / _local_13); - const _local_28 = ((_local_10.length * _local_7.y) / _local_14); + const _local_27 = ((planeLeftSide.length * planePosition.x) / leftSideLength); + const _local_28 = ((planeRightSide.length * planePosition.y) / rightSideLength); - newEvent = new RoomObjectWallMouseEvent(eventType, this.object, event.eventId, _local_8, _local_9, _local_10, _local_27, _local_28, direction, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); + newEvent = new RoomObjectWallMouseEvent(eventType, this.object, event.eventId, planeLocation, planeLeftSide, planeRightSide, _local_27, _local_28, direction, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); } if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(newEvent); From daf41b4b8553e5931ad6d8f3a42014513bfc2b7b Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 14 Jul 2021 03:10:47 -0400 Subject: [PATCH 131/155] Add pet experience bubble --- .../visualization/pet/ExperienceData.ts | 79 ++++++++++++++++ .../visualization/pet/PetVisualization.ts | 92 +++++++++++++++++-- 2 files changed, 161 insertions(+), 10 deletions(-) create mode 100644 src/nitro/room/object/visualization/pet/ExperienceData.ts diff --git a/src/nitro/room/object/visualization/pet/ExperienceData.ts b/src/nitro/room/object/visualization/pet/ExperienceData.ts new file mode 100644 index 00000000..c424adfd --- /dev/null +++ b/src/nitro/room/object/visualization/pet/ExperienceData.ts @@ -0,0 +1,79 @@ +import { RenderTexture, Resource, Texture } from '@pixi/core'; +import { Container } from '@pixi/display'; +import { Sprite } from '@pixi/sprite'; +import { Text } from '@pixi/text'; +import { TextureUtils } from '../../../../../room'; +import { Nitro } from '../../../../Nitro'; + +export class ExperienceData +{ + private _sprite: Sprite; + private _texture: RenderTexture; + private _amount: number; + private _alpha: number; + + constructor(texture: Texture) + { + this._sprite = new Sprite(texture); + this._texture = null; + this._amount = -1; + this._alpha = 0; + } + + public renderBubble(amount: number): RenderTexture + { + if(!this._sprite || (this._amount === amount)) return null; + + const container = new Container(); + + container.addChild(this._sprite); + + const text = new Text(('+' + amount), { + fontFamily: 'Arial', + fontSize: 9, + fill: 0xFFFFFF, + align: 'center' + }); + + text.anchor.x = 0.5; + + text.x = (this._sprite.width / 2); + text.y = 19; + + container.addChild(text); + + if(!this._texture) + { + this._texture = TextureUtils.generateTexture(container); + } + else + { + Nitro.instance.renderer.render(container, { + renderTexture: this._texture, + clear: true + }); + } + + return this._texture; + } + + public get amount(): number + { + return this._amount; + } + + public set amount(amount: number) + { + this._amount = amount; + } + + public get alpha(): number + { + return this._alpha; + } + + public set alpha(alpha: number) + { + this._alpha = alpha; + } +} diff --git a/src/nitro/room/object/visualization/pet/PetVisualization.ts b/src/nitro/room/object/visualization/pet/PetVisualization.ts index 3051ea03..1bc4042b 100644 --- a/src/nitro/room/object/visualization/pet/PetVisualization.ts +++ b/src/nitro/room/object/visualization/pet/PetVisualization.ts @@ -1,6 +1,8 @@ +import { Resource, Texture } from '@pixi/core'; import { IObjectVisualizationData } from '../../../../../room/object/visualization/IRoomObjectVisualizationData'; import { IGraphicAsset } from '../../../../../room/object/visualization/utils/IGraphicAsset'; import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; +import { Nitro } from '../../../../Nitro'; import { RoomObjectVariable } from '../../RoomObjectVariable'; import { RoomObjectVisualizationType } from '../../RoomObjectVisualizationType'; import { AnimationData } from '../data/AnimationData'; @@ -9,21 +11,22 @@ import { DirectionData } from '../data/DirectionData'; import { LayerData } from '../data/LayerData'; import { FurnitureAnimatedVisualization } from '../furniture/FurnitureAnimatedVisualization'; import { FurnitureVisualizationData } from '../furniture/FurnitureVisualizationData'; +import { ExperienceData } from './ExperienceData'; import { PetVisualizationData } from './PetVisualizationData'; export class PetVisualization extends FurnitureAnimatedVisualization { public static TYPE: string = RoomObjectVisualizationType.PET_ANIMATED; - private static HEAD: string = 'head'; - private static SADDLE: string = 'saddle'; - private static HAIR: string = 'hair'; - private static ADDITIONAL_SPRITE_COUNT: number = 1; - private static EXPERIENCE_BUBBLE_VISIBLE_IN_MS: number = 1000; - private static PET_EXPERIENCE_BUBBLE_PNG: string = 'pet_experience_bubble_png'; - private static POSTURE_ANIMATION_INDEX: number = 0; - private static GESTURE_ANIMATION_INDEX: number = 1; - private static ANIMATION_INDEX_COUNT: number = 2; + private static HEAD: string = 'head'; + private static SADDLE: string = 'saddle'; + private static HAIR: string = 'hair'; + private static ADDITIONAL_SPRITE_COUNT: number = 1; + private static EXPERIENCE_BUBBLE_VISIBLE_IN_MS: number = 1000; + private static PET_EXPERIENCE_BUBBLE: string = 'pet_experience_bubble'; + private static POSTURE_ANIMATION_INDEX: number = 0; + private static GESTURE_ANIMATION_INDEX: number = 1; + private static ANIMATION_INDEX_COUNT: number = 2; protected _data: PetVisualizationData; @@ -43,6 +46,9 @@ export class PetVisualization extends FurnitureAnimatedVisualization private _customPaletteIds: number[]; private _isRiding: boolean; private _color: number; + private _experience: number; + private _experienceTimestamp: number; + private _experienceData: ExperienceData; private _previousAnimationDirection: number; private _animationStates: AnimationStateData[]; @@ -69,6 +75,9 @@ export class PetVisualization extends FurnitureAnimatedVisualization this._customPaletteIds = []; this._isRiding = false; this._color = 0xFFFFFF; + this._experience = 0; + this._experienceTimestamp = 0; + this._experienceData = null; this._previousAnimationDirection = -1; this._animationStates = []; @@ -80,6 +89,13 @@ export class PetVisualization extends FurnitureAnimatedVisualization { if(!(data instanceof PetVisualizationData)) return false; + const texture = this.getPetAdditionAsset(PetVisualization.PET_EXPERIENCE_BUBBLE); + + if(texture) + { + this._experienceData = new ExperienceData(texture); + } + return super.initialize(data); } @@ -111,7 +127,53 @@ export class PetVisualization extends FurnitureAnimatedVisualization { super.update(geometry, time, update, skipUpdate); - // update experience + this.updateExperienceBubble(time); + } + + protected updateExperienceBubble(time: number): void + { + if(!this._experienceData) return; + + this._experienceData.alpha = 0; + + if(this._experienceTimestamp) + { + const difference = (time - this._experienceTimestamp); + + if(difference < PetVisualization.EXPERIENCE_BUBBLE_VISIBLE_IN_MS) + { + this._experienceData.alpha = (Math.sin(((difference / PetVisualization.EXPERIENCE_BUBBLE_VISIBLE_IN_MS) * Math.PI)) * 0xFF); + } + else + { + this._experienceTimestamp = 0; + } + + const sprite = this.getSprite((this.totalSprites - 1)); + + if(sprite) + { + if(this._experienceData.alpha > 0) + { + const texture = this._experienceData.renderBubble(this._experience); + + if(texture) + { + sprite.texture = texture; + sprite.offsetX = -20; + sprite.offsetY = -80; + sprite.alpha = this._experienceData.alpha; + sprite.visible = true; + sprite.relativeDepth = -0.2; + + return; + } + } + + sprite.texture = null; + sprite.visible = false; + } + } } protected updateModel(scale: number): boolean @@ -176,6 +238,9 @@ export class PetVisualization extends FurnitureAnimatedVisualization this._headDirection = this.object.getDirection().x; } + this._experience = (model.getValue(RoomObjectVariable.FIGURE_GAINED_EXPERIENCE)); + this._experienceTimestamp = (model.getValue(RoomObjectVariable.FIGURE_EXPERIENCE_TIMESTAMP)); + const customPaletteIndex = model.getValue(RoomObjectVariable.PET_PALETTE_INDEX); const customLayerIds = model.getValue(RoomObjectVariable.PET_CUSTOM_LAYER_IDS); const customPartIds = model.getValue(RoomObjectVariable.PET_CUSTOM_PARTS_IDS); @@ -557,4 +622,11 @@ export class PetVisualization extends FurnitureAnimatedVisualization return posture; } + + public getPetAdditionAsset(name: string): Texture + { + const url = (Nitro.instance.getConfiguration('images.url') + '/additions/' + name + '.png'); + + return Nitro.instance.core.asset.getTexture(url); + } } From 1571d0ac893cc085b96b3aa4b06f99d7178f3c19 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 14 Jul 2021 03:10:54 -0400 Subject: [PATCH 132/155] 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; From cbc6b3f25cb13ffd3ad7cabcf7fc1935af154e2c Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 15 Jul 2021 02:42:16 -0400 Subject: [PATCH 133/155] Fix busted hit detection --- src/room/renderer/RoomSpriteCanvas.ts | 2 +- src/room/renderer/utils/ExtendedSprite.ts | 51 ++++++++++++++++------- 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/src/room/renderer/RoomSpriteCanvas.ts b/src/room/renderer/RoomSpriteCanvas.ts index 5ca61f46..b8a3d732 100644 --- a/src/room/renderer/RoomSpriteCanvas.ts +++ b/src/room/renderer/RoomSpriteCanvas.ts @@ -604,7 +604,7 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas extendedSprite.tag = objectSprite.tag; extendedSprite.alphaTolerance = objectSprite.alphaTolerance; extendedSprite.name = sprite.name; - extendedSprite.varyingDepth = objectSprite.varyingDepth; + extendedSprite.varyingDepth = objectSprite.varyingDepth; extendedSprite.clickHandling = objectSprite.clickHandling; extendedSprite.filters = objectSprite.filters; diff --git a/src/room/renderer/utils/ExtendedSprite.ts b/src/room/renderer/utils/ExtendedSprite.ts index 004f6528..1b43b410 100644 --- a/src/room/renderer/utils/ExtendedSprite.ts +++ b/src/room/renderer/utils/ExtendedSprite.ts @@ -73,15 +73,28 @@ export class ExtendedSprite extends Sprite if((sprite.texture === Texture.EMPTY) || (sprite.blendMode !== BLEND_MODES.NORMAL)) return; - const texture = sprite.texture; - const baseTexture = texture.baseTexture; + const texture = sprite.texture; + const baseTexture = texture.baseTexture; if(!texture || !baseTexture || !baseTexture.valid) return false; + const resolution = baseTexture.resolution; const x = (point.x * sprite.scale.x); const y = (point.y * sprite.scale.y); - if(!sprite.getLocalBounds().contains(x, y)) return false; + let dx = (x + texture.frame.x); + let dy = (y + texture.frame.y); + + if(texture.trim) + { + dx -= texture.trim.x; + dy -= texture.trim.y; + } + + dx = Math.round(dx) * resolution; + dy = Math.round(dy) * resolution; + + if(((dx < 0) || (dx > texture.width)) || ((dy < 0) || (dy > texture.height))) return false; //@ts-ignore if(!baseTexture.hitMap) @@ -109,15 +122,13 @@ export class ExtendedSprite extends Sprite } //@ts-ignore - const hitMap = baseTexture.hitMap; - //@ts-ignore - const width = baseTexture.hitMapWidth; - const resolution = baseTexture.resolution; - const dx = Math.round((x + texture.frame.x) * resolution); - const dy = Math.round((y + texture.frame.y) * resolution); - const index = (((dy * width) + dx) * 4); + const hitMap = (baseTexture.hitMap as Uint32Array); - return ((hitMap[index + 3] !== undefined) && (hitMap[index + 3] > sprite.alphaTolerance)); + const ind = (dx + dy * baseTexture.realWidth); + const ind1 = ind % 32; + const ind2 = ind / 32 | 0; + + return (hitMap[ind2] & (1 << ind1)) !== 0; } private static generateHitMap(baseTexture: BaseTexture, tempCanvas: HTMLCanvasElement = null): boolean @@ -162,10 +173,22 @@ export class ExtendedSprite extends Sprite const height = canvas.height; const imageData = context.getImageData(0, 0, width, height); + const hitmap = new Uint32Array(Math.ceil(width * height / 32)); + const threshold = 128; + + for(let i = 0; i < width * height; i++) + { + const ind1 = i % 32; + const ind2 = i / 32 | 0; + + if(imageData.data[i * 4 + 3] >= threshold) + { + hitmap[ind2] = hitmap[ind2] | (1 << ind1); + } + } + //@ts-ignore - baseTexture.hitMap = imageData.data; - //@ts-ignore - baseTexture.hitMapWidth = width; + baseTexture.hitMap = hitmap; return true; } From 56e66cb96b38ccab5c769d86905a62a392ae55bb Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 15 Jul 2021 12:32:10 -0400 Subject: [PATCH 134/155] Another fix for busted hit detection --- src/room/renderer/utils/ExtendedSprite.ts | 27 +++++++++++------------ 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/room/renderer/utils/ExtendedSprite.ts b/src/room/renderer/utils/ExtendedSprite.ts index 1b43b410..60ac3d58 100644 --- a/src/room/renderer/utils/ExtendedSprite.ts +++ b/src/room/renderer/utils/ExtendedSprite.ts @@ -78,23 +78,10 @@ export class ExtendedSprite extends Sprite if(!texture || !baseTexture || !baseTexture.valid) return false; - const resolution = baseTexture.resolution; const x = (point.x * sprite.scale.x); const y = (point.y * sprite.scale.y); - let dx = (x + texture.frame.x); - let dy = (y + texture.frame.y); - - if(texture.trim) - { - dx -= texture.trim.x; - dy -= texture.trim.y; - } - - dx = Math.round(dx) * resolution; - dy = Math.round(dy) * resolution; - - if(((dx < 0) || (dx > texture.width)) || ((dy < 0) || (dy > texture.height))) return false; + if(!sprite.getLocalBounds().contains(x, y)) return false; //@ts-ignore if(!baseTexture.hitMap) @@ -124,6 +111,18 @@ export class ExtendedSprite extends Sprite //@ts-ignore const hitMap = (baseTexture.hitMap as Uint32Array); + let dx = (x + texture.frame.x); + let dy = (y + texture.frame.y); + + if(texture.trim) + { + dx -= texture.trim.x; + dy -= texture.trim.y; + } + + dx = (Math.round(dx) * baseTexture.resolution); + dy = (Math.round(dy) * baseTexture.resolution); + const ind = (dx + dy * baseTexture.realWidth); const ind1 = ind % 32; const ind2 = ind / 32 | 0; From 0aaac608b4bf63374ba9b81b106ac796ab76cbf0 Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 16 Jul 2021 02:42:04 -0400 Subject: [PATCH 135/155] Add unseen tracker packets --- src/nitro/communication/NitroMessages.ts | 34 ++++++++++++------- .../messages/outgoing/OutgoingHeader.ts | 2 ++ .../messages/outgoing/inventory/index.ts | 1 + .../unseen/UnseenResetCategoryComposer.ts | 21 ++++++++++++ .../unseen/UnseenResetItemsComposer.ts | 21 ++++++++++++ .../outgoing/inventory/unseen/index.ts | 2 ++ 6 files changed, 69 insertions(+), 12 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/inventory/unseen/UnseenResetCategoryComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/inventory/unseen/UnseenResetItemsComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/inventory/unseen/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 6281ed81..57badc3a 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, PetExperienceEvent, 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, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent'; @@ -835,17 +835,25 @@ export class NitroMessages implements IMessageConfiguration // INVENTORY - // MARKETPLACE - this._composers.set(OutgoingHeader.REQUEST_SELL_ITEM, RequestSellItemComposer); - this._composers.set(OutgoingHeader.REQUEST_MARKETPLACE_ITEM_STATS, MarketplaceRequesstItemStatsComposer); - this._composers.set(OutgoingHeader.MARKETPLACE_REDEEM_CREDITS, MarketplaceRedeemCreditsComposer); + //// BADGES + this._composers.set(OutgoingHeader.USER_BADGES, RequestBadgesComposer); + this._composers.set(OutgoingHeader.USER_BADGES_CURRENT_UPDATE, SetActivatedBadgesComposer); - // FURNI + //// BOTS + this._composers.set(OutgoingHeader.USER_BOTS, GetBotInventoryComposer); + + //// FURNI this._composers.set(OutgoingHeader.USER_FURNITURE, FurnitureListComposer); this._composers.set(OutgoingHeader.USER_FURNITURE2, FurnitureList2Composer); - this._composers.set(OutgoingHeader.ITEM_SAVE_BACKGROUND, RoomAdsUpdateComposer); - // TRADING + //// MARKETPLACE + this._composers.set(OutgoingHeader.REQUEST_SELL_ITEM, RequestSellItemComposer); + this._composers.set(OutgoingHeader.REQUEST_MARKETPLACE_ITEM_STATS, MarketplaceRequesstItemStatsComposer); + + //// PETS + this._composers.set(OutgoingHeader.USER_PETS, RequestPetsComposer); + + //// TRADING this._composers.set(OutgoingHeader.TRADE_ACCEPT, TradingAcceptComposer); this._composers.set(OutgoingHeader.TRADE_CANCEL, TradingCancelComposer); this._composers.set(OutgoingHeader.TRADE_CLOSE, TradingCloseComposer); @@ -856,6 +864,10 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.TRADE, TradingOpenComposer); this._composers.set(OutgoingHeader.TRADE_UNACCEPT, TradingUnacceptComposer); + //// UNSEEN + this._composers.set(OutgoingHeader.UNSEEN_RESET_CATEGORY, UnseenResetCategoryComposer); + this._composers.set(OutgoingHeader.UNSEEN_RESET_ITEMS, UnseenResetItemsComposer); + // ACHIVEMENTS this._composers.set(OutgoingHeader.ACHIEVEMENT_LIST, RequestAchievementsMessageComposer); @@ -943,6 +955,7 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.ONE_WAY_DOOR_CLICK, FurnitureOneWayDoorComposer); this._composers.set(OutgoingHeader.ITEM_EXCHANGE_REDEEM, FurnitureExchangeComposer); this._composers.set(OutgoingHeader.ITEM_CLOTHING_REDEEM, RedeemItemClothingComposer); + this._composers.set(OutgoingHeader.ITEM_SAVE_BACKGROUND, RoomAdsUpdateComposer); // MAPPING this._composers.set(OutgoingHeader.ROOM_MODEL, RoomModelComposer); @@ -1009,14 +1022,11 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.MARKETPLACE_TAKE_BACK_ITEM, MarketplaceTakeItemBackComposer); this._composers.set(OutgoingHeader.MARKETPLACE_REQUEST_OFFERS, MarketplaceRequestOffersComposer); this._composers.set(OutgoingHeader.MARKETPLACE_BUY_OFFER, MarketplaceBuyOfferComposer); + this._composers.set(OutgoingHeader.MARKETPLACE_REDEEM_CREDITS, MarketplaceRedeemCreditsComposer); // BOTS this._composers.set(OutgoingHeader.USER_BOTS, GetBotInventoryComposer); - // BADGES - this._composers.set(OutgoingHeader.USER_BADGES, RequestBadgesComposer); - this._composers.set(OutgoingHeader.USER_BADGES_CURRENT_UPDATE, SetActivatedBadgesComposer); - // PETS this._composers.set(OutgoingHeader.USER_PETS, RequestPetsComposer); diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 0a3c1d80..45309de5 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -244,4 +244,6 @@ export class OutgoingHeader public static REMOVE_PET_SADDLE = 186; public static TOGGLE_PET_RIDING = 1472; public static TOGGLE_PET_BREEDING = 3379; + public static UNSEEN_RESET_CATEGORY = 3493; + public static UNSEEN_RESET_ITEMS = 2343; } diff --git a/src/nitro/communication/messages/outgoing/inventory/index.ts b/src/nitro/communication/messages/outgoing/inventory/index.ts index 51eb4de7..3832a002 100644 --- a/src/nitro/communication/messages/outgoing/inventory/index.ts +++ b/src/nitro/communication/messages/outgoing/inventory/index.ts @@ -4,3 +4,4 @@ export * from './furni'; export * from './marketplace'; export * from './pets'; export * from './trading'; +export * from './unseen'; diff --git a/src/nitro/communication/messages/outgoing/inventory/unseen/UnseenResetCategoryComposer.ts b/src/nitro/communication/messages/outgoing/inventory/unseen/UnseenResetCategoryComposer.ts new file mode 100644 index 00000000..93954358 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/inventory/unseen/UnseenResetCategoryComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class UnseenResetCategoryComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(category: number) + { + this._data = [ category ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/inventory/unseen/UnseenResetItemsComposer.ts b/src/nitro/communication/messages/outgoing/inventory/unseen/UnseenResetItemsComposer.ts new file mode 100644 index 00000000..163992cd --- /dev/null +++ b/src/nitro/communication/messages/outgoing/inventory/unseen/UnseenResetItemsComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class UnseenResetItemsComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(category: number, ...itemIds: number[]) + { + this._data = [ category, itemIds.length, ...itemIds ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/inventory/unseen/index.ts b/src/nitro/communication/messages/outgoing/inventory/unseen/index.ts new file mode 100644 index 00000000..52f1b4e5 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/inventory/unseen/index.ts @@ -0,0 +1,2 @@ +export * from './UnseenResetCategoryComposer'; +export * from './UnseenResetItemsComposer'; From 27b64a1c0a8f4231b43ed837a9f51cbf57bf9f03 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 17 Jul 2021 03:24:40 -0400 Subject: [PATCH 136/155] Remove event extension of NitroEvent --- src/core/events/EventDispatcher.ts | 5 +++-- src/core/events/IEventDispatcher.ts | 5 +++-- src/core/events/NitroEvent.ts | 16 +++++++++++++--- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/core/events/EventDispatcher.ts b/src/core/events/EventDispatcher.ts index 773e7c68..59456ec6 100644 --- a/src/core/events/EventDispatcher.ts +++ b/src/core/events/EventDispatcher.ts @@ -4,6 +4,7 @@ import { IDisposable } from '../common/disposable/IDisposable'; import { INitroLogger } from '../common/logger/INitroLogger'; import { NitroLogger } from '../common/logger/NitroLogger'; import { IEventDispatcher } from './IEventDispatcher'; +import { NitroEvent } from './NitroEvent'; export class EventDispatcher extends Disposable implements IEventDispatcher, IDisposable { @@ -61,7 +62,7 @@ export class EventDispatcher extends Disposable implements IEventDispatcher, IDi } } - public dispatchEvent(event: Event): boolean + public dispatchEvent(event: NitroEvent): boolean { if(!event) return false; @@ -72,7 +73,7 @@ export class EventDispatcher extends Disposable implements IEventDispatcher, IDi return true; } - private processEvent(event: Event): void + private processEvent(event: NitroEvent): void { const existing = this._listeners.get(event.type); diff --git a/src/core/events/IEventDispatcher.ts b/src/core/events/IEventDispatcher.ts index 50a6019a..3ac781aa 100644 --- a/src/core/events/IEventDispatcher.ts +++ b/src/core/events/IEventDispatcher.ts @@ -1,9 +1,10 @@ import { IDisposable } from '../common/disposable/IDisposable'; +import { NitroEvent } from './NitroEvent'; export interface IEventDispatcher extends IDisposable { addEventListener(type: string, callback: Function): void removeEventListener(type: string, callback: Function): void; removeAllListeners(): void; - dispatchEvent(event: Event): boolean; -} \ No newline at end of file + dispatchEvent(event: NitroEvent): boolean; +} diff --git a/src/core/events/NitroEvent.ts b/src/core/events/NitroEvent.ts index f6d3743a..a85eb43c 100644 --- a/src/core/events/NitroEvent.ts +++ b/src/core/events/NitroEvent.ts @@ -1,4 +1,14 @@ -export class NitroEvent extends Event +export class NitroEvent { - public static COMPLETE: string = 'NITRO_COMPLETE'; -} \ No newline at end of file + private _type: string; + + constructor(type: string) + { + this._type = type; + } + + public get type(): string + { + return this._type; + } +} From affb98c8a83f75139a487588fe2f5428c5936cdc Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 17 Jul 2021 03:24:54 -0400 Subject: [PATCH 137/155] RoomEngine add setSelectedAvatar --- src/nitro/room/IRoomEngine.ts | 1 + src/nitro/room/RoomEngine.ts | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/nitro/room/IRoomEngine.ts b/src/nitro/room/IRoomEngine.ts index 049981ea..286f6c16 100644 --- a/src/nitro/room/IRoomEngine.ts +++ b/src/nitro/room/IRoomEngine.ts @@ -75,6 +75,7 @@ export interface IRoomEngine extends INitroManager getRoomObjectImage(roomId: number, objectId: number, category: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number): ImageResult; getRoomObjectPetImage(typeId: number, paletteId: number, color: number, direction: IVector3D, scale: number, listener: IGetImageListener, headOnly?: boolean, bgColor?: number, customParts?: PetCustomPart[], posture?: string): ImageResult; selectRoomObject(roomId: number, objectId: number, objectCategory: number): void; + setSelectedAvatar(roomId: number, objectId: number): void; cancelRoomObjectInsert(): void; getPetColorResult(petIndex: number, paletteIndex: number): PetColorResult; getPetColorResultsForTag(petIndex: number, tagName: string): PetColorResult[]; diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index 5214c572..ebed6c9c 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2720,6 +2720,13 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato this._roomObjectEventHandler.setSelectedObject(roomId, objectId, objectCategory); } + public setSelectedAvatar(roomId: number, objectId: number): void + { + if(this._roomObjectEventHandler) return; + + this._roomObjectEventHandler.setSelectedAvatar(roomId, objectId, true); + } + public cancelRoomObjectInsert(): void { if(!this._roomObjectEventHandler) return; From 88c757c55730ff119f042c3ed6468221d659c5cc Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 17 Jul 2021 03:25:32 -0400 Subject: [PATCH 138/155] Increase bouncing steps for higher framerate --- src/nitro/room/object/logic/furniture/FurnitureLogic.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index 13e7c49a..41c54c86 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -20,7 +20,7 @@ import { MovingObjectLogic } from '../MovingObjectLogic'; export class FurnitureLogic extends MovingObjectLogic { - private static BOUNCING_STEPS: number = 8; + private static BOUNCING_STEPS: number = 20; private static BOUNCING_Z: number = 0.0625; private _sizeX: number; From 96ec50fd9374abe7fc633fe0fe1b31a6cdaf5e6b Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 19 Jul 2021 13:28:06 -0400 Subject: [PATCH 139/155] Remove useless avatar files --- src/nitro/avatar/figuredata/FigureData.ts | 311 ------------------ src/nitro/avatar/figuredata/FigureDataView.ts | 43 --- src/nitro/avatar/figuredata/index.ts | 2 - src/nitro/avatar/index.ts | 1 - 4 files changed, 357 deletions(-) delete mode 100644 src/nitro/avatar/figuredata/FigureData.ts delete mode 100644 src/nitro/avatar/figuredata/FigureDataView.ts delete mode 100644 src/nitro/avatar/figuredata/index.ts diff --git a/src/nitro/avatar/figuredata/FigureData.ts b/src/nitro/avatar/figuredata/FigureData.ts deleted file mode 100644 index cefcf535..00000000 --- a/src/nitro/avatar/figuredata/FigureData.ts +++ /dev/null @@ -1,311 +0,0 @@ -import { IAvatarImageListener } from '../IAvatarImageListener'; -import { FigureDataView } from './FigureDataView'; - -export class FigureData implements IAvatarImageListener -{ - public static MALE: string = 'M'; - public static FEMALE: string = 'F'; - public static UNISEX: string = 'U'; - public static SCALE: string = 'h'; - public static STD: string = 'std'; - public static DEFAULT_FRAME: string = '0'; - public static FACE: string = 'hd'; - public static HAIR: string = 'hr'; - public static HAT: string = 'ha'; - public static HEAD_ACCESSORIES: string = 'he'; - public static EYE_ACCESSORIES: string = 'ea'; - public static FACE_ACCESSORIES: string = 'fa'; - public static JACKET: string = 'cc'; - public static SHIRT: string = 'ch'; - public static CHEST_ACCESSORIES: string = 'ca'; - public static CHEST_PRINTS: string = 'cp'; - public static TROUSERS: string = 'lg'; - public static SHOES: string = 'sh'; - public static TROUSER_ACCESSORIES: string = 'wa'; - - private _view: FigureDataView; - private _data: Map; - private _colors: Map; - private _gender: string = 'M'; - private _isDisposed: boolean; - private _direction: number = 4; - private _avatarEffectType: number = -1; - - constructor() - { - this._direction = FigureDataView.PREVIEW_AVATAR_DIRECTION; - this._view = new FigureDataView(this); - } - - public loadAvatarData(figureString: string, gender: string): void - { - this._data = new Map(); - this._colors = new Map(); - this._gender = gender; - - this.parseFigureString(figureString); - this.updateView(); - } - - public dispose(): void - { - this._data = null; - this._colors = null; - this._isDisposed = true; - - if(this._view) - { - this._view.dispose(); - - this._view = null; - } - } - - public get disposed(): boolean - { - return this._isDisposed; - } - - private parseFigureString(figure: string): void - { - if(!figure) return; - - const sets = figure.split('.'); - - if(!sets || !sets.length) return; - - for(const set of sets) - { - const parts = set.split('-'); - - if(!parts.length) continue; - - const setType = parts[0]; - const setId = parseInt(parts[1]); - const colorIds: number[] = []; - - let offset = 2; - - while(offset < parts.length) - { - colorIds.push(parseInt(parts[offset])); - - offset++; - } - - if(!colorIds.length) colorIds.push(0); - - this.savePartSetId(setType, setId, false); - this.savePartSetColourId(setType, colorIds, false); - } - } - - public getPartSetId(k: string): number - { - const existing = this._data.get(k); - - if(existing !== undefined) return existing; - - return -1; - } - - public getColourIds(k: string): number[] - { - const existing = this._colors.get(k); - - if(existing !== undefined) return existing; - - return []; - // return [this._avatarEditor._Str_24919(k)]; - } - - public getFigureString(): string - { - let figureString = ''; - const setParts: string[] = []; - - for(const [ setType, setId ] of this._data.entries()) - { - const colorIds = this._colors.get(setType); - - let setPart = ((setType + '-') + setId); - - if(colorIds && colorIds.length) - { - let i = 0; - - while(i < colorIds.length) - { - setPart = (setPart + ('-' + colorIds[i])); - - i++; - } - } - - setParts.push(setPart); - } - - let i = 0; - - while(i < setParts.length) - { - figureString = (figureString + setParts[i]); - - if(i < (setParts.length - 1)) figureString = (figureString + '.'); - - i++; - } - - return figureString; - } - - public savePartData(k: string, _arg_2: number, _arg_3: number[], _arg_4: boolean = false): void - { - this.savePartSetId(k, _arg_2, _arg_4); - this.savePartSetColourId(k, _arg_3, _arg_4); - } - - private savePartSetId(k: string, _arg_2: number, _arg_3: boolean = true): void - { - switch(k) - { - case FigureData.FACE: - case FigureData.HAIR: - case FigureData.HAT: - case FigureData.HEAD_ACCESSORIES: - case FigureData.EYE_ACCESSORIES: - case FigureData.FACE_ACCESSORIES: - case FigureData.SHIRT: - case FigureData.JACKET: - case FigureData.CHEST_ACCESSORIES: - case FigureData.CHEST_PRINTS: - case FigureData.TROUSERS: - case FigureData.SHOES: - case FigureData.TROUSER_ACCESSORIES: - if(_arg_2 >= 0) - { - this._data.set(k, _arg_2); - } - else - { - this._data.delete(k); - } - break; - } - - if(_arg_3) this.updateView(); - } - - public savePartSetColourId(k: string, _arg_2: number[], _arg_3: boolean = true): void - { - switch(k) - { - case FigureData.FACE: - case FigureData.HAIR: - case FigureData.HAT: - case FigureData.HEAD_ACCESSORIES: - case FigureData.EYE_ACCESSORIES: - case FigureData.FACE_ACCESSORIES: - case FigureData.SHIRT: - case FigureData.JACKET: - case FigureData.CHEST_ACCESSORIES: - case FigureData.CHEST_PRINTS: - case FigureData.TROUSERS: - case FigureData.SHOES: - case FigureData.TROUSER_ACCESSORIES: - this._colors.set(k, _arg_2); - break; - } - - if(_arg_3) this.updateView(); - } - - public getFigureStringWithFace(k: number, override = true): string - { - let figureString = ''; - - const setTypes: string[] = [ FigureData.FACE ]; - const figureSets: string[] = []; - - for(const setType of setTypes) - { - const colors = this._colors.get(setType); - - if(colors === undefined) continue; - - let setId = this._data.get(setType); - - if((setType === FigureData.FACE) && override) setId = k; - - let figureSet = ((setType + '-') + setId); - - if(setId >= 0) - { - let i = 0; - - while(i < colors.length) - { - figureSet = (figureSet + ('-' + colors[i])); - - i++; - } - } - - figureSets.push(figureSet); - } - - let i = 0; - - while(i < figureSets.length) - { - figureString = (figureString + figureSets[i]); - - if(i < (figureSets.length - 1)) figureString = (figureString + '.'); - - i++; - } - - return figureString; - } - - public updateView(): void - { - this._view.update(this.getFigureString(), this._avatarEffectType, this._direction); - } - - public get view(): FigureDataView - { - return this._view; - } - - public get gender(): string - { - return this._gender; - } - - public resetFigure(k: string): void - { - this.updateView(); - } - - public set avatarEffectType(k: number) - { - this._avatarEffectType = k; - } - - public get avatarEffectType(): number - { - return this._avatarEffectType; - } - - public get direction(): number - { - return this._direction; - } - - public set direction(k: number) - { - this._direction = k; - this.updateView(); - } -} diff --git a/src/nitro/avatar/figuredata/FigureDataView.ts b/src/nitro/avatar/figuredata/FigureDataView.ts deleted file mode 100644 index 61e10638..00000000 --- a/src/nitro/avatar/figuredata/FigureDataView.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { IAvatarImageListener } from '../IAvatarImageListener'; -import { FigureData } from './FigureData'; - -export class FigureDataView implements IAvatarImageListener -{ - public static PREVIEW_AVATAR_DIRECTION: number = 4; - - private _model: FigureData; - private _figureString: string; - private _isDisposed: boolean; - - constructor(k: FigureData) - { - this._model = k; - this._figureString = null; - this._isDisposed = false; - } - - public dispose(): void - { - this._isDisposed = true; - } - - public update(k: string, effectId: number = 0, direction: number = 4): void - { - this._figureString = k; - } - - public resetFigure(k: string): void - { - if(k !== this._figureString) return; - } - - public get disposed(): boolean - { - return this._isDisposed; - } - - public get figureString(): string - { - return this._figureString; - } -} diff --git a/src/nitro/avatar/figuredata/index.ts b/src/nitro/avatar/figuredata/index.ts deleted file mode 100644 index 5cb0cb68..00000000 --- a/src/nitro/avatar/figuredata/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './FigureData'; -export * from './FigureDataView'; diff --git a/src/nitro/avatar/index.ts b/src/nitro/avatar/index.ts index 314f3e5c..3265bf6d 100644 --- a/src/nitro/avatar/index.ts +++ b/src/nitro/avatar/index.ts @@ -14,7 +14,6 @@ export * from './EffectAssetDownloadLibrary'; export * from './EffectAssetDownloadManager'; export * from './enum'; export * from './events'; -export * from './figuredata'; export * from './geometry'; export * from './IAvatarEffectListener'; export * from './IAvatarFigureContainer'; From dbeab77f03d6fe822cf023393ff31c4681b3ff4c Mon Sep 17 00:00:00 2001 From: Bill Date: Mon, 19 Jul 2021 13:28:16 -0400 Subject: [PATCH 140/155] Fix room previewer category --- src/nitro/room/preview/RoomPreviewer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/room/preview/RoomPreviewer.ts b/src/nitro/room/preview/RoomPreviewer.ts index 6fe24cf3..d542948e 100644 --- a/src/nitro/room/preview/RoomPreviewer.ts +++ b/src/nitro/room/preview/RoomPreviewer.ts @@ -818,7 +818,7 @@ export class RoomPreviewer { if(this.isRoomEngineReady) { - const roomObject = this._roomEngine.getRoomObject(this._previewRoomId, RoomPreviewer.PREVIEW_OBJECT_ID, RoomObjectCategory.UNIT); + const roomObject = this._roomEngine.getRoomObject(this._previewRoomId, RoomPreviewer.PREVIEW_OBJECT_ID, this._currentPreviewObjectCategory); if(roomObject && roomObject.visualization) return roomObject.visualization.getImage(0xFFFFFF, -1); } From f281a54fb2a9b9e1dce99d8ac14feff3ee6b1a92 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 21 Jul 2021 03:07:30 -0400 Subject: [PATCH 141/155] Fix file --- src/nitro/communication/NitroMessages.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 57badc3a..3c2d1a79 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, PetExperienceEvent, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer } from './messages'; +import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, ChangeUserNameResultMessageEvent, FurnitureGuildInfoComposer, MysteryBoxKeysEvent, PetExperienceEvent, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent'; @@ -1072,7 +1072,3 @@ export class NitroMessages implements IMessageConfiguration return this._composers; } } -function ChangeUserNameResultMessageEvent(USER_CHANGE_NAME: number, ChangeUserNameResultMessageEvent: any) -{ - throw new Error('Function not implemented.'); -} From 30f6dda417ac0a25a3fec2a94aa4a8234458fbeb Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 21 Jul 2021 04:31:00 -0500 Subject: [PATCH 142/155] added landing view packets --- src/nitro/communication/NitroMessages.ts | 12 ++++ .../messages/incoming/IncomingHeader.ts | 2 + .../incoming/landingview/PromoArticleData.ts | 62 +++++++++++++++++++ .../landingview/PromoArticlesMessageEvent.ts | 16 +++++ .../votes/CommunityGoalVoteMessageEvent.ts | 16 +++++ .../room/pet/PetBreedingResultData.ts | 2 +- .../messages/outgoing/OutgoingHeader.ts | 2 + .../landingview/GetPromoArticlesComposer.ts | 21 +++++++ .../votes/CommunityGoalVoteMessageComposer.ts | 21 +++++++ .../catalog/MarketplaceItemStatsParser.ts | 4 +- .../landingview/PromoArticlesMessageParser.ts | 33 ++++++++++ .../votes/CommunityVoteReceivedParser.ts | 24 +++++++ .../RoomWidgetCameraConfigurationParser.ts | 2 +- .../camera/RoomWidgetCameraPublishedParser.ts | 2 +- 14 files changed, 214 insertions(+), 5 deletions(-) create mode 100644 src/nitro/communication/messages/incoming/landingview/PromoArticleData.ts create mode 100644 src/nitro/communication/messages/incoming/landingview/PromoArticlesMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/landingview/votes/CommunityGoalVoteMessageEvent.ts create mode 100644 src/nitro/communication/messages/outgoing/landingview/GetPromoArticlesComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer.ts create mode 100644 src/nitro/communication/messages/parser/landingview/PromoArticlesMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/landingview/votes/CommunityVoteReceivedParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 3c2d1a79..57d79fdf 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -85,6 +85,8 @@ import { TradingOpenEvent } from './messages/incoming/inventory/trading/TradingO import { TradingOpenFailedEvent } from './messages/incoming/inventory/trading/TradingOpenFailedEvent'; import { TradingOtherNotAllowedEvent } from './messages/incoming/inventory/trading/TradingOtherNotAllowedEvent'; import { TradingYouAreNotAllowedEvent } from './messages/incoming/inventory/trading/TradingYouAreNotAllowedEvent'; +import { PromoArticlesMessageEvent } from './messages/incoming/landingview/PromoArticlesMessageEvent'; +import { CommunityGoalVoteMessageEvent } from './messages/incoming/landingview/votes/CommunityGoalVoteMessageEvent'; import { ModeratorMessageEvent } from './messages/incoming/moderation/ModeratorMessageEvent'; import { ModtoolCallForHelpTopicsEvent } from './messages/incoming/modtool/ModtoolCallForHelpTopicsEvent'; import { ModtoolMainEvent } from './messages/incoming/modtool/ModtoolMainEvent'; @@ -284,6 +286,8 @@ import { TradingListAddItemsComposer } from './messages/outgoing/inventory/tradi import { TradingListItemRemoveComposer } from './messages/outgoing/inventory/trading/TradingListRemoveItemComposer'; import { TradingOpenComposer } from './messages/outgoing/inventory/trading/TradingOpenComposer'; import { TradingUnacceptComposer } from './messages/outgoing/inventory/trading/TradingUnacceptComposer'; +import { GetPromoArticlesComposer } from './messages/outgoing/landingview/GetPromoArticlesComposer'; +import { CommunityGoalVoteMessageComposer } from './messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer'; import { ModtoolChangeRoomSettingsComposer } from './messages/outgoing/modtool/ModtoolChangeRoomSettingsComposer'; import { ModtoolEventAlertComposer } from './messages/outgoing/modtool/ModtoolEventAlertComposer'; import { ModtoolRequestRoomChatlogComposer } from './messages/outgoing/modtool/ModtoolRequestRoomChatlogComposer'; @@ -745,6 +749,10 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.MARKETPLACE_ITEM_POSTED, MarketplaceItemPostedEvent); this._events.set(IncomingHeader.MARKETPLACE_ITEMS_SEARCHED, MarketplaceOffersReceivedEvent); this._events.set(IncomingHeader.MARKETPLACE_AFTER_ORDER_STATUS, MarketplaceBuyOfferResultEvent); + + // LANDING VIEW + this._events.set(IncomingHeader.COMMUNITY_GOAL_VOTE_EVENT, CommunityGoalVoteMessageEvent); + this._events.set(IncomingHeader.PROMO_ARTICLES, PromoArticlesMessageEvent); } private registerComposers(): void @@ -1060,6 +1068,10 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.USER_SETTINGS_OLD_CHAT, UserSettingsOldChatComposer); this._composers.set(OutgoingHeader.USER_SETTINGS_INVITES, UserSettingsRoomInvitesComposer); this._composers.set(OutgoingHeader.USER_SETTINGS_VOLUME, UserSettingsSoundComposer); + + // LANDING VIEW + this._composers.set(OutgoingHeader.COMMUNITY_GOAL_VOTE_COMPOSER, CommunityGoalVoteMessageComposer); + this._composers.set(OutgoingHeader.GET_PROMO_ARTICLES, GetPromoArticlesComposer); } public get events(): Map diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 4736b23b..eb3c98b0 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -252,4 +252,6 @@ export class IncomingHeader public static CATALOG_APPROVE_NAME_RESULT = 1503; public static OBJECTS_DATA_UPDATE = 1453; public static PET_EXPERIENCE = 2156; + public static COMMUNITY_GOAL_VOTE_EVENT = 1435; + public static PROMO_ARTICLES = 286; } diff --git a/src/nitro/communication/messages/incoming/landingview/PromoArticleData.ts b/src/nitro/communication/messages/incoming/landingview/PromoArticleData.ts new file mode 100644 index 00000000..9b7b086d --- /dev/null +++ b/src/nitro/communication/messages/incoming/landingview/PromoArticleData.ts @@ -0,0 +1,62 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; + +export class PromoArticleData +{ + public static readonly LINK_TYPE_URL = 0; + public static readonly LINK_TYPE_INTERNAL = 1; + public static readonly LINK_TYPE_NO_LINK = 2; + + private _id: number; + private _title: string; + private _bodyText: string; + private _buttonText: string; + private _linkType: number; + private _linkContent: string; + private _imageUrl: string; + + constructor(k: IMessageDataWrapper) + { + this._id = k.readInt(); + this._title = k.readString(); + this._bodyText = k.readString(); + this._buttonText = k.readString(); + this._linkType = k.readInt(); + this._linkContent = k.readString(); + this._imageUrl = k.readString(); + } + + public get id(): number + { + return this._id; + } + + public get title(): string + { + return this._title; + } + + public get bodyText(): string + { + return this._bodyText; + } + + public get buttonText(): string + { + return this._buttonText; + } + + public get linkType(): number + { + return this._linkType; + } + + public get linkContent(): string + { + return this._linkContent; + } + + public get imageUrl(): string + { + return this._imageUrl; + } +} diff --git a/src/nitro/communication/messages/incoming/landingview/PromoArticlesMessageEvent.ts b/src/nitro/communication/messages/incoming/landingview/PromoArticlesMessageEvent.ts new file mode 100644 index 00000000..53b66a91 --- /dev/null +++ b/src/nitro/communication/messages/incoming/landingview/PromoArticlesMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { PromoArticlesMessageParser } from '../../parser/landingview/PromoArticlesMessageParser'; + +export class PromoArticlesMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, PromoArticlesMessageParser); + } + + public getParser(): PromoArticlesMessageParser + { + return this.parser as PromoArticlesMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/landingview/votes/CommunityGoalVoteMessageEvent.ts b/src/nitro/communication/messages/incoming/landingview/votes/CommunityGoalVoteMessageEvent.ts new file mode 100644 index 00000000..f8e7a8bd --- /dev/null +++ b/src/nitro/communication/messages/incoming/landingview/votes/CommunityGoalVoteMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent'; +import { CommunityVoteReceivedParser } from '../../../parser/landingview/votes/CommunityVoteReceivedParser'; + +export class CommunityGoalVoteMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CommunityVoteReceivedParser); + } + + public getParser(): CommunityVoteReceivedParser + { + return this.parser as CommunityVoteReceivedParser; + } +} diff --git a/src/nitro/communication/messages/incoming/room/pet/PetBreedingResultData.ts b/src/nitro/communication/messages/incoming/room/pet/PetBreedingResultData.ts index 293d7133..6447c3d4 100644 --- a/src/nitro/communication/messages/incoming/room/pet/PetBreedingResultData.ts +++ b/src/nitro/communication/messages/incoming/room/pet/PetBreedingResultData.ts @@ -1,4 +1,4 @@ -export class PetBreedingResultData +export class PetBreedingResultData { private _stuffId: number; private _classId: number; diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 45309de5..d57fc463 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -246,4 +246,6 @@ export class OutgoingHeader public static TOGGLE_PET_BREEDING = 3379; public static UNSEEN_RESET_CATEGORY = 3493; public static UNSEEN_RESET_ITEMS = 2343; + public static COMMUNITY_GOAL_VOTE_COMPOSER = 3536; + public static GET_PROMO_ARTICLES = 1827; } diff --git a/src/nitro/communication/messages/outgoing/landingview/GetPromoArticlesComposer.ts b/src/nitro/communication/messages/outgoing/landingview/GetPromoArticlesComposer.ts new file mode 100644 index 00000000..672e5747 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/landingview/GetPromoArticlesComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetPromoArticlesComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer.ts b/src/nitro/communication/messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer.ts new file mode 100644 index 00000000..faa2a77c --- /dev/null +++ b/src/nitro/communication/messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; + +export class CommunityGoalVoteMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(voteOption: number) + { + this._data = [voteOption]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/parser/catalog/MarketplaceItemStatsParser.ts b/src/nitro/communication/messages/parser/catalog/MarketplaceItemStatsParser.ts index 25b5b897..b51fb5da 100644 --- a/src/nitro/communication/messages/parser/catalog/MarketplaceItemStatsParser.ts +++ b/src/nitro/communication/messages/parser/catalog/MarketplaceItemStatsParser.ts @@ -70,13 +70,13 @@ export class MarketplaceItemStatsParser implements IMessageParser this._averagePrices = []; this._soldAmounts = []; - for(let i = 0; i < count; i++) + for(let i = 0; i < count; i++) { this._dayOffsets.push(wrapper.readInt()); this._averagePrices.push(wrapper.readInt()); this._soldAmounts.push(wrapper.readInt()); } - + this._furniCategoryId = wrapper.readInt(); this._furniTypeId = wrapper.readInt(); return true; diff --git a/src/nitro/communication/messages/parser/landingview/PromoArticlesMessageParser.ts b/src/nitro/communication/messages/parser/landingview/PromoArticlesMessageParser.ts new file mode 100644 index 00000000..48af0f87 --- /dev/null +++ b/src/nitro/communication/messages/parser/landingview/PromoArticlesMessageParser.ts @@ -0,0 +1,33 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { PromoArticleData } from '../../incoming/landingview/PromoArticleData'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class PromoArticlesMessageParser implements IMessageParser +{ + private _articles: PromoArticleData[]; + + public flush(): boolean + { + this._articles = []; + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + const count = wrapper.readInt(); + + for(let i = 0; i < count; i++) + { + this._articles.push(new PromoArticleData(wrapper)); + } + + return true; + } + + public get articles(): PromoArticleData[] + { + return this._articles; + } +} diff --git a/src/nitro/communication/messages/parser/landingview/votes/CommunityVoteReceivedParser.ts b/src/nitro/communication/messages/parser/landingview/votes/CommunityVoteReceivedParser.ts new file mode 100644 index 00000000..21b9928c --- /dev/null +++ b/src/nitro/communication/messages/parser/landingview/votes/CommunityVoteReceivedParser.ts @@ -0,0 +1,24 @@ +import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from './../../../../../../core/communication/messages/IMessageParser'; + +export class CommunityVoteReceivedParser implements IMessageParser +{ + private _acknowledged: boolean; + + public flush(): boolean + { + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + this._acknowledged = wrapper.readBoolean(); + return true; + } + + public get acknowledged(): boolean + { + return this._acknowledged; + } +} diff --git a/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraConfigurationParser.ts b/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraConfigurationParser.ts index 5c4e809b..9fd54e6c 100644 --- a/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraConfigurationParser.ts +++ b/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraConfigurationParser.ts @@ -23,7 +23,7 @@ export class RoomWidgetCameraConfigurationParser implements IMessageParser this._credits = wrapper.readInt(); this._points = wrapper.readInt(); this._pointsType = wrapper.readInt(); - + return true; } diff --git a/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPublishedParser.ts b/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPublishedParser.ts index f68c41b8..4149d073 100644 --- a/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPublishedParser.ts +++ b/src/nitro/communication/messages/parser/room/camera/RoomWidgetCameraPublishedParser.ts @@ -23,7 +23,7 @@ export class RoomWidgetCameraPublishedParser implements IMessageParser this._wasSuccessful = wrapper.readBoolean(); this._cooldownSeconds = wrapper.readInt(); this._extraDataId = wrapper.readInt(); - + return true; } From 7d68944e98b233231c2bd8fc34b6b36bf3db30cd Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 21 Jul 2021 16:42:30 -0400 Subject: [PATCH 143/155] Make wardrobe page id optional --- .../messages/outgoing/user/wardrobe/UserWardrobePageComposer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nitro/communication/messages/outgoing/user/wardrobe/UserWardrobePageComposer.ts b/src/nitro/communication/messages/outgoing/user/wardrobe/UserWardrobePageComposer.ts index 80e35aa6..c1ffcf15 100644 --- a/src/nitro/communication/messages/outgoing/user/wardrobe/UserWardrobePageComposer.ts +++ b/src/nitro/communication/messages/outgoing/user/wardrobe/UserWardrobePageComposer.ts @@ -4,7 +4,7 @@ export class UserWardrobePageComposer implements IMessageComposer; - constructor(pageId: number) + constructor(pageId: number = 0) { this._data = [ pageId ]; } From c74432feabb4fbd8da7e354b1b0ce22724a3e46f Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 21 Jul 2021 18:17:58 -0500 Subject: [PATCH 144/155] added quest incoming messages --- src/nitro/communication/NitroMessages.ts | 24 +++ .../messages/incoming/IncomingHeader.ts | 11 ++ .../communication/messages/incoming/index.ts | 2 + .../messages/incoming/landingview/index.ts | 3 + .../incoming/landingview/votes/index.ts | 1 + .../incoming/quest/CommunityGoalData.ts | 96 +++++++++ .../CommunityGoalEarnedPrizesMessageEvent.ts | 16 ++ .../quest/CommunityGoalHallOfFameData.ts | 41 ++++ .../CommunityGoalHallOfFameMessageEvent.ts | 16 ++ .../CommunityGoalProgressMessageEvent.ts | 16 ++ ...ConcurrentUsersGoalProgressMessageEvent.ts | 16 ++ .../incoming/quest/EpicPopupMessageEvent.ts | 16 ++ .../incoming/quest/HallOfFameEntryData.ts | 45 +++++ .../incoming/quest/ILandingPageUserEntry.ts | 6 + .../messages/incoming/quest/PrizeData.ts | 51 +++++ .../quest/QuestCancelledMessageEvent.ts | 16 ++ .../quest/QuestCompletedMessageEvent.ts | 16 ++ .../incoming/quest/QuestDailyMessageEvent.ts | 16 ++ .../incoming/quest/QuestMessageData.ts | 186 ++++++++++++++++++ .../incoming/quest/QuestMessageEvent.ts | 16 ++ .../incoming/quest/QuestsMessageEvent.ts | 16 ++ .../quest/SeasonalQuestsMessageEvent.ts | 16 ++ .../messages/incoming/quest/index.ts | 17 ++ .../communication/messages/outgoing/index.ts | 1 + .../messages/outgoing/landingview/index.ts | 2 + .../outgoing/landingview/votes/index.ts | 1 + .../communication/messages/parser/index.ts | 2 + .../messages/parser/landingview/index.ts | 2 + .../parser/landingview/votes/index.ts | 1 + .../CommunityGoalEarnedPrizesMessageParser.ts | 31 +++ .../CommunityGoalHallOfFameMessageParser.ts | 27 +++ .../CommunityGoalProgressMessageParser.ts | 27 +++ ...oncurrentUsersGoalProgressMessageParser.ts | 42 ++++ .../parser/quest/EpicPopupMessageParser.ts | 26 +++ .../quest/QuestCancelledMessageParser.ts | 25 +++ .../quest/QuestCompletedMessageParser.ts | 34 ++++ .../parser/quest/QuestDailyMessageParser.ts | 45 +++++ .../parser/quest/QuestMessageParser.ts | 27 +++ .../parser/quest/QuestsMessageParser.ts | 41 ++++ .../parser/quest/SeasonalQuestsParser.ts | 33 ++++ .../messages/parser/quest/index.ts | 11 ++ 41 files changed, 1037 insertions(+) create mode 100644 src/nitro/communication/messages/incoming/landingview/index.ts create mode 100644 src/nitro/communication/messages/incoming/landingview/votes/index.ts create mode 100644 src/nitro/communication/messages/incoming/quest/CommunityGoalData.ts create mode 100644 src/nitro/communication/messages/incoming/quest/CommunityGoalEarnedPrizesMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/CommunityGoalHallOfFameData.ts create mode 100644 src/nitro/communication/messages/incoming/quest/CommunityGoalHallOfFameMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/CommunityGoalProgressMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/ConcurrentUsersGoalProgressMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/EpicPopupMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/HallOfFameEntryData.ts create mode 100644 src/nitro/communication/messages/incoming/quest/ILandingPageUserEntry.ts create mode 100644 src/nitro/communication/messages/incoming/quest/PrizeData.ts create mode 100644 src/nitro/communication/messages/incoming/quest/QuestCancelledMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/QuestCompletedMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/QuestDailyMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/QuestMessageData.ts create mode 100644 src/nitro/communication/messages/incoming/quest/QuestMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/QuestsMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/SeasonalQuestsMessageEvent.ts create mode 100644 src/nitro/communication/messages/incoming/quest/index.ts create mode 100644 src/nitro/communication/messages/outgoing/landingview/index.ts create mode 100644 src/nitro/communication/messages/outgoing/landingview/votes/index.ts create mode 100644 src/nitro/communication/messages/parser/landingview/index.ts create mode 100644 src/nitro/communication/messages/parser/landingview/votes/index.ts create mode 100644 src/nitro/communication/messages/parser/quest/CommunityGoalEarnedPrizesMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/CommunityGoalHallOfFameMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/CommunityGoalProgressMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/ConcurrentUsersGoalProgressMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/EpicPopupMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/QuestCancelledMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/QuestCompletedMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/QuestDailyMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/QuestMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/QuestsMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/SeasonalQuestsParser.ts create mode 100644 src/nitro/communication/messages/parser/quest/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 57d79fdf..6e9f2da8 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -113,6 +113,17 @@ import { NotificationDialogMessageEvent } from './messages/incoming/notification import { PetPlacingErrorEvent } from './messages/incoming/notifications/PetPlacingErrorEvent'; import { RespectReceivedEvent } from './messages/incoming/notifications/RespectReceivedEvent'; import { UnseenItemsEvent } from './messages/incoming/notifications/UnseenItemsEvent'; +import { CommunityGoalEarnedPrizesMessageEvent } from './messages/incoming/quest/CommunityGoalEarnedPrizesMessageEvent'; +import { CommunityGoalHallOfFameMessageEvent } from './messages/incoming/quest/CommunityGoalHallOfFameMessageEvent'; +import { CommunityGoalProgressMessageEvent } from './messages/incoming/quest/CommunityGoalProgressMessageEvent'; +import { ConcurrentUsersGoalProgressMessageEvent } from './messages/incoming/quest/ConcurrentUsersGoalProgressMessageEvent'; +import { EpicPopupMessageEvent } from './messages/incoming/quest/EpicPopupMessageEvent'; +import { QuestCancelledMessageEvent } from './messages/incoming/quest/QuestCancelledMessageEvent'; +import { QuestCompletedMessageEvent } from './messages/incoming/quest/QuestCompletedMessageEvent'; +import { QuestDailyMessageEvent } from './messages/incoming/quest/QuestDailyMessageEvent'; +import { QuestMessageEvent } from './messages/incoming/quest/QuestMessageEvent'; +import { QuestsMessageEvent } from './messages/incoming/quest/QuestsMessageEvent'; +import { SeasonalQuestsMessageEvent } from './messages/incoming/quest/SeasonalQuestsMessageEvent'; import { RoomDoorbellAcceptedEvent } from './messages/incoming/room/access/doorbell/RoomDoorbellAcceptedEvent'; import { RoomDoorbellEvent } from './messages/incoming/room/access/doorbell/RoomDoorbellEvent'; import { RoomDoorbellRejectedEvent } from './messages/incoming/room/access/doorbell/RoomDoorbellRejectedEvent'; @@ -753,6 +764,19 @@ export class NitroMessages implements IMessageConfiguration // LANDING VIEW this._events.set(IncomingHeader.COMMUNITY_GOAL_VOTE_EVENT, CommunityGoalVoteMessageEvent); this._events.set(IncomingHeader.PROMO_ARTICLES, PromoArticlesMessageEvent); + + // QUESTS + this._events.set(IncomingHeader.COMMUNITY_GOAL_EARNED_PRIZES, CommunityGoalEarnedPrizesMessageEvent); + this._events.set(IncomingHeader.COMMUNITY_GOAL_PROGRESS, CommunityGoalProgressMessageEvent); + this._events.set(IncomingHeader.CONCURRENT_USERS_GOAL_PROGRESS, ConcurrentUsersGoalProgressMessageEvent); + this._events.set(IncomingHeader.QUEST_DAILY, QuestDailyMessageEvent); + this._events.set(IncomingHeader.QUEST_CANCELLED, QuestCancelledMessageEvent); + this._events.set(IncomingHeader.QUEST_COMPLETED, QuestCompletedMessageEvent); + this._events.set(IncomingHeader.COMMUNITY_GOAL_HALL_OF_FAME, CommunityGoalHallOfFameMessageEvent); + this._events.set(IncomingHeader.EPIC_POPUP, EpicPopupMessageEvent); + this._events.set(IncomingHeader.SEASONAL_QUESTS, SeasonalQuestsMessageEvent); + this._events.set(IncomingHeader.QUESTS, QuestsMessageEvent); + this._events.set(IncomingHeader.QUEST, QuestMessageEvent); } private registerComposers(): void diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index eb3c98b0..247e5c3a 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -254,4 +254,15 @@ export class IncomingHeader public static PET_EXPERIENCE = 2156; public static COMMUNITY_GOAL_VOTE_EVENT = 1435; public static PROMO_ARTICLES = 286; + public static COMMUNITY_GOAL_EARNED_PRIZES = 3319; + public static COMMUNITY_GOAL_PROGRESS = 2525; + public static CONCURRENT_USERS_GOAL_PROGRESS = 2737; + public static QUEST_DAILY = 1878; + public static QUEST_CANCELLED = 3027; + public static QUEST_COMPLETED = 949; + public static COMMUNITY_GOAL_HALL_OF_FAME = 3005; + public static EPIC_POPUP = 3945; + public static SEASONAL_QUESTS = 1122; + public static QUESTS = 3625; + public static QUEST = 230; } diff --git a/src/nitro/communication/messages/incoming/index.ts b/src/nitro/communication/messages/incoming/index.ts index 5b2529cb..9cd40fbc 100644 --- a/src/nitro/communication/messages/incoming/index.ts +++ b/src/nitro/communication/messages/incoming/index.ts @@ -22,11 +22,13 @@ export * from './inventory/furni/gifts'; export * from './inventory/marketplace'; export * from './inventory/pets'; export * from './inventory/trading'; +export * from './landingview'; export * from './moderation'; export * from './modtool'; export * from './mysterybox'; export * from './navigator'; export * from './notifications'; +export * from './quest'; export * from './room'; export * from './room/access'; export * from './room/access/doorbell'; diff --git a/src/nitro/communication/messages/incoming/landingview/index.ts b/src/nitro/communication/messages/incoming/landingview/index.ts new file mode 100644 index 00000000..340e57ef --- /dev/null +++ b/src/nitro/communication/messages/incoming/landingview/index.ts @@ -0,0 +1,3 @@ +export * from './PromoArticleData'; +export * from './PromoArticlesMessageEvent'; +export * from './votes'; diff --git a/src/nitro/communication/messages/incoming/landingview/votes/index.ts b/src/nitro/communication/messages/incoming/landingview/votes/index.ts new file mode 100644 index 00000000..adcbb0e5 --- /dev/null +++ b/src/nitro/communication/messages/incoming/landingview/votes/index.ts @@ -0,0 +1 @@ +export * from './CommunityGoalVoteMessageEvent'; diff --git a/src/nitro/communication/messages/incoming/quest/CommunityGoalData.ts b/src/nitro/communication/messages/incoming/quest/CommunityGoalData.ts new file mode 100644 index 00000000..c61bf15c --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/CommunityGoalData.ts @@ -0,0 +1,96 @@ +import { IDisposable } from '../../../../../core/common/disposable/IDisposable'; +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; + +export class CommunityGoalData implements IDisposable +{ + private _hasGoalExpired: boolean; + private _personalContributionScore: number; + private _personalContributionRank: number; + private _communityTotalScore: number; + private _communityHighestAchievedLevel: number; + private _scoreRemainingUntilNextLevel: number; + private _percentCompletionTowardsNextLevel: number; + private _goalCode: string; + private _timeRemainingInSeconds: number; + private _rewardUserLimits: number[]; + + constructor(wrapper: IMessageDataWrapper) + { + this._rewardUserLimits = []; + this._hasGoalExpired = wrapper.readBoolean(); + this._personalContributionScore = wrapper.readInt(); + this._personalContributionRank = wrapper.readInt(); + this._communityTotalScore = wrapper.readInt(); + this._communityHighestAchievedLevel = wrapper.readInt(); + this._scoreRemainingUntilNextLevel = wrapper.readInt(); + this._percentCompletionTowardsNextLevel = wrapper.readInt(); + this._goalCode = wrapper.readString(); + this._timeRemainingInSeconds = wrapper.readInt(); + + const count = wrapper.readInt(); + for(let i = 0; i < count; i++) + { + this._rewardUserLimits.push(wrapper.readInt()); + } + } + + public dispose(): void + { + this._rewardUserLimits = null; + } + + public get disposed(): boolean + { + return this._rewardUserLimits == null; + } + + public get hasGoalExpired(): boolean + { + return this._hasGoalExpired; + } + + public get personalContributionScore(): number + { + return this._personalContributionScore; + } + + public get personalContributionRank(): number + { + return this._personalContributionRank; + } + + public get communityTotalScore(): number + { + return this._communityTotalScore; + } + + public get communityHighestAchievedLevel(): number + { + return this._communityHighestAchievedLevel; + } + + public get scoreRemainingUntilNextLevel(): number + { + return this._scoreRemainingUntilNextLevel; + } + + public get percentCompletionTowardsNextLevel(): number + { + return this._percentCompletionTowardsNextLevel; + } + + public get timeRemainingInSeconds(): number + { + return this._timeRemainingInSeconds; + } + + public get rewardUserLimits(): number[] + { + return this._rewardUserLimits; + } + + public get goalCode(): string + { + return this._goalCode; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/CommunityGoalEarnedPrizesMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/CommunityGoalEarnedPrizesMessageEvent.ts new file mode 100644 index 00000000..cba6f877 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/CommunityGoalEarnedPrizesMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CommunityGoalEarnedPrizesMessageParser } from '../../parser/quest/CommunityGoalEarnedPrizesMessageParser'; + +export class CommunityGoalEarnedPrizesMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CommunityGoalEarnedPrizesMessageParser); + } + + public getParser(): CommunityGoalEarnedPrizesMessageParser + { + return this.parser as CommunityGoalEarnedPrizesMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/CommunityGoalHallOfFameData.ts b/src/nitro/communication/messages/incoming/quest/CommunityGoalHallOfFameData.ts new file mode 100644 index 00000000..13d06d47 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/CommunityGoalHallOfFameData.ts @@ -0,0 +1,41 @@ +import { IDisposable } from '../../../../../core/common/disposable/IDisposable'; +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { HallOfFameEntryData } from './HallOfFameEntryData'; + +export class CommunityGoalHallOfFameData implements IDisposable +{ + private _goalCode: string; + private _hof: HallOfFameEntryData[]; + + constructor(wrapper: IMessageDataWrapper) + { + this._hof = []; + this._goalCode = wrapper.readString(); + + const count = wrapper.readInt(); + for(let i = 0; i < count; i++) + { + this._hof.push(new HallOfFameEntryData(wrapper)); + } + } + + public dispose(): void + { + this._hof = null; + } + + public get disposed(): boolean + { + return this._hof == null; + } + + public get hof(): HallOfFameEntryData[] + { + return this._hof; + } + + public get goalCode(): string + { + return this._goalCode; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/CommunityGoalHallOfFameMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/CommunityGoalHallOfFameMessageEvent.ts new file mode 100644 index 00000000..f742686b --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/CommunityGoalHallOfFameMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CommunityGoalHallOfFameMessageParser } from '../../parser/quest/CommunityGoalHallOfFameMessageParser'; + +export class CommunityGoalHallOfFameMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CommunityGoalHallOfFameMessageParser); + } + + public getParser(): CommunityGoalHallOfFameMessageParser + { + return this.parser as CommunityGoalHallOfFameMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/CommunityGoalProgressMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/CommunityGoalProgressMessageEvent.ts new file mode 100644 index 00000000..8f9519fc --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/CommunityGoalProgressMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CommunityGoalProgressMessageParser } from '../../parser/quest/CommunityGoalProgressMessageParser'; + +export class CommunityGoalProgressMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CommunityGoalProgressMessageParser); + } + + public getParser(): CommunityGoalProgressMessageParser + { + return this.parser as CommunityGoalProgressMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/ConcurrentUsersGoalProgressMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/ConcurrentUsersGoalProgressMessageEvent.ts new file mode 100644 index 00000000..79fc4c8f --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/ConcurrentUsersGoalProgressMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { ConcurrentUsersGoalProgressMessageParser } from '../../parser/quest/ConcurrentUsersGoalProgressMessageParser'; + +export class ConcurrentUsersGoalProgressMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, ConcurrentUsersGoalProgressMessageParser); + } + + public getParser(): ConcurrentUsersGoalProgressMessageParser + { + return this.parser as ConcurrentUsersGoalProgressMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/EpicPopupMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/EpicPopupMessageEvent.ts new file mode 100644 index 00000000..7080827a --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/EpicPopupMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { EpicPopupMessageParser } from '../../parser/quest/EpicPopupMessageParser'; + +export class EpicPopupMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, EpicPopupMessageParser); + } + + public getParser(): EpicPopupMessageParser + { + return this.parser as EpicPopupMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/HallOfFameEntryData.ts b/src/nitro/communication/messages/incoming/quest/HallOfFameEntryData.ts new file mode 100644 index 00000000..30130b7f --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/HallOfFameEntryData.ts @@ -0,0 +1,45 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { ILandingPageUserEntry } from './ILandingPageUserEntry'; + +export class HallOfFameEntryData implements ILandingPageUserEntry +{ + private _userId: number; + private _userName: string; + private _figure: string; + private _rank: number; + private _currentScore: number; + + constructor(wrapper: IMessageDataWrapper) + { + this._userId = wrapper.readInt(); + this._userName = wrapper.readString(); + this._figure = wrapper.readString(); + this._rank = wrapper.readInt(); + this._currentScore = wrapper.readInt(); + } + + public get userId(): number + { + return this._userId; + } + + public get userName(): string + { + return this._userName; + } + + public get figure(): string + { + return this._figure; + } + + public get rank(): number + { + return this._rank; + } + + public get currentScore(): number + { + return this._currentScore; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/ILandingPageUserEntry.ts b/src/nitro/communication/messages/incoming/quest/ILandingPageUserEntry.ts new file mode 100644 index 00000000..060628d4 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/ILandingPageUserEntry.ts @@ -0,0 +1,6 @@ +export interface ILandingPageUserEntry +{ + get userId(): number; + get userName(): string; + get figure(): string; +} diff --git a/src/nitro/communication/messages/incoming/quest/PrizeData.ts b/src/nitro/communication/messages/incoming/quest/PrizeData.ts new file mode 100644 index 00000000..092c77c8 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/PrizeData.ts @@ -0,0 +1,51 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; + +export class PrizeData +{ + private _communityGoalId: number; + private _communityGoalCode: string; + private _userRank: number; + private _rewardCode: string; + private _badge: boolean; + private _localizedName: string; + + constructor(k: IMessageDataWrapper) + { + this._communityGoalId = k.readInt(); + this._communityGoalCode = k.readString(); + this._userRank = k.readInt(); + this._rewardCode = k.readString(); + this._badge = k.readBoolean(); + this._localizedName = k.readString(); + } + + public get communityGoalId(): number + { + return this._communityGoalId; + } + + public get communityGoalCode(): string + { + return this._communityGoalCode; + } + + public get userRank(): number + { + return this._userRank; + } + + public get rewardCode(): string + { + return this._rewardCode; + } + + public get badge(): boolean + { + return this._badge; + } + + public get localizedName(): string + { + return this._localizedName; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/QuestCancelledMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/QuestCancelledMessageEvent.ts new file mode 100644 index 00000000..487ca547 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/QuestCancelledMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuestCancelledMessageParser } from '../../parser/quest/QuestCancelledMessageParser'; + +export class QuestCancelledMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuestCancelledMessageParser); + } + + public getParser(): QuestCancelledMessageParser + { + return this.parser as QuestCancelledMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/QuestCompletedMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/QuestCompletedMessageEvent.ts new file mode 100644 index 00000000..8dd49e75 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/QuestCompletedMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuestCompletedMessageParser } from '../../parser/quest/QuestCompletedMessageParser'; + +export class QuestCompletedMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuestCompletedMessageParser); + } + + public getParser(): QuestCompletedMessageParser + { + return this.parser as QuestCompletedMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/QuestDailyMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/QuestDailyMessageEvent.ts new file mode 100644 index 00000000..886c4906 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/QuestDailyMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuestDailyMessageParser } from '../../parser/quest/QuestDailyMessageParser'; + +export class QuestDailyMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuestDailyMessageParser); + } + + public getParser(): QuestDailyMessageParser + { + return this.parser as QuestDailyMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/QuestMessageData.ts b/src/nitro/communication/messages/incoming/quest/QuestMessageData.ts new file mode 100644 index 00000000..3d142584 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/QuestMessageData.ts @@ -0,0 +1,186 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; + +export class QuestMessageData +{ + private _campaignCode: string; + private _completedQuestsInCampaign: number; + private _questCountInCampaign: number; + private _activityPointType: number; + private _id: number; + private _accepted: boolean; + private _type: string; + private _imageVersion: string; + private _rewardCurrencyAmount: number; + private _localizationCode: string; + private _completedSteps: number; + private _totalSteps: number; + private _waitPeriodSeconds: number; + private _sortOrder: number; + private _catalogPageName: string; + private _chainCode: string; + private _easy: boolean; + private _receiveTime: Date; + + constructor(wrapper: IMessageDataWrapper) + { + this._receiveTime = new Date(); + this._campaignCode = wrapper.readString(); + this._completedQuestsInCampaign = wrapper.readInt(); + this._questCountInCampaign = wrapper.readInt(); + this._activityPointType = wrapper.readInt(); + this._id = wrapper.readInt(); + this._accepted = wrapper.readBoolean(); + this._type = wrapper.readString(); + this._imageVersion = wrapper.readString(); + this._rewardCurrencyAmount = wrapper.readInt(); + this._localizationCode = wrapper.readString(); + this._completedSteps = wrapper.readInt(); + this._totalSteps = wrapper.readInt(); + this._sortOrder = wrapper.readInt(); + this._catalogPageName = wrapper.readString(); + this._chainCode = wrapper.readString(); + this._easy = wrapper.readBoolean(); + } + + public static getCampaignLocalizationKeyForCode(k: string): string + { + return 'quests.' + k; + } + + public get campaignCode(): string + { + return this._campaignCode; + } + + public get localizationCode(): string + { + return this._localizationCode; + } + + public get completedQuestsInCampaign(): number + { + return this._completedQuestsInCampaign; + } + + public get questCountInCampaign(): number + { + return this._questCountInCampaign; + } + + public get activityPointType(): number + { + return this._activityPointType; + } + + public set accepted(k: boolean) + { + this._accepted = k; + } + + public get accepted(): boolean + { + return this._accepted; + } + + public set id(k: number) + { + this._id = k; + } + + public get id(): number + { + return this._id; + } + + public get type(): string + { + return this._type; + } + + public get imageVersion(): string + { + return this._imageVersion; + } + + public get rewardCurrencyAmount(): number + { + return this._rewardCurrencyAmount; + } + + public get completedSteps(): number + { + return this._completedSteps; + } + + public get totalSteps(): number + { + return this._totalSteps; + } + + public get isCompleted(): boolean + { + return this._completedSteps == this._totalSteps; + } + + public set waitPeriodSeconds(k: number) + { + this._waitPeriodSeconds = k; + } + + public get waitPeriodSeconds(): number + { + if(this._waitPeriodSeconds < 1) + { + return 0; + } + const k = new Date(); + const _local_2 = (k.getTime() - this._receiveTime.getTime()); + const _local_3 = Math.max(0, (this._waitPeriodSeconds - Math.floor((_local_2 / 1000)))); + return _local_3; + } + + public getCampaignLocalizationKey(): string + { + return QuestMessageData.getCampaignLocalizationKeyForCode(this.campaignCode); + } + + public getQuestLocalizationKey(): string + { + return (this.getCampaignLocalizationKey() + '.') + this._localizationCode; + } + + public get completedCampaign(): boolean + { + return this._id < 1; + } + + public get lastQuestInCampaign(): boolean + { + return this._completedQuestsInCampaign >= this._questCountInCampaign; + } + + public get receiveTime(): Date + { + return this._receiveTime; + } + + public get sortOrder(): number + { + return this._sortOrder; + } + + public get catalogPageName(): string + { + return this._catalogPageName; + } + + public get chainCode(): string + { + return this._chainCode; + } + + public get easy(): boolean + { + return this._easy; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/QuestMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/QuestMessageEvent.ts new file mode 100644 index 00000000..a92ecad2 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/QuestMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuestMessageParser } from '../../parser/quest/QuestMessageParser'; + +export class QuestMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuestMessageParser); + } + + public getParser(): QuestMessageParser + { + return this.parser as QuestMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/QuestsMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/QuestsMessageEvent.ts new file mode 100644 index 00000000..ca737872 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/QuestsMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { QuestsMessageParser } from '../../parser/quest/QuestsMessageParser'; + +export class QuestsMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, QuestsMessageParser); + } + + public getParser(): QuestsMessageParser + { + return this.parser as QuestsMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/SeasonalQuestsMessageEvent.ts b/src/nitro/communication/messages/incoming/quest/SeasonalQuestsMessageEvent.ts new file mode 100644 index 00000000..f1de7034 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/SeasonalQuestsMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { SeasonalQuestsParser } from '../../parser/quest/SeasonalQuestsParser'; + +export class SeasonalQuestsMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, SeasonalQuestsParser); + } + + public getParser(): SeasonalQuestsParser + { + return this.parser as SeasonalQuestsParser; + } +} diff --git a/src/nitro/communication/messages/incoming/quest/index.ts b/src/nitro/communication/messages/incoming/quest/index.ts new file mode 100644 index 00000000..23e9be95 --- /dev/null +++ b/src/nitro/communication/messages/incoming/quest/index.ts @@ -0,0 +1,17 @@ +export * from './CommunityGoalData'; +export * from './CommunityGoalEarnedPrizesMessageEvent'; +export * from './CommunityGoalHallOfFameData'; +export * from './CommunityGoalHallOfFameMessageEvent'; +export * from './CommunityGoalProgressMessageEvent'; +export * from './ConcurrentUsersGoalProgressMessageEvent'; +export * from './EpicPopupMessageEvent'; +export * from './HallOfFameEntryData'; +export * from './ILandingPageUserEntry'; +export * from './PrizeData'; +export * from './QuestCancelledMessageEvent'; +export * from './QuestCompletedMessageEvent'; +export * from './QuestDailyMessageEvent'; +export * from './QuestMessageData'; +export * from './QuestMessageEvent'; +export * from './QuestsMessageEvent'; +export * from './SeasonalQuestsMessageEvent'; diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index 5379101f..b2b29f7c 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -6,6 +6,7 @@ export * from './friendlist'; export * from './group'; export * from './handshake'; export * from './inventory'; +export * from './landingview'; export * from './modtool'; export * from './navigator'; export * from './OutgoingHeader'; diff --git a/src/nitro/communication/messages/outgoing/landingview/index.ts b/src/nitro/communication/messages/outgoing/landingview/index.ts new file mode 100644 index 00000000..9adfb30d --- /dev/null +++ b/src/nitro/communication/messages/outgoing/landingview/index.ts @@ -0,0 +1,2 @@ +export * from './GetPromoArticlesComposer'; +export * from './votes'; diff --git a/src/nitro/communication/messages/outgoing/landingview/votes/index.ts b/src/nitro/communication/messages/outgoing/landingview/votes/index.ts new file mode 100644 index 00000000..ceaf9d7f --- /dev/null +++ b/src/nitro/communication/messages/outgoing/landingview/votes/index.ts @@ -0,0 +1 @@ +export * from './CommunityGoalVoteMessageComposer'; diff --git a/src/nitro/communication/messages/parser/index.ts b/src/nitro/communication/messages/parser/index.ts index 1614562a..821f7d5f 100644 --- a/src/nitro/communication/messages/parser/index.ts +++ b/src/nitro/communication/messages/parser/index.ts @@ -9,11 +9,13 @@ export * from './generic'; export * from './group'; export * from './help'; export * from './inventory'; +export * from './landingview'; export * from './moderation'; export * from './modtool'; export * from './mysterybox'; export * from './navigator'; export * from './notifications'; +export * from './quest'; export * from './room'; export * from './roomevents'; export * from './security'; diff --git a/src/nitro/communication/messages/parser/landingview/index.ts b/src/nitro/communication/messages/parser/landingview/index.ts new file mode 100644 index 00000000..40b224db --- /dev/null +++ b/src/nitro/communication/messages/parser/landingview/index.ts @@ -0,0 +1,2 @@ +export * from './PromoArticlesMessageParser'; +export * from './votes'; diff --git a/src/nitro/communication/messages/parser/landingview/votes/index.ts b/src/nitro/communication/messages/parser/landingview/votes/index.ts new file mode 100644 index 00000000..4a0e00f2 --- /dev/null +++ b/src/nitro/communication/messages/parser/landingview/votes/index.ts @@ -0,0 +1 @@ +export * from './CommunityVoteReceivedParser'; diff --git a/src/nitro/communication/messages/parser/quest/CommunityGoalEarnedPrizesMessageParser.ts b/src/nitro/communication/messages/parser/quest/CommunityGoalEarnedPrizesMessageParser.ts new file mode 100644 index 00000000..7fcbeb02 --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/CommunityGoalEarnedPrizesMessageParser.ts @@ -0,0 +1,31 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { PrizeData } from '../../incoming/quest/PrizeData'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class CommunityGoalEarnedPrizesMessageParser implements IMessageParser +{ + private _prizes: PrizeData[]; + + public flush(): boolean + { + this._prizes = []; + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + const count = wrapper.readInt(); + for(let i = 0; i < count; i++) + { + this._prizes.push(new PrizeData(wrapper)); + } + return true; + } + + public get prizes(): PrizeData[] + { + return this._prizes; + } +} diff --git a/src/nitro/communication/messages/parser/quest/CommunityGoalHallOfFameMessageParser.ts b/src/nitro/communication/messages/parser/quest/CommunityGoalHallOfFameMessageParser.ts new file mode 100644 index 00000000..f8210399 --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/CommunityGoalHallOfFameMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { CommunityGoalHallOfFameData } from '../../incoming/quest/CommunityGoalHallOfFameData'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class CommunityGoalHallOfFameMessageParser implements IMessageParser +{ + private _data: CommunityGoalHallOfFameData; + + public flush(): boolean + { + this._data = null; + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._data = new CommunityGoalHallOfFameData(wrapper); + return true; + } + + public get data(): CommunityGoalHallOfFameData + { + return this._data; + } +} diff --git a/src/nitro/communication/messages/parser/quest/CommunityGoalProgressMessageParser.ts b/src/nitro/communication/messages/parser/quest/CommunityGoalProgressMessageParser.ts new file mode 100644 index 00000000..5f06505a --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/CommunityGoalProgressMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { CommunityGoalData } from '../../incoming/quest/CommunityGoalData'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class CommunityGoalProgressMessageParser implements IMessageParser +{ + private _data: CommunityGoalData; + + public flush(): boolean + { + this._data = null; + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._data = new CommunityGoalData(wrapper); + return true; + } + + public get data(): CommunityGoalData + { + return this._data; + } +} diff --git a/src/nitro/communication/messages/parser/quest/ConcurrentUsersGoalProgressMessageParser.ts b/src/nitro/communication/messages/parser/quest/ConcurrentUsersGoalProgressMessageParser.ts new file mode 100644 index 00000000..af597b4d --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/ConcurrentUsersGoalProgressMessageParser.ts @@ -0,0 +1,42 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class ConcurrentUsersGoalProgressMessageParser implements IMessageParser +{ + private _state: number; + private _userCount: number; + private _userCountGoal: number; + + public flush(): boolean + { + this._state = -1; + this._userCount = -1; + this._userCountGoal = -1; + return true; + } + + public parse(wrapper:IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._state = wrapper.readInt(); + this._userCount = wrapper.readInt(); + this._userCountGoal = wrapper.readInt(); + return true; + } + + public get state(): number + { + return this._state; + } + + public get userCount(): number + { + return this._userCount; + } + + public get userCountGoal(): number + { + return this._userCountGoal; + } +} diff --git a/src/nitro/communication/messages/parser/quest/EpicPopupMessageParser.ts b/src/nitro/communication/messages/parser/quest/EpicPopupMessageParser.ts new file mode 100644 index 00000000..a9caa21a --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/EpicPopupMessageParser.ts @@ -0,0 +1,26 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class EpicPopupMessageParser implements IMessageParser +{ + private _imageUri: string; + + public flush(): boolean + { + this._imageUri = ''; + return true; + } + + public parse(wrapper:IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._imageUri = wrapper.readString(); + return true; + } + + public get imageUri():string + { + return this._imageUri; + } +} diff --git a/src/nitro/communication/messages/parser/quest/QuestCancelledMessageParser.ts b/src/nitro/communication/messages/parser/quest/QuestCancelledMessageParser.ts new file mode 100644 index 00000000..797ebaf4 --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/QuestCancelledMessageParser.ts @@ -0,0 +1,25 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class QuestCancelledMessageParser implements IMessageParser +{ + private _expired: boolean; + + public flush(): boolean + { + return true; + } + + public parse(wrapper:IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._expired = wrapper.readBoolean(); + return true; + } + + public get expired(): boolean + { + return this._expired; + } +} diff --git a/src/nitro/communication/messages/parser/quest/QuestCompletedMessageParser.ts b/src/nitro/communication/messages/parser/quest/QuestCompletedMessageParser.ts new file mode 100644 index 00000000..3d3a1c01 --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/QuestCompletedMessageParser.ts @@ -0,0 +1,34 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { QuestMessageData } from '../../incoming/quest/QuestMessageData'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class QuestCompletedMessageParser implements IMessageParser +{ + private _questData: QuestMessageData; + private _showDialog: boolean; + + public flush(): boolean + { + this._questData = null; + return true; + } + + public parse(wrapper:IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._questData = new QuestMessageData(wrapper); + this._showDialog = wrapper.readBoolean(); + return true; + } + + public get questData():QuestMessageData + { + return this._questData; + } + + public get showDialog(): boolean + { + return this._showDialog; + } +} diff --git a/src/nitro/communication/messages/parser/quest/QuestDailyMessageParser.ts b/src/nitro/communication/messages/parser/quest/QuestDailyMessageParser.ts new file mode 100644 index 00000000..64d0f911 --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/QuestDailyMessageParser.ts @@ -0,0 +1,45 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { QuestMessageData } from '../../incoming/quest/QuestMessageData'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class QuestDailyMessageParser implements IMessageParser +{ + private _quest:QuestMessageData; + private _easyQuestCount:number; + private _hardQuestCount:number; + + public flush(): boolean + { + this._quest = null; + return true; + } + + public parse(wrapper:IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + const _local_2 = wrapper.readBoolean(); + if(_local_2) + { + this._quest = new QuestMessageData(wrapper); + this._easyQuestCount = wrapper.readInt(); + this._hardQuestCount = wrapper.readInt(); + } + return true; + } + + public get quest(): QuestMessageData + { + return this._quest; + } + + public get easyQuestCount(): number + { + return this._easyQuestCount; + } + + public get hardQuestCount(): number + { + return this._hardQuestCount; + } +} diff --git a/src/nitro/communication/messages/parser/quest/QuestMessageParser.ts b/src/nitro/communication/messages/parser/quest/QuestMessageParser.ts new file mode 100644 index 00000000..241c07d7 --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/QuestMessageParser.ts @@ -0,0 +1,27 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { QuestMessageData } from '../../incoming/quest/QuestMessageData'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class QuestMessageParser implements IMessageParser +{ + private _quest: QuestMessageData; + + public flush(): boolean + { + this._quest = null; + return true; + } + + public parse(wrapper:IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._quest = new QuestMessageData(wrapper); + return true; + } + + public get quest():QuestMessageData + { + return this._quest; + } +} diff --git a/src/nitro/communication/messages/parser/quest/QuestsMessageParser.ts b/src/nitro/communication/messages/parser/quest/QuestsMessageParser.ts new file mode 100644 index 00000000..6695905c --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/QuestsMessageParser.ts @@ -0,0 +1,41 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser'; +import { QuestMessageData } from '../../incoming/quest/QuestMessageData'; + +export class QuestsMessageParser implements IMessageParser +{ + private _quests: QuestMessageData[]; + private _openWindow: boolean; + + + public flush(): boolean + { + this._quests = []; + return true; + } + + public parse(wrapper:IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + const count = wrapper.readInt(); + + for(let i = 0; i < count; i++) + { + this._quests.push(new QuestMessageData(wrapper)); + } + + this._openWindow = wrapper.readBoolean(); + return true; + } + + public get quests(): QuestMessageData[] + { + return this._quests; + } + + public get openWindow(): boolean + { + return this._openWindow; + } +} diff --git a/src/nitro/communication/messages/parser/quest/SeasonalQuestsParser.ts b/src/nitro/communication/messages/parser/quest/SeasonalQuestsParser.ts new file mode 100644 index 00000000..2ddece51 --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/SeasonalQuestsParser.ts @@ -0,0 +1,33 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { QuestMessageData } from '../../incoming/quest/QuestMessageData'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class SeasonalQuestsParser implements IMessageParser +{ + private _quests: QuestMessageData[]; + + public flush(): boolean + { + this._quests = []; + return true; + } + + public parse(wrapper:IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + const count = wrapper.readInt(); + + for(let i = 0; i < count; i++) + { + this._quests.push(new QuestMessageData(wrapper)); + } + + return true; + } + + public get quests(): QuestMessageData[] + { + return this._quests; + } +} diff --git a/src/nitro/communication/messages/parser/quest/index.ts b/src/nitro/communication/messages/parser/quest/index.ts new file mode 100644 index 00000000..c96e9fed --- /dev/null +++ b/src/nitro/communication/messages/parser/quest/index.ts @@ -0,0 +1,11 @@ +export * from './CommunityGoalEarnedPrizesMessageParser'; +export * from './CommunityGoalHallOfFameMessageParser'; +export * from './CommunityGoalProgressMessageParser'; +export * from './ConcurrentUsersGoalProgressMessageParser'; +export * from './EpicPopupMessageParser'; +export * from './QuestCancelledMessageParser'; +export * from './QuestCompletedMessageParser'; +export * from './QuestDailyMessageParser'; +export * from './QuestMessageParser'; +export * from './QuestsMessageParser'; +export * from './SeasonalQuestsParser'; From 0c481542740a00f5d2a580c552d795414be10a62 Mon Sep 17 00:00:00 2001 From: Bill Date: Wed, 21 Jul 2021 20:05:47 -0400 Subject: [PATCH 145/155] Fix interface error --- .../messages/incoming/quest/ILandingPageUserEntry.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nitro/communication/messages/incoming/quest/ILandingPageUserEntry.ts b/src/nitro/communication/messages/incoming/quest/ILandingPageUserEntry.ts index 060628d4..02362a8e 100644 --- a/src/nitro/communication/messages/incoming/quest/ILandingPageUserEntry.ts +++ b/src/nitro/communication/messages/incoming/quest/ILandingPageUserEntry.ts @@ -1,6 +1,6 @@ export interface ILandingPageUserEntry { - get userId(): number; - get userName(): string; - get figure(): string; + userId: number; + userName: string; + figure: string; } From d2dbdc2f0ec80a9c840a189cc3bba7ec4d9ad77f Mon Sep 17 00:00:00 2001 From: Dank074 Date: Wed, 21 Jul 2021 19:22:23 -0500 Subject: [PATCH 146/155] added outgoing quest messages --- src/nitro/communication/NitroMessages.ts | 33 +++++++++++++++++++ .../messages/outgoing/OutgoingHeader.ts | 16 +++++++++ .../communication/messages/outgoing/index.ts | 1 + .../quest/AcceptQuestMessageComposer.ts | 21 ++++++++++++ .../quest/ActivateQuestMessageComposer.ts | 21 ++++++++++++ .../quest/CancelQuestMessageComposer.ts | 21 ++++++++++++ ...iendRequestQuestCompleteMessageComposer.ts | 21 ++++++++++++ ...ommunityGoalEarnedPrizesMessageComposer.ts | 21 ++++++++++++ ...tCommunityGoalHallOfFameMessageComposer.ts | 21 ++++++++++++ ...GetCommunityGoalProgressMessageComposer.ts | 21 ++++++++++++ ...currentUsersGoalProgressMessageComposer.ts | 21 ++++++++++++ ...GetConcurrentUsersRewardMessageComposer.ts | 21 ++++++++++++ .../quest/GetDailyQuestMessageComposer.ts | 21 ++++++++++++ .../quest/GetQuestsMessageComposer.ts | 21 ++++++++++++ .../GetSeasonalQuestsOnlyMessageComposer.ts | 21 ++++++++++++ .../quest/OpenQuestTrackerMessageComposer.ts | 21 ++++++++++++ ...RedeemCommunityGoalPrizeMessageComposer.ts | 21 ++++++++++++ .../quest/RejectQuestMessageComposer.ts | 21 ++++++++++++ .../quest/StartCampaignMessageComposer.ts | 21 ++++++++++++ .../messages/outgoing/quest/index.ts | 16 +++++++++ 20 files changed, 402 insertions(+) create mode 100644 src/nitro/communication/messages/outgoing/quest/AcceptQuestMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/ActivateQuestMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/CancelQuestMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/FriendRequestQuestCompleteMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/GetCommunityGoalEarnedPrizesMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/GetCommunityGoalHallOfFameMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/GetCommunityGoalProgressMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/GetConcurrentUsersGoalProgressMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/GetConcurrentUsersRewardMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/GetDailyQuestMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/GetQuestsMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/GetSeasonalQuestsOnlyMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/OpenQuestTrackerMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/RedeemCommunityGoalPrizeMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/RejectQuestMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/StartCampaignMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/quest/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 6e9f2da8..b573d2f7 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -325,6 +325,22 @@ import { NavigatorSettingsSaveComposer } from './messages/outgoing/navigator/Nav import { OutgoingHeader } from './messages/outgoing/OutgoingHeader'; import { PetRespectComposer } from './messages/outgoing/pet/PetRespectComposer'; import { RequestPetInfoComposer } from './messages/outgoing/pet/RequestPetInfoComposer'; +import { AcceptQuestMessageComposer } from './messages/outgoing/quest/AcceptQuestMessageComposer'; +import { ActivateQuestMessageComposer } from './messages/outgoing/quest/ActivateQuestMessageComposer'; +import { CancelQuestMessageComposer } from './messages/outgoing/quest/CancelQuestMessageComposer'; +import { FriendRequestQuestCompleteMessageComposer } from './messages/outgoing/quest/FriendRequestQuestCompleteMessageComposer'; +import { GetCommunityGoalEarnedPrizesMessageComposer } from './messages/outgoing/quest/GetCommunityGoalEarnedPrizesMessageComposer'; +import { GetCommunityGoalHallOfFameMessageComposer } from './messages/outgoing/quest/GetCommunityGoalHallOfFameMessageComposer'; +import { GetCommunityGoalProgressMessageComposer } from './messages/outgoing/quest/GetCommunityGoalProgressMessageComposer'; +import { GetConcurrentUsersGoalProgressMessageComposer } from './messages/outgoing/quest/GetConcurrentUsersGoalProgressMessageComposer'; +import { GetConcurrentUsersRewardMessageComposer } from './messages/outgoing/quest/GetConcurrentUsersRewardMessageComposer'; +import { GetDailyQuestMessageComposer } from './messages/outgoing/quest/GetDailyQuestMessageComposer'; +import { GetQuestsMessageComposer } from './messages/outgoing/quest/GetQuestsMessageComposer'; +import { GetSeasonalQuestsOnlyMessageComposer } from './messages/outgoing/quest/GetSeasonalQuestsOnlyMessageComposer'; +import { OpenQuestTrackerMessageComposer } from './messages/outgoing/quest/OpenQuestTrackerMessageComposer'; +import { RedeemCommunityGoalPrizeMessageComposer } from './messages/outgoing/quest/RedeemCommunityGoalPrizeMessageComposer'; +import { RejectQuestMessageComposer } from './messages/outgoing/quest/RejectQuestMessageComposer'; +import { StartCampaignMessageComposer } from './messages/outgoing/quest/StartCampaignMessageComposer'; import { RoomDoorbellAccessComposer } from './messages/outgoing/room/access/RoomDoorbellAccessComposer'; import { RoomEnterComposer } from './messages/outgoing/room/access/RoomEnterComposer'; import { RoomAmbassadorAlertComposer } from './messages/outgoing/room/action/RoomAmbassadorAlertComposer'; @@ -1096,6 +1112,23 @@ export class NitroMessages implements IMessageConfiguration // LANDING VIEW this._composers.set(OutgoingHeader.COMMUNITY_GOAL_VOTE_COMPOSER, CommunityGoalVoteMessageComposer); this._composers.set(OutgoingHeader.GET_PROMO_ARTICLES, GetPromoArticlesComposer); + + this._composers.set(OutgoingHeader.ACCEPT_QUEST, AcceptQuestMessageComposer); + this._composers.set(OutgoingHeader.ACTIVATE_QUEST, ActivateQuestMessageComposer); + this._composers.set(OutgoingHeader.CANCEL_QUEST, CancelQuestMessageComposer); + this._composers.set(OutgoingHeader.FRIEND_REQUEST_QUEST_COMPLETE, FriendRequestQuestCompleteMessageComposer); + this._composers.set(OutgoingHeader.GET_COMMUNITY_GOAL_EARNED_PRIZES, GetCommunityGoalEarnedPrizesMessageComposer); + this._composers.set(OutgoingHeader.GET_COMMUNITY_GOAL_HALL_OF_FAME, GetCommunityGoalHallOfFameMessageComposer); + this._composers.set(OutgoingHeader.GET_COMMUNITY_GOAL_PROGRESS, GetCommunityGoalProgressMessageComposer); + this._composers.set(OutgoingHeader.GET_CONCURRENT_USERS_GOAL_PROGRESS, GetConcurrentUsersGoalProgressMessageComposer); + this._composers.set(OutgoingHeader.GET_CONCURRENT_USERS_REWARD, GetConcurrentUsersRewardMessageComposer); + this._composers.set(OutgoingHeader.GET_DAILY_QUEST, GetDailyQuestMessageComposer); + this._composers.set(OutgoingHeader.GET_QUESTS, GetQuestsMessageComposer); + this._composers.set(OutgoingHeader.GET_SEASONAL_QUESTS_ONLY, GetSeasonalQuestsOnlyMessageComposer); + this._composers.set(OutgoingHeader.OPEN_QUEST_TRACKER, OpenQuestTrackerMessageComposer); + this._composers.set(OutgoingHeader.REDEEM_COMMUNITY_GOAL_PRIZE, RedeemCommunityGoalPrizeMessageComposer); + this._composers.set(OutgoingHeader.REJECT_QUEST, RejectQuestMessageComposer); + this._composers.set(OutgoingHeader.START_CAMPAIGN, StartCampaignMessageComposer); } public get events(): Map diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index d57fc463..367f695c 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -248,4 +248,20 @@ export class OutgoingHeader public static UNSEEN_RESET_ITEMS = 2343; public static COMMUNITY_GOAL_VOTE_COMPOSER = 3536; public static GET_PROMO_ARTICLES = 1827; + public static ACCEPT_QUEST = 3604; + public static ACTIVATE_QUEST = 793; + public static CANCEL_QUEST = 3133; + public static FRIEND_REQUEST_QUEST_COMPLETE = 1148; + public static GET_COMMUNITY_GOAL_EARNED_PRIZES = 2688; + public static GET_COMMUNITY_GOAL_HALL_OF_FAME = 2167; + public static GET_COMMUNITY_GOAL_PROGRESS = 1145; + public static GET_CONCURRENT_USERS_GOAL_PROGRESS = 1343; + public static GET_CONCURRENT_USERS_REWARD = 3872; + public static GET_DAILY_QUEST = 2486; + public static GET_QUESTS = 3333; + public static GET_SEASONAL_QUESTS_ONLY = 1190; + public static OPEN_QUEST_TRACKER = 2750; + public static REDEEM_COMMUNITY_GOAL_PRIZE = 90; + public static REJECT_QUEST = 2397; + public static START_CAMPAIGN = 1697; } diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index b2b29f7c..cd84b135 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -11,6 +11,7 @@ export * from './modtool'; export * from './navigator'; export * from './OutgoingHeader'; export * from './pet'; +export * from './quest'; export * from './room'; export * from './roomevents'; export * from './user'; diff --git a/src/nitro/communication/messages/outgoing/quest/AcceptQuestMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/AcceptQuestMessageComposer.ts new file mode 100644 index 00000000..eccf5a13 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/AcceptQuestMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class AcceptQuestMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/ActivateQuestMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/ActivateQuestMessageComposer.ts new file mode 100644 index 00000000..a38f12e7 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/ActivateQuestMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class ActivateQuestMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/CancelQuestMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/CancelQuestMessageComposer.ts new file mode 100644 index 00000000..e5634ca8 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/CancelQuestMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class CancelQuestMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/FriendRequestQuestCompleteMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/FriendRequestQuestCompleteMessageComposer.ts new file mode 100644 index 00000000..2f828ff0 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/FriendRequestQuestCompleteMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class FriendRequestQuestCompleteMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/GetCommunityGoalEarnedPrizesMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/GetCommunityGoalEarnedPrizesMessageComposer.ts new file mode 100644 index 00000000..2e2dac6d --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/GetCommunityGoalEarnedPrizesMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetCommunityGoalEarnedPrizesMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/GetCommunityGoalHallOfFameMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/GetCommunityGoalHallOfFameMessageComposer.ts new file mode 100644 index 00000000..503932c4 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/GetCommunityGoalHallOfFameMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetCommunityGoalHallOfFameMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: string) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/GetCommunityGoalProgressMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/GetCommunityGoalProgressMessageComposer.ts new file mode 100644 index 00000000..33e580d8 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/GetCommunityGoalProgressMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetCommunityGoalProgressMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/GetConcurrentUsersGoalProgressMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/GetConcurrentUsersGoalProgressMessageComposer.ts new file mode 100644 index 00000000..961731a9 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/GetConcurrentUsersGoalProgressMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetConcurrentUsersGoalProgressMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/GetConcurrentUsersRewardMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/GetConcurrentUsersRewardMessageComposer.ts new file mode 100644 index 00000000..1b72ec46 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/GetConcurrentUsersRewardMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetConcurrentUsersRewardMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/GetDailyQuestMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/GetDailyQuestMessageComposer.ts new file mode 100644 index 00000000..0b2aa544 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/GetDailyQuestMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetDailyQuestMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: boolean, _arg_2: number) + { + this._data = [k, _arg_2]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/GetQuestsMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/GetQuestsMessageComposer.ts new file mode 100644 index 00000000..102cc1e1 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/GetQuestsMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetQuestsMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/GetSeasonalQuestsOnlyMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/GetSeasonalQuestsOnlyMessageComposer.ts new file mode 100644 index 00000000..e3b749ae --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/GetSeasonalQuestsOnlyMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetSeasonalQuestsOnlyMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/OpenQuestTrackerMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/OpenQuestTrackerMessageComposer.ts new file mode 100644 index 00000000..2c1b14a6 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/OpenQuestTrackerMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class OpenQuestTrackerMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/RedeemCommunityGoalPrizeMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/RedeemCommunityGoalPrizeMessageComposer.ts new file mode 100644 index 00000000..79d5d679 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/RedeemCommunityGoalPrizeMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class RedeemCommunityGoalPrizeMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(communityGoalId: number) + { + this._data = [communityGoalId]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/RejectQuestMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/RejectQuestMessageComposer.ts new file mode 100644 index 00000000..69682722 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/RejectQuestMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class RejectQuestMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/StartCampaignMessageComposer.ts b/src/nitro/communication/messages/outgoing/quest/StartCampaignMessageComposer.ts new file mode 100644 index 00000000..f3231ea9 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/StartCampaignMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class StartCampaignMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: string) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/quest/index.ts b/src/nitro/communication/messages/outgoing/quest/index.ts new file mode 100644 index 00000000..e9f5c992 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/quest/index.ts @@ -0,0 +1,16 @@ +export * from './AcceptQuestMessageComposer'; +export * from './ActivateQuestMessageComposer'; +export * from './CancelQuestMessageComposer'; +export * from './FriendRequestQuestCompleteMessageComposer'; +export * from './GetCommunityGoalEarnedPrizesMessageComposer'; +export * from './GetCommunityGoalHallOfFameMessageComposer'; +export * from './GetCommunityGoalProgressMessageComposer'; +export * from './GetConcurrentUsersGoalProgressMessageComposer'; +export * from './GetConcurrentUsersRewardMessageComposer'; +export * from './GetDailyQuestMessageComposer'; +export * from './GetQuestsMessageComposer'; +export * from './GetSeasonalQuestsOnlyMessageComposer'; +export * from './OpenQuestTrackerMessageComposer'; +export * from './RedeemCommunityGoalPrizeMessageComposer'; +export * from './RejectQuestMessageComposer'; +export * from './StartCampaignMessageComposer'; From 432c649ee18a61cc67687efa4bd97bd75db4eafe Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 22 Jul 2021 00:29:34 -0400 Subject: [PATCH 147/155] Add room ad events --- .../room/events/RoomObjectRoomAdEvent.ts | 31 +++++++++++++++++++ src/nitro/room/events/index.ts | 1 + .../object/logic/furniture/FurnitureLogic.ts | 27 ++++++++++++++++ .../furniture/FurnitureRoomBillboardLogic.ts | 17 +++++++++- src/nitro/utils/HabboWebTools.ts | 7 ++++- 5 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 src/nitro/room/events/RoomObjectRoomAdEvent.ts diff --git a/src/nitro/room/events/RoomObjectRoomAdEvent.ts b/src/nitro/room/events/RoomObjectRoomAdEvent.ts new file mode 100644 index 00000000..9f948933 --- /dev/null +++ b/src/nitro/room/events/RoomObjectRoomAdEvent.ts @@ -0,0 +1,31 @@ +import { IRoomObject, RoomObjectEvent } from '../../../room'; + +export class RoomObjectRoomAdEvent extends RoomObjectEvent +{ + public static ROOM_AD_LOAD_IMAGE: string = 'RORAE_ROOM_AD_LOAD_IMAGE'; + public static ROOM_AD_FURNI_CLICK: string = 'RORAE_ROOM_AD_FURNI_CLICK'; + public static ROOM_AD_FURNI_DOUBLE_CLICK: string = 'RORAE_ROOM_AD_FURNI_DOUBLE_CLICK'; + public static ROOM_AD_TOOLTIP_SHOW: string = 'RORAE_ROOM_AD_TOOLTIP_SHOW'; + public static ROOM_AD_TOOLTIP_HIDE: string = 'RORAE_ROOM_AD_TOOLTIP_HIDE'; + + private _imageUrl: string = ''; + private _clickUrl: string = ''; + + constructor(type: string, object: IRoomObject, imageUrl: string = '', clickUrl: string = '') + { + super(type, object); + + this._imageUrl = imageUrl; + this._clickUrl = clickUrl; + } + + public get imageUrl(): string + { + return this._imageUrl; + } + + public get clickUrl(): string + { + return this._clickUrl; + } +} diff --git a/src/nitro/room/events/index.ts b/src/nitro/room/events/index.ts index 54ea2f56..4ed46c10 100644 --- a/src/nitro/room/events/index.ts +++ b/src/nitro/room/events/index.ts @@ -16,6 +16,7 @@ export * from './RoomObjectFurnitureActionEvent'; export * from './RoomObjectHSLColorEnabledEvent'; export * from './RoomObjectHSLColorEnableEvent'; export * from './RoomObjectMoveEvent'; +export * from './RoomObjectRoomAdEvent'; export * from './RoomObjectSamplePlaybackEvent'; export * from './RoomObjectStateChangedEvent'; export * from './RoomObjectTileMouseEvent'; diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index 41c54c86..42c86b99 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -8,6 +8,7 @@ import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; import { IVector3D } from '../../../../../room/utils/IVector3D'; import { Vector3d } from '../../../../../room/utils/Vector3d'; import { MouseEventType } from '../../../../ui/MouseEventType'; +import { RoomObjectRoomAdEvent } from '../../../events'; import { RoomObjectStateChangedEvent } from '../../../events/RoomObjectStateChangedEvent'; import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent'; import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage'; @@ -133,6 +134,13 @@ export class FurnitureLogic extends MovingObjectLogic return model.getValue(RoomObjectVariable.FURNITURE_AD_URL); } + protected handleAdClick():void + { + if(!this.eventDispatcher) return; + + this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_FURNI_CLICK, this.object)); + } + public update(time: number): void { super.update(time); @@ -256,6 +264,11 @@ export class FurnitureLogic extends MovingObjectLogic { if(this.eventDispatcher) { + if(adUrl && (adUrl.indexOf('http') === 0)) + { + this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_SHOW, this.object)); + } + const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_ENTER, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); mouseEvent.localX = event.localX; @@ -274,6 +287,11 @@ export class FurnitureLogic extends MovingObjectLogic { if(this.eventDispatcher) { + if(adUrl && (adUrl.indexOf('http') === 0)) + { + this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE, this.object)); + } + const mouseEvent = new RoomObjectMouseEvent(RoomObjectMouseEvent.MOUSE_LEAVE, this.object, event.eventId, event.altKey, event.ctrlKey, event.shiftKey, event.buttonDown); mouseEvent.localX = event.localX; @@ -301,6 +319,13 @@ export class FurnitureLogic extends MovingObjectLogic mouseEvent.spriteOffsetY = event.spriteOffsetY; this.eventDispatcher.dispatchEvent(mouseEvent); + + if(adUrl && (adUrl.indexOf('http') === 0)) + { + this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE, this.object)); + } + + if(adUrl && adUrl.length) this.handleAdClick(); } return; case MouseEventType.MOUSE_DOWN: @@ -357,6 +382,8 @@ export class FurnitureLogic extends MovingObjectLogic const adUrl = this.getAdClickUrl(this.object.model); + + if(this.widget) this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.OPEN_WIDGET, this.object)); this.eventDispatcher.dispatchEvent(new RoomObjectStateChangedEvent(RoomObjectStateChangedEvent.STATE_CHANGE, this.object)); diff --git a/src/nitro/room/object/logic/furniture/FurnitureRoomBillboardLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRoomBillboardLogic.ts index 0c1aa11b..3496f2d7 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureRoomBillboardLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureRoomBillboardLogic.ts @@ -1,4 +1,5 @@ import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel'; +import { HabboWebTools } from '../../../../utils'; import { RoomObjectVariable } from '../../RoomObjectVariable'; import { FurnitureRoomBrandingLogic } from './FurnitureRoomBrandingLogic'; @@ -15,4 +16,18 @@ export class FurnitureRoomBillboardLogic extends FurnitureRoomBrandingLogic { return model.getValue(RoomObjectVariable.FURNITURE_BRANDING_URL); } -} \ No newline at end of file + + protected handleAdClick():void + { + const adUrl = this.getAdClickUrl(this.object.model); + + if(adUrl.indexOf('http') === 0) + { + HabboWebTools.openWebPage(adUrl); + + return; + } + + super.handleAdClick(); + } +} diff --git a/src/nitro/utils/HabboWebTools.ts b/src/nitro/utils/HabboWebTools.ts index 2765f0f3..b089d650 100644 --- a/src/nitro/utils/HabboWebTools.ts +++ b/src/nitro/utils/HabboWebTools.ts @@ -43,6 +43,11 @@ export class HabboWebTools } } + public static openWebPage(pageUrl: string): void + { + window.open(pageUrl); + } + public static sendHeartBeat(): void { try @@ -330,4 +335,4 @@ export class HabboWebTools NitroLogger.log('External interface not working. Could not update figure.'); } } -} \ No newline at end of file +} From f513a0f431b341439ea92ea73f448e9836bf1f86 Mon Sep 17 00:00:00 2001 From: Bill Date: Thu, 22 Jul 2021 00:29:43 -0400 Subject: [PATCH 148/155] Update typings --- .../messages/parser/user/wardrobe/UserWardrobePageParser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nitro/communication/messages/parser/user/wardrobe/UserWardrobePageParser.ts b/src/nitro/communication/messages/parser/user/wardrobe/UserWardrobePageParser.ts index 0ccbd67a..412f62e2 100644 --- a/src/nitro/communication/messages/parser/user/wardrobe/UserWardrobePageParser.ts +++ b/src/nitro/communication/messages/parser/user/wardrobe/UserWardrobePageParser.ts @@ -3,7 +3,7 @@ import { IMessageParser } from '../../../../../../core/communication/messages/IM export class UserWardrobePageParser implements IMessageParser { - private _looks: Map; + private _looks: Map; public flush(): boolean { @@ -26,7 +26,7 @@ export class UserWardrobePageParser implements IMessageParser const look = wrapper.readString(); const gender = wrapper.readString(); - this._looks.set(slotId, [look, gender]); + this._looks.set(slotId, [ look, gender ]); totalLooks--; } From 394544aa717f3720a15cf964f5b64c5213e19198 Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 23 Jul 2021 00:24:18 -0400 Subject: [PATCH 149/155] Register badge received event --- src/nitro/communication/NitroMessages.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index b573d2f7..078d820a 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, ChangeUserNameResultMessageEvent, FurnitureGuildInfoComposer, MysteryBoxKeysEvent, PetExperienceEvent, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer } from './messages'; +import { ApproveNameMessageComposer, BadgeReceivedEvent, CatalogApproveNameResultEvent, ChangeUserNameResultMessageEvent, FurnitureGuildInfoComposer, MysteryBoxKeysEvent, PetExperienceEvent, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent'; @@ -716,6 +716,7 @@ export class NitroMessages implements IMessageConfiguration // BADGES this._events.set(IncomingHeader.USER_BADGES, BadgesEvent); + this._events.set(IncomingHeader.USER_BADGES_ADD, BadgeReceivedEvent); // ACCESS this._events.set(IncomingHeader.USER_PERKS, UserPerksEvent); From a1b527da62e4d12d07f8d528487f3f703d6213a2 Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 23 Jul 2021 01:07:49 -0400 Subject: [PATCH 150/155] Updates --- src/nitro/room/RoomObjectEventHandler.ts | 51 ++++++++++++++++++- .../room/events/RoomEngineRoomAdEvent.ts | 9 ++++ src/nitro/room/events/index.ts | 1 + .../furniture/FurnitureBadgeDisplayLogic.ts | 7 ++- .../object/logic/furniture/FurnitureLogic.ts | 21 ++++++-- .../furniture/FurnitureRoomBillboardLogic.ts | 11 ++-- .../furniture/FurnitureRoomBrandingLogic.ts | 32 ++++++++++++ .../FurnitureBadgeDisplayVisualization.ts | 23 +++++---- .../FurnitureBrandedImageVisualization.ts | 50 ++++++++++++++---- src/nitro/room/preview/RoomPreviewer.ts | 5 ++ src/nitro/session/BadgeImageManager.ts | 21 ++++---- 11 files changed, 188 insertions(+), 43 deletions(-) create mode 100644 src/nitro/room/events/RoomEngineRoomAdEvent.ts diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index e948c081..5c2ef72b 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -35,7 +35,7 @@ import { RoomUnitWalkComposer } from '../communication/messages/outgoing/room/un import { Nitro } from '../Nitro'; import { MouseEventType } from '../ui/MouseEventType'; import { RoomObjectPlacementSource } from './enums/RoomObjectPlacementSource'; -import { RoomEngineUseProductEvent } from './events'; +import { RoomEngineRoomAdEvent, RoomEngineUseProductEvent, RoomObjectRoomAdEvent } from './events'; import { RoomEngineDimmerStateEvent } from './events/RoomEngineDimmerStateEvent'; import { RoomEngineObjectEvent } from './events/RoomEngineObjectEvent'; import { RoomEngineObjectPlacedEvent } from './events/RoomEngineObjectPlacedEvent'; @@ -299,6 +299,13 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou case RoomObjectFloorHoleEvent.REMOVE_HOLE: this.onRoomObjectFloorHoleEvent(event as RoomObjectFloorHoleEvent, roomId); return; + case RoomObjectRoomAdEvent.ROOM_AD_FURNI_CLICK: + case RoomObjectRoomAdEvent.ROOM_AD_FURNI_DOUBLE_CLICK: + case RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_SHOW: + case RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE: + case RoomObjectRoomAdEvent.ROOM_AD_LOAD_IMAGE: + this.onRoomObjectRoomAdEvent(event as RoomObjectRoomAdEvent, roomId); + return; case RoomObjectBadgeAssetEvent.LOAD_BADGE: this.onRoomObjectBadgeAssetEvent(event as RoomObjectBadgeAssetEvent, roomId); return; @@ -867,6 +874,48 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou } } + private onRoomObjectRoomAdEvent(event: RoomObjectRoomAdEvent, roomId: number): void + { + if(!event) return; + + let eventType: string = null; + + switch(event.type) + { + case RoomObjectRoomAdEvent.ROOM_AD_FURNI_CLICK: + this._roomEngine.events.dispatchEvent(event); + + if(event.clickUrl && (event.clickUrl.length > 0)) + { + Nitro.instance.createLinkEvent(event.clickUrl); + } + + eventType = RoomEngineRoomAdEvent.FURNI_CLICK; + break; + case RoomObjectRoomAdEvent.ROOM_AD_FURNI_DOUBLE_CLICK: + if(event.clickUrl && (event.clickUrl.length > 0)) + { + const catalogPage = 'CATALOG_PAGE'; + + if(event.clickUrl.indexOf(catalogPage) === 0) + { + Nitro.instance.createLinkEvent(event.clickUrl.substr(catalogPage.length)); + } + } + + eventType = RoomEngineRoomAdEvent.FURNI_DOUBLE_CLICK; + break; + case RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_SHOW: + eventType = RoomEngineRoomAdEvent.TOOLTIP_SHOW; + break; + case RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE: + eventType = RoomEngineRoomAdEvent.TOOLTIP_HIDE; + break; + } + + if(eventType) this._roomEngine.events.dispatchEvent(new RoomEngineObjectEvent(eventType, roomId, event.objectId, this._roomEngine.getRoomObjectCategoryForType(event.objectType))); + } + private onRoomObjectBadgeAssetEvent(event: RoomObjectBadgeAssetEvent, roomId: number): void { if(!event || !this._roomEngine) return; diff --git a/src/nitro/room/events/RoomEngineRoomAdEvent.ts b/src/nitro/room/events/RoomEngineRoomAdEvent.ts new file mode 100644 index 00000000..3325373b --- /dev/null +++ b/src/nitro/room/events/RoomEngineRoomAdEvent.ts @@ -0,0 +1,9 @@ +import { RoomEngineObjectEvent } from './RoomEngineObjectEvent'; + +export class RoomEngineRoomAdEvent extends RoomEngineObjectEvent +{ + public static FURNI_CLICK: string = 'RERAE_FURNI_CLICK'; + public static FURNI_DOUBLE_CLICK: string = 'RERAE_FURNI_DOUBLE_CLICK'; + public static TOOLTIP_SHOW: string = 'RERAE_TOOLTIP_SHOW'; + public static TOOLTIP_HIDE: string = 'RERAE_TOOLTIP_HIDE'; +} diff --git a/src/nitro/room/events/index.ts b/src/nitro/room/events/index.ts index 4ed46c10..87819fb2 100644 --- a/src/nitro/room/events/index.ts +++ b/src/nitro/room/events/index.ts @@ -5,6 +5,7 @@ export * from './RoomEngineEvent'; export * from './RoomEngineObjectEvent'; export * from './RoomEngineObjectPlacedEvent'; export * from './RoomEngineObjectPlacedOnUserEvent'; +export * from './RoomEngineRoomAdEvent'; export * from './RoomEngineSamplePlaybackEvent'; export * from './RoomEngineTriggerWidgetEvent'; export * from './RoomEngineUseProductEvent'; diff --git a/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts index 7f90bb19..083b6bfc 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureBadgeDisplayLogic.ts @@ -57,6 +57,11 @@ export class FurnitureBadgeDisplayLogic extends FurnitureLogic { if(badgeId === '') return; - if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectBadgeAssetEvent(RoomObjectBadgeAssetEvent.LOAD_BADGE, this.object, badgeId, false)); + if(this.eventDispatcher) + { + this.object.model.setValue(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS, -1); + + this.eventDispatcher.dispatchEvent(new RoomObjectBadgeAssetEvent(RoomObjectBadgeAssetEvent.LOAD_BADGE, this.object, badgeId, false)); + } } } diff --git a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts index 42c86b99..ff173907 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureLogic.ts @@ -63,7 +63,15 @@ export class FurnitureLogic extends MovingObjectLogic public getEventTypes(): string[] { - const types = [ RoomObjectStateChangedEvent.STATE_CHANGE, RoomObjectMouseEvent.CLICK, RoomObjectMouseEvent.MOUSE_DOWN, RoomObjectMouseEvent.MOUSE_DOWN_LONG ]; + const types = [ + RoomObjectStateChangedEvent.STATE_CHANGE, + RoomObjectMouseEvent.CLICK, + RoomObjectMouseEvent.MOUSE_DOWN, + RoomObjectMouseEvent.MOUSE_DOWN_LONG, + RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_SHOW, + RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE, + RoomObjectRoomAdEvent.ROOM_AD_FURNI_DOUBLE_CLICK, + RoomObjectRoomAdEvent.ROOM_AD_FURNI_CLICK ]; if(this.widget) types.push(RoomObjectWidgetRequestEvent.OPEN_WIDGET, RoomObjectWidgetRequestEvent.CLOSE_WIDGET); @@ -134,7 +142,7 @@ export class FurnitureLogic extends MovingObjectLogic return model.getValue(RoomObjectVariable.FURNITURE_AD_URL); } - protected handleAdClick():void + protected handleAdClick(objectId: number, objectType: string, clickUrl: string):void { if(!this.eventDispatcher) return; @@ -325,7 +333,7 @@ export class FurnitureLogic extends MovingObjectLogic this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE, this.object)); } - if(adUrl && adUrl.length) this.handleAdClick(); + if(adUrl && adUrl.length) this.handleAdClick(this.object.id, this.object.type, adUrl); } return; case MouseEventType.MOUSE_DOWN: @@ -380,9 +388,12 @@ export class FurnitureLogic extends MovingObjectLogic { if(!this.object || !this.eventDispatcher) return; - const adUrl = this.getAdClickUrl(this.object.model); - + const clickUrl = this.getAdClickUrl(this.object.model); + if(clickUrl && clickUrl.length) + { + this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_FURNI_DOUBLE_CLICK, this.object, null, clickUrl)); + } if(this.widget) this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.OPEN_WIDGET, this.object)); diff --git a/src/nitro/room/object/logic/furniture/FurnitureRoomBillboardLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRoomBillboardLogic.ts index 3496f2d7..34dd6624 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureRoomBillboardLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureRoomBillboardLogic.ts @@ -1,5 +1,6 @@ import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel'; import { HabboWebTools } from '../../../../utils'; +import { RoomObjectRoomAdEvent } from '../../../events'; import { RoomObjectVariable } from '../../RoomObjectVariable'; import { FurnitureRoomBrandingLogic } from './FurnitureRoomBrandingLogic'; @@ -17,17 +18,15 @@ export class FurnitureRoomBillboardLogic extends FurnitureRoomBrandingLogic return model.getValue(RoomObjectVariable.FURNITURE_BRANDING_URL); } - protected handleAdClick():void + protected handleAdClick(objectId: number, objectType: string, clickUrl: string):void { - const adUrl = this.getAdClickUrl(this.object.model); - - if(adUrl.indexOf('http') === 0) + if(clickUrl.indexOf('http') === 0) { - HabboWebTools.openWebPage(adUrl); + HabboWebTools.openWebPage(clickUrl); return; } - super.handleAdClick(); + if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_FURNI_CLICK, this.object, '', clickUrl)); } } diff --git a/src/nitro/room/object/logic/furniture/FurnitureRoomBrandingLogic.ts b/src/nitro/room/object/logic/furniture/FurnitureRoomBrandingLogic.ts index 4fa661a5..d102d02f 100644 --- a/src/nitro/room/object/logic/furniture/FurnitureRoomBrandingLogic.ts +++ b/src/nitro/room/object/logic/furniture/FurnitureRoomBrandingLogic.ts @@ -1,6 +1,10 @@ +import { IAssetData } from '../../../../../core'; +import { IRoomGeometry, RoomSpriteMouseEvent } from '../../../../../room'; import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage'; import { Nitro } from '../../../../Nitro'; +import { MouseEventType } from '../../../../ui'; import { RoomWidgetEnumItemExtradataParameter } from '../../../../ui/widget/enums/RoomWidgetEnumItemExtradataParameter'; +import { RoomObjectRoomAdEvent } from '../../../events'; import { ObjectAdUpdateMessage } from '../../../messages/ObjectAdUpdateMessage'; import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage'; import { MapDataType } from '../../data/type/MapDataType'; @@ -16,15 +20,34 @@ export class FurnitureRoomBrandingLogic extends FurnitureLogic public static OFFSETY_KEY: string = 'offsetY'; public static OFFSETZ_KEY: string = 'offsetZ'; + protected _disableFurnitureSelection: boolean; protected _hasClickUrl: boolean; constructor() { super(); + this._disableFurnitureSelection = true; this._hasClickUrl = false; } + public getEventTypes(): string[] + { + const types = [ RoomObjectRoomAdEvent.ROOM_AD_LOAD_IMAGE ]; + + return this.mergeTypes(super.getEventTypes(), types); + } + + public initialize(asset: IAssetData): void + { + super.initialize(asset); + + if(this._disableFurnitureSelection) + { + this.object.model.setValue(RoomObjectVariable.FURNITURE_SELECTION_DISABLED, 1); + } + } + public processUpdateMessage(message: RoomObjectUpdateMessage): void { super.processUpdateMessage(message); @@ -106,6 +129,15 @@ export class FurnitureRoomBrandingLogic extends FurnitureLogic } } + public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void + { + if(!event || !geometry) return; + + if((event.type === MouseEventType.MOUSE_MOVE) || (event.type === MouseEventType.DOUBLE_CLICK)) return; + + super.mouseEvent(event, geometry); + } + private downloadBackground(): void { const model = this.object && this.object.model; diff --git a/src/nitro/room/object/visualization/furniture/FurnitureBadgeDisplayVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureBadgeDisplayVisualization.ts index e3c4183b..0e6d81a1 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureBadgeDisplayVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureBadgeDisplayVisualization.ts @@ -22,22 +22,25 @@ export class FurnitureBadgeDisplayVisualization extends FurnitureAnimatedVisuali { let updateModel = super.updateModel(scale); - if(!isNaN(this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS))) + const badgeStatus = this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS); + + if(badgeStatus === -1) { - const status = (this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS) !== 0); + this._badgeAssetNameNormalScale = ''; + this._badgeAssetNameSmallScale = ''; + } - if(status && this._badgeAssetNameNormalScale === '') - { - this._badgeAssetNameNormalScale = this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_ASSET_NAME); + else if(badgeStatus === 1 && (this._badgeAssetNameNormalScale === '')) + { + this._badgeAssetNameNormalScale = this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_ASSET_NAME); - if(this._badgeAssetNameSmallScale === '') this._badgeAssetNameSmallScale = this._badgeAssetNameNormalScale + '_32'; + if(this._badgeAssetNameSmallScale === '') this._badgeAssetNameSmallScale = this._badgeAssetNameNormalScale + '_32'; - const visibleInState = this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_VISIBLE_IN_STATE); + const visibleInState = this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_VISIBLE_IN_STATE); - if(!isNaN) this._badgeVisibleInState = visibleInState; + if(!isNaN(visibleInState)) this._badgeVisibleInState = visibleInState; - updateModel = true; - } + updateModel = true; } return updateModel; diff --git a/src/nitro/room/object/visualization/furniture/FurnitureBrandedImageVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureBrandedImageVisualization.ts index 1692c8bb..22ed6d09 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureBrandedImageVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureBrandedImageVisualization.ts @@ -6,6 +6,10 @@ import { FurnitureVisualization } from './FurnitureVisualization'; export class FurnitureBrandedImageVisualization extends FurnitureVisualization { private static BRANDED_IMAGE: string = 'branded_image'; + private static STATE_0: number = 0; + private static STATE_1: number = 1; + private static STATE_2: number = 2; + private static STATE_3: number = 3; protected _imageUrl: string; protected _shortUrl: string; @@ -139,7 +143,42 @@ export class FurnitureBrandedImageVisualization extends FurnitureVisualization if(!texture) return; - this.asset.addAsset(this._imageUrl, texture, true, 0, 0, false, false); + const state = this.object.getState(0); + + let x = 0; + let y = 0; + let flipH = false; + let flipV = false; + + switch(state) + { + case FurnitureBrandedImageVisualization.STATE_0: + x = 0; + y = 0; + flipH = false; + flipV = false; + break; + case FurnitureBrandedImageVisualization.STATE_1: + x = -(texture.width); + y = 0; + flipH = true; + flipV = false; + break; + case FurnitureBrandedImageVisualization.STATE_2: + x = -(texture.width); + y = -(texture.height); + flipH = true; + flipV = true; + break; + case FurnitureBrandedImageVisualization.STATE_3: + x = 0; + y = -(texture.height); + flipH = false; + flipV = true; + break; + } + + this.asset.addAsset(this._imageUrl, texture, true, x, y, flipH, flipV); } protected getSpriteAssetName(scale: number, layerId: number): string @@ -150,13 +189,4 @@ export class FurnitureBrandedImageVisualization extends FurnitureVisualization return super.getSpriteAssetName(scale, layerId); } - - protected getLayerIgnoreMouse(scale: number, direction: number, layerId: number): boolean - { - const tag = this.getLayerTag(scale, direction, layerId); - - if(tag !== FurnitureBrandedImageVisualization.BRANDED_IMAGE) return super.getLayerIgnoreMouse(scale, direction, layerId); - - return true; - } } diff --git a/src/nitro/room/preview/RoomPreviewer.ts b/src/nitro/room/preview/RoomPreviewer.ts index d542948e..8720025b 100644 --- a/src/nitro/room/preview/RoomPreviewer.ts +++ b/src/nitro/room/preview/RoomPreviewer.ts @@ -387,6 +387,11 @@ export class RoomPreviewer if(this.isRoomEngineReady) this._roomEngine.updateRoomObjectUserAction(this._previewRoomId, RoomPreviewer.PREVIEW_OBJECT_ID, action, value, parameter); } + public updateObjectStuffData(stuffData: IObjectData): void + { + if(this.isRoomEngineReady) this._roomEngine.updateRoomObjectFloor(this._previewRoomId, RoomPreviewer.PREVIEW_OBJECT_ID, null, null, stuffData.state, stuffData); + } + public changeRoomObjectState(): void { if(this.isRoomEngineReady) diff --git a/src/nitro/session/BadgeImageManager.ts b/src/nitro/session/BadgeImageManager.ts index 020b8b4e..b14eb574 100644 --- a/src/nitro/session/BadgeImageManager.ts +++ b/src/nitro/session/BadgeImageManager.ts @@ -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 = BadgeImageManager.NORMAL_BADGE, load: boolean = true): Texture { let badge = this.getBadgeTexture(badgeName, type); @@ -42,25 +42,25 @@ export class BadgeImageManager return (badge) ? new BadgeInfo(badge, false) : new BadgeInfo(this.getBadgePlaceholder(), true); } - public loadBadgeImage(badgeName: string, type: string = 'normal_badge'): string + public loadBadgeImage(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE): string { - if(this._assets.getTexture(badgeName)) return badgeName; + if(this._assets.getTexture(this.getBadgeUrl(badgeName, type))) return badgeName; this.getBadgeTexture(badgeName, type); return null; } - private getBadgeTexture(badgeName: string, type: string = 'normal_badge'): Texture + private getBadgeTexture(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE): Texture { - const existing = this._assets.getTexture(badgeName); + const url = this.getBadgeUrl(badgeName, type); + + const existing = this._assets.getTexture(url); if(existing) return existing.clone(); if(this._requestedBadges.get(badgeName)) return null; - const url = this.getBadgeUrl(badgeName, type); - if(url) { this._requestedBadges.set(badgeName, true); @@ -69,7 +69,7 @@ export class BadgeImageManager { if(flag) { - const texture = this._assets.getTexture(badgeName); + const texture = this._assets.getTexture(url); if(texture && this._events) this._events.dispatchEvent(new BadgeImageReadyEvent(badgeName, texture.clone())); } @@ -81,14 +81,15 @@ export class BadgeImageManager private getBadgePlaceholder(): Texture { - const existing = this._assets.getTexture('loading_icon'); + const url = (Nitro.instance.getConfiguration('images.url') + '/loading_icon.png'); + const existing = this._assets.getTexture(url); if(!existing) return null; return existing.clone(); } - public getBadgeUrl(badge: string, type: string = 'normal_badge'): string + public getBadgeUrl(badge: string, type: string = BadgeImageManager.NORMAL_BADGE): string { let url = null; From 22058f82bd595540d121b68e02e52ec4e6aee27a Mon Sep 17 00:00:00 2001 From: Dank074 Date: Fri, 23 Jul 2021 17:58:39 -0500 Subject: [PATCH 151/155] added bonusrare packets --- src/nitro/communication/NitroMessages.ts | 5 +- .../messages/incoming/IncomingHeader.ts | 1 + .../catalog/BonusRareInfoMessageEvent.ts | 16 ++++++ .../messages/incoming/catalog/index.ts | 1 + .../messages/outgoing/OutgoingHeader.ts | 1 + .../GetBonusRareInfoMessageComposer.ts | 21 ++++++++ .../messages/outgoing/catalog/index.ts | 1 + .../catalog/BonusRareInfoMessageParser.ts | 50 +++++++++++++++++++ .../messages/parser/catalog/index.ts | 1 + 9 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/incoming/catalog/BonusRareInfoMessageEvent.ts create mode 100644 src/nitro/communication/messages/outgoing/catalog/GetBonusRareInfoMessageComposer.ts create mode 100644 src/nitro/communication/messages/parser/catalog/BonusRareInfoMessageParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index b573d2f7..59a46e8c 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, ChangeUserNameResultMessageEvent, FurnitureGuildInfoComposer, MysteryBoxKeysEvent, PetExperienceEvent, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer } from './messages'; +import { ApproveNameMessageComposer, BonusRareInfoMessageEvent, CatalogApproveNameResultEvent, ChangeUserNameResultMessageEvent, FurnitureGuildInfoComposer, GetBonusRareInfoMessageComposer, MysteryBoxKeysEvent, PetExperienceEvent, PetMountComposer, PetSupplementComposer, RemovePetSaddleComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent, TogglePetBreedingComposer, TogglePetRidingComposer, UnseenResetCategoryComposer, UnseenResetItemsComposer, UsePetProductComposer } from './messages'; import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent'; import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent'; import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent'; @@ -487,6 +487,7 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.REDEEM_VOUCHER_OK, CatalogRedeemVoucherOkEvent); this._events.set(IncomingHeader.CATALOG_RECEIVE_PET_BREEDS, SellablePetPalettesEvent); this._events.set(IncomingHeader.CATALOG_APPROVE_NAME_RESULT, CatalogApproveNameResultEvent); + this._events.set(IncomingHeader.BONUS_RARE_INFO, BonusRareInfoMessageEvent); // CAMERA this._events.set(IncomingHeader.CAMERA_PRICE, RoomWidgetCameraConfigurationEvent); @@ -814,6 +815,7 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.GIFT_CONFIG, CatalogRequestGiftConfigurationComposer); this._composers.set(OutgoingHeader.CATALOG_SELECT_VIP_GIFT, CatalogSelectClubGiftComposer); this._composers.set(OutgoingHeader.CATALOG_REQUESET_PET_BREEDS, CatalogRequestPetBreedsComposer); + this._composers.set(OutgoingHeader.GET_BONUS_RARE_INFO, GetBonusRareInfoMessageComposer); // CAMERA this._composers.set(OutgoingHeader.CAMERA_PRICE, RoomWidgetCameraConfigurationComposer); @@ -1113,6 +1115,7 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.COMMUNITY_GOAL_VOTE_COMPOSER, CommunityGoalVoteMessageComposer); this._composers.set(OutgoingHeader.GET_PROMO_ARTICLES, GetPromoArticlesComposer); + // QUEST this._composers.set(OutgoingHeader.ACCEPT_QUEST, AcceptQuestMessageComposer); this._composers.set(OutgoingHeader.ACTIVATE_QUEST, ActivateQuestMessageComposer); this._composers.set(OutgoingHeader.CANCEL_QUEST, CancelQuestMessageComposer); diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 247e5c3a..8c568364 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -265,4 +265,5 @@ export class IncomingHeader public static SEASONAL_QUESTS = 1122; public static QUESTS = 3625; public static QUEST = 230; + public static BONUS_RARE_INFO = 1533; } diff --git a/src/nitro/communication/messages/incoming/catalog/BonusRareInfoMessageEvent.ts b/src/nitro/communication/messages/incoming/catalog/BonusRareInfoMessageEvent.ts new file mode 100644 index 00000000..15bb58d4 --- /dev/null +++ b/src/nitro/communication/messages/incoming/catalog/BonusRareInfoMessageEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { BonusRareInfoMessageParser } from '../../parser/catalog/BonusRareInfoMessageParser'; + +export class BonusRareInfoMessageEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, BonusRareInfoMessageParser); + } + + public getParser(): BonusRareInfoMessageParser + { + return this.parser as BonusRareInfoMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/catalog/index.ts b/src/nitro/communication/messages/incoming/catalog/index.ts index 518c657a..550b9d0f 100644 --- a/src/nitro/communication/messages/incoming/catalog/index.ts +++ b/src/nitro/communication/messages/incoming/catalog/index.ts @@ -1,3 +1,4 @@ +export * from './BonusRareInfoMessageEvent'; export * from './CatalogApproveNameResultEvent'; export * from './CatalogClubEvent'; export * from './CatalogClubGiftsEvent'; diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 367f695c..4de6ff80 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -264,4 +264,5 @@ export class OutgoingHeader public static REDEEM_COMMUNITY_GOAL_PRIZE = 90; public static REJECT_QUEST = 2397; public static START_CAMPAIGN = 1697; + public static GET_BONUS_RARE_INFO = 957; } diff --git a/src/nitro/communication/messages/outgoing/catalog/GetBonusRareInfoMessageComposer.ts b/src/nitro/communication/messages/outgoing/catalog/GetBonusRareInfoMessageComposer.ts new file mode 100644 index 00000000..17945045 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/catalog/GetBonusRareInfoMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetBonusRareInfoMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/catalog/index.ts b/src/nitro/communication/messages/outgoing/catalog/index.ts index 03f9b993..abe7c88f 100644 --- a/src/nitro/communication/messages/outgoing/catalog/index.ts +++ b/src/nitro/communication/messages/outgoing/catalog/index.ts @@ -9,6 +9,7 @@ export * from './CatalogRequestVipGiftsComposer'; export * from './CatalogRequestVipOffersComposer'; export * from './CatalogSearchComposer'; export * from './CatalogSelectClubGiftComposer'; +export * from './GetBonusRareInfoMessageComposer'; export * from './marketplace'; export * from './RedeemItemClothingComposer'; export * from './RedeemVoucherComposer'; diff --git a/src/nitro/communication/messages/parser/catalog/BonusRareInfoMessageParser.ts b/src/nitro/communication/messages/parser/catalog/BonusRareInfoMessageParser.ts new file mode 100644 index 00000000..d3d988cd --- /dev/null +++ b/src/nitro/communication/messages/parser/catalog/BonusRareInfoMessageParser.ts @@ -0,0 +1,50 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class BonusRareInfoMessageParser implements IMessageParser +{ + private _productType: string; + private _productClassId: number; + private _totalCoinsForBonus: number; + private _coinsStillRequiredToBuy: number; + + public flush(): boolean + { + this._totalCoinsForBonus = -1; + this._coinsStillRequiredToBuy = -1; + this._productType = ''; + this._productClassId = -1; + return true; + } + + public parse(wrapper:IMessageDataWrapper): boolean + { + if(!wrapper) return false; + + this._productType = wrapper.readString(); + this._productClassId = wrapper.readInt(); + this._totalCoinsForBonus = wrapper.readInt(); + this._coinsStillRequiredToBuy = wrapper.readInt(); + return true; + } + + public get totalCoinsForBonus(): number + { + return this._totalCoinsForBonus; + } + + public get coinsStillRequiredToBuy(): number + { + return this._coinsStillRequiredToBuy; + } + + public get productType(): string + { + return this._productType; + } + + public get productClassId(): number + { + return this._productClassId; + } +} diff --git a/src/nitro/communication/messages/parser/catalog/index.ts b/src/nitro/communication/messages/parser/catalog/index.ts index 52ac4447..3a6bc3b4 100644 --- a/src/nitro/communication/messages/parser/catalog/index.ts +++ b/src/nitro/communication/messages/parser/catalog/index.ts @@ -1,3 +1,4 @@ +export * from './BonusRareInfoMessageParser'; export * from './CatalogApproveNameResultParser'; export * from './CatalogClubParser'; export * from './CatalogGiftConfigurationParser'; From 368ed8b4048511694a86a5344409da35ef3ec861 Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 24 Jul 2021 23:26:50 -0400 Subject: [PATCH 152/155] Update packet --- .../subscription/UserSubscriptionParser.ts | 96 ++++++++++--------- 1 file changed, 52 insertions(+), 44 deletions(-) diff --git a/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts b/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts index 6231e6a5..49eeeaca 100644 --- a/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts +++ b/src/nitro/communication/messages/parser/user/inventory/subscription/UserSubscriptionParser.ts @@ -3,34 +3,36 @@ import { IMessageParser } from '../../../../../../../core/communication/messages export class UserSubscriptionParser implements IMessageParser { - public static readonly RESPONSE_TYPE_LOGIN:number = 1; - public static readonly RESPONSE_TYPE_PURCHASE:number = 2; - public static readonly RESPONSE_TYPE_DISCOUNT_AVAILABLE:number = 3; - public static readonly RESPONSE_TYPE_CITIZENSHIP_DISCOUNT:number = 4; + public static readonly RESPONSE_TYPE_LOGIN: number = 1; + public static readonly RESPONSE_TYPE_PURCHASE: number = 2; + public static readonly RESPONSE_TYPE_DISCOUNT_AVAILABLE: number = 3; + public static readonly RESPONSE_TYPE_CITIZENSHIP_DISCOUNT: number = 4; - private _name: string; - private _days: number; - private _int1: number; - private _months: number; - private _years: number; + private _productName: string; + private _daysToPeriodEnd: number; + private _memberPeriods: number; + private _periodsSubscribedAhead: number; + private _responseType: number; private _hasEverBeenMember: boolean; private _isVip: boolean; private _pastClubDays: number; - private _pastVIPDays: number; - private _totalSeconds: number; + private _pastVipDays: number; + private _minutesUntilExpiration: number; + private _minutesSinceLastModified: number; public flush(): boolean { - this._name = null; - this._days = 0; - this._int1 = 0; - this._months = 0; - this._years = 0; - this._hasEverBeenMember = false; - this._isVip = false; - this._pastClubDays = 0; - this._pastVIPDays = 0; - this._totalSeconds = 0; + this._productName = null; + this._daysToPeriodEnd = 0; + this._memberPeriods = 0; + this._periodsSubscribedAhead = 0; + this._responseType = 0; + this._hasEverBeenMember = false; + this._isVip = false; + this._pastClubDays = 0; + this._pastVipDays = 0; + this._minutesUntilExpiration = 0; + this._minutesSinceLastModified = 0; return true; } @@ -39,44 +41,45 @@ export class UserSubscriptionParser implements IMessageParser { if(!wrapper) return false; - this._name = wrapper.readString(); - this._days = wrapper.readInt(); - this._int1 = wrapper.readInt(); - this._months = wrapper.readInt(); - this._years = wrapper.readInt(); + this._productName = wrapper.readString(); + this._daysToPeriodEnd = wrapper.readInt(); + this._memberPeriods = wrapper.readInt(); + this._periodsSubscribedAhead = wrapper.readInt(); + this._responseType = wrapper.readInt(); this._hasEverBeenMember = wrapper.readBoolean(); - this._isVip = wrapper.readBoolean(); - this._pastClubDays = wrapper.readInt(); - this._pastVIPDays = wrapper.readInt(); + this._isVip = wrapper.readBoolean(); + this._pastClubDays = wrapper.readInt(); + this._pastVipDays = wrapper.readInt(); + this._minutesUntilExpiration = wrapper.readInt(); - if(wrapper.bytesAvailable) this._totalSeconds = wrapper.readInt(); + if(wrapper.bytesAvailable) this._minutesSinceLastModified = wrapper.readInt(); return true; } - public get name(): string + public get productName(): string { - return this._name; + return this._productName; } - public get days(): number + public get daysToPeriodEnd(): number { - return this._days; + return this._daysToPeriodEnd; } - public get int1(): number + public get memberPeriods(): number { - return this._int1; + return this._memberPeriods; } - public get months(): number + public get periodsSubscribedAhead(): number { - return this._months; + return this._periodsSubscribedAhead; } - public get years(): number + public get responseType(): number { - return this._years; + return this._responseType; } public get hasEverBeenMember(): boolean @@ -94,13 +97,18 @@ export class UserSubscriptionParser implements IMessageParser return this._pastClubDays; } - public get pastVIPDays(): number + public get pastVipDays(): number { - return this._pastVIPDays; + return this._pastVipDays; } - public get totalSeconds(): number + public get minutesUntilExpiration(): number { - return this._totalSeconds; + return this._minutesUntilExpiration; + } + + public get minutesSinceLastModified(): number + { + return this._minutesSinceLastModified; } } From 3c78e866096e7776cd23133d6aa5415d50b8c32a Mon Sep 17 00:00:00 2001 From: Bill Date: Sat, 24 Jul 2021 23:26:55 -0400 Subject: [PATCH 153/155] Update map --- src/core/utils/AdvancedMap.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/utils/AdvancedMap.ts b/src/core/utils/AdvancedMap.ts index 4683d487..fb8c7940 100644 --- a/src/core/utils/AdvancedMap.ts +++ b/src/core/utils/AdvancedMap.ts @@ -7,12 +7,14 @@ export class AdvancedMap implements IDisposable private _array: U[]; private _keys: T[]; - constructor() + constructor(map: Map = null) { this._length = 0; this._dictionary = new Map(); this._array = []; this._keys = []; + + if(map) for(const [ key, value ] of map.entries()) this.add(key, value); } public get length(): number @@ -154,4 +156,4 @@ export class AdvancedMap implements IDisposable return map; } -} \ No newline at end of file +} From 37f5bf6a10cbf2c76c2afe59cd617ca74c814faa Mon Sep 17 00:00:00 2001 From: Bill Date: Sun, 25 Jul 2021 03:40:03 -0400 Subject: [PATCH 154/155] Fix busted badge displays --- src/nitro/room/RoomContentLoader.ts | 4 ++-- src/nitro/room/RoomEngine.ts | 2 +- .../furniture/FurnitureBadgeDisplayVisualization.ts | 10 +++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/nitro/room/RoomContentLoader.ts b/src/nitro/room/RoomContentLoader.ts index 38afc6fd..d282c7b6 100644 --- a/src/nitro/room/RoomContentLoader.ts +++ b/src/nitro/room/RoomContentLoader.ts @@ -316,13 +316,13 @@ export class RoomContentLoader implements IFurnitureDataListener return image; } - public addAssetToCollection(collectionName: string, assetName: string, texture: Texture): boolean + public addAssetToCollection(collectionName: string, assetName: string, texture: Texture, override: boolean = true): boolean { const collection = this.getCollection(collectionName); if(!collection) return false; - return collection.addAsset(assetName, texture, true, 0, 0, false, false); + return collection.addAsset(assetName, texture, override, 0, 0, false, false); } private createCollection(data: IAssetData, spritesheet: Spritesheet): GraphicAssetCollection diff --git a/src/nitro/room/RoomEngine.ts b/src/nitro/room/RoomEngine.ts index ebed6c9c..06e05fde 100644 --- a/src/nitro/room/RoomEngine.ts +++ b/src/nitro/room/RoomEngine.ts @@ -2438,7 +2438,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato const badgeName = (groupBadge) ? this._sessionDataManager.loadGroupBadgeImage(badgeId) : this._sessionDataManager.loadBadgeImage(badgeId); const badgeImage = (groupBadge) ? this._sessionDataManager.getGroupBadgeImage(badgeId) : this._sessionDataManager.getBadgeImage(badgeId); - if(badgeImage) this._roomContentLoader.addAssetToCollection(object.type, badgeName, badgeImage); + if(badgeImage) this._roomContentLoader.addAssetToCollection(object.type, badgeName, badgeImage, false); } public dispatchMouseEvent(canvasId: number, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): void diff --git a/src/nitro/room/object/visualization/furniture/FurnitureBadgeDisplayVisualization.ts b/src/nitro/room/object/visualization/furniture/FurnitureBadgeDisplayVisualization.ts index 0e6d81a1..617e4f0c 100644 --- a/src/nitro/room/object/visualization/furniture/FurnitureBadgeDisplayVisualization.ts +++ b/src/nitro/room/object/visualization/furniture/FurnitureBadgeDisplayVisualization.ts @@ -5,6 +5,7 @@ export class FurnitureBadgeDisplayVisualization extends FurnitureAnimatedVisuali { private static BADGE: string = 'BADGE'; + private _badgeId: string; private _badgeAssetNameNormalScale: string; private _badgeAssetNameSmallScale: string; private _badgeVisibleInState: number; @@ -13,6 +14,7 @@ export class FurnitureBadgeDisplayVisualization extends FurnitureAnimatedVisuali { super(); + this._badgeId = ''; this._badgeAssetNameNormalScale = ''; this._badgeAssetNameSmallScale = ''; this._badgeVisibleInState = -1; @@ -22,7 +24,8 @@ export class FurnitureBadgeDisplayVisualization extends FurnitureAnimatedVisuali { let updateModel = super.updateModel(scale); - const badgeStatus = this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS); + const badgeStatus = this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS); + const badgeId = this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_ASSET_NAME); if(badgeStatus === -1) { @@ -30,9 +33,10 @@ export class FurnitureBadgeDisplayVisualization extends FurnitureAnimatedVisuali this._badgeAssetNameSmallScale = ''; } - else if(badgeStatus === 1 && (this._badgeAssetNameNormalScale === '')) + else if((badgeStatus === 1) && (badgeId !== this._badgeId)) { - this._badgeAssetNameNormalScale = this.object.model.getValue(RoomObjectVariable.FURNITURE_BADGE_ASSET_NAME); + this._badgeId = badgeId; + this._badgeAssetNameNormalScale = this._badgeId; if(this._badgeAssetNameSmallScale === '') this._badgeAssetNameSmallScale = this._badgeAssetNameNormalScale + '_32'; From e87cf83f4a50b8b463509f0940bb702145eda48a Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sun, 25 Jul 2021 22:50:22 -0500 Subject: [PATCH 155/155] added crafting packets --- src/nitro/communication/NitroMessages.ts | 22 ++++++++ .../messages/incoming/IncomingHeader.ts | 4 ++ .../crafting/CraftableProductsEvent.ts | 16 ++++++ .../incoming/crafting/CraftingRecipeEvent.ts | 16 ++++++ .../crafting/CraftingRecipesAvailableEvent.ts | 16 ++++++ .../incoming/crafting/CraftingResultEvent.ts | 16 ++++++ .../messages/outgoing/OutgoingHeader.ts | 7 ++- .../outgoing/crafting/CraftComposer.ts | 21 ++++++++ .../outgoing/crafting/CraftSecretComposer.ts | 21 ++++++++ .../crafting/GetCraftableProductsComposer.ts | 21 ++++++++ .../crafting/GetCraftingRecipeComposer.ts | 21 ++++++++ .../GetCraftingRecipesAvailableComposer.ts | 21 ++++++++ .../CraftableProductsMessageParser.ts | 53 +++++++++++++++++++ .../CraftingRecipeIngredientParser.ts | 23 ++++++++ .../crafting/CraftingRecipeMessageParser.ts | 35 ++++++++++++ .../CraftingRecipesAvailableMessageParser.ts | 33 ++++++++++++ .../crafting/CraftingResultMessageParser.ts | 36 +++++++++++++ .../crafting/CraftingResultObjectParser.ts | 23 ++++++++ 18 files changed, 404 insertions(+), 1 deletion(-) create mode 100644 src/nitro/communication/messages/incoming/crafting/CraftableProductsEvent.ts create mode 100644 src/nitro/communication/messages/incoming/crafting/CraftingRecipeEvent.ts create mode 100644 src/nitro/communication/messages/incoming/crafting/CraftingRecipesAvailableEvent.ts create mode 100644 src/nitro/communication/messages/incoming/crafting/CraftingResultEvent.ts create mode 100644 src/nitro/communication/messages/outgoing/crafting/CraftComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/crafting/CraftSecretComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/crafting/GetCraftableProductsComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/crafting/GetCraftingRecipeComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/crafting/GetCraftingRecipesAvailableComposer.ts create mode 100644 src/nitro/communication/messages/parser/crafting/CraftableProductsMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/crafting/CraftingRecipeIngredientParser.ts create mode 100644 src/nitro/communication/messages/parser/crafting/CraftingRecipeMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/crafting/CraftingRecipesAvailableMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/crafting/CraftingResultMessageParser.ts create mode 100644 src/nitro/communication/messages/parser/crafting/CraftingResultObjectParser.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 47e17825..12e27741 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -24,6 +24,10 @@ import { MarketplaceOwnItemsEvent } from './messages/incoming/catalog/marketplac import { MarketplaceConfigEvent } from './messages/incoming/catalog/MarketplaceConfigEvent'; import { MarketplaceItemStatsEvent } from './messages/incoming/catalog/MarketplaceItemStatsEvent'; import { ClientPingEvent } from './messages/incoming/client/ClientPingEvent'; +import { CraftableProductsEvent } from './messages/incoming/crafting/CraftableProductsEvent'; +import { CraftingRecipeEvent } from './messages/incoming/crafting/CraftingRecipeEvent'; +import { CraftingRecipesAvailableEvent } from './messages/incoming/crafting/CraftingRecipesAvailableEvent'; +import { CraftingResultEvent } from './messages/incoming/crafting/CraftingResultEvent'; import { DesktopViewEvent } from './messages/incoming/desktop/DesktopViewEvent'; import { AcceptFriendResultEvent } from './messages/incoming/friendlist/AcceptFriendResultEvent'; import { FindFriendsProcessResultEvent } from './messages/incoming/friendlist/FindFriendsProcessResultEvent'; @@ -244,6 +248,11 @@ import { RedeemItemClothingComposer } from './messages/outgoing/catalog/RedeemIt import { CatalogRedeemVoucherComposer } from './messages/outgoing/catalog/RedeemVoucherComposer'; import { ClientPongComposer } from './messages/outgoing/client/ClientPongComposer'; import { ClientReleaseVersionComposer } from './messages/outgoing/client/ClientReleaseVersionComposer'; +import { CraftComposer } from './messages/outgoing/crafting/CraftComposer'; +import { CraftSecretComposer } from './messages/outgoing/crafting/CraftSecretComposer'; +import { GetCraftableProductsComposer } from './messages/outgoing/crafting/GetCraftableProductsComposer'; +import { GetCraftingRecipeComposer } from './messages/outgoing/crafting/GetCraftingRecipeComposer'; +import { GetCraftingRecipesAvailableComposer } from './messages/outgoing/crafting/GetCraftingRecipesAvailableComposer'; import { DesktopViewComposer } from './messages/outgoing/desktop/DesktopViewComposer'; import { AcceptFriendComposer } from './messages/outgoing/friendlist/AcceptFriendComposer'; import { DeclineFriendComposer } from './messages/outgoing/friendlist/DeclineFriendComposer'; @@ -795,6 +804,12 @@ export class NitroMessages implements IMessageConfiguration this._events.set(IncomingHeader.SEASONAL_QUESTS, SeasonalQuestsMessageEvent); this._events.set(IncomingHeader.QUESTS, QuestsMessageEvent); this._events.set(IncomingHeader.QUEST, QuestMessageEvent); + + // CRAFTING + this._events.set(IncomingHeader.CRAFTABLE_PRODUCTS, CraftableProductsEvent); + this._events.set(IncomingHeader.CRAFTING_RECIPE, CraftingRecipeEvent); + this._events.set(IncomingHeader.CRAFTING_RECIPES_AVAILABLE, CraftingRecipesAvailableEvent); + this._events.set(IncomingHeader.CRAFTING_RESULT, CraftingResultEvent); } private registerComposers(): void @@ -1133,6 +1148,13 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.REDEEM_COMMUNITY_GOAL_PRIZE, RedeemCommunityGoalPrizeMessageComposer); this._composers.set(OutgoingHeader.REJECT_QUEST, RejectQuestMessageComposer); this._composers.set(OutgoingHeader.START_CAMPAIGN, StartCampaignMessageComposer); + + // CRAFTING + this._composers.set(OutgoingHeader.CRAFT, CraftComposer); + this._composers.set(OutgoingHeader.CRAFT_SECRET, CraftSecretComposer); + this._composers.set(OutgoingHeader.GET_CRAFTABLE_PRODUCTS, GetCraftableProductsComposer); + this._composers.set(OutgoingHeader.GET_CRAFTING_RECIPE, GetCraftingRecipeComposer); + this._composers.set(OutgoingHeader.GET_CRAFTING_RECIPES_AVAILABLE, GetCraftingRecipesAvailableComposer); } public get events(): Map diff --git a/src/nitro/communication/messages/incoming/IncomingHeader.ts b/src/nitro/communication/messages/incoming/IncomingHeader.ts index 8c568364..9e2e3637 100644 --- a/src/nitro/communication/messages/incoming/IncomingHeader.ts +++ b/src/nitro/communication/messages/incoming/IncomingHeader.ts @@ -266,4 +266,8 @@ export class IncomingHeader public static QUESTS = 3625; public static QUEST = 230; public static BONUS_RARE_INFO = 1533; + public static CRAFTABLE_PRODUCTS = 1000; + public static CRAFTING_RECIPE = 2774; + public static CRAFTING_RECIPES_AVAILABLE = 2124; + public static CRAFTING_RESULT = 618; } diff --git a/src/nitro/communication/messages/incoming/crafting/CraftableProductsEvent.ts b/src/nitro/communication/messages/incoming/crafting/CraftableProductsEvent.ts new file mode 100644 index 00000000..9f507f20 --- /dev/null +++ b/src/nitro/communication/messages/incoming/crafting/CraftableProductsEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CraftableProductsMessageParser } from '../../parser/crafting/CraftableProductsMessageParser'; + +export class CraftableProductsEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CraftableProductsMessageParser); + } + + public getParser(): CraftableProductsMessageParser + { + return this.parser as CraftableProductsMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/crafting/CraftingRecipeEvent.ts b/src/nitro/communication/messages/incoming/crafting/CraftingRecipeEvent.ts new file mode 100644 index 00000000..4f75d095 --- /dev/null +++ b/src/nitro/communication/messages/incoming/crafting/CraftingRecipeEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CraftingRecipeMessageParser } from '../../parser/crafting/CraftingRecipeMessageParser'; + +export class CraftingRecipeEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CraftingRecipeMessageParser); + } + + public getParser(): CraftingRecipeMessageParser + { + return this.parser as CraftingRecipeMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/crafting/CraftingRecipesAvailableEvent.ts b/src/nitro/communication/messages/incoming/crafting/CraftingRecipesAvailableEvent.ts new file mode 100644 index 00000000..ec6182fd --- /dev/null +++ b/src/nitro/communication/messages/incoming/crafting/CraftingRecipesAvailableEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CraftingRecipesAvailableMessageParser } from '../../parser/crafting/CraftingRecipesAvailableMessageParser'; + +export class CraftingRecipesAvailableEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CraftingRecipesAvailableMessageParser); + } + + public getParser(): CraftingRecipesAvailableMessageParser + { + return this.parser as CraftingRecipesAvailableMessageParser; + } +} diff --git a/src/nitro/communication/messages/incoming/crafting/CraftingResultEvent.ts b/src/nitro/communication/messages/incoming/crafting/CraftingResultEvent.ts new file mode 100644 index 00000000..f3e0d30e --- /dev/null +++ b/src/nitro/communication/messages/incoming/crafting/CraftingResultEvent.ts @@ -0,0 +1,16 @@ +import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent'; +import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent'; +import { CraftingResultMessageParser } from '../../parser/crafting/CraftingResultMessageParser'; + +export class CraftingResultEvent extends MessageEvent implements IMessageEvent +{ + constructor(callBack: Function) + { + super(callBack, CraftingResultMessageParser); + } + + public getParser(): CraftingResultMessageParser + { + return this.parser as CraftingResultMessageParser; + } +} diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 4de6ff80..1e86d55f 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -264,5 +264,10 @@ export class OutgoingHeader public static REDEEM_COMMUNITY_GOAL_PRIZE = 90; public static REJECT_QUEST = 2397; public static START_CAMPAIGN = 1697; - public static GET_BONUS_RARE_INFO = 957; + public static GET_BONUS_RARE_INFO = 957; + public static CRAFT = 3591; + public static CRAFT_SECRET = 1251; + public static GET_CRAFTABLE_PRODUCTS = 633; + public static GET_CRAFTING_RECIPE = 1173; + public static GET_CRAFTING_RECIPES_AVAILABLE = 3086; } diff --git a/src/nitro/communication/messages/outgoing/crafting/CraftComposer.ts b/src/nitro/communication/messages/outgoing/crafting/CraftComposer.ts new file mode 100644 index 00000000..80110032 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/crafting/CraftComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class CraftComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number, _arg_2: string) + { + this._data = [k, _arg_2]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/crafting/CraftSecretComposer.ts b/src/nitro/communication/messages/outgoing/crafting/CraftSecretComposer.ts new file mode 100644 index 00000000..c3ea984a --- /dev/null +++ b/src/nitro/communication/messages/outgoing/crafting/CraftSecretComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class CraftSecretComposer implements IMessageComposer +{ + private _data: number[]; + + constructor(k: number, _arg_2:number[]) + { + this._data = [k, _arg_2.length].concat(_arg_2); + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/crafting/GetCraftableProductsComposer.ts b/src/nitro/communication/messages/outgoing/crafting/GetCraftableProductsComposer.ts new file mode 100644 index 00000000..ea94f9ec --- /dev/null +++ b/src/nitro/communication/messages/outgoing/crafting/GetCraftableProductsComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetCraftableProductsComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: string) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/crafting/GetCraftingRecipeComposer.ts b/src/nitro/communication/messages/outgoing/crafting/GetCraftingRecipeComposer.ts new file mode 100644 index 00000000..cfb0dc66 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/crafting/GetCraftingRecipeComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetCraftingRecipeComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(k: number) + { + this._data = [k]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/crafting/GetCraftingRecipesAvailableComposer.ts b/src/nitro/communication/messages/outgoing/crafting/GetCraftingRecipesAvailableComposer.ts new file mode 100644 index 00000000..79a4e840 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/crafting/GetCraftingRecipesAvailableComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class GetCraftingRecipesAvailableComposer implements IMessageComposer +{ + private _data: number[]; + + constructor(k: number, _arg_2:number[]) + { + this._data = [k, _arg_2.length].concat(_arg_2); + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/parser/crafting/CraftableProductsMessageParser.ts b/src/nitro/communication/messages/parser/crafting/CraftableProductsMessageParser.ts new file mode 100644 index 00000000..437f15a0 --- /dev/null +++ b/src/nitro/communication/messages/parser/crafting/CraftableProductsMessageParser.ts @@ -0,0 +1,53 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; +import { CraftingResultObjectParser } from './CraftingResultObjectParser'; + +export class CraftableProductsMessageParser implements IMessageParser +{ + private _recipes: CraftingResultObjectParser[]; + private _ingredients: string[]; + + constructor() + { + this._recipes = []; + this._ingredients = []; + } + + public flush(): boolean + { + this._recipes = []; + this._ingredients = []; + return true; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + const craftingResultCount = wrapper.readInt(); + for(let i = 0; i < craftingResultCount; i++) + { + this._recipes.push(new CraftingResultObjectParser(wrapper)); + } + const ingredientCount = wrapper.readInt(); + for(let i = 0; i < ingredientCount; i++) + { + this._ingredients.push(wrapper.readString()); + } + return true; + } + + public get recipes(): CraftingResultObjectParser[] + { + return this._recipes; + } + + public get ingredients(): string[] + { + return this._ingredients; + } + + public isActive(): boolean + { + return (this._recipes.length > 0) || (this._ingredients.length > 0); + } +} diff --git a/src/nitro/communication/messages/parser/crafting/CraftingRecipeIngredientParser.ts b/src/nitro/communication/messages/parser/crafting/CraftingRecipeIngredientParser.ts new file mode 100644 index 00000000..15d00ccf --- /dev/null +++ b/src/nitro/communication/messages/parser/crafting/CraftingRecipeIngredientParser.ts @@ -0,0 +1,23 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; + +export class CraftingRecipeIngredientParser +{ + private _count: number; + private _itemName: string; + + constructor(wrapper: IMessageDataWrapper) + { + this._count = wrapper.readInt(); + this._itemName = wrapper.readString(); + } + + public get count(): number + { + return this._count; + } + + public get itemName(): string + { + return this._itemName; + } +} diff --git a/src/nitro/communication/messages/parser/crafting/CraftingRecipeMessageParser.ts b/src/nitro/communication/messages/parser/crafting/CraftingRecipeMessageParser.ts new file mode 100644 index 00000000..88645661 --- /dev/null +++ b/src/nitro/communication/messages/parser/crafting/CraftingRecipeMessageParser.ts @@ -0,0 +1,35 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; +import { CraftingRecipeIngredientParser } from './CraftingRecipeIngredientParser'; + +export class CraftingRecipeMessageParser implements IMessageParser +{ + private _ingredients: CraftingRecipeIngredientParser[]; + + constructor() + { + this._ingredients = []; + } + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + const ingredientCount = wrapper.readInt(); + for(let i = 0; i < ingredientCount; i++) + { + this._ingredients.push(new CraftingRecipeIngredientParser(wrapper)); + } + return true; + } + + public flush(): boolean + { + this._ingredients = []; + return true; + } + + public get ingredients(): CraftingRecipeIngredientParser[] + { + return this._ingredients; + } +} diff --git a/src/nitro/communication/messages/parser/crafting/CraftingRecipesAvailableMessageParser.ts b/src/nitro/communication/messages/parser/crafting/CraftingRecipesAvailableMessageParser.ts new file mode 100644 index 00000000..065e300c --- /dev/null +++ b/src/nitro/communication/messages/parser/crafting/CraftingRecipesAvailableMessageParser.ts @@ -0,0 +1,33 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; + +export class CraftingRecipesAvailableMessageParser implements IMessageParser +{ + private _hasRecipes: boolean; + private _count: number; + + public parse(wrapper: IMessageDataWrapper): boolean + { + if(!wrapper) return false; + this._count = wrapper.readInt(); + this._hasRecipes = wrapper.readBoolean(); + return true; + } + + public flush(): boolean + { + this._count = 0; + this._hasRecipes = false; + return true; + } + + public get count(): number + { + return this._count; + } + + public get hasRecipes(): boolean + { + return this._hasRecipes; + } +} diff --git a/src/nitro/communication/messages/parser/crafting/CraftingResultMessageParser.ts b/src/nitro/communication/messages/parser/crafting/CraftingResultMessageParser.ts new file mode 100644 index 00000000..39f2845b --- /dev/null +++ b/src/nitro/communication/messages/parser/crafting/CraftingResultMessageParser.ts @@ -0,0 +1,36 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; +import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser'; +import { CraftingResultObjectParser } from './CraftingResultObjectParser'; + +export class CraftingResultMessageParser implements IMessageParser +{ + private _success: boolean; + private _result: CraftingResultObjectParser; + + public parse(wrapper:IMessageDataWrapper): boolean + { + if(!wrapper) return false; + this._success = wrapper.readBoolean(); + if(this._success) + { + this._result = new CraftingResultObjectParser(wrapper); + } + return true; + } + + public flush(): boolean + { + this._success = false; + return true; + } + + public get success(): boolean + { + return this._success; + } + + public get result():CraftingResultObjectParser + { + return this._result; + } +} diff --git a/src/nitro/communication/messages/parser/crafting/CraftingResultObjectParser.ts b/src/nitro/communication/messages/parser/crafting/CraftingResultObjectParser.ts new file mode 100644 index 00000000..41fd49ba --- /dev/null +++ b/src/nitro/communication/messages/parser/crafting/CraftingResultObjectParser.ts @@ -0,0 +1,23 @@ +import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper'; + +export class CraftingResultObjectParser +{ + private _recipeName: string; + private _itemName: string; + + constructor(wrapper: IMessageDataWrapper) + { + this._recipeName = wrapper.readString(); + this._itemName = wrapper.readString(); + } + + public get recipeName(): string + { + return this._recipeName; + } + + public get itemName(): string + { + return this._itemName; + } +}