From b50091c5fcc9e8faba1939d4ef1eda0fc67e09ab Mon Sep 17 00:00:00 2001 From: modeco80 Date: Tue, 9 Jul 2024 23:57:33 -0400 Subject: [PATCH] remove Agent.animationFinished() we can just put its logic in the finish callback we give to the animation state --- msagent.js/src/agent.ts | 6 +----- msagent.js/src/character.ts | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/msagent.js/src/agent.ts b/msagent.js/src/agent.ts index 2395a6c..1c94711 100644 --- a/msagent.js/src/agent.ts +++ b/msagent.js/src/agent.ts @@ -164,7 +164,7 @@ export class Agent { // Create and start the animation state this.animState = new AgentAnimationState(this, animInfo.animationData, () => { - this.animationFinished(); + this.animState = null; finishCallback(); }); this.animState.play(); @@ -175,10 +175,6 @@ export class Agent { if (index !== -1) this.playAnimation(index, finishCallback); } - animationFinished() { - this.animState = null; - } - show() { this.cnv.style.display = 'block'; this.playAnimationByName('Show', () => {}); diff --git a/msagent.js/src/character.ts b/msagent.js/src/character.ts index 55d2df4..5a897cf 100644 --- a/msagent.js/src/character.ts +++ b/msagent.js/src/character.ts @@ -47,9 +47,6 @@ function agentCharacterParseACS(buffer: BufferStream): AcsData { return acsData; } -// TODO this will be the public API -// Dunno about maintaining canvases. We can pass a div into agentInit and add a characterInit() which recieves it -// (which we then mount characters and their wordballoons into?) export function agentCreateCharacter(data: Uint8Array): Agent { return new Agent(agentCharacterParseACS(new BufferStream(data))); }