mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-26 17:30:52 +01:00
cleaned Animation
This commit is contained in:
parent
45f88bf30b
commit
2197d5c88a
@ -888,9 +888,9 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
||||
{
|
||||
const _local_2 = this._structure.getAnimation(((k.definition.state + '.') + k.actionParameter));
|
||||
|
||||
if(_local_2 && _local_2._Str_1892())
|
||||
if(_local_2 && _local_2.hasOverriddenActions())
|
||||
{
|
||||
const _local_5 = _local_2._Str_1571();
|
||||
const _local_5 = _local_2.overriddenActionNames();
|
||||
|
||||
if(_local_5)
|
||||
{
|
||||
@ -924,11 +924,11 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
||||
|
||||
if(_local_2)
|
||||
{
|
||||
this._sprites = this._sprites.concat(_local_2._Str_786);
|
||||
this._sprites = this._sprites.concat(_local_2.spriteData);
|
||||
|
||||
if(_local_2._Str_776()) this._directionOffset = _local_2._Str_1493.offset;
|
||||
if(_local_2.hasDirectionData()) this._directionOffset = _local_2.directionData.offset;
|
||||
|
||||
if(_local_2._Str_872()) this._avatarSpriteData = _local_2._Str_1475;
|
||||
if(_local_2.hasAvatarData()) this._avatarSpriteData = _local_2.avatarData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ export class AvatarStructure extends EventDispatcher
|
||||
|
||||
public getBodyPartData(animation: string, frameCount: number, spriteId: string): AvatarAnimationLayerData
|
||||
{
|
||||
return this._animationManager._Str_607(animation, frameCount, spriteId) as AvatarAnimationLayerData;
|
||||
return this._animationManager.getLayerData(animation, frameCount, spriteId) as AvatarAnimationLayerData;
|
||||
}
|
||||
|
||||
public getAnimation(k: string): Animation
|
||||
@ -260,9 +260,9 @@ export class AvatarStructure extends EventDispatcher
|
||||
|
||||
if(_local_8)
|
||||
{
|
||||
_local_3 = _local_8._Str_1065(0, k.overridingAction);
|
||||
_local_3 = _local_8.getAnimatedBodyPartIds(0, k.overridingAction);
|
||||
|
||||
if(_local_8._Str_706())
|
||||
if(_local_8.hasAddData())
|
||||
{
|
||||
const _local_11 = {
|
||||
id: '',
|
||||
@ -280,7 +280,7 @@ export class AvatarStructure extends EventDispatcher
|
||||
setType: ''
|
||||
};
|
||||
|
||||
for(const _local_13 of _local_8._Str_687)
|
||||
for(const _local_13 of _local_8.addData)
|
||||
{
|
||||
const _local_6 = this._geometry._Str_1919(_local_5, _local_13.align);
|
||||
|
||||
@ -369,7 +369,7 @@ export class AvatarStructure extends EventDispatcher
|
||||
{
|
||||
_local_14 = this.getPopulatedArray(_local_10.frameCount(_arg_3.overridingAction));
|
||||
|
||||
for(const _local_25 of _local_10._Str_1065(0, _arg_3.overridingAction))
|
||||
for(const _local_25 of _local_10.getAnimatedBodyPartIds(0, _arg_3.overridingAction))
|
||||
{
|
||||
if(_local_25 === k)
|
||||
{
|
||||
@ -559,11 +559,11 @@ export class AvatarStructure extends EventDispatcher
|
||||
|
||||
if(_local_10 != null)
|
||||
{
|
||||
const _local_48 = _local_10._Str_1550(_local_12);
|
||||
const _local_48 = _local_10.getAddData(_local_12);
|
||||
|
||||
if(_local_48)
|
||||
{
|
||||
_local_45 = _local_48._Str_1096;
|
||||
_local_45 = _local_48.isBlended;
|
||||
_local_46 = _local_48.blend;
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ export class AddDataContainer
|
||||
return this._blend;
|
||||
}
|
||||
|
||||
public get _Str_1096(): boolean
|
||||
public get isBlended(): boolean
|
||||
{
|
||||
return this._blend !== 1;
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import { SpriteDataContainer } from './SpriteDataContainer';
|
||||
|
||||
export class Animation implements IAnimation
|
||||
{
|
||||
private static _Str_2211: any[] = [];
|
||||
private static EMPTY_ARRAY: any[] = [];
|
||||
|
||||
private _id: string;
|
||||
private _description: string;
|
||||
@ -76,16 +76,16 @@ export class Animation implements IAnimation
|
||||
|
||||
const frames: AvatarAnimationLayerData[][] = [];
|
||||
|
||||
this._Str_1031(frames, override.frames, k);
|
||||
this.parseFrames(frames, override.frames, k);
|
||||
|
||||
this._overrideFrames.set(name, frames);
|
||||
}
|
||||
}
|
||||
|
||||
this._Str_1031(this._frames, _arg_2.frames, k);
|
||||
this.parseFrames(this._frames, _arg_2.frames, k);
|
||||
}
|
||||
|
||||
private _Str_1031(frames: AvatarAnimationLayerData[][], _arg_2: IAssetAnimationFrame[], _arg_3: AvatarStructure): void
|
||||
private parseFrames(frames: AvatarAnimationLayerData[][], _arg_2: IAssetAnimationFrame[], _arg_3: AvatarStructure): void
|
||||
{
|
||||
if(!_arg_2 || !_arg_2.length) return;
|
||||
|
||||
@ -144,14 +144,14 @@ export class Animation implements IAnimation
|
||||
return 0;
|
||||
}
|
||||
|
||||
public _Str_1892(): boolean
|
||||
public hasOverriddenActions(): boolean
|
||||
{
|
||||
if(!this._overriddenActions) return false;
|
||||
|
||||
return (this._overriddenActions.size > 0);
|
||||
}
|
||||
|
||||
public _Str_1571(): string[]
|
||||
public overriddenActionNames(): string[]
|
||||
{
|
||||
if(!this._overriddenActions) return null;
|
||||
|
||||
@ -169,7 +169,7 @@ export class Animation implements IAnimation
|
||||
return this._overriddenActions.get(k);
|
||||
}
|
||||
|
||||
private _Str_2259(frameCount: number, _arg_2: string = null): AvatarAnimationLayerData[]
|
||||
private getFrame(frameCount: number, _arg_2: string = null): AvatarAnimationLayerData[]
|
||||
{
|
||||
if(frameCount < 0) frameCount = 0;
|
||||
|
||||
@ -195,11 +195,11 @@ export class Animation implements IAnimation
|
||||
return layers;
|
||||
}
|
||||
|
||||
public _Str_1065(k: number, _arg_2: string=null): string[]
|
||||
public getAnimatedBodyPartIds(k: number, _arg_2: string=null): string[]
|
||||
{
|
||||
const _local_3: string[] = [];
|
||||
|
||||
for(const layer of this._Str_2259(k, _arg_2))
|
||||
for(const layer of this.getFrame(k, _arg_2))
|
||||
{
|
||||
if(layer.type === AvatarAnimationLayerData.BODYPART)
|
||||
{
|
||||
@ -221,9 +221,9 @@ export class Animation implements IAnimation
|
||||
return _local_3;
|
||||
}
|
||||
|
||||
public _Str_607(frameCount: number, spriteId: string, _arg_3: string = null): AvatarAnimationLayerData
|
||||
public getLayerData(frameCount: number, spriteId: string, _arg_3: string = null): AvatarAnimationLayerData
|
||||
{
|
||||
for(const layer of this._Str_2259(frameCount, _arg_3))
|
||||
for(const layer of this.getFrame(frameCount, _arg_3))
|
||||
{
|
||||
if(layer.id === spriteId) return layer;
|
||||
|
||||
@ -242,22 +242,22 @@ export class Animation implements IAnimation
|
||||
return null;
|
||||
}
|
||||
|
||||
public _Str_872(): boolean
|
||||
public hasAvatarData(): boolean
|
||||
{
|
||||
return this._avatarData !== null;
|
||||
}
|
||||
|
||||
public _Str_776(): boolean
|
||||
public hasDirectionData(): boolean
|
||||
{
|
||||
return this._directionData !== null;
|
||||
}
|
||||
|
||||
public _Str_706(): boolean
|
||||
public hasAddData(): boolean
|
||||
{
|
||||
return this._addData !== null;
|
||||
}
|
||||
|
||||
public _Str_1550(k: string): AddDataContainer
|
||||
public getAddData(k: string): AddDataContainer
|
||||
{
|
||||
if(this._addData)
|
||||
{
|
||||
@ -275,29 +275,29 @@ export class Animation implements IAnimation
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public get _Str_786(): SpriteDataContainer[]
|
||||
public get spriteData(): SpriteDataContainer[]
|
||||
{
|
||||
return this._spriteData || Animation._Str_2211;
|
||||
return this._spriteData || Animation.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
public get _Str_1475(): AvatarDataContainer
|
||||
public get avatarData(): AvatarDataContainer
|
||||
{
|
||||
return this._avatarData;
|
||||
}
|
||||
|
||||
public get _Str_1493(): DirectionDataContainer
|
||||
public get directionData(): DirectionDataContainer
|
||||
{
|
||||
return this._directionData;
|
||||
}
|
||||
|
||||
public get _Str_652(): string[]
|
||||
public get removeData(): string[]
|
||||
{
|
||||
return this._removeData || Animation._Str_2211;
|
||||
return this._removeData || Animation.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
public get _Str_687(): AddDataContainer[]
|
||||
public get addData(): AddDataContainer[]
|
||||
{
|
||||
return this._addData || Animation._Str_2211;
|
||||
return this._addData || Animation.EMPTY_ARRAY;
|
||||
}
|
||||
|
||||
public toString(): string
|
||||
|
@ -34,13 +34,13 @@ export class AnimationManager implements IAnimationManager
|
||||
return existing;
|
||||
}
|
||||
|
||||
public _Str_607(animation: string, frameCount: number, spriteId: string): IAnimationLayerData
|
||||
public getLayerData(animation: string, frameCount: number, spriteId: string): IAnimationLayerData
|
||||
{
|
||||
const existing = this.getAnimation(animation);
|
||||
|
||||
if(!existing) return null;
|
||||
|
||||
return existing._Str_607(frameCount, spriteId);
|
||||
return existing.getLayerData(frameCount, spriteId);
|
||||
}
|
||||
|
||||
public get animations(): Map<string, IAnimation>
|
||||
|
@ -1,11 +1,11 @@
|
||||
export interface IAnimation
|
||||
{
|
||||
_Str_872(): boolean;
|
||||
_Str_776(): boolean;
|
||||
_Str_706(): boolean;
|
||||
hasAvatarData(): boolean;
|
||||
hasDirectionData(): boolean;
|
||||
hasAddData(): boolean;
|
||||
id: string;
|
||||
_Str_786: any;
|
||||
_Str_652: any;
|
||||
_Str_687: any;
|
||||
spriteData: any;
|
||||
removeData: any;
|
||||
addData: any;
|
||||
resetOnToggle: boolean;
|
||||
}
|
||||
}
|
||||
|
@ -5,5 +5,5 @@ export interface IAnimationManager
|
||||
{
|
||||
animations: Map<any, any>;
|
||||
getAnimation(_arg_1: string): IAnimation;
|
||||
_Str_607(_arg_1: string, _arg_2: number, _arg_3: string): IAnimationLayerData;
|
||||
getLayerData(_arg_1: string, _arg_2: number, _arg_3: string): IAnimationLayerData;
|
||||
}
|
||||
|
4
src/nitro/avatar/cache/AvatarImageCache.ts
vendored
4
src/nitro/avatar/cache/AvatarImageCache.ts
vendored
@ -191,7 +191,7 @@ export class AvatarImageCache
|
||||
|
||||
if(_local_16)
|
||||
{
|
||||
const _local_18 = _local_16._Str_607(_local_17, k, _local_7.overridingAction);
|
||||
const _local_18 = _local_16.getLayerData(_local_17, k, _local_7.overridingAction);
|
||||
|
||||
if(_local_18)
|
||||
{
|
||||
@ -246,7 +246,7 @@ export class AvatarImageCache
|
||||
_local_10 = _local_18.items;
|
||||
}
|
||||
|
||||
_local_9 = _local_16._Str_652;
|
||||
_local_9 = _local_16.removeData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user