mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-19 06:46:28 +01:00
cleaned FigureDataContainer
This commit is contained in:
parent
ed772306a3
commit
413ba368a8
@ -409,13 +409,13 @@ export class AvatarRenderManager extends NitroManager implements IAvatarRenderMa
|
||||
{
|
||||
const container = new FigureDataContainer();
|
||||
|
||||
container._Str_2153(k, _arg_2);
|
||||
container.loadAvatarData(k, _arg_2);
|
||||
|
||||
const partSets: IFigurePartSet[] = this.resolveFigureSets(_arg_3);
|
||||
|
||||
for(const partSet of partSets)
|
||||
{
|
||||
container._Str_2088(partSet.type, partSet.id, container.getColourIds(partSet.type));
|
||||
container.savePartData(partSet.type, partSet.id, container.getColourIds(partSet.type));
|
||||
}
|
||||
|
||||
return container.getFigureString();
|
||||
|
@ -1,7 +1,7 @@
|
||||
export class AvatarEditorInstanceId
|
||||
{
|
||||
public static _Str_3350: number = 0;
|
||||
public static _Str_7195: number = 1;
|
||||
public static _Str_17909: number = 2;
|
||||
public static _Str_16370: number = 3;
|
||||
public static OWN_AVATAR_EDITOR: number = 0;
|
||||
public static FURNITURE_AVATAR_EDITOR: number = 1;
|
||||
public static BOT_EDITOR: number = 2;
|
||||
public static DEV_TOOL_EDITOR: number = 3;
|
||||
}
|
@ -3,25 +3,25 @@ import { FigureDataView } from './FigureDataView';
|
||||
|
||||
export class FigureData implements IAvatarImageListener
|
||||
{
|
||||
public static M: string = 'M';
|
||||
public static F: string = 'F';
|
||||
public static U: string = 'U';
|
||||
public static H: string = 'h';
|
||||
public static MALE: string = 'M';
|
||||
public static FEMALE: string = 'F';
|
||||
public static UNISEX: string = 'U';
|
||||
public static SCALE: string = 'h';
|
||||
public static STD: string = 'std';
|
||||
public static _Str_2028: string = '0';
|
||||
public static DEFAULT_FRAME: string = '0';
|
||||
public static FACE: string = 'hd';
|
||||
public static HR: string = 'hr';
|
||||
public static HA: string = 'ha';
|
||||
public static HE: string = 'he';
|
||||
public static EA: string = 'ea';
|
||||
public static FA: string = 'fa';
|
||||
public static CC: string = 'cc';
|
||||
public static CH: string = 'ch';
|
||||
public static HAIR: string = 'hr';
|
||||
public static HAT: string = 'ha';
|
||||
public static HEAD_ACCESSORIES: string = 'he';
|
||||
public static EYE_ACCESSORIES: string = 'ea';
|
||||
public static FACE_ACCESSORIES: string = 'fa';
|
||||
public static JACKET: string = 'cc';
|
||||
public static SHIRT: string = 'ch';
|
||||
public static CHEST_ACCESSORIES: string = 'ca';
|
||||
public static CHEST_PRINTS: string = 'cp';
|
||||
public static LG: string = 'lg';
|
||||
public static SH: string = 'sh';
|
||||
public static WA: string = 'wa';
|
||||
public static TROUSERS: string = 'lg';
|
||||
public static SHOES: string = 'sh';
|
||||
public static TROUSER_ACCESSORIES: string = 'wa';
|
||||
|
||||
private _view: FigureDataView;
|
||||
private _data: Map<string, number>;
|
||||
@ -170,18 +170,18 @@ export class FigureData implements IAvatarImageListener
|
||||
switch(k)
|
||||
{
|
||||
case FigureData.FACE:
|
||||
case FigureData.HR:
|
||||
case FigureData.HA:
|
||||
case FigureData.HE:
|
||||
case FigureData.EA:
|
||||
case FigureData.FA:
|
||||
case FigureData.CH:
|
||||
case FigureData.CC:
|
||||
case FigureData.HAIR:
|
||||
case FigureData.HAT:
|
||||
case FigureData.HEAD_ACCESSORIES:
|
||||
case FigureData.EYE_ACCESSORIES:
|
||||
case FigureData.FACE_ACCESSORIES:
|
||||
case FigureData.SHIRT:
|
||||
case FigureData.JACKET:
|
||||
case FigureData.CHEST_ACCESSORIES:
|
||||
case FigureData.CHEST_PRINTS:
|
||||
case FigureData.LG:
|
||||
case FigureData.SH:
|
||||
case FigureData.WA:
|
||||
case FigureData.TROUSERS:
|
||||
case FigureData.SHOES:
|
||||
case FigureData.TROUSER_ACCESSORIES:
|
||||
if(_arg_2 >= 0)
|
||||
{
|
||||
this._data.set(k, _arg_2);
|
||||
@ -201,18 +201,18 @@ export class FigureData implements IAvatarImageListener
|
||||
switch(k)
|
||||
{
|
||||
case FigureData.FACE:
|
||||
case FigureData.HR:
|
||||
case FigureData.HA:
|
||||
case FigureData.HE:
|
||||
case FigureData.EA:
|
||||
case FigureData.FA:
|
||||
case FigureData.CH:
|
||||
case FigureData.CC:
|
||||
case FigureData.HAIR:
|
||||
case FigureData.HAT:
|
||||
case FigureData.HEAD_ACCESSORIES:
|
||||
case FigureData.EYE_ACCESSORIES:
|
||||
case FigureData.FACE_ACCESSORIES:
|
||||
case FigureData.SHIRT:
|
||||
case FigureData.JACKET:
|
||||
case FigureData.CHEST_ACCESSORIES:
|
||||
case FigureData.CHEST_PRINTS:
|
||||
case FigureData.LG:
|
||||
case FigureData.SH:
|
||||
case FigureData.WA:
|
||||
case FigureData.TROUSERS:
|
||||
case FigureData.SHOES:
|
||||
case FigureData.TROUSER_ACCESSORIES:
|
||||
this._colors.set(k, _arg_2);
|
||||
break;
|
||||
}
|
||||
|
@ -1,25 +1,25 @@
|
||||
export class FigureDataContainer
|
||||
{
|
||||
private static M: string = 'M';
|
||||
private static F: string = 'F';
|
||||
private static U: string = 'U';
|
||||
private static H: string = 'h';
|
||||
private static MALE: string = 'M';
|
||||
private static FEMALE: string = 'F';
|
||||
private static UNISEX: string = 'U';
|
||||
private static SCALE: string = 'h';
|
||||
private static STD: string = 'std';
|
||||
private static _Str_2028: string = '0';
|
||||
private static DEFAULT_FRAME: string = '0';
|
||||
private static HD: string = 'hd';
|
||||
private static HR: string = 'hr';
|
||||
private static HA: string = 'ha';
|
||||
private static HE: string = 'he';
|
||||
private static EA: string = 'ea';
|
||||
private static FA: string = 'fa';
|
||||
private static CC: string = 'cc';
|
||||
private static CH: string = 'ch';
|
||||
private static CA: string = 'ca';
|
||||
private static CP: string = 'cp';
|
||||
private static LG: string = 'lg';
|
||||
private static SH: string = 'sh';
|
||||
private static WA: string = 'wa';
|
||||
private static _Str_1329: number[] = [28, 29, 30, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 68];
|
||||
private static HAIR: string = 'hr';
|
||||
private static HAT: string = 'ha';
|
||||
private static HEAD_ACCESSORIES: string = 'he';
|
||||
private static EYE_ACCESSORIES: string = 'ea';
|
||||
private static FACE_ACCESSORIES: string = 'fa';
|
||||
private static JACKET: string = 'cc';
|
||||
private static SHIRT: string = 'ch';
|
||||
private static CHEST_ACCESSORIES: string = 'ca';
|
||||
private static CHEST_PRINTS: string = 'cp';
|
||||
private static TROUSERS: string = 'lg';
|
||||
private static SHOES: string = 'sh';
|
||||
private static TROUSER_ACCESSORIES: string = 'wa';
|
||||
private static BLOCKED_FX_TYPES: number[] = [28, 29, 30, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 68];
|
||||
|
||||
private _data: Map<string, number>;
|
||||
private _colors: Map<string, number[]>;
|
||||
@ -27,13 +27,13 @@
|
||||
private _isDisposed: boolean;
|
||||
private _avatarEffectType: number = -1;
|
||||
|
||||
public _Str_2153(k: string, _arg_2: string): void
|
||||
public loadAvatarData(k: string, _arg_2: string): void
|
||||
{
|
||||
this._data = new Map();
|
||||
this._colors = new Map();
|
||||
this._gender = _arg_2;
|
||||
|
||||
this._Str_958(k);
|
||||
this.parseFigureString(k);
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
@ -48,7 +48,7 @@
|
||||
return this._isDisposed;
|
||||
}
|
||||
|
||||
private _Str_958(k: string): void
|
||||
private parseFigureString(k: string): void
|
||||
{
|
||||
if(!k) return;
|
||||
|
||||
@ -73,20 +73,20 @@
|
||||
|
||||
if(!colors.length) colors.push(0);
|
||||
|
||||
this._Str_1876(part, setId, false);
|
||||
this.savePartSetId(part, setId, false);
|
||||
this.savePartSetColourId(part, colors, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public _Str_2131(k: string): boolean
|
||||
public hasSetType(k: string): boolean
|
||||
{
|
||||
return !!this._data.get(k);
|
||||
}
|
||||
|
||||
public getPartSetId(k: string): number
|
||||
{
|
||||
if(this._Str_2131(k)) return this._data.get(k);
|
||||
if(this.hasSetType(k)) return this._data.get(k);
|
||||
|
||||
return -1;
|
||||
}
|
||||
@ -129,29 +129,29 @@
|
||||
return figure;
|
||||
}
|
||||
|
||||
public _Str_2088(k: string, _arg_2: number, _arg_3: number[], _arg_4: boolean = false): void
|
||||
public savePartData(k: string, _arg_2: number, _arg_3: number[], _arg_4: boolean = false): void
|
||||
{
|
||||
this._Str_1876(k, _arg_2, _arg_4);
|
||||
this.savePartSetId(k, _arg_2, _arg_4);
|
||||
this.savePartSetColourId(k, _arg_3, _arg_4);
|
||||
}
|
||||
|
||||
private _Str_1876(k: string, _arg_2: number, _arg_3: boolean = true): void
|
||||
private savePartSetId(k: string, _arg_2: number, _arg_3: boolean = true): void
|
||||
{
|
||||
switch(k)
|
||||
{
|
||||
case FigureDataContainer.HD:
|
||||
case FigureDataContainer.HR:
|
||||
case FigureDataContainer.HA:
|
||||
case FigureDataContainer.HE:
|
||||
case FigureDataContainer.EA:
|
||||
case FigureDataContainer.FA:
|
||||
case FigureDataContainer.CH:
|
||||
case FigureDataContainer.CC:
|
||||
case FigureDataContainer.CA:
|
||||
case FigureDataContainer.CP:
|
||||
case FigureDataContainer.LG:
|
||||
case FigureDataContainer.SH:
|
||||
case FigureDataContainer.WA:
|
||||
case FigureDataContainer.HAIR:
|
||||
case FigureDataContainer.HAT:
|
||||
case FigureDataContainer.HEAD_ACCESSORIES:
|
||||
case FigureDataContainer.EYE_ACCESSORIES:
|
||||
case FigureDataContainer.FACE_ACCESSORIES:
|
||||
case FigureDataContainer.SHIRT:
|
||||
case FigureDataContainer.JACKET:
|
||||
case FigureDataContainer.CHEST_ACCESSORIES:
|
||||
case FigureDataContainer.CHEST_PRINTS:
|
||||
case FigureDataContainer.TROUSERS:
|
||||
case FigureDataContainer.SHOES:
|
||||
case FigureDataContainer.TROUSER_ACCESSORIES:
|
||||
if(_arg_2 >= 0)
|
||||
{
|
||||
this._data.set(k, _arg_2);
|
||||
@ -168,18 +168,18 @@
|
||||
switch(k)
|
||||
{
|
||||
case FigureDataContainer.HD:
|
||||
case FigureDataContainer.HR:
|
||||
case FigureDataContainer.HA:
|
||||
case FigureDataContainer.HE:
|
||||
case FigureDataContainer.EA:
|
||||
case FigureDataContainer.FA:
|
||||
case FigureDataContainer.CH:
|
||||
case FigureDataContainer.CC:
|
||||
case FigureDataContainer.CA:
|
||||
case FigureDataContainer.CP:
|
||||
case FigureDataContainer.LG:
|
||||
case FigureDataContainer.SH:
|
||||
case FigureDataContainer.WA:
|
||||
case FigureDataContainer.HAIR:
|
||||
case FigureDataContainer.HAT:
|
||||
case FigureDataContainer.HEAD_ACCESSORIES:
|
||||
case FigureDataContainer.EYE_ACCESSORIES:
|
||||
case FigureDataContainer.FACE_ACCESSORIES:
|
||||
case FigureDataContainer.SHIRT:
|
||||
case FigureDataContainer.JACKET:
|
||||
case FigureDataContainer.CHEST_ACCESSORIES:
|
||||
case FigureDataContainer.CHEST_PRINTS:
|
||||
case FigureDataContainer.TROUSERS:
|
||||
case FigureDataContainer.SHOES:
|
||||
case FigureDataContainer.TROUSER_ACCESSORIES:
|
||||
this._colors.set(k, _arg_2);
|
||||
return;
|
||||
}
|
||||
|
@ -16,12 +16,12 @@ import { RoomObjectManager } from './RoomObjectManager';
|
||||
|
||||
export class RoomManager extends NitroManager implements IRoomManager, IRoomInstanceContainer
|
||||
{
|
||||
public static _Str_9994: number = -1;
|
||||
public static _Str_16337: number = 0;
|
||||
public static _Str_16443: number = 1;
|
||||
public static _Str_13904: number = 2;
|
||||
public static _Str_9846: number = 3;
|
||||
private static _Str_18280: number = 40;
|
||||
public static ROOM_MANAGER_ERROR: number = -1;
|
||||
public static ROOM_MANAGER_LOADING: number = 0;
|
||||
public static ROOM_MANAGER_LOADED: number = 1;
|
||||
public static ROOM_MANAGER_INITIALIZING: number = 2;
|
||||
public static ROOM_MANAGER_INITIALIZED: number = 3;
|
||||
private static CONTENT_PROCESSING_TIME_LIMIT_MILLISECONDS: number = 40;
|
||||
|
||||
private _state: number;
|
||||
private _rooms: Map<string, IRoomInstance>;
|
||||
@ -42,7 +42,7 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst
|
||||
{
|
||||
super();
|
||||
|
||||
this._state = RoomManager._Str_16443;
|
||||
this._state = RoomManager.ROOM_MANAGER_LOADED;
|
||||
this._rooms = new Map();
|
||||
this._contentLoader = null;
|
||||
this._updateCategories = [];
|
||||
@ -66,7 +66,7 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst
|
||||
|
||||
public onInit(): void
|
||||
{
|
||||
if(this._state >= RoomManager._Str_13904 || !this._contentLoader) return;
|
||||
if(this._state >= RoomManager.ROOM_MANAGER_INITIALIZING || !this._contentLoader) return;
|
||||
|
||||
const mandatoryLibraries = RoomContentLoader.MANDATORY_LIBRARIES;
|
||||
|
||||
@ -82,7 +82,7 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst
|
||||
}
|
||||
}
|
||||
|
||||
this._state = RoomManager._Str_13904;
|
||||
this._state = RoomManager.ROOM_MANAGER_INITIALIZING;
|
||||
}
|
||||
|
||||
public getRoomInstance(roomId: string): IRoomInstance
|
||||
@ -347,9 +347,9 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst
|
||||
|
||||
private removeFromInitialLoad(type: string): void
|
||||
{
|
||||
if(!type || this._state === RoomManager._Str_9994) return;
|
||||
if(!type || this._state === RoomManager.ROOM_MANAGER_ERROR) return;
|
||||
|
||||
if(!this._contentLoader) this._state = RoomManager._Str_9994;
|
||||
if(!this._contentLoader) this._state = RoomManager.ROOM_MANAGER_ERROR;
|
||||
|
||||
if(this._contentLoader.getCollection(type))
|
||||
{
|
||||
@ -359,7 +359,7 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst
|
||||
|
||||
if(!this._initialLoadList.length)
|
||||
{
|
||||
this._state = RoomManager._Str_9846;
|
||||
this._state = RoomManager.ROOM_MANAGER_INITIALIZED;
|
||||
|
||||
if(this._listener)
|
||||
{
|
||||
@ -369,7 +369,7 @@ export class RoomManager extends NitroManager implements IRoomManager, IRoomInst
|
||||
}
|
||||
else
|
||||
{
|
||||
this._state = RoomManager._Str_9994;
|
||||
this._state = RoomManager.ROOM_MANAGER_ERROR;
|
||||
|
||||
if(this._listener) this._listener.onRoomEngineInitalized(false);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user