summaryrefslogtreecommitdiff
path: root/test-client/tiles.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-09-27 00:02:22 +0200
committermetamuffin <metamuffin@disroot.org>2024-09-27 00:02:30 +0200
commit938551ca5ea0aa9c606443f8f45e9907639b8f6e (patch)
treeb2a7165fa29159c3491673d8cb9211ed8728f1f2 /test-client/tiles.ts
parentb4143bf35dce7b7826a44022c7116eb042c9a68e (diff)
downloadhurrycurry-938551ca5ea0aa9c606443f8f45e9907639b8f6e.tar
hurrycurry-938551ca5ea0aa9c606443f8f45e9907639b8f6e.tar.bz2
hurrycurry-938551ca5ea0aa9c606443f8f45e9907639b8f6e.tar.zst
unknown orders
Diffstat (limited to 'test-client/tiles.ts')
-rw-r--r--test-client/tiles.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/test-client/tiles.ts b/test-client/tiles.ts
index 86203cb7..d890212f 100644
--- a/test-client/tiles.ts
+++ b/test-client/tiles.ts
@@ -83,6 +83,20 @@ function cross(size: number, stroke: string, stroke_width = 0.05): Component {
c.stroke()
}
}
+function text(s: string): Component {
+ return c => {
+ c.font = "0.8px sans-serif"
+ c.strokeStyle = "#e38242"
+ c.fillStyle = "white"
+ c.lineWidth = 0.05
+ c.textAlign = "center"
+ c.textBaseline = "middle"
+ c.lineJoin = "round"
+ c.lineCap = "round"
+ c.strokeText(s, 0, 0)
+ c.fillText(s, 0, 0)
+ }
+}
function arrange_items(...items: ItemName[]): Component {
return c => {
@@ -150,6 +164,7 @@ const ITEMS: { [key in ItemName]: (c: string[]) => Component } = {
"dirty-plate": () => circle(0.4, "#947a6f", "#d3a187", 0.02),
"mochi-dough": () => circle(0.3, "rgb(172, 162, 151)"),
"rice-flour": () => iref("rice"),
+ "unknown-order": () => text("!"),
"pan": i => c => (circle(0.35, "rgb(29, 29, 29)", "rgb(39, 39, 39)", 0.04)(c), arrange_items(...i)(c)),
"pot": i => c => (circle(0.27, "rgb(29, 29, 29)", "rgb(56, 56, 56)", 0.2)(c), arrange_items(...i)(c)),