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
Merge pull request #52 from duckietm/Dev
🔥 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 { 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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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';
|
||||
|
||||
+2
-2
@@ -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
|
||||
|
||||
+2
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user