You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
🔥 Fix Avatar buddy they are now 100% as habbo
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { Container, Texture } from 'pixi.js';
|
import { Container, Texture } from 'pixi.js';
|
||||||
|
import { IActiveActionData } from './actions';
|
||||||
import { IAvatarFigureContainer } from './IAvatarFigureContainer';
|
import { IAvatarFigureContainer } from './IAvatarFigureContainer';
|
||||||
import { IAnimationLayerData, ISpriteDataContainer } from './animation';
|
import { IAnimationLayerData, ISpriteDataContainer } from './animation';
|
||||||
import { IPartColor } from './structure';
|
import { IPartColor } from './structure';
|
||||||
@@ -18,6 +19,7 @@ export interface IAvatarImage
|
|||||||
getDirection(): number;
|
getDirection(): number;
|
||||||
getFigure(): IAvatarFigureContainer;
|
getFigure(): IAvatarFigureContainer;
|
||||||
getPartColor(_arg_1: string): IPartColor;
|
getPartColor(_arg_1: string): IPartColor;
|
||||||
|
getMainAction(): IActiveActionData;
|
||||||
isAnimating(): boolean;
|
isAnimating(): boolean;
|
||||||
getCanvasOffsets(): number[];
|
getCanvasOffsets(): number[];
|
||||||
initActionAppends(): void;
|
initActionAppends(): void;
|
||||||
|
|||||||
@@ -158,6 +158,11 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
|
|||||||
return this._canvasOffsets;
|
return this._canvasOffsets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getMainAction(): IActiveActionData
|
||||||
|
{
|
||||||
|
return this._mainAction;
|
||||||
|
}
|
||||||
|
|
||||||
public getLayerData(k: ISpriteDataContainer): IAnimationLayerData
|
public getLayerData(k: ISpriteDataContainer): IAnimationLayerData
|
||||||
{
|
{
|
||||||
return this._structure.getBodyPartData(k.animation.id, this._frameCounter, k.id);
|
return this._structure.getBodyPartData(k.animation.id, this._frameCounter, k.id);
|
||||||
|
|||||||
@@ -366,6 +366,9 @@ export class AvatarStructure
|
|||||||
|
|
||||||
const visiblePartTypes = this._geometry.getParts(geometryType, bodyPartId, direction, activePartTypes, avatar);
|
const visiblePartTypes = this._geometry.getParts(geometryType, bodyPartId, direction, activePartTypes, avatar);
|
||||||
const figurePartTypeIds = figureContainer.getPartTypeIds();
|
const figurePartTypeIds = figureContainer.getPartTypeIds();
|
||||||
|
const mainAction = avatar?.getMainAction?.();
|
||||||
|
const isSittingPosture = (mainAction?.definition?.assetPartDefinition === 'sit')
|
||||||
|
|| (action.definition.assetPartDefinition === 'sit');
|
||||||
|
|
||||||
for(const figurePartType of figurePartTypeIds)
|
for(const figurePartType of figurePartTypeIds)
|
||||||
{
|
{
|
||||||
@@ -390,8 +393,44 @@ export class AvatarStructure
|
|||||||
{
|
{
|
||||||
removes = removes.concat(figurePartSet.hiddenLayers);
|
removes = removes.concat(figurePartSet.hiddenLayers);
|
||||||
|
|
||||||
|
let petHasVisibleSit = false;
|
||||||
|
|
||||||
|
if(isSittingPosture && figurePartType === 'pt')
|
||||||
|
{
|
||||||
|
for(const fp of figurePartSet.parts)
|
||||||
|
{
|
||||||
|
if(fp.type === 'pt')
|
||||||
|
{
|
||||||
|
for(const dir of ['0', '2'])
|
||||||
|
{
|
||||||
|
const assetName = 'h_sit_pt_' + fp.id + '_' + dir + '_0';
|
||||||
|
const testAsset = this._renderManager.getAssetByName(assetName);
|
||||||
|
|
||||||
|
if(testAsset && testAsset.width > 1 && testAsset.height > 1 && testAsset.source === assetName)
|
||||||
|
{
|
||||||
|
const stdName = 'h_std_pt_' + fp.id + '_' + dir + '_0';
|
||||||
|
const stdAsset = this._renderManager.getAssetByName(stdName);
|
||||||
|
|
||||||
|
if(!stdAsset || stdAsset.source !== assetName)
|
||||||
|
{
|
||||||
|
petHasVisibleSit = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for(const figurePart of figurePartSet.parts)
|
for(const figurePart of figurePartSet.parts)
|
||||||
{
|
{
|
||||||
|
if(isSittingPosture && figurePartType === 'pt')
|
||||||
|
{
|
||||||
|
if(petHasVisibleSit && figurePart.type !== 'pt') continue;
|
||||||
|
if(!petHasVisibleSit) continue;
|
||||||
|
}
|
||||||
if(visiblePartTypes.indexOf(figurePart.type) > -1)
|
if(visiblePartTypes.indexOf(figurePart.type) > -1)
|
||||||
{
|
{
|
||||||
if(animationAction)
|
if(animationAction)
|
||||||
|
|||||||
@@ -139,6 +139,8 @@ export class AvatarImageCache
|
|||||||
|
|
||||||
if((((this._geometryType === GeometryType.SITTING) && (k === GeometryType.VERTICAL)) || ((this._geometryType === GeometryType.VERTICAL) && (k === GeometryType.SITTING)) || ((this._geometryType === GeometryType.SNOWWARS_HORIZONTAL) && (k = GeometryType.SNOWWARS_HORIZONTAL))))
|
if((((this._geometryType === GeometryType.SITTING) && (k === GeometryType.VERTICAL)) || ((this._geometryType === GeometryType.VERTICAL) && (k === GeometryType.SITTING)) || ((this._geometryType === GeometryType.SNOWWARS_HORIZONTAL) && (k = GeometryType.SNOWWARS_HORIZONTAL))))
|
||||||
{
|
{
|
||||||
|
this.disposeInactiveActions(0);
|
||||||
|
|
||||||
this._geometryType = k;
|
this._geometryType = k;
|
||||||
this._canvas = null;
|
this._canvas = null;
|
||||||
this._defaultAction = (k === GeometryType.HORIZONTAL) ? 'lay' : 'std';
|
this._defaultAction = (k === GeometryType.HORIZONTAL) ? 'lay' : 'std';
|
||||||
|
|||||||
Reference in New Issue
Block a user