cleaned some variables

This commit is contained in:
Dank074 2021-06-23 04:24:32 -05:00
parent 436905d5b6
commit 39b9c2b969
10 changed files with 70 additions and 70 deletions

View File

@ -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;

View File

@ -77,7 +77,7 @@ export class FurnitureSoundBlockLogic extends FurnitureMultiStateLogic
if(this._state === FurnitureSoundBlockLogic.STATE_UNINITIALIZED && model.getValue<number>(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<number>(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)

View File

@ -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<number>(RoomObjectVariable.FURNITURE_VOTE_COUNTER_COUNT);
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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);
}
}
}

View File

@ -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;
}
}
}

View File

@ -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('_');
}

View File

@ -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);
}
}
}

View File

@ -42,4 +42,4 @@ export class FurnitureVoteMajorityVisualization extends FurnitureAnimatedVisuali
return super.getLayerAlpha(scale, direction, layerId);
}
}
}