X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Ftracker%2FDungeons.js;h=4890bbbc6afbb433a38c282c0bf33b63cdc2d571;hb=60fd718e3b558eaea02a8d64bd6aac74be91f782;hp=08a581f209a1428bbf12f0cf002239f14a0be28c;hpb=24489254a5d05efd6fe7dceb2cffe5fdb49ab7b7;p=alttp.git diff --git a/resources/js/components/tracker/Dungeons.js b/resources/js/components/tracker/Dungeons.js index 08a581f..4890bbb 100644 --- a/resources/js/components/tracker/Dungeons.js +++ b/resources/js/components/tracker/Dungeons.js @@ -3,64 +3,178 @@ import React from 'react'; import CountDisplay from './CountDisplay'; import ToggleIcon from './ToggleIcon'; import { + BOSSES, getDungeonAcquiredSKs, getDungeonRemainingItems, + shouldShowDungeonItem, } from '../../helpers/tracker'; import { useTracker } from '../../hooks/tracker'; const Dungeons = () => { - const { dungeons, state } = useTracker(); + const { config, dungeons, state } = useTracker(); - return
+ const layout = React.useMemo(() => { + const mapX = 1; + const compassX = shouldShowDungeonItem(config, 'Map') ? mapX + 1 : mapX; + const smallX = shouldShowDungeonItem(config, 'Compass') ? compassX + 1 : compassX; + const bigX = shouldShowDungeonItem(config, 'Small') ? smallX + 1 : smallX; + const countX = shouldShowDungeonItem(config, 'Big') ? bigX + 1 : bigX; + const bossX = countX + 1; + const prizeX = bossX + 1; + const dungeonWidth = prizeX + 1; + const width = (4 * dungeonWidth) + 2; + const height = 4; + const viewBox = `0 0 ${width} ${height}`; + return { + width, + height, + viewBox, + transform: { + tag: '', + map: `translate(${mapX} 0) scale(0.9)`, + compass: `translate(${compassX} 0) scale(0.9)`, + small: `translate(${smallX} 0) scale(0.9)`, + big: `translate(${bigX} 0) scale(0.9)`, + checks: `translate(${countX} 0) scale(0.9)`, + boss: `translate(${bossX} 0)`, + prize: `translate(${prizeX} 0)`, + hc: 'translate(0.5, 0.5)', + ct: 'translate(0.5, 1.5)', + gt: 'translate(0.5, 2.5)', + gtBoss1: `translate(${bossX - 2} 1)`, + gtBoss2: `translate(${bossX - 1} 1)`, + gtBoss3: `translate(${bossX} 1)`, + ep: `translate(${dungeonWidth + 0.5}, 0.5)`, + dp: `translate(${dungeonWidth + 0.5}, 1.5)`, + th: `translate(${dungeonWidth + 0.5}, 2.5)`, + pd: `translate(${(2 * dungeonWidth) + 1.5}, 0.5)`, + sp: `translate(${(2 * dungeonWidth) + 1.5}, 1.5)`, + sw: `translate(${(2 * dungeonWidth) + 1.5}, 2.5)`, + tt: `translate(${(2 * dungeonWidth) + 1.5}, 3.5)`, + ip: `translate(${(3 * dungeonWidth) + 2.5}, 0.5)`, + mm: `translate(${(3 * dungeonWidth) + 2.5}, 1.5)`, + tr: `translate(${(3 * dungeonWidth) + 2.5}, 2.5)`, + }, + }; + }, [config, dungeons]); + + return { + e.preventDefault(); + e.stopPropagation(); + }} + > {dungeons.map(dungeon => -
- {dungeon.id.toUpperCase()} - - - - - - - - + + + {dungeon.id.toUpperCase()} + + {shouldShowDungeonItem(config, 'Map') ? + + + + : null} + {shouldShowDungeonItem(config, 'Compass') ? + + + + : null} + {shouldShowDungeonItem(config, 'Small') ? + + + + + : null} + {shouldShowDungeonItem(config, 'Big') ? + + + + : null} + - + {dungeon.boss ? - + + + : null} {dungeon.prize ? - + + + : null} -
+ {dungeon.id === 'gt' && config.bossShuffle ? <> + + + + + + + + + + : null} + )} -
; + ; }; export default Dungeons;