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

@ -4,38 +4,39 @@ import { HallOfFameEntryData } from './HallOfFameEntryData';
export class CommunityGoalHallOfFameData implements IDisposable export class CommunityGoalHallOfFameData implements IDisposable
{ {
private _goalCode: string; private _goalCode: string;
private _hof: HallOfFameEntryData[]; private _hof: HallOfFameEntryData[];
constructor(wrapper: IMessageDataWrapper) constructor(wrapper: IMessageDataWrapper)
{ {
this._hof = []; this._hof = [];
this._goalCode = wrapper.readString(); this._goalCode = wrapper.readString();
const count = wrapper.readInt(); const count = wrapper.readInt();
for(let i = 0; i < count; i++)
{
this._hof.push(new HallOfFameEntryData(wrapper));
}
}
public dispose(): void for(let i = 0; i < count; i++)
{ {
this._hof = null; this._hof.push(new HallOfFameEntryData(wrapper));
} }
}
public get disposed(): boolean public dispose(): void
{ {
return this._hof == null; this._hof = null;
} }
public get hof(): HallOfFameEntryData[] public get disposed(): boolean
{ {
return this._hof; return this._hof == null;
} }
public get goalCode(): string public get hof(): HallOfFameEntryData[]
{ {
return this._goalCode; return this._hof;
} }
public get goalCode(): string
{
return this._goalCode;
}
} }

View File

@ -3,43 +3,43 @@ import { ILandingPageUserEntry } from './ILandingPageUserEntry';
export class HallOfFameEntryData implements ILandingPageUserEntry export class HallOfFameEntryData implements ILandingPageUserEntry
{ {
private _userId: number; private _userId: number;
private _userName: string; private _userName: string;
private _figure: string; private _figure: string;
private _rank: number; private _rank: number;
private _currentScore: number; private _currentScore: number;
constructor(wrapper: IMessageDataWrapper) constructor(wrapper: IMessageDataWrapper)
{ {
this._userId = wrapper.readInt(); this._userId = wrapper.readInt();
this._userName = wrapper.readString(); this._userName = wrapper.readString();
this._figure = wrapper.readString(); this._figure = wrapper.readString();
this._rank = wrapper.readInt(); this._rank = wrapper.readInt();
this._currentScore = wrapper.readInt(); this._currentScore = wrapper.readInt();
} }
public get userId(): number public get userId(): number
{ {
return this._userId; return this._userId;
} }
public get userName(): string public get userName(): string
{ {
return this._userName; return this._userName;
} }
public get figure(): string public get figure(): string
{ {
return this._figure; return this._figure;
} }
public get rank(): number public get rank(): number
{ {
return this._rank; return this._rank;
} }
public get currentScore(): number public get currentScore(): number
{ {
return this._currentScore; return this._currentScore;
} }
} }

View File

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

View File

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

View File

@ -1,6 +1,16 @@
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization'; import { FurnitureAnimatedVisualization } from './FurnitureAnimatedVisualization';
export class FurnitureSoundBlockVisualization extends 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'; import { FurnitureDynamicThumbnailVisualization } from './FurnitureDynamicThumbnailVisualization';
export class FurnitureYoutubeVisualization extends FurnitureDynamicThumbnailVisualization export class FurnitureYoutubeVisualization extends FurnitureDynamicThumbnailVisualization
@ -8,13 +9,8 @@ export class FurnitureYoutubeVisualization extends FurnitureDynamicThumbnailVisu
{ {
if(!this.object) return null; 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); return (url + FurnitureYoutubeVisualization.THUMBNAIL);
// const url = this.object.model.getValue<string>(RoomObjectVariable.SESSION_URL_PREFIX);
// if(!data || !url) return null;
// return (url + FurnitureYoutubeVisualization.THUMBNAIL);
} }
} }