summaryrefslogtreecommitdiff
path: root/test-client/visual.ts
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-09-04 20:00:30 +0200
committermetamuffin <metamuffin@disroot.org>2024-09-04 20:00:30 +0200
commit740dc4b45cb59ff184e5cebc5b19f402bb9d54d2 (patch)
tree188c59484dc4b4c268a107def8d485919a3b5100 /test-client/visual.ts
parent406ba2117783f17010f4786a86fa02ae715388e6 (diff)
downloadhurrycurry-740dc4b45cb59ff184e5cebc5b19f402bb9d54d2.tar
hurrycurry-740dc4b45cb59ff184e5cebc5b19f402bb9d54d2.tar.bz2
hurrycurry-740dc4b45cb59ff184e5cebc5b19f402bb9d54d2.tar.zst
refactor interact function and new progress proto
Diffstat (limited to 'test-client/visual.ts')
-rw-r--r--test-client/visual.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/test-client/visual.ts b/test-client/visual.ts
index a54ca143..4c0a8ecc 100644
--- a/test-client/visual.ts
+++ b/test-client/visual.ts
@@ -120,9 +120,9 @@ function draw_item(item: ItemData) {
ctx.translate(item.x, item.y)
if (item.remove_anim) ctx.scale(1 - item.remove_anim, 1 - item.remove_anim)
draw_item_sprite(ctx, data.item_names[item.kind] as ItemName)
- if (item.progress !== null && item.progress !== undefined) {
- ctx.fillStyle = item.progress_warn ? "rgba(230, 58, 58, 0.66)" : "rgba(115, 230, 58, 0.66)"
- ctx.fillRect(-0.5, -0.5, 1, item.progress)
+ if (item.active) {
+ ctx.fillStyle = item.active.warn ? "rgba(230, 58, 58, 0.66)" : "rgba(115, 230, 58, 0.66)"
+ ctx.fillRect(-0.5, -0.5, 1, item.active.position)
}
ctx.restore()
}