This commit is contained in:
Bill 2021-04-29 01:01:23 -04:00
parent c0800343fa
commit 26dfb91534
6 changed files with 17 additions and 12 deletions

View File

@ -1,7 +1,7 @@
import { Texture } from 'pixi.js';
import { RenderTexture } from 'pixi.js';
export interface IGetImageListener
{
imageReady(id: number, texture: Texture, image?: HTMLImageElement): void;
imageReady(id: number, texture: RenderTexture, image?: HTMLImageElement): void;
imageFailed(id: number): void;
}

View File

@ -70,7 +70,7 @@ export interface IRoomEngine extends INitroManager
getFurnitureFloorImage(typeId: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number, extras?: string, state?: number, frameCount?: number, objectData?: IObjectData): ImageResult;
getFurnitureWallImage(typeId: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number, extras?: string, state?: number, frameCount?: number): ImageResult;
getRoomObjectImage(roomId: number, objectId: number, category: number, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor?: number): ImageResult;
getRoomObjectPetImage(typeId: number, paletteId: number, color: number, direction: IVector3D, scale: number, listener: IGetImageListener, _arg_7?: boolean, bgColor?: number, customParts?: PetCustomPart[], posture?: string): ImageResult;
getRoomObjectPetImage(typeId: number, paletteId: number, color: number, direction: IVector3D, scale: number, listener: IGetImageListener, headOnly?: boolean, bgColor?: number, customParts?: PetCustomPart[], posture?: string): ImageResult;
selectRoomObject(roomId: number, objectId: number, objectCategory: number): void;
_Str_8675(): void;
cancelRoomObjectPlacement(): void;

View File

@ -1,4 +1,4 @@
import { Container, DisplayObject, Matrix, Point, Rectangle, Sprite, Texture } from 'pixi.js';
import { Container, DisplayObject, Matrix, Point, Rectangle, RenderTexture, Sprite, Texture } from 'pixi.js';
import { IDisposable } from '../../core/common/disposable/IDisposable';
import { IUpdateReceiver } from '../../core/common/IUpdateReceiver';
import { NitroLogger } from '../../core/common/logger/NitroLogger';
@ -2972,12 +2972,12 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
return this.getGenericRoomObjectImage(type, color, direction, scale, listener, bgColor, extras, null, state, frameCount);
}
public getRoomObjectPetImage(typeId: number, paletteId: number, color: number, direction: IVector3D, scale: number, listener: IGetImageListener, _arg_7: boolean = true, bgColor: number = 0, customParts: PetCustomPart[] = null, posture: string = null): ImageResult
public getRoomObjectPetImage(typeId: number, paletteId: number, color: number, direction: IVector3D, scale: number, listener: IGetImageListener, headOnly: boolean = false, bgColor: number = 0, customParts: PetCustomPart[] = null, posture: string = null): ImageResult
{
let type: string = null;
let value = ((((typeId + ' ') + paletteId) + ' ') + color.toString(16));
if(!_arg_7) value = (value + (' ' + 'head'));
if(headOnly) value = (value + (' ' + 'head'));
if(customParts)
{
@ -3219,7 +3219,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
const objectId = roomObject.id;
const visualization = roomObject.visualization;
let texture: Texture = null;
let texture: RenderTexture = null;
if(visualization)
{

View File

@ -775,7 +775,7 @@ export class RoomPreviewer
return renderingCanvas;
}
public getGenericRoomObjectImage(type: string, value: string, direction: IVector3D, scale: number, listener:IGetImageListener, bgColor: number = 0, extras: string = null, objectData: IObjectData = null, state: number = -1, frame: number = -1, posture: string = null): ImageResult
public getGenericRoomObjectImage(type: string, value: string, direction: IVector3D, scale: number, listener: IGetImageListener, bgColor: number = 0, extras: string = null, objectData: IObjectData = null, state: number = -1, frame: number = -1, posture: string = null): ImageResult
{
if(this.isRoomEngineReady)
{

View File

@ -1,4 +1,4 @@
import { Rectangle, RenderTexture, Texture } from 'pixi.js';
import { Rectangle, RenderTexture } from 'pixi.js';
import { IRoomGeometry } from '../../utils/IRoomGeometry';
import { IRoomObject } from '../IRoomObject';
import { IObjectVisualizationData } from './IRoomObjectVisualizationData';
@ -12,6 +12,6 @@ export interface IRoomObjectVisualization
getImage(bgColor: number, originalId: number): RenderTexture;
instanceId: number;
object: IRoomObject;
image: Texture;
image: RenderTexture;
updateSpriteCounter: number;
}

View File

@ -1080,4 +1080,9 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas
{
return this._canvasUpdated;
}
public set canvasUpdated(flag: boolean)
{
this._canvasUpdated = flag;
}
}