Merge pull request #52 from duckietm/Dev

🔥 Fix Avatar buddy they are now 100% as habbo
This commit is contained in:
DuckieTM
2026-04-17 13:54:12 +02:00
committed by GitHub
7 changed files with 59 additions and 4 deletions
@@ -1,4 +1,5 @@
import { Container, Texture } from 'pixi.js';
import { IActiveActionData } from './actions';
import { IAvatarFigureContainer } from './IAvatarFigureContainer';
import { IAnimationLayerData, ISpriteDataContainer } from './animation';
import { IPartColor } from './structure';
@@ -18,6 +19,7 @@ export interface IAvatarImage
getDirection(): number;
getFigure(): IAvatarFigureContainer;
getPartColor(_arg_1: string): IPartColor;
getMainAction(): IActiveActionData;
isAnimating(): boolean;
getCanvasOffsets(): number[];
initActionAppends(): void;
+5
View File
@@ -158,6 +158,11 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener
return this._canvasOffsets;
}
public getMainAction(): IActiveActionData
{
return this._mainAction;
}
public getLayerData(k: ISpriteDataContainer): IAnimationLayerData
{
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 figurePartTypeIds = figureContainer.getPartTypeIds();
const mainAction = avatar?.getMainAction?.();
const isSittingPosture = (mainAction?.definition?.assetPartDefinition === 'sit')
|| (action.definition.assetPartDefinition === 'sit');
for(const figurePartType of figurePartTypeIds)
{
@@ -390,8 +393,44 @@ export class AvatarStructure
{
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)
{
if(isSittingPosture && figurePartType === 'pt')
{
if(petHasVisibleSit && figurePart.type !== 'pt') continue;
if(!petHasVisibleSit) continue;
}
if(visiblePartTypes.indexOf(figurePart.type) > -1)
{
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))))
{
this.disposeInactiveActions(0);
this._geometryType = k;
this._canvas = null;
this._defaultAction = (k === GeometryType.HORIZONTAL) ? 'lay' : 'std';
@@ -4,9 +4,9 @@ export class CatalogAdminCreateOfferComposer implements IMessageComposer<Constru
{
private _data: ConstructorParameters<typeof CatalogAdminCreateOfferComposer>;
constructor(pageId: number, itemId: number, catalogName: string, costCredits: number, costPoints: number, pointsType: number, amount: number, clubOnly: number, extradata: string, haveOffer: boolean, offerIdGroup: number, limitedStack: number, orderNumber: number, catalogMode: string = 'NORMAL')
constructor(pageId: number, itemIds: string, catalogName: string, costCredits: number, costPoints: number, pointsType: number, amount: number, clubOnly: number, extradata: string, haveOffer: boolean, offerIdGroup: number, limitedStack: number, orderNumber: number, catalogMode: string = 'NORMAL')
{
this._data = [ pageId, itemId, catalogName, costCredits, costPoints, pointsType, amount, clubOnly, extradata, haveOffer, offerIdGroup, limitedStack, orderNumber, catalogMode ];
this._data = [ pageId, itemIds, catalogName, costCredits, costPoints, pointsType, amount, clubOnly, extradata, haveOffer, offerIdGroup, limitedStack, orderNumber, catalogMode ];
}
dispose(): void
@@ -4,9 +4,9 @@ export class CatalogAdminSaveOfferComposer implements IMessageComposer<Construct
{
private _data: ConstructorParameters<typeof CatalogAdminSaveOfferComposer>;
constructor(offerId: number, pageId: number, itemId: number, catalogName: string, costCredits: number, costPoints: number, pointsType: number, amount: number, clubOnly: number, extradata: string, haveOffer: boolean, offerIdGroup: number, limitedStack: number, orderNumber: number, catalogMode: string = 'NORMAL')
constructor(offerId: number, pageId: number, itemIds: string, catalogName: string, costCredits: number, costPoints: number, pointsType: number, amount: number, clubOnly: number, extradata: string, haveOffer: boolean, offerIdGroup: number, limitedStack: number, orderNumber: number, catalogMode: string = 'NORMAL')
{
this._data = [ offerId, pageId, itemId, catalogName, costCredits, costPoints, pointsType, amount, clubOnly, extradata, haveOffer, offerIdGroup, limitedStack, orderNumber, catalogMode ];
this._data = [ offerId, pageId, itemIds, catalogName, costCredits, costPoints, pointsType, amount, clubOnly, extradata, haveOffer, offerIdGroup, limitedStack, orderNumber, catalogMode ];
}
dispose(): void
@@ -14,6 +14,7 @@ export class CatalogPageMessageOfferData
private _bundlePurchaseAllowed: boolean;
private _isPet: boolean;
private _previewImage: string;
private _itemIds: string;
private _products: CatalogPageMessageProductData[];
constructor(wrapper: IMessageDataWrapper)
@@ -41,6 +42,7 @@ export class CatalogPageMessageOfferData
this._bundlePurchaseAllowed = wrapper.readBoolean();
this._isPet = wrapper.readBoolean();
this._previewImage = wrapper.readString();
this._itemIds = wrapper.readString();
}
public get offerId(): number
@@ -102,4 +104,9 @@ export class CatalogPageMessageOfferData
{
return this._products;
}
public get itemIds(): string
{
return this._itemIds;
}
}