Add thumbnail

This commit is contained in:
Bill 2021-07-30 19:59:15 -04:00
parent 4b268a5826
commit 6c0bb8576a
3 changed files with 8 additions and 5 deletions

View File

@ -2,7 +2,7 @@ import { RenderRoomMessageComposer } from './RenderRoomMessageComposer';
export class RenderRoomThumbnailMessageComposer extends RenderRoomMessageComposer export class RenderRoomThumbnailMessageComposer extends RenderRoomMessageComposer
{ {
constructor(k:any, _arg_2:string, _arg_3:string, _arg_4:number, _arg_5:number) constructor(k:any = '', _arg_2:string = '', _arg_3:string = '', _arg_4:number = -1, _arg_5:number = -1)
{ {
super(k, _arg_2, _arg_3, _arg_4, _arg_5); super(k, _arg_2, _arg_3, _arg_4, _arg_5);
} }

View File

@ -90,7 +90,7 @@ export interface IRoomEngine extends INitroManager
processRoomObjectOperation(objectId: number, category: number, operation: string): boolean; processRoomObjectOperation(objectId: number, category: number, operation: string): boolean;
processRoomObjectPlacement(placementSource: string, id: number, category: number, typeId: number, legacyString?: string, stuffData?: IObjectData, state?: number, frameNumber?: number, posture?: string): boolean; processRoomObjectPlacement(placementSource: string, id: number, category: number, typeId: number, legacyString?: string, stuffData?: IObjectData, state?: number, frameNumber?: number, posture?: string): boolean;
dispatchMouseEvent(canvasId: number, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): void; dispatchMouseEvent(canvasId: number, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): void;
createRoomScreenshot(roomId: number, canvasId?: number, bounds?: Rectangle, sendToServer?: boolean): HTMLImageElement; createRoomScreenshot(roomId: number, canvasId?: number, bounds?: Rectangle, sendToServer?: boolean, asThumbnail?: boolean): HTMLImageElement;
modifyRoomObjectData(objectId: number, objectCategory: number, colorHex: string, text: string): boolean; modifyRoomObjectData(objectId: number, objectCategory: number, colorHex: string, text: string): boolean;
deleteRoomObject(objectId: number, objectCategory: number): boolean; deleteRoomObject(objectId: number, objectCategory: number): boolean;
sessionDataManager: ISessionDataManager; sessionDataManager: ISessionDataManager;

View File

@ -30,7 +30,7 @@ import { RoomGeometry } from '../../room/utils/RoomGeometry';
import { Vector3d } from '../../room/utils/Vector3d'; import { Vector3d } from '../../room/utils/Vector3d';
import { PetCustomPart } from '../avatar/pets/PetCustomPart'; import { PetCustomPart } from '../avatar/pets/PetCustomPart';
import { PetFigureData } from '../avatar/pets/PetFigureData'; import { PetFigureData } from '../avatar/pets/PetFigureData';
import { RenderRoomMessageComposer } from '../communication'; import { RenderRoomMessageComposer, RenderRoomThumbnailMessageComposer } from '../communication';
import { INitroCommunicationManager } from '../communication/INitroCommunicationManager'; import { INitroCommunicationManager } from '../communication/INitroCommunicationManager';
import { ToolbarIconEnum } from '../enums/ToolbarIconEnum'; import { ToolbarIconEnum } from '../enums/ToolbarIconEnum';
import { NitroToolbarAnimateIconEvent } from '../events/NitroToolbarAnimateIconEvent'; import { NitroToolbarAnimateIconEvent } from '../events/NitroToolbarAnimateIconEvent';
@ -3448,7 +3448,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
return null; return null;
} }
public createRoomScreenshot(roomId: number, canvasId: number = -1, bounds: Rectangle = null, sendToServer: boolean = false): HTMLImageElement public createRoomScreenshot(roomId: number, canvasId: number = -1, bounds: Rectangle = null, sendToServer: boolean = false, asThumbnail: boolean = false): HTMLImageElement
{ {
let canvas: IRoomRenderingCanvas = null; let canvas: IRoomRenderingCanvas = null;
@ -3474,7 +3474,10 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
if(sendToServer) if(sendToServer)
{ {
const composer = new RenderRoomMessageComposer(); let composer: RenderRoomMessageComposer = null;
if(asThumbnail) composer = new RenderRoomThumbnailMessageComposer();
else composer = new RenderRoomMessageComposer();
composer.assignBitmap(texture); composer.assignBitmap(texture);