👈 Added FURNITURE_PICKUP_ALL for chooser

This commit is contained in:
duckietm 2025-03-19 12:49:49 +01:00
parent 45bf5aa96f
commit e0c0c06c99
5 changed files with 38 additions and 9 deletions

File diff suppressed because one or more lines are too long

View File

@ -472,5 +472,6 @@ export class OutgoingHeader
public static RENTABLE_EXTEND_RENT_OR_BUYOUT_FURNI = 1071; public static RENTABLE_EXTEND_RENT_OR_BUYOUT_FURNI = 1071;
public static RENTABLE_GET_RENT_OR_BUYOUT_OFFER = 2518; public static RENTABLE_GET_RENT_OR_BUYOUT_OFFER = 2518;
public static FURNITURE_PICKUP_ALL = 10017;
public static DELETE_ITEM = 10018; public static DELETE_ITEM = 10018;
} }

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../../api';
export class FurniturePickupAllComposer implements IMessageComposer<ConstructorParameters<typeof FurniturePickupAllComposer>>
{
private _data: ConstructorParameters<typeof FurniturePickupAllComposer>;
constructor(...objectId: number[])
{
this._data = [objectId.length, ...objectId];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -5,6 +5,7 @@ export * from './ExtendRentOrBuyoutStripItemMessageComposer';
export * from './floor'; export * from './floor';
export * from './FurnitureAliasesComposer'; export * from './FurnitureAliasesComposer';
export * from './FurnitureGroupInfoComposer'; export * from './FurnitureGroupInfoComposer';
export * from './FurniturePickupAllComposer';
export * from './FurniturePickupComposer'; export * from './FurniturePickupComposer';
export * from './FurniturePlaceComposer'; export * from './FurniturePlaceComposer';
export * from './FurniturePlacePaintComposer'; export * from './FurniturePlacePaintComposer';

View File

@ -1,6 +1,6 @@
import { IGraphicAsset } from '@nitrots/api'; import { IGraphicAsset } from '@nitrots/api';
import { GetRenderer, TextureUtils } from '@nitrots/utils'; import { GetRenderer, TextureUtils } from '@nitrots/utils';
import { Matrix, Sprite, Texture, RenderTexture, Graphics } from 'pixi.js'; import { Matrix, Sprite, Texture, RenderTexture } from 'pixi.js';
import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization'; import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization';
export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualization { export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualization {
@ -79,13 +79,19 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
const assetName = (this.cacheSpriteAssetName(scale, layerId, false) + this.getFrameNumber(scale, layerId)); const assetName = (this.cacheSpriteAssetName(scale, layerId, false) + this.getFrameNumber(scale, layerId));
const asset = this.getAsset(assetName, layerId); const asset = this.getAsset(assetName, layerId);
const thumbnailAssetName = `${this.getThumbnailAssetName(scale)}-${this._uniqueId}`; const thumbnailAssetName = `${this.getThumbnailAssetName(scale)}-${this._uniqueId}`;
const transformedTexture = this.generateTransformedThumbnail(k, asset || { width: 64, height: 64, offsetX: -34, offsetY: -30 }); const transformedTexture = this.generateTransformedThumbnail(k, asset || { width: 64, height: 64 });
this.asset.addAsset(thumbnailAssetName, transformedTexture, true, asset?.offsetX || -34, asset?.offsetY || -30, false, false); // Calculate dynamic offsets based on transformed bounds
const sprite = new Sprite(transformedTexture);
const bounds = sprite.getLocalBounds();
const offsetX = -Math.floor(bounds.width / 2); // Center horizontally
const offsetY = -Math.floor(bounds.height / 2); // Center vertically
const sprite = this.getSprite(layerId); this.asset.addAsset(thumbnailAssetName, transformedTexture, true, offsetX, offsetY, false, false);
if (sprite) {
sprite.texture = transformedTexture; const placedSprite = this.getSprite(layerId);
if (placedSprite) {
placedSprite.texture = transformedTexture;
} }
return; return;
@ -133,8 +139,7 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
const height = 64; const height = 64;
const container = new Sprite(); const container = new Sprite();
sprite.position.set((width - sprite.width) / 2, (height - sprite.height) / 2);
sprite.position.set((width - sprite.width) / 2 + 2, (height - sprite.height) / 2 + 2);
container.addChild(sprite); container.addChild(sprite);
const renderTexture = RenderTexture.create({ width, height, resolution: 1 }); const renderTexture = RenderTexture.create({ width, height, resolution: 1 });