This commit is contained in:
Bill 2021-08-16 23:21:24 -04:00
parent 175bca56ea
commit 30d56bf180
6 changed files with 87 additions and 75 deletions

View File

@ -13,6 +13,7 @@ export class CommunityGoalHallOfFameData implements IDisposable
this._goalCode = wrapper.readString();
const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
this._hof.push(new HallOfFameEntryData(wrapper));

View File

@ -882,7 +882,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
const objectCategory = this._roomEngine.getRoomObjectCategoryForType(event.objectType);
const selectedData = this.getSelectedRoomObjectData(roomId);
if(!selectedData)
if(selectedData)
{
if((selectedData.category === objectCategory) && (selectedData.id === event.objectId))
{

View File

@ -9,14 +9,13 @@ import { FurnitureVisualization } from './FurnitureVisualization';
export class FurnitureAnimatedVisualization extends FurnitureVisualization
{
private static FRAME_INCREASE_AMOUNT: number = 1;
public static TYPE: string = RoomObjectVisualizationType.FURNITURE_ANIMATED;
public static DEFAULT_ANIMATION_ID: number = 0;
protected _data: FurnitureAnimatedVisualizationData;
protected _state: number;
protected _frameIncrease: number;
private _animationData: AnimationStateData;
private _animationScale: number;
private _animationChangeTime: number;
@ -28,6 +27,7 @@ export class FurnitureAnimatedVisualization extends FurnitureVisualization
super();
this._state = -1;
this._frameIncrease = 1;
this._animationData = new AnimationStateData();
this._animationScale = 0;
this._animationChangeTime = 0;
@ -290,7 +290,7 @@ export class FurnitureAnimatedVisualization extends FurnitureVisualization
if(!frameCount) frameCount = this._data.getStartFrame(scale, animationId, this._direction);
frameCount += FurnitureAnimatedVisualization.FRAME_INCREASE_AMOUNT;
frameCount += this.frameIncrease;
animationData.frameCounter = frameCount;
animationData.animationOver = true;
@ -312,13 +312,13 @@ export class FurnitureAnimatedVisualization extends FurnitureVisualization
if(frame)
{
if(frame.isLastFrame && (frame.remainingFrameRepeats <= FurnitureAnimatedVisualization.FRAME_INCREASE_AMOUNT))
if(frame.isLastFrame && (frame.remainingFrameRepeats <= this.frameIncrease))
{
lastFramePlayed = true;
}
}
if((this._directionChanged || !frame) || ((frame.remainingFrameRepeats >= 0) && ((frame.remainingFrameRepeats = (frame.remainingFrameRepeats - FurnitureAnimatedVisualization.FRAME_INCREASE_AMOUNT)) <= 0)))
if((this._directionChanged || !frame) || ((frame.remainingFrameRepeats >= 0) && ((frame.remainingFrameRepeats = (frame.remainingFrameRepeats - this.frameIncrease)) <= 0)))
{
sequenceId = AnimationFrame.SEQUENCE_NOT_DEFINED;
@ -404,4 +404,9 @@ export class FurnitureAnimatedVisualization extends FurnitureVisualization
this._directionChanged = true;
}
protected get frameIncrease(): number
{
return this._frameIncrease;
}
}

View File

@ -1,6 +1,16 @@
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization';
export class FurnitureSoundBlockVisualization extends FurnitureAnimatedVisualization
{
private _internalFrameIncreaseCounter: number = 0;
protected updateAnimations(scale: number): number
{
this._internalFrameIncreaseCounter = (this._internalFrameIncreaseCounter + this.object.model.getValue<number>(RoomObjectVariable.FURNITURE_SOUNDBLOCK_RELATIVE_ANIMATION_SPEED));
this._frameIncrease = this._internalFrameIncreaseCounter;
this._internalFrameIncreaseCounter = (this._internalFrameIncreaseCounter - this._frameIncrease);
return super.updateAnimations(scale);
}
}

View File

@ -1,3 +1,4 @@
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { FurnitureDynamicThumbnailVisualization } from './FurnitureDynamicThumbnailVisualization';
export class FurnitureYoutubeVisualization extends FurnitureDynamicThumbnailVisualization
@ -8,13 +9,8 @@ export class FurnitureYoutubeVisualization extends FurnitureDynamicThumbnailVisu
{
if(!this.object) return null;
return null;
const url = this.object.model.getValue<string>(RoomObjectVariable.SESSION_URL_PREFIX);
// const data = this.object.model.getValue<any>(RoomObjectVariable.FURNITURE_DATA);
// const url = this.object.model.getValue<string>(RoomObjectVariable.SESSION_URL_PREFIX);
// if(!data || !url) return null;
// return (url + FurnitureYoutubeVisualization.THUMBNAIL);
return (url + FurnitureYoutubeVisualization.THUMBNAIL);
}
}