cleaned FigureSetData

This commit is contained in:
Dank074 2021-05-29 20:40:49 -05:00
parent 8f6559be3a
commit 45f88bf30b
11 changed files with 49 additions and 49 deletions

View File

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

View File

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

View File

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

View File

@ -58,7 +58,7 @@ export class AvatarImageActionCache
}
}
public _Str_2244():IActiveActionData
public getAction():IActiveActionData
{
return this._Str_1233;
}

View File

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

View File

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

View File

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

View File

@ -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())
{

View File

@ -1,5 +1,5 @@
export interface IFigureSetData
{
parse(data: any): boolean;
_Str_1017(data: any): boolean;
}
appendXML(data: any): boolean;
}

View File

@ -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;
}
appendXML(k: any): boolean;
getSetType(_arg_1: string): ISetType;
getPalette(_arg_1: number): IPalette;
getFigurePartSet(_arg_1: number): IFigurePartSet;
}

View File

@ -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<string, ActivePartSet>
public get activePartSets(): Map<string, ActivePartSet>
{
return this._activePartSets;
}