You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-20 15:36:18 +00:00
Move to Renderer V2
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
import { IRoomGeometry, RoomObjectVariable } from '@nitrots/api';
|
||||
import { FurnitureVisualization } from './FurnitureVisualization';
|
||||
|
||||
export class FurnitureGiftWrappedVisualization extends FurnitureVisualization
|
||||
{
|
||||
private _packetType: number = 0;
|
||||
private _ribbonType: number = 0;
|
||||
|
||||
public update(geometry: IRoomGeometry, time: number, update: boolean, skipUpdate: boolean): void
|
||||
{
|
||||
this.updatePresentWrap();
|
||||
|
||||
super.update(geometry, time, update, skipUpdate);
|
||||
}
|
||||
|
||||
private updatePresentWrap(): void
|
||||
{
|
||||
if(!this.object) return;
|
||||
|
||||
const extras = this.object.model.getValue<string>(RoomObjectVariable.FURNITURE_EXTRAS);
|
||||
|
||||
const local3 = 1000;
|
||||
const typeIndex = parseInt(extras);
|
||||
|
||||
this._packetType = Math.floor((typeIndex / local3));
|
||||
this._ribbonType = (typeIndex % local3);
|
||||
}
|
||||
|
||||
public getFrameNumber(scale: number, layerId: number): number
|
||||
{
|
||||
if(layerId <= 1) return this._packetType;
|
||||
|
||||
return this._ribbonType;
|
||||
}
|
||||
|
||||
public getSpriteAssetName(scale: number, layerId: number): string
|
||||
{
|
||||
const size = this.getValidSize(scale);
|
||||
|
||||
let assetName = this._type;
|
||||
let layerCode = '';
|
||||
|
||||
if(layerId < (this.spriteCount - 1))
|
||||
{
|
||||
layerCode = String.fromCharCode(('a'.charCodeAt(0) + layerId));
|
||||
}
|
||||
else
|
||||
{
|
||||
layerCode = 'sd';
|
||||
}
|
||||
|
||||
const frameNumber = this.getFrameNumber(scale, layerId);
|
||||
|
||||
assetName = (assetName + ((((('_' + size) + '_') + layerCode) + '_') + this.direction));
|
||||
assetName = (assetName + ('_' + frameNumber));
|
||||
|
||||
return assetName;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user