From 45f88bf30b4d46eeb117b0e8f83c7700efdd8d8c Mon Sep 17 00:00:00 2001 From: Dank074 Date: Sat, 29 May 2021 20:40:49 -0500 Subject: [PATCH] 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; }