diff options
| author | stonedDiscord <Tukz@gmx.de> | 2022-06-23 17:38:24 +0200 |
|---|---|---|
| committer | stonedDiscord <Tukz@gmx.de> | 2022-06-23 17:38:24 +0200 |
| commit | 601631bd4c0ca01e55e40848f755adc264997a26 (patch) | |
| tree | 7f05173fd15f49aab1a762b07074bb414419dcd1 /webAO | |
| parent | c4c4299fe5024af9f786ef34be4fa6594b6f4959 (diff) | |
don't show chatbox on blankpost
Diffstat (limited to 'webAO')
| -rw-r--r-- | webAO/client.ts | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/webAO/client.ts b/webAO/client.ts index e1b9dd1..1646ed9 100644 --- a/webAO/client.ts +++ b/webAO/client.ts @@ -2232,7 +2232,8 @@ class Viewport { this.chatmsg.startspeaking = false; } else { this.chatmsg.startspeaking = true; - chatContainerBox.style.opacity = '1'; + if(this.chatmsg.content !== "") + chatContainerBox.style.opacity = '1'; } this.chatmsg.preanimdelay = gifLength; @@ -2295,7 +2296,7 @@ class Viewport { this.chatmsg.sound = this.chatmsg.effects[2]; } this.chatmsg.parsed = await attorneyMarkdown.applyMarkdown(chatmsg.content, this.colors[this.chatmsg.color]) - this.tick(); + this.chat_tick(); } async handleTextTick(charLayers: HTMLImageElement) { @@ -2409,7 +2410,10 @@ class Viewport { * * XXX: This relies on a global variable `this.chatmsg`! */ - async tick() { + async chat_tick() { + // note: this is called fairly often + // do not perform heavy operations here + await delay(this.chatmsg.speed) if (this.textnow === this.chatmsg.content) { @@ -2545,7 +2549,7 @@ class Viewport { } } if (this._animating) { - this.tick() + this.chat_tick() } this.tickTimer += UPDATE_INTERVAL; } |
