mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-19 06:46:28 +01:00
Updates
This commit is contained in:
parent
394544aa71
commit
a1b527da62
@ -35,7 +35,7 @@ import { RoomUnitWalkComposer } from '../communication/messages/outgoing/room/un
|
|||||||
import { Nitro } from '../Nitro';
|
import { Nitro } from '../Nitro';
|
||||||
import { MouseEventType } from '../ui/MouseEventType';
|
import { MouseEventType } from '../ui/MouseEventType';
|
||||||
import { RoomObjectPlacementSource } from './enums/RoomObjectPlacementSource';
|
import { RoomObjectPlacementSource } from './enums/RoomObjectPlacementSource';
|
||||||
import { RoomEngineUseProductEvent } from './events';
|
import { RoomEngineRoomAdEvent, RoomEngineUseProductEvent, RoomObjectRoomAdEvent } from './events';
|
||||||
import { RoomEngineDimmerStateEvent } from './events/RoomEngineDimmerStateEvent';
|
import { RoomEngineDimmerStateEvent } from './events/RoomEngineDimmerStateEvent';
|
||||||
import { RoomEngineObjectEvent } from './events/RoomEngineObjectEvent';
|
import { RoomEngineObjectEvent } from './events/RoomEngineObjectEvent';
|
||||||
import { RoomEngineObjectPlacedEvent } from './events/RoomEngineObjectPlacedEvent';
|
import { RoomEngineObjectPlacedEvent } from './events/RoomEngineObjectPlacedEvent';
|
||||||
@ -299,6 +299,13 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
|
|||||||
case RoomObjectFloorHoleEvent.REMOVE_HOLE:
|
case RoomObjectFloorHoleEvent.REMOVE_HOLE:
|
||||||
this.onRoomObjectFloorHoleEvent(event as RoomObjectFloorHoleEvent, roomId);
|
this.onRoomObjectFloorHoleEvent(event as RoomObjectFloorHoleEvent, roomId);
|
||||||
return;
|
return;
|
||||||
|
case RoomObjectRoomAdEvent.ROOM_AD_FURNI_CLICK:
|
||||||
|
case RoomObjectRoomAdEvent.ROOM_AD_FURNI_DOUBLE_CLICK:
|
||||||
|
case RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_SHOW:
|
||||||
|
case RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE:
|
||||||
|
case RoomObjectRoomAdEvent.ROOM_AD_LOAD_IMAGE:
|
||||||
|
this.onRoomObjectRoomAdEvent(event as RoomObjectRoomAdEvent, roomId);
|
||||||
|
return;
|
||||||
case RoomObjectBadgeAssetEvent.LOAD_BADGE:
|
case RoomObjectBadgeAssetEvent.LOAD_BADGE:
|
||||||
this.onRoomObjectBadgeAssetEvent(event as RoomObjectBadgeAssetEvent, roomId);
|
this.onRoomObjectBadgeAssetEvent(event as RoomObjectBadgeAssetEvent, roomId);
|
||||||
return;
|
return;
|
||||||
@ -867,6 +874,48 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private onRoomObjectRoomAdEvent(event: RoomObjectRoomAdEvent, roomId: number): void
|
||||||
|
{
|
||||||
|
if(!event) return;
|
||||||
|
|
||||||
|
let eventType: string = null;
|
||||||
|
|
||||||
|
switch(event.type)
|
||||||
|
{
|
||||||
|
case RoomObjectRoomAdEvent.ROOM_AD_FURNI_CLICK:
|
||||||
|
this._roomEngine.events.dispatchEvent(event);
|
||||||
|
|
||||||
|
if(event.clickUrl && (event.clickUrl.length > 0))
|
||||||
|
{
|
||||||
|
Nitro.instance.createLinkEvent(event.clickUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
eventType = RoomEngineRoomAdEvent.FURNI_CLICK;
|
||||||
|
break;
|
||||||
|
case RoomObjectRoomAdEvent.ROOM_AD_FURNI_DOUBLE_CLICK:
|
||||||
|
if(event.clickUrl && (event.clickUrl.length > 0))
|
||||||
|
{
|
||||||
|
const catalogPage = 'CATALOG_PAGE';
|
||||||
|
|
||||||
|
if(event.clickUrl.indexOf(catalogPage) === 0)
|
||||||
|
{
|
||||||
|
Nitro.instance.createLinkEvent(event.clickUrl.substr(catalogPage.length));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
eventType = RoomEngineRoomAdEvent.FURNI_DOUBLE_CLICK;
|
||||||
|
break;
|
||||||
|
case RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_SHOW:
|
||||||
|
eventType = RoomEngineRoomAdEvent.TOOLTIP_SHOW;
|
||||||
|
break;
|
||||||
|
case RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE:
|
||||||
|
eventType = RoomEngineRoomAdEvent.TOOLTIP_HIDE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(eventType) this._roomEngine.events.dispatchEvent(new RoomEngineObjectEvent(eventType, roomId, event.objectId, this._roomEngine.getRoomObjectCategoryForType(event.objectType)));
|
||||||
|
}
|
||||||
|
|
||||||
private onRoomObjectBadgeAssetEvent(event: RoomObjectBadgeAssetEvent, roomId: number): void
|
private onRoomObjectBadgeAssetEvent(event: RoomObjectBadgeAssetEvent, roomId: number): void
|
||||||
{
|
{
|
||||||
if(!event || !this._roomEngine) return;
|
if(!event || !this._roomEngine) return;
|
||||||
|
9
src/nitro/room/events/RoomEngineRoomAdEvent.ts
Normal file
9
src/nitro/room/events/RoomEngineRoomAdEvent.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { RoomEngineObjectEvent } from './RoomEngineObjectEvent';
|
||||||
|
|
||||||
|
export class RoomEngineRoomAdEvent extends RoomEngineObjectEvent
|
||||||
|
{
|
||||||
|
public static FURNI_CLICK: string = 'RERAE_FURNI_CLICK';
|
||||||
|
public static FURNI_DOUBLE_CLICK: string = 'RERAE_FURNI_DOUBLE_CLICK';
|
||||||
|
public static TOOLTIP_SHOW: string = 'RERAE_TOOLTIP_SHOW';
|
||||||
|
public static TOOLTIP_HIDE: string = 'RERAE_TOOLTIP_HIDE';
|
||||||
|
}
|
@ -5,6 +5,7 @@ export * from './RoomEngineEvent';
|
|||||||
export * from './RoomEngineObjectEvent';
|
export * from './RoomEngineObjectEvent';
|
||||||
export * from './RoomEngineObjectPlacedEvent';
|
export * from './RoomEngineObjectPlacedEvent';
|
||||||
export * from './RoomEngineObjectPlacedOnUserEvent';
|
export * from './RoomEngineObjectPlacedOnUserEvent';
|
||||||
|
export * from './RoomEngineRoomAdEvent';
|
||||||
export * from './RoomEngineSamplePlaybackEvent';
|
export * from './RoomEngineSamplePlaybackEvent';
|
||||||
export * from './RoomEngineTriggerWidgetEvent';
|
export * from './RoomEngineTriggerWidgetEvent';
|
||||||
export * from './RoomEngineUseProductEvent';
|
export * from './RoomEngineUseProductEvent';
|
||||||
|
@ -57,6 +57,11 @@ export class FurnitureBadgeDisplayLogic extends FurnitureLogic
|
|||||||
{
|
{
|
||||||
if(badgeId === '') return;
|
if(badgeId === '') return;
|
||||||
|
|
||||||
if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectBadgeAssetEvent(RoomObjectBadgeAssetEvent.LOAD_BADGE, this.object, badgeId, false));
|
if(this.eventDispatcher)
|
||||||
|
{
|
||||||
|
this.object.model.setValue(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS, -1);
|
||||||
|
|
||||||
|
this.eventDispatcher.dispatchEvent(new RoomObjectBadgeAssetEvent(RoomObjectBadgeAssetEvent.LOAD_BADGE, this.object, badgeId, false));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,15 @@ export class FurnitureLogic extends MovingObjectLogic
|
|||||||
|
|
||||||
public getEventTypes(): string[]
|
public getEventTypes(): string[]
|
||||||
{
|
{
|
||||||
const types = [ RoomObjectStateChangedEvent.STATE_CHANGE, RoomObjectMouseEvent.CLICK, RoomObjectMouseEvent.MOUSE_DOWN, RoomObjectMouseEvent.MOUSE_DOWN_LONG ];
|
const types = [
|
||||||
|
RoomObjectStateChangedEvent.STATE_CHANGE,
|
||||||
|
RoomObjectMouseEvent.CLICK,
|
||||||
|
RoomObjectMouseEvent.MOUSE_DOWN,
|
||||||
|
RoomObjectMouseEvent.MOUSE_DOWN_LONG,
|
||||||
|
RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_SHOW,
|
||||||
|
RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE,
|
||||||
|
RoomObjectRoomAdEvent.ROOM_AD_FURNI_DOUBLE_CLICK,
|
||||||
|
RoomObjectRoomAdEvent.ROOM_AD_FURNI_CLICK ];
|
||||||
|
|
||||||
if(this.widget) types.push(RoomObjectWidgetRequestEvent.OPEN_WIDGET, RoomObjectWidgetRequestEvent.CLOSE_WIDGET);
|
if(this.widget) types.push(RoomObjectWidgetRequestEvent.OPEN_WIDGET, RoomObjectWidgetRequestEvent.CLOSE_WIDGET);
|
||||||
|
|
||||||
@ -134,7 +142,7 @@ export class FurnitureLogic extends MovingObjectLogic
|
|||||||
return model.getValue<string>(RoomObjectVariable.FURNITURE_AD_URL);
|
return model.getValue<string>(RoomObjectVariable.FURNITURE_AD_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected handleAdClick():void
|
protected handleAdClick(objectId: number, objectType: string, clickUrl: string):void
|
||||||
{
|
{
|
||||||
if(!this.eventDispatcher) return;
|
if(!this.eventDispatcher) return;
|
||||||
|
|
||||||
@ -325,7 +333,7 @@ export class FurnitureLogic extends MovingObjectLogic
|
|||||||
this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE, this.object));
|
this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_TOOLTIP_HIDE, this.object));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(adUrl && adUrl.length) this.handleAdClick();
|
if(adUrl && adUrl.length) this.handleAdClick(this.object.id, this.object.type, adUrl);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case MouseEventType.MOUSE_DOWN:
|
case MouseEventType.MOUSE_DOWN:
|
||||||
@ -380,9 +388,12 @@ export class FurnitureLogic extends MovingObjectLogic
|
|||||||
{
|
{
|
||||||
if(!this.object || !this.eventDispatcher) return;
|
if(!this.object || !this.eventDispatcher) return;
|
||||||
|
|
||||||
const adUrl = this.getAdClickUrl(this.object.model);
|
const clickUrl = this.getAdClickUrl(this.object.model);
|
||||||
|
|
||||||
|
|
||||||
|
if(clickUrl && clickUrl.length)
|
||||||
|
{
|
||||||
|
this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_FURNI_DOUBLE_CLICK, this.object, null, clickUrl));
|
||||||
|
}
|
||||||
|
|
||||||
if(this.widget) this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.OPEN_WIDGET, this.object));
|
if(this.widget) this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.OPEN_WIDGET, this.object));
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
|
import { IRoomObjectModel } from '../../../../../room/object/IRoomObjectModel';
|
||||||
import { HabboWebTools } from '../../../../utils';
|
import { HabboWebTools } from '../../../../utils';
|
||||||
|
import { RoomObjectRoomAdEvent } from '../../../events';
|
||||||
import { RoomObjectVariable } from '../../RoomObjectVariable';
|
import { RoomObjectVariable } from '../../RoomObjectVariable';
|
||||||
import { FurnitureRoomBrandingLogic } from './FurnitureRoomBrandingLogic';
|
import { FurnitureRoomBrandingLogic } from './FurnitureRoomBrandingLogic';
|
||||||
|
|
||||||
@ -17,17 +18,15 @@ export class FurnitureRoomBillboardLogic extends FurnitureRoomBrandingLogic
|
|||||||
return model.getValue<string>(RoomObjectVariable.FURNITURE_BRANDING_URL);
|
return model.getValue<string>(RoomObjectVariable.FURNITURE_BRANDING_URL);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected handleAdClick():void
|
protected handleAdClick(objectId: number, objectType: string, clickUrl: string):void
|
||||||
{
|
{
|
||||||
const adUrl = this.getAdClickUrl(this.object.model);
|
if(clickUrl.indexOf('http') === 0)
|
||||||
|
|
||||||
if(adUrl.indexOf('http') === 0)
|
|
||||||
{
|
{
|
||||||
HabboWebTools.openWebPage(adUrl);
|
HabboWebTools.openWebPage(clickUrl);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
super.handleAdClick();
|
if(this.eventDispatcher) this.eventDispatcher.dispatchEvent(new RoomObjectRoomAdEvent(RoomObjectRoomAdEvent.ROOM_AD_FURNI_CLICK, this.object, '', clickUrl));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
|
import { IAssetData } from '../../../../../core';
|
||||||
|
import { IRoomGeometry, RoomSpriteMouseEvent } from '../../../../../room';
|
||||||
import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage';
|
import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage';
|
||||||
import { Nitro } from '../../../../Nitro';
|
import { Nitro } from '../../../../Nitro';
|
||||||
|
import { MouseEventType } from '../../../../ui';
|
||||||
import { RoomWidgetEnumItemExtradataParameter } from '../../../../ui/widget/enums/RoomWidgetEnumItemExtradataParameter';
|
import { RoomWidgetEnumItemExtradataParameter } from '../../../../ui/widget/enums/RoomWidgetEnumItemExtradataParameter';
|
||||||
|
import { RoomObjectRoomAdEvent } from '../../../events';
|
||||||
import { ObjectAdUpdateMessage } from '../../../messages/ObjectAdUpdateMessage';
|
import { ObjectAdUpdateMessage } from '../../../messages/ObjectAdUpdateMessage';
|
||||||
import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage';
|
import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage';
|
||||||
import { MapDataType } from '../../data/type/MapDataType';
|
import { MapDataType } from '../../data/type/MapDataType';
|
||||||
@ -16,15 +20,34 @@ export class FurnitureRoomBrandingLogic extends FurnitureLogic
|
|||||||
public static OFFSETY_KEY: string = 'offsetY';
|
public static OFFSETY_KEY: string = 'offsetY';
|
||||||
public static OFFSETZ_KEY: string = 'offsetZ';
|
public static OFFSETZ_KEY: string = 'offsetZ';
|
||||||
|
|
||||||
|
protected _disableFurnitureSelection: boolean;
|
||||||
protected _hasClickUrl: boolean;
|
protected _hasClickUrl: boolean;
|
||||||
|
|
||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
this._disableFurnitureSelection = true;
|
||||||
this._hasClickUrl = false;
|
this._hasClickUrl = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getEventTypes(): string[]
|
||||||
|
{
|
||||||
|
const types = [ RoomObjectRoomAdEvent.ROOM_AD_LOAD_IMAGE ];
|
||||||
|
|
||||||
|
return this.mergeTypes(super.getEventTypes(), types);
|
||||||
|
}
|
||||||
|
|
||||||
|
public initialize(asset: IAssetData): void
|
||||||
|
{
|
||||||
|
super.initialize(asset);
|
||||||
|
|
||||||
|
if(this._disableFurnitureSelection)
|
||||||
|
{
|
||||||
|
this.object.model.setValue(RoomObjectVariable.FURNITURE_SELECTION_DISABLED, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public processUpdateMessage(message: RoomObjectUpdateMessage): void
|
public processUpdateMessage(message: RoomObjectUpdateMessage): void
|
||||||
{
|
{
|
||||||
super.processUpdateMessage(message);
|
super.processUpdateMessage(message);
|
||||||
@ -106,6 +129,15 @@ export class FurnitureRoomBrandingLogic extends FurnitureLogic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public mouseEvent(event: RoomSpriteMouseEvent, geometry: IRoomGeometry): void
|
||||||
|
{
|
||||||
|
if(!event || !geometry) return;
|
||||||
|
|
||||||
|
if((event.type === MouseEventType.MOUSE_MOVE) || (event.type === MouseEventType.DOUBLE_CLICK)) return;
|
||||||
|
|
||||||
|
super.mouseEvent(event, geometry);
|
||||||
|
}
|
||||||
|
|
||||||
private downloadBackground(): void
|
private downloadBackground(): void
|
||||||
{
|
{
|
||||||
const model = this.object && this.object.model;
|
const model = this.object && this.object.model;
|
||||||
|
@ -22,11 +22,15 @@ export class FurnitureBadgeDisplayVisualization extends FurnitureAnimatedVisuali
|
|||||||
{
|
{
|
||||||
let updateModel = super.updateModel(scale);
|
let updateModel = super.updateModel(scale);
|
||||||
|
|
||||||
if(!isNaN(this.object.model.getValue<number>(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS)))
|
const badgeStatus = this.object.model.getValue<number>(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS);
|
||||||
{
|
|
||||||
const status = (this.object.model.getValue<number>(RoomObjectVariable.FURNITURE_BADGE_IMAGE_STATUS) !== 0);
|
|
||||||
|
|
||||||
if(status && this._badgeAssetNameNormalScale === '')
|
if(badgeStatus === -1)
|
||||||
|
{
|
||||||
|
this._badgeAssetNameNormalScale = '';
|
||||||
|
this._badgeAssetNameSmallScale = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(badgeStatus === 1 && (this._badgeAssetNameNormalScale === ''))
|
||||||
{
|
{
|
||||||
this._badgeAssetNameNormalScale = this.object.model.getValue<string>(RoomObjectVariable.FURNITURE_BADGE_ASSET_NAME);
|
this._badgeAssetNameNormalScale = this.object.model.getValue<string>(RoomObjectVariable.FURNITURE_BADGE_ASSET_NAME);
|
||||||
|
|
||||||
@ -34,11 +38,10 @@ export class FurnitureBadgeDisplayVisualization extends FurnitureAnimatedVisuali
|
|||||||
|
|
||||||
const visibleInState = this.object.model.getValue<number>(RoomObjectVariable.FURNITURE_BADGE_VISIBLE_IN_STATE);
|
const visibleInState = this.object.model.getValue<number>(RoomObjectVariable.FURNITURE_BADGE_VISIBLE_IN_STATE);
|
||||||
|
|
||||||
if(!isNaN) this._badgeVisibleInState = visibleInState;
|
if(!isNaN(visibleInState)) this._badgeVisibleInState = visibleInState;
|
||||||
|
|
||||||
updateModel = true;
|
updateModel = true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return updateModel;
|
return updateModel;
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,10 @@ import { FurnitureVisualization } from './FurnitureVisualization';
|
|||||||
export class FurnitureBrandedImageVisualization extends FurnitureVisualization
|
export class FurnitureBrandedImageVisualization extends FurnitureVisualization
|
||||||
{
|
{
|
||||||
private static BRANDED_IMAGE: string = 'branded_image';
|
private static BRANDED_IMAGE: string = 'branded_image';
|
||||||
|
private static STATE_0: number = 0;
|
||||||
|
private static STATE_1: number = 1;
|
||||||
|
private static STATE_2: number = 2;
|
||||||
|
private static STATE_3: number = 3;
|
||||||
|
|
||||||
protected _imageUrl: string;
|
protected _imageUrl: string;
|
||||||
protected _shortUrl: string;
|
protected _shortUrl: string;
|
||||||
@ -139,7 +143,42 @@ export class FurnitureBrandedImageVisualization extends FurnitureVisualization
|
|||||||
|
|
||||||
if(!texture) return;
|
if(!texture) return;
|
||||||
|
|
||||||
this.asset.addAsset(this._imageUrl, texture, true, 0, 0, false, false);
|
const state = this.object.getState(0);
|
||||||
|
|
||||||
|
let x = 0;
|
||||||
|
let y = 0;
|
||||||
|
let flipH = false;
|
||||||
|
let flipV = false;
|
||||||
|
|
||||||
|
switch(state)
|
||||||
|
{
|
||||||
|
case FurnitureBrandedImageVisualization.STATE_0:
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
flipH = false;
|
||||||
|
flipV = false;
|
||||||
|
break;
|
||||||
|
case FurnitureBrandedImageVisualization.STATE_1:
|
||||||
|
x = -(texture.width);
|
||||||
|
y = 0;
|
||||||
|
flipH = true;
|
||||||
|
flipV = false;
|
||||||
|
break;
|
||||||
|
case FurnitureBrandedImageVisualization.STATE_2:
|
||||||
|
x = -(texture.width);
|
||||||
|
y = -(texture.height);
|
||||||
|
flipH = true;
|
||||||
|
flipV = true;
|
||||||
|
break;
|
||||||
|
case FurnitureBrandedImageVisualization.STATE_3:
|
||||||
|
x = 0;
|
||||||
|
y = -(texture.height);
|
||||||
|
flipH = false;
|
||||||
|
flipV = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.asset.addAsset(this._imageUrl, texture, true, x, y, flipH, flipV);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getSpriteAssetName(scale: number, layerId: number): string
|
protected getSpriteAssetName(scale: number, layerId: number): string
|
||||||
@ -150,13 +189,4 @@ export class FurnitureBrandedImageVisualization extends FurnitureVisualization
|
|||||||
|
|
||||||
return super.getSpriteAssetName(scale, layerId);
|
return super.getSpriteAssetName(scale, layerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getLayerIgnoreMouse(scale: number, direction: number, layerId: number): boolean
|
|
||||||
{
|
|
||||||
const tag = this.getLayerTag(scale, direction, layerId);
|
|
||||||
|
|
||||||
if(tag !== FurnitureBrandedImageVisualization.BRANDED_IMAGE) return super.getLayerIgnoreMouse(scale, direction, layerId);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -387,6 +387,11 @@ export class RoomPreviewer
|
|||||||
if(this.isRoomEngineReady) this._roomEngine.updateRoomObjectUserAction(this._previewRoomId, RoomPreviewer.PREVIEW_OBJECT_ID, action, value, parameter);
|
if(this.isRoomEngineReady) this._roomEngine.updateRoomObjectUserAction(this._previewRoomId, RoomPreviewer.PREVIEW_OBJECT_ID, action, value, parameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public updateObjectStuffData(stuffData: IObjectData): void
|
||||||
|
{
|
||||||
|
if(this.isRoomEngineReady) this._roomEngine.updateRoomObjectFloor(this._previewRoomId, RoomPreviewer.PREVIEW_OBJECT_ID, null, null, stuffData.state, stuffData);
|
||||||
|
}
|
||||||
|
|
||||||
public changeRoomObjectState(): void
|
public changeRoomObjectState(): void
|
||||||
{
|
{
|
||||||
if(this.isRoomEngineReady)
|
if(this.isRoomEngineReady)
|
||||||
|
@ -26,7 +26,7 @@ export class BadgeImageManager
|
|||||||
this._assets = null;
|
this._assets = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBadgeImage(badgeName: string, type: string = 'normal_badge', load: boolean = true): Texture<Resource>
|
public getBadgeImage(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE, load: boolean = true): Texture<Resource>
|
||||||
{
|
{
|
||||||
let badge = this.getBadgeTexture(badgeName, type);
|
let badge = this.getBadgeTexture(badgeName, type);
|
||||||
|
|
||||||
@ -42,25 +42,25 @@ export class BadgeImageManager
|
|||||||
return (badge) ? new BadgeInfo(badge, false) : new BadgeInfo(this.getBadgePlaceholder(), true);
|
return (badge) ? new BadgeInfo(badge, false) : new BadgeInfo(this.getBadgePlaceholder(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public loadBadgeImage(badgeName: string, type: string = 'normal_badge'): string
|
public loadBadgeImage(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE): string
|
||||||
{
|
{
|
||||||
if(this._assets.getTexture(badgeName)) return badgeName;
|
if(this._assets.getTexture(this.getBadgeUrl(badgeName, type))) return badgeName;
|
||||||
|
|
||||||
this.getBadgeTexture(badgeName, type);
|
this.getBadgeTexture(badgeName, type);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getBadgeTexture(badgeName: string, type: string = 'normal_badge'): Texture<Resource>
|
private getBadgeTexture(badgeName: string, type: string = BadgeImageManager.NORMAL_BADGE): Texture<Resource>
|
||||||
{
|
{
|
||||||
const existing = this._assets.getTexture(badgeName);
|
const url = this.getBadgeUrl(badgeName, type);
|
||||||
|
|
||||||
|
const existing = this._assets.getTexture(url);
|
||||||
|
|
||||||
if(existing) return existing.clone();
|
if(existing) return existing.clone();
|
||||||
|
|
||||||
if(this._requestedBadges.get(badgeName)) return null;
|
if(this._requestedBadges.get(badgeName)) return null;
|
||||||
|
|
||||||
const url = this.getBadgeUrl(badgeName, type);
|
|
||||||
|
|
||||||
if(url)
|
if(url)
|
||||||
{
|
{
|
||||||
this._requestedBadges.set(badgeName, true);
|
this._requestedBadges.set(badgeName, true);
|
||||||
@ -69,7 +69,7 @@ export class BadgeImageManager
|
|||||||
{
|
{
|
||||||
if(flag)
|
if(flag)
|
||||||
{
|
{
|
||||||
const texture = this._assets.getTexture(badgeName);
|
const texture = this._assets.getTexture(url);
|
||||||
|
|
||||||
if(texture && this._events) this._events.dispatchEvent(new BadgeImageReadyEvent(badgeName, texture.clone()));
|
if(texture && this._events) this._events.dispatchEvent(new BadgeImageReadyEvent(badgeName, texture.clone()));
|
||||||
}
|
}
|
||||||
@ -81,14 +81,15 @@ export class BadgeImageManager
|
|||||||
|
|
||||||
private getBadgePlaceholder(): Texture<Resource>
|
private getBadgePlaceholder(): Texture<Resource>
|
||||||
{
|
{
|
||||||
const existing = this._assets.getTexture('loading_icon');
|
const url = (Nitro.instance.getConfiguration<string>('images.url') + '/loading_icon.png');
|
||||||
|
const existing = this._assets.getTexture(url);
|
||||||
|
|
||||||
if(!existing) return null;
|
if(!existing) return null;
|
||||||
|
|
||||||
return existing.clone();
|
return existing.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBadgeUrl(badge: string, type: string = 'normal_badge'): string
|
public getBadgeUrl(badge: string, type: string = BadgeImageManager.NORMAL_BADGE): string
|
||||||
{
|
{
|
||||||
let url = null;
|
let url = null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user