mirror of
https://github.com/duckietm/Nitro-Cool-UI-Renderer.git
synced 2025-06-21 15:06:58 +00:00
👈 Added FURNITURE_PICKUP_ALL for chooser
This commit is contained in:
parent
45bf5aa96f
commit
e0c0c06c99
File diff suppressed because one or more lines are too long
@ -472,5 +472,6 @@ export class OutgoingHeader
|
||||
public static RENTABLE_EXTEND_RENT_OR_BUYOUT_FURNI = 1071;
|
||||
public static RENTABLE_GET_RENT_OR_BUYOUT_OFFER = 2518;
|
||||
|
||||
public static FURNITURE_PICKUP_ALL = 10017;
|
||||
public static DELETE_ITEM = 10018;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ export * from './ExtendRentOrBuyoutStripItemMessageComposer';
|
||||
export * from './floor';
|
||||
export * from './FurnitureAliasesComposer';
|
||||
export * from './FurnitureGroupInfoComposer';
|
||||
export * from './FurniturePickupAllComposer';
|
||||
export * from './FurniturePickupComposer';
|
||||
export * from './FurniturePlaceComposer';
|
||||
export * from './FurniturePlacePaintComposer';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { IGraphicAsset } from '@nitrots/api';
|
||||
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';
|
||||
|
||||
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 asset = this.getAsset(assetName, layerId);
|
||||
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);
|
||||
if (sprite) {
|
||||
sprite.texture = transformedTexture;
|
||||
this.asset.addAsset(thumbnailAssetName, transformedTexture, true, offsetX, offsetY, false, false);
|
||||
|
||||
const placedSprite = this.getSprite(layerId);
|
||||
if (placedSprite) {
|
||||
placedSprite.texture = transformedTexture;
|
||||
}
|
||||
|
||||
return;
|
||||
@ -133,8 +139,7 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza
|
||||
const height = 64;
|
||||
|
||||
const container = new Sprite();
|
||||
|
||||
sprite.position.set((width - sprite.width) / 2 + 2, (height - sprite.height) / 2 + 2);
|
||||
sprite.position.set((width - sprite.width) / 2, (height - sprite.height) / 2);
|
||||
container.addChild(sprite);
|
||||
|
||||
const renderTexture = RenderTexture.create({ width, height, resolution: 1 });
|
||||
|
Loading…
x
Reference in New Issue
Block a user