From 740dc4b45cb59ff184e5cebc5b19f402bb9d54d2 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 4 Sep 2024 20:00:30 +0200 Subject: refactor interact function and new progress proto --- test-client/visual.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test-client/visual.ts') 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() } -- cgit v1.2.3-70-g09d2