From 04a4902d1054a2e8776107c99ef83496b6050b60 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 29 Jun 2024 20:26:02 +0200 Subject: server message for command errors --- test-client/main.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test-client/main.ts') 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; -- cgit v1.2.3-70-g09d2