From 33b7c61841eadee76250c7e9a2696292c4e85f96 Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 12 Jun 2021 17:07:07 -0500 Subject: [PATCH] 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; }