diff options
author | metamuffin <metamuffin@disroot.org> | 2024-09-04 20:00:30 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2024-09-04 20:00:30 +0200 |
commit | 740dc4b45cb59ff184e5cebc5b19f402bb9d54d2 (patch) | |
tree | 188c59484dc4b4c268a107def8d485919a3b5100 /test-client/visual.ts | |
parent | 406ba2117783f17010f4786a86fa02ae715388e6 (diff) | |
download | hurrycurry-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.ts | 6 |
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() } |