cleaned up avatar/structure/figure

This commit is contained in:
Dank074 2021-05-29 20:09:46 -05:00
parent c4b8d64d75
commit 8f6559be3a
17 changed files with 59 additions and 59 deletions

View File

@ -248,7 +248,7 @@ export class AvatarAssetDownloadManager extends EventDispatcher
if(!set) continue;
const figurePartSet = set._Str_1020(container.getPartSetId(key));
const figurePartSet = set.getPartSet(container.getPartSetId(key));
if(!figurePartSet) continue;

View File

@ -333,7 +333,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa
if(setType)
{
const figurePartSet = setType._Str_1020(container.getPartSetId(id));
const figurePartSet = setType.getPartSet(container.getPartSetId(id));
if(!figurePartSet)
{
@ -367,18 +367,18 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa
{
const set = figureData._Str_740(part);
const setId = container.getPartSetId(part);
const partSet = set._Str_1020(setId);
const partSet = set.getPartSet(setId);
if(partSet)
{
clubLevel = Math.max(partSet.clubLevel, clubLevel);
const palette = figureData._Str_783(set._Str_734);
const palette = figureData._Str_783(set.paletteID);
const colors = container.getPartColorIds(part);
for(const colorId of colors)
{
const color = palette._Str_751(colorId);
const color = palette.getColor(colorId);
clubLevel = Math.max(color.clubLevel, clubLevel);
}
@ -391,7 +391,7 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa
{
const set = figureData._Str_740(part);
if(parts.indexOf(part) === -1) clubLevel = Math.max(set._Str_1002(gender), clubLevel);
if(parts.indexOf(part) === -1) clubLevel = Math.max(set.optionalFromClubLevel(gender), clubLevel);
}
return clubLevel;

View File

@ -161,11 +161,11 @@ export class AvatarStructure extends EventDispatcher
if(_local_5 == null) return null;
const _local_6 = this._figureData._Str_783(_local_5._Str_734);
const _local_6 = this._figureData._Str_783(_local_5.paletteID);
if(!_local_6) return null;
return _local_6._Str_751(_local_4[_arg_3]);
return _local_6.getColor(_local_4[_arg_3]);
}
public getBodyPartData(animation: string, frameCount: number, spriteId: string): AvatarAnimationLayerData
@ -405,15 +405,15 @@ export class AvatarStructure extends EventDispatcher
if(_local_30)
{
const _local_31 = this._figureData._Str_783(_local_30._Str_734);
const _local_31 = this._figureData._Str_783(_local_30.paletteID);
if(_local_31)
{
const _local_32 = _local_30._Str_1020(_local_28);
const _local_32 = _local_30.getPartSet(_local_28);
if(_local_32)
{
removes = removes.concat(_local_32._Str_790);
removes = removes.concat(_local_32.hiddenLayers);
for(const _local_33 of _local_32.parts)
{
@ -447,12 +447,12 @@ export class AvatarStructure extends EventDispatcher
if(!_local_35 || (_local_35 === '')) _local_35 = _local_33.type;
if(_local_29 && (_local_29.length > (_local_33._Str_827 - 1)))
if(_local_29 && (_local_29.length > (_local_33.colorLayerIndex - 1)))
{
_local_36 = _local_31._Str_751(_local_29[(_local_33._Str_827 - 1)]);
_local_36 = _local_31.getColor(_local_29[(_local_33.colorLayerIndex - 1)]);
}
const _local_37 = (_local_33._Str_827 > 0);
const _local_37 = (_local_33.colorLayerIndex > 0);
const _local_18 = new AvatarImagePartContainer(k, _local_33.type, _local_33.id.toString(), _local_36, _local_20, _local_34, _local_37, _local_33.paletteMap, _local_35);
_local_11.push(_local_18);

View File

@ -397,7 +397,7 @@ export class AvatarImageCache
}
else
{
if(container.isColorable && container.color) color = container.color._Str_915;
if(container.isColorable && container.color) color = container.color.rgb;
const offset = new Point(-(asset.x), -(asset.y));

View File

@ -55,7 +55,7 @@ export class FigureSetData implements IFigureSetData, IStructureData
if(setType)
{
setType._Str_1874(_local_2);
setType.cleanUp(_local_2);
}
else
{
@ -81,7 +81,7 @@ export class FigureSetData implements IFigureSetData, IStructureData
}
else
{
_local_4._Str_2015(_local_2);
_local_4.append(_local_2);
}
}
@ -96,7 +96,7 @@ export class FigureSetData implements IFigureSetData, IStructureData
}
else
{
_local_5._Str_2015(_local_3);
_local_5.append(_local_3);
}
}
@ -109,7 +109,7 @@ export class FigureSetData implements IFigureSetData, IStructureData
for(const set of this._setTypes.values())
{
if(!set || !set._Str_895(k, _arg_2)) continue;
if(!set || !set.isMandatory(k, _arg_2)) continue;
types.push(set.type);
}
@ -140,7 +140,7 @@ export class FigureSetData implements IFigureSetData, IStructureData
{
for(const set of this._setTypes.values())
{
const partSet = set._Str_1020(k);
const partSet = set.getPartSet(k);
if(!partSet) continue;

View File

@ -54,7 +54,7 @@ export class FigurePart implements IFigurePart
return this._index;
}
public get _Str_827(): number
public get colorLayerIndex(): number
{
return this._colorLayerIndex;
}
@ -63,4 +63,4 @@ export class FigurePart implements IFigurePart
{
return this._paletteMapId;
}
}
}

View File

@ -117,7 +117,7 @@ export class FigurePartSet implements IFigurePartSet
return this._isColorable;
}
public get _Str_608(): boolean
public get isSelectable(): boolean
{
return this._isSelectable;
}
@ -127,17 +127,17 @@ export class FigurePartSet implements IFigurePartSet
return this._parts;
}
public get _Str_790(): string[]
public get hiddenLayers(): string[]
{
return this._hiddenLayers;
}
public get _Str_653(): boolean
public get isPreSelectable(): boolean
{
return this._isPreSelectable;
}
public get _Str_651(): boolean
public get isSellable(): boolean
{
return this._isSellable;
}

View File

@ -4,6 +4,6 @@ export interface IFigurePart
type: string;
breed: number;
index: number;
_Str_827: number;
colorLayerIndex: number;
paletteMap: number;
}
}

View File

@ -8,9 +8,9 @@ export interface IFigurePartSet
gender: string;
clubLevel: number;
isColorable: boolean;
_Str_608: boolean;
isSelectable: boolean;
parts: IFigurePart[];
_Str_790: string[];
_Str_653: boolean;
_Str_651: boolean;
hiddenLayers: string[];
isPreSelectable: boolean;
isSellable: boolean;
}

View File

@ -2,7 +2,7 @@ import { IPartColor } from './IPartColor';
export interface IPalette
{
_Str_751(id: number): IPartColor;
getColor(id: number): IPartColor;
id: number;
colors: Map<string, IPartColor>;
}
}

View File

@ -4,5 +4,5 @@ export interface IPartColor
index: number;
clubLevel: number;
isSelectable: boolean;
_Str_915: number;
}
rgb: number;
}

View File

@ -3,10 +3,10 @@ import { IFigurePartSet } from './IFigurePartSet';
export interface ISetType
{
_Str_1020(_arg_1: number): IFigurePartSet;
_Str_895(_arg_1: string, _arg_2: number): boolean;
_Str_1002(_arg_1: string): number;
getPartSet(_arg_1: number): IFigurePartSet;
isMandatory(_arg_1: string, _arg_2: number): boolean;
optionalFromClubLevel(_arg_1: string): number;
type: string;
_Str_734: number;
_Str_710: AdvancedMap<string, IFigurePartSet>;
}
paletteID: number;
partSets: AdvancedMap<string, IFigurePartSet>;
}

View File

@ -14,10 +14,10 @@ export class Palette implements IPalette
this._id = parseInt(data['$'].id);
this._colors = new Map();
this._Str_2015(data);
this.append(data);
}
public _Str_2015(data: any): void
public append(data: any): void
{
for(const color of data.color)
{
@ -27,7 +27,7 @@ export class Palette implements IPalette
}
}
public _Str_751(id: number): IPartColor
public getColor(id: number): IPartColor
{
if((id === undefined) || id < 0) return null;
@ -43,4 +43,4 @@ export class Palette implements IPalette
{
return this._colors;
}
}
}

View File

@ -39,8 +39,8 @@ export class PartColor implements IPartColor
return this._isSelectable;
}
public get _Str_915(): number
public get rgb(): number
{
return this._rgb;
}
}
}

View File

@ -21,7 +21,7 @@ export class SetType implements ISetType
this._isMandatory['M'] = [ (parseInt(data['$'].mand_m_0) === 1), (parseInt(data['$'].mand_m_1) === 1) ];
this._partSets = new AdvancedMap();
this._Str_2015(data);
this.append(data);
}
public dispose(): void
@ -36,7 +36,7 @@ export class SetType implements ISetType
this._partSets = null;
}
public _Str_1874(k: any): void
public cleanUp(k: any): void
{
for(const _local_2 of k)
{
@ -52,7 +52,7 @@ export class SetType implements ISetType
}
}
public _Str_2015(k: any): void
public append(k: any): void
{
if(!k || !k.set) return;
@ -71,7 +71,7 @@ export class SetType implements ISetType
return null;
}
public _Str_1020(k: number): IFigurePartSet
public getPartSet(k: number): IFigurePartSet
{
return this._partSets.getValue(k.toString());
}
@ -81,24 +81,24 @@ export class SetType implements ISetType
return this._type;
}
public get _Str_734(): number
public get paletteID(): number
{
return this._paletteId;
}
public _Str_895(k: string, _arg_2: number): boolean
public isMandatory(k: string, _arg_2: number): boolean
{
return this._isMandatory[k.toUpperCase()][Math.min(_arg_2, 1)];
}
public _Str_1002(k: string): number
public optionalFromClubLevel(k: string): number
{
const _local_2 = this._isMandatory[k.toUpperCase()];
return _local_2.indexOf(false);
}
public get _Str_710(): AdvancedMap<string, IFigurePartSet>
public get partSets(): AdvancedMap<string, IFigurePartSet>
{
return this._partSets;
}

View File

@ -509,7 +509,7 @@ export class RoomPlane implements IRoomPlane
{
const normal = geometry.getCoordinatePosition(this._normal);
const cm = layer._Str_8547()._Str_21968(normal);
//const data = new PlaneDrawingData(maskData, blend(this._color, layer._Str_751()), cm._Str_14945());
//const data = new PlaneDrawingData(maskData, blend(this._color, layer.getColor()), cm._Str_14945());
const data = new PlaneDrawingData(maskData, this._color, cm._Str_14945());
Randomizer._Str_17384(this._randomSeed);
@ -537,7 +537,7 @@ export class RoomPlane implements IRoomPlane
}
else
{
//data = new PlaneDrawingData(maskData, blend(this._color, layer._Str_751()));
//data = new PlaneDrawingData(maskData, blend(this._color, layer.getColor()));
const data = new PlaneDrawingData(maskData, this._color);
drawingDatas.push(data);

View File

@ -140,7 +140,7 @@ export class PlaneVisualizationLayer
return this._material;
}
public _Str_751(): number
public getColor(): number
{
return this._color;
}