]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/tracker/Dungeons.js
clean up manual tracking
[alttp.git] / resources / js / components / tracker / Dungeons.js
index 07b66389dd0b7f7e5830c09edcca060af7dd8c53..08a581f209a1428bbf12f0cf002239f14a0be28c 100644 (file)
@@ -2,6 +2,10 @@ import React from 'react';
 
 import CountDisplay from './CountDisplay';
 import ToggleIcon from './ToggleIcon';
+import {
+       getDungeonAcquiredSKs,
+       getDungeonRemainingItems,
+} from '../../helpers/tracker';
 import { useTracker } from '../../hooks/tracker';
 
 const Dungeons = () => {
@@ -24,7 +28,7 @@ const Dungeons = () => {
                                                controller={ToggleIcon.dungeonCountController(dungeon, dungeon.sk)}
                                                icons={['small-key']}
                                        />
-                                       <CountDisplay count={state[`${dungeon.id}-small-key`] || 0} />
+                                       <CountDisplay count={getDungeonAcquiredSKs(state, dungeon)} />
                                </span>
                                <ToggleIcon
                                        controller={ToggleIcon.dungeonController(dungeon)}
@@ -32,10 +36,10 @@ const Dungeons = () => {
                                />
                                <span className="dungeon-checks">
                                        <ToggleIcon
-                                               controller={ToggleIcon.dungeonCheckController(dungeon, dungeon.items)}
+                                               controller={ToggleIcon.dungeonCheckController(dungeon)}
                                                icons={['open-chest', 'chest']}
                                        />
-                                       <CountDisplay count={dungeon.items - (state[`${dungeon.id}-checks`] || 0)} />
+                                       <CountDisplay count={getDungeonRemainingItems(state, dungeon)} />
                                </span>
                                {dungeon.boss ?
                                        <ToggleIcon