This commit is contained in:
Bill 2021-09-15 18:56:51 -04:00
commit 4ff842af10

View File

@ -8,6 +8,7 @@ import { RoomObjectLogicBase } from '../../../../../room/object/logic/RoomObject
import { ColorConverter } from '../../../../../room/utils/ColorConverter'; import { ColorConverter } from '../../../../../room/utils/ColorConverter';
import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry'; import { IRoomGeometry } from '../../../../../room/utils/IRoomGeometry';
import { Vector3d } from '../../../../../room/utils/Vector3d'; import { Vector3d } from '../../../../../room/utils/Vector3d';
import { Nitro } from '../../../../Nitro';
import { MouseEventType } from '../../../../ui/MouseEventType'; import { MouseEventType } from '../../../../ui/MouseEventType';
import { RoomObjectTileMouseEvent } from '../../../events/RoomObjectTileMouseEvent'; import { RoomObjectTileMouseEvent } from '../../../events/RoomObjectTileMouseEvent';
import { RoomObjectWallMouseEvent } from '../../../events/RoomObjectWallMouseEvent'; import { RoomObjectWallMouseEvent } from '../../../events/RoomObjectWallMouseEvent';
@ -39,6 +40,7 @@ export class RoomLogic extends RoomObjectLogicBase
private _colorTransitionLength: number; private _colorTransitionLength: number;
private _lastHoleUpdate: number; private _lastHoleUpdate: number;
private _needsMapUpdate: boolean; private _needsMapUpdate: boolean;
private _skipColorTransition: boolean;
constructor() constructor()
{ {
@ -56,6 +58,7 @@ export class RoomLogic extends RoomObjectLogicBase
this._colorTransitionLength = 1500; this._colorTransitionLength = 1500;
this._lastHoleUpdate = 0; this._lastHoleUpdate = 0;
this._needsMapUpdate = false; this._needsMapUpdate = false;
this._skipColorTransition = false;
} }
public getEventTypes(): string[] public getEventTypes(): string[]
@ -97,6 +100,8 @@ export class RoomLogic extends RoomObjectLogicBase
this.object.model.setValue(RoomObjectVariable.ROOM_FLOOR_VISIBILITY, 1); this.object.model.setValue(RoomObjectVariable.ROOM_FLOOR_VISIBILITY, 1);
this.object.model.setValue(RoomObjectVariable.ROOM_WALL_VISIBILITY, 1); this.object.model.setValue(RoomObjectVariable.ROOM_WALL_VISIBILITY, 1);
this.object.model.setValue(RoomObjectVariable.ROOM_LANDSCAPE_VISIBILITY, 1); this.object.model.setValue(RoomObjectVariable.ROOM_LANDSCAPE_VISIBILITY, 1);
this._skipColorTransition = (Nitro.instance.getConfiguration<boolean>('room.color.skip.transition') === true);
} }
public update(time: number): void public update(time: number): void
@ -325,7 +330,11 @@ export class RoomLogic extends RoomObjectLogicBase
this._targetColor = message.color; this._targetColor = message.color;
this._targetLight = message.light; this._targetLight = message.light;
this._colorChangedTime = this.time; this._colorChangedTime = this.time;
this._colorTransitionLength = 1500;
if(this._skipColorTransition)
this._colorTransitionLength = 0;
else
this._colorTransitionLength = 1500;
model.setValue(RoomObjectVariable.ROOM_COLORIZE_BG_ONLY, message.backgroundOnly); model.setValue(RoomObjectVariable.ROOM_COLORIZE_BG_ONLY, message.backgroundOnly);
} }