From 103371b7fdc3b11e1a937d46474819ab0a5425fb Mon Sep 17 00:00:00 2001 From: Daniel Karbach Date: Thu, 4 Apr 2024 17:00:44 +0200 Subject: [PATCH] pendant auto tracking --- resources/js/helpers/tracker.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/resources/js/helpers/tracker.js b/resources/js/helpers/tracker.js index f73aa66..06513cc 100644 --- a/resources/js/helpers/tracker.js +++ b/resources/js/helpers/tracker.js @@ -1863,7 +1863,21 @@ const collectInventory = (state, data, prizeMap) => { if (dungeon.prize) { const isCrystal = prizeMap[dungeon.offset].isCrystal; const prizeFlags = data[isCrystal ? INV_ADDR.CRYSTALS : INV_ADDR.PENDANTS]; - state[`${dungeon.id}-prize-acquired`] = !!(prizeFlags & prizeMap[dungeon.offset].mask); + const prizeAcquired = !!(prizeFlags & prizeMap[dungeon.offset].mask); + state[`${dungeon.id}-prize-acquired`] = prizeAcquired; + if (prizeAcquired) { + if (!isCrystal) { + if (prizeMap[dungeon.offset].mask === 1) { + state[`${dungeon.id}-prize`] = 'red-pendant'; + } else if (prizeMap[dungeon.offset].mask === 2) { + state[`${dungeon.id}-prize`] = 'blue-pendant'; + } else if (prizeMap[dungeon.offset].mask === 4) { + state[`${dungeon.id}-prize`] = 'green-pendant'; + } + } else { + state[`${dungeon.id}-prize`] = 'crystal'; + } + } } }); }; -- 2.39.2