clean AvatarFigureContainer

This commit is contained in:
Dank074 2021-05-09 02:51:27 -05:00
parent 19d028e8da
commit 4e54c91554
6 changed files with 29 additions and 29 deletions

View File

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

View File

@ -11,12 +11,12 @@ export class AvatarFigureContainer implements IAvatarFigureContainer
this.parseFigure(figure);
}
public _Str_1016(): IterableIterator<string>
public getPartTypeIds(): IterableIterator<string>
{
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<string, any> = 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);
}
}
}
}
}

View File

@ -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[]

View File

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

View File

@ -1,10 +1,10 @@
export interface IAvatarFigureContainer
{
_Str_1016(): IterableIterator<string>;
_Str_744(_arg_1: string): boolean;
getPartTypeIds(): IterableIterator<string>;
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;
}
getPartColorIds(_arg_1: string): number[];
updatePart(_arg_1: string, _arg_2: number, _arg_3: number[]): void;
removePart(_arg_1: string): void;
getFigureString(): string;
}

View File

@ -98,7 +98,7 @@
return [];
}
public _Str_1008(): string
public getFigureString(): string
{
let figure = '';
@ -238,4 +238,4 @@
{
return this._gender;
}
}
}