summaryrefslogtreecommitdiff
path: root/test-client/protocol.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-11-18 18:21:32 +0100
committermetamuffin <metamuffin@disroot.org>2024-11-18 18:22:17 +0100
commit9d9d4fa85f17c783c7460f61236e3e9e34f6411e (patch)
treef9eb2c15d30495cf4beaf72b105c1c78ce0baece /test-client/protocol.ts
parentb1abfaff30c50493befc7947980626557c857c8e (diff)
downloadhurrycurry-9d9d4fa85f17c783c7460f61236e3e9e34f6411e.tar
hurrycurry-9d9d4fa85f17c783c7460f61236e3e9e34f6411e.tar.bz2
hurrycurry-9d9d4fa85f17c783c7460f61236e3e9e34f6411e.tar.zst
conditional document elements
Diffstat (limited to 'test-client/protocol.ts')
-rw-r--r--test-client/protocol.ts11
1 files changed, 10 insertions, 1 deletions
diff --git a/test-client/protocol.ts b/test-client/protocol.ts
index 8fa15c8d..55d2fc15 100644
--- a/test-client/protocol.ts
+++ b/test-client/protocol.ts
@@ -69,7 +69,7 @@ export type PacketC =
| { type: "set_ingame", state: boolean, lobby: boolean } // Set to false when entering the game or switching maps
export type Menu =
- { menu: "book" }
+ { menu: "document", data: DocumentElement }
| { menu: "score", data: Score }
export interface MessageTimeout {
@@ -101,3 +101,12 @@ export type ItemLocation =
| { tile: Vec2 }
export type PlayerClass = "chef" | "bot" | "customer"
+
+export type DocumentElement =
+ { t: "document", es: DocumentElement[] }
+ | { t: "page", background?: string, es: DocumentElement[] }
+ | { t: "list", es: DocumentElement[] }
+ | { t: "table", es: DocumentElement[][] }
+ | { t: "par", es: DocumentElement[] }
+ | { t: "text", s: Message, size: number, color?: string, font?: string, bold: boolean }
+ | { t: "conditional", cond: string, value: boolean, e: DocumentElement }