🔥 Fix Avatar buddy they are now 100% as habbo

This commit is contained in:
duckietm
2026-04-17 11:48:38 +02:00
parent 282fd6f6bd
commit 2c2f03f20e
4 changed files with 48 additions and 0 deletions
@@ -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;
+5
View File
@@ -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);
+39
View File
@@ -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)
+2
View File
@@ -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';