aboutsummaryrefslogtreecommitdiff
path: root/test-client/main.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-06-29 20:26:02 +0200
committermetamuffin <metamuffin@disroot.org>2024-06-29 20:26:02 +0200
commit04a4902d1054a2e8776107c99ef83496b6050b60 (patch)
tree45d4bd14ec4a17e0accd060bf7211ee421418a34 /test-client/main.ts
parent03c46a18d3a283ee737688c4c65bb5ef1d6ba1dc (diff)
downloadhurrycurry-04a4902d1054a2e8776107c99ef83496b6050b60.tar
hurrycurry-04a4902d1054a2e8776107c99ef83496b6050b60.tar.bz2
hurrycurry-04a4902d1054a2e8776107c99ef83496b6050b60.tar.zst
server message for command errors
Diffstat (limited to 'test-client/main.ts')
-rw-r--r--test-client/main.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/test-client/main.ts b/test-client/main.ts
index e3185c67..38b9e730 100644
--- a/test-client/main.ts
+++ b/test-client/main.ts
@@ -211,6 +211,11 @@ function packet(p: PacketC) {
global_message_clear = setTimeout(() => global_message = undefined, 4000)
console.warn(p.message)
break;
+ case "server_message":
+ if (global_message_clear) clearTimeout(global_message_clear)
+ global_message = { inner: { text: p.text }, anim_size: 0., anim_position: { x: 0, y: 0 } }
+ global_message_clear = setTimeout(() => global_message = undefined, 4000)
+ break;
case "set_ingame":
console.log(`ingame ${p.state}`);
break;