mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-31 11:12:35 +01:00
Fix ad url
This commit is contained in:
parent
e36a906d89
commit
03fbeabbd5
@ -1,4 +1,4 @@
|
|||||||
import { DisplayObject, Point, Rectangle } from 'pixi.js';
|
import { DisplayObject, Point, Rectangle, RenderTexture } from 'pixi.js';
|
||||||
import { INitroManager } from '../../core/common/INitroManager';
|
import { INitroManager } from '../../core/common/INitroManager';
|
||||||
import { IRoomObject } from '../../room';
|
import { IRoomObject } from '../../room';
|
||||||
import { IRoomManager } from '../../room/IRoomManager';
|
import { IRoomManager } from '../../room/IRoomManager';
|
||||||
@ -90,7 +90,8 @@ 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, asThumbnail?: boolean): HTMLImageElement;
|
createTextureFromRoom(roomId: number, canvasId?: number, bounds?: Rectangle): RenderTexture;
|
||||||
|
saveTextureAsScreenshot(texture: RenderTexture, saveAsThumbnail?: boolean): void
|
||||||
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;
|
||||||
|
@ -253,6 +253,15 @@ export class RoomContentLoader implements IFurnitureDataListener
|
|||||||
return name.substr(0, index);
|
return name.substr(0, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getRoomObjectAdUrl(type: string): string
|
||||||
|
{
|
||||||
|
const value = this._objectTypeAdUrls.get(type);
|
||||||
|
|
||||||
|
if(!value) return '';
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
public getPetColorResult(petIndex: number, paletteIndex: number): PetColorResult
|
public getPetColorResult(petIndex: number, paletteIndex: number): PetColorResult
|
||||||
{
|
{
|
||||||
const colorResults = this._petColors.get(petIndex);
|
const colorResults = this._petColors.get(petIndex);
|
||||||
|
@ -1049,6 +1049,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
|||||||
{
|
{
|
||||||
model.setValue(RoomObjectVariable.FURNITURE_COLOR, this.getFurnitureFloorColorIndex(data.typeId));
|
model.setValue(RoomObjectVariable.FURNITURE_COLOR, this.getFurnitureFloorColorIndex(data.typeId));
|
||||||
model.setValue(RoomObjectVariable.FURNITURE_TYPE_ID, data.typeId);
|
model.setValue(RoomObjectVariable.FURNITURE_TYPE_ID, data.typeId);
|
||||||
|
model.setValue(RoomObjectVariable.FURNITURE_AD_URL, this.getRoomObjectAdUrl(data.type));
|
||||||
model.setValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT, (data.realRoomObject ? 1 : 0));
|
model.setValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT, (data.realRoomObject ? 1 : 0));
|
||||||
model.setValue(RoomObjectVariable.FURNITURE_EXPIRY_TIME, data.expiryTime);
|
model.setValue(RoomObjectVariable.FURNITURE_EXPIRY_TIME, data.expiryTime);
|
||||||
model.setValue(RoomObjectVariable.FURNITURE_EXPIRTY_TIMESTAMP, Nitro.instance.time);
|
model.setValue(RoomObjectVariable.FURNITURE_EXPIRTY_TIMESTAMP, Nitro.instance.time);
|
||||||
@ -1107,6 +1108,7 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
|||||||
{
|
{
|
||||||
model.setValue(RoomObjectVariable.FURNITURE_COLOR, this.getFurnitureWallColorIndex(data.typeId));
|
model.setValue(RoomObjectVariable.FURNITURE_COLOR, this.getFurnitureWallColorIndex(data.typeId));
|
||||||
model.setValue(RoomObjectVariable.FURNITURE_TYPE_ID, data.typeId);
|
model.setValue(RoomObjectVariable.FURNITURE_TYPE_ID, data.typeId);
|
||||||
|
model.setValue(RoomObjectVariable.FURNITURE_AD_URL, this.getRoomObjectAdUrl(data.type));
|
||||||
model.setValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT, (data.realRoomObject ? 1 : 0));
|
model.setValue(RoomObjectVariable.FURNITURE_REAL_ROOM_OBJECT, (data.realRoomObject ? 1 : 0));
|
||||||
model.setValue(RoomObjectVariable.OBJECT_ACCURATE_Z_VALUE, 1);
|
model.setValue(RoomObjectVariable.OBJECT_ACCURATE_Z_VALUE, 1);
|
||||||
model.setValue(RoomObjectVariable.FURNITURE_EXPIRY_TIME, data.expiryTime);
|
model.setValue(RoomObjectVariable.FURNITURE_EXPIRY_TIME, data.expiryTime);
|
||||||
@ -3448,7 +3450,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, asThumbnail: boolean = false): HTMLImageElement
|
public createTextureFromRoom(roomId: number, canvasId: number = -1, bounds: Rectangle = null): RenderTexture
|
||||||
{
|
{
|
||||||
let canvas: IRoomRenderingCanvas = null;
|
let canvas: IRoomRenderingCanvas = null;
|
||||||
|
|
||||||
@ -3472,27 +3474,19 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
|||||||
texture = canvas.getDisplayAsTexture();
|
texture = canvas.getDisplayAsTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(sendToServer)
|
return texture;
|
||||||
{
|
}
|
||||||
let composer: RenderRoomMessageComposer = null;
|
|
||||||
|
|
||||||
if(asThumbnail) composer = new RenderRoomThumbnailMessageComposer();
|
public saveTextureAsScreenshot(texture: RenderTexture, saveAsThumbnail: boolean = false): void
|
||||||
else composer = new RenderRoomMessageComposer();
|
{
|
||||||
|
let composer: RenderRoomMessageComposer = null;
|
||||||
|
|
||||||
composer.assignBitmap(texture);
|
if(saveAsThumbnail) composer = new RenderRoomThumbnailMessageComposer();
|
||||||
|
else composer = new RenderRoomMessageComposer();
|
||||||
|
|
||||||
this._communication.connection.send(composer);
|
composer.assignBitmap(texture);
|
||||||
}
|
|
||||||
|
|
||||||
const base64 = TextureUtils.generateImageUrl(texture);
|
this._communication.connection.send(composer);
|
||||||
const image = new Image();
|
|
||||||
|
|
||||||
image.src = base64;
|
|
||||||
|
|
||||||
/*const newWindow = window.open('');
|
|
||||||
newWindow.document.write(image.outerHTML);*/
|
|
||||||
|
|
||||||
return image;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public objectsInitialized(k: string): void
|
public objectsInitialized(k: string): void
|
||||||
@ -3525,6 +3519,11 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
|||||||
return (object.model.getValue<string>(RoomObjectVariable.OBJECT_ROOM_ID));
|
return (object.model.getValue<string>(RoomObjectVariable.OBJECT_ROOM_ID));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getRoomObjectAdUrl(type: string): string
|
||||||
|
{
|
||||||
|
return this._roomContentLoader.getRoomObjectAdUrl(type);
|
||||||
|
}
|
||||||
|
|
||||||
public getPetTypeId(figure: string): number
|
public getPetTypeId(figure: string): number
|
||||||
{
|
{
|
||||||
let type = -1;
|
let type = -1;
|
||||||
|
@ -26,6 +26,7 @@ export class FurnitureVisualization extends RoomObjectSpriteVisualization
|
|||||||
protected _alphaMultiplier: number;
|
protected _alphaMultiplier: number;
|
||||||
protected _alphaChanged: boolean;
|
protected _alphaChanged: boolean;
|
||||||
protected _clickUrl: string;
|
protected _clickUrl: string;
|
||||||
|
protected _clickHandling: boolean;
|
||||||
|
|
||||||
protected _cacheDirection: number;
|
protected _cacheDirection: number;
|
||||||
protected _cacheScale: number;
|
protected _cacheScale: number;
|
||||||
@ -60,6 +61,7 @@ export class FurnitureVisualization extends RoomObjectSpriteVisualization
|
|||||||
this._alphaMultiplier = 1;
|
this._alphaMultiplier = 1;
|
||||||
this._alphaChanged = false;
|
this._alphaChanged = false;
|
||||||
this._clickUrl = null;
|
this._clickUrl = null;
|
||||||
|
this._clickHandling = false;
|
||||||
|
|
||||||
this._cacheDirection = -1;
|
this._cacheDirection = -1;
|
||||||
this._cacheScale = 0;
|
this._cacheScale = 0;
|
||||||
@ -224,6 +226,7 @@ export class FurnitureVisualization extends RoomObjectSpriteVisualization
|
|||||||
|
|
||||||
this._selectedColor = model.getValue<number>(RoomObjectVariable.FURNITURE_COLOR);
|
this._selectedColor = model.getValue<number>(RoomObjectVariable.FURNITURE_COLOR);
|
||||||
this._clickUrl = model.getValue<string>(RoomObjectVariable.FURNITURE_AD_URL);
|
this._clickUrl = model.getValue<string>(RoomObjectVariable.FURNITURE_AD_URL);
|
||||||
|
this._clickHandling = ((this._clickUrl && (this._clickUrl !== '') && (this._clickUrl.indexOf('http') === 0)) || false);
|
||||||
this._furnitureLift = (model.getValue<number>(RoomObjectVariable.FURNITURE_LIFT_AMOUNT) || 0);
|
this._furnitureLift = (model.getValue<number>(RoomObjectVariable.FURNITURE_LIFT_AMOUNT) || 0);
|
||||||
|
|
||||||
let alphaMultiplier = model.getValue<number>(RoomObjectVariable.FURNITURE_ALPHA_MULTIPLIER);
|
let alphaMultiplier = model.getValue<number>(RoomObjectVariable.FURNITURE_ALPHA_MULTIPLIER);
|
||||||
@ -318,9 +321,9 @@ export class FurnitureVisualization extends RoomObjectSpriteVisualization
|
|||||||
|
|
||||||
sprite.relativeDepth = (relativeDepth * FurnitureVisualization.DEPTH_MULTIPLIER);
|
sprite.relativeDepth = (relativeDepth * FurnitureVisualization.DEPTH_MULTIPLIER);
|
||||||
sprite.name = assetName;
|
sprite.name = assetName;
|
||||||
sprite.libraryAssetName = this.getLibraryAssetNameForSprite(assetData, sprite);
|
sprite.libraryAssetName = this.getLibraryAssetNameForSprite(assetData, sprite);
|
||||||
sprite.posture = this.getPostureForAsset(scale, assetData.source);
|
sprite.posture = this.getPostureForAsset(scale, assetData.source);
|
||||||
sprite.clickHandling = false;
|
sprite.clickHandling = this._clickHandling;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -348,11 +351,15 @@ export class FurnitureVisualization extends RoomObjectSpriteVisualization
|
|||||||
if(!sprite) return;
|
if(!sprite) return;
|
||||||
|
|
||||||
sprite.texture = null;
|
sprite.texture = null;
|
||||||
|
sprite.libraryAssetName = '';
|
||||||
|
sprite.posture = '';
|
||||||
|
sprite.tag = '';
|
||||||
sprite.offsetX = 0;
|
sprite.offsetX = 0;
|
||||||
sprite.offsetY = 0;
|
sprite.offsetY = 0;
|
||||||
sprite.flipH = false;
|
sprite.flipH = false;
|
||||||
sprite.flipV = false;
|
sprite.flipV = false;
|
||||||
sprite.relativeDepth = 0;
|
sprite.relativeDepth = 0;
|
||||||
|
sprite.clickHandling = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getSpriteAssetName(scale: number, layerId: number): string
|
protected getSpriteAssetName(scale: number, layerId: number): string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user