]> git.localhorst.tv Git - alttp.git/commitdiff
compact keysanity tracker
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Sat, 20 Apr 2024 11:57:30 +0000 (13:57 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Sat, 20 Apr 2024 11:57:30 +0000 (13:57 +0200)
resources/js/components/tracker/Canvas.js
resources/js/components/tracker/ConfigDialog.js
resources/js/components/tracker/Dungeons.js
resources/js/components/tracker/ToggleIcon.js
resources/js/components/tracker/Toolbar.js
resources/js/helpers/tracker.js
resources/js/i18n/de.js
resources/js/i18n/en.js
resources/sass/tracker.scss

index 89339abb346eedcebbb870d7e3044bac2705bf29..62dafe14b9896f03e2943fa766bac45806623fc3 100644 (file)
@@ -56,7 +56,9 @@ const Canvas = () => {
                        if (shouldShowDungeonItem(config, 'Big')) {
                                ++count;
                        }
-                       return count > 2 ? LAYOUTS.manyDungeonItemsVertical : LAYOUTS.defaultVertical;
+                       const compact = config.compactKeysanity && count === 4;
+                       return !compact && count > 2
+                               ? LAYOUTS.manyDungeonItemsVertical : LAYOUTS.defaultVertical;
                } else {
                        return LAYOUTS.defaultHorizontal;
                }
index db6df71418af5e73a59ed92bec4c9e7e1f75773c..9d6b5be2c38d9d788b9f12494414e4b7c9a93195 100644 (file)
@@ -300,6 +300,18 @@ const ConfigDialog = ({
                                                        )}
                                                </Form.Select>
                                        </Form.Group>
+                                       <Form.Group
+                                               className="d-flex justify-content-between my-2"
+                                               controlId="tracker.compactKeysanity"
+                                       >
+                                               <Form.Label>{t('tracker.config.compactKeysanity')}</Form.Label>
+                                               <Form.Control
+                                                       as={LargeCheck}
+                                                       name="compactKeysanity"
+                                                       onChange={handleChange}
+                                                       value={!!config.compactKeysanity}
+                                               />
+                                       </Form.Group>
                                </Col>
                                <Col sm={6}>
                                        <h3>{t('tracker.config.calculation')}</h3>
index c6ed5c2fe7991a41c1d6fbeebfbe8c9bd5ac224d..8a7e4d034b4ff06e27b0fb0175d925e9b00d223c 100644 (file)
@@ -7,6 +7,7 @@ import {
        BOSSES,
        getDungeonAcquiredSKs,
        getDungeonRemainingItems,
+       shouldCompactKeysanity,
        shouldShowDungeonItem,
 } from '../../helpers/tracker';
 import { useTracker } from '../../hooks/tracker';
@@ -15,11 +16,12 @@ const Dungeons = ({ columns }) => {
        const { config, dungeons, state } = useTracker();
 
        const layout = React.useMemo(() => {
+               const compact = shouldCompactKeysanity(config);
                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 countX = compact ? 2 : shouldShowDungeonItem(config, 'Big') ? bigX + 1 : bigX;
                const bossX = countX + 1;
                const prizeX = bossX + 1;
                const dungeonWidth = Math.max(5, prizeX + 1);
@@ -33,10 +35,14 @@ const Dungeons = ({ columns }) => {
 
                const transforms = {
                        tag: null,
-                       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)`,
+                       map: compact
+                               ? 'translate(0.75 -0.25) scale(0.45)' : `translate(${mapX} 0) scale(0.9)`,
+                       compass: compact
+                               ? 'translate(1.25 -0.25) scale(0.45)' : `translate(${compassX} 0) scale(0.9)`,
+                       small: compact
+                               ? 'translate(0.75 0.25) scale(0.45)' : `translate(${smallX} 0) scale(0.9)`,
+                       big: compact
+                               ? 'translate(1.25 0.25) scale(0.45)' : `translate(${bigX} 0) scale(0.9)`,
                        checks: `translate(${countX} 0) scale(0.9)`,
                        boss: `translate(${bossX} 0)`,
                        prize: `translate(${prizeX} 0)`,
index 6dee8180f7be7bfdb3a80dc5819c26b68776f1ee..d3e3960fa4bd00795561344ddc493e40998e9c32 100644 (file)
@@ -19,7 +19,7 @@ import {
 } from '../../helpers/tracker';
 import { useTracker } from '../../hooks/tracker';
 
-const ToggleIcon = ({ controller, className, icons, svg, transform }) => {
+const ToggleIcon = ({ controller, className, icons, svg, title, transform }) => {
        const { setManualState, state } = useTracker();
        const activeController = controller || ToggleIcon.nullController;
        const active = activeController.getActive(state, icons);
@@ -50,7 +50,7 @@ const ToggleIcon = ({ controller, className, icons, svg, transform }) => {
                        }}
                        transform={transform}
                >
-                       <ZeldaIcon name={icon} svg />
+                       <ZeldaIcon name={icon} svg title={title} />
                </g>;
        }
        return <span
@@ -66,7 +66,7 @@ const ToggleIcon = ({ controller, className, icons, svg, transform }) => {
                        e.stopPropagation();
                }}
        >
-               <ZeldaIcon name={active || defaultIcon || icons[0]} />
+               <ZeldaIcon name={active || defaultIcon || icons[0]} title={title} />
        </span>;
 };
 
@@ -305,6 +305,7 @@ ToggleIcon.propTypes = {
        }),
        icons: PropTypes.arrayOf(PropTypes.string),
        svg: PropTypes.bool,
+       title: PropTypes.string,
        transform: PropTypes.string,
 };
 
index 85e0f0428bf6bb4d47c7dbfa6833d602a9c1df80..f9d488a03f5bacf88afe29ce52dc8bb6b4e9cfd2 100644 (file)
@@ -60,16 +60,42 @@ const Toolbar = () => {
                                <Button
                                        className="me-3"
                                        onClick={() => setShowConfigDialog(true)}
+                                       title={t('button.settings')}
                                        variant="outline-secondary"
                                >
-                                       <Icon.SETTINGS />
+                                       <Icon.SETTINGS title="" />
                                </Button>
-                               <ToggleIcon controller={wildController} icons={['map']} />
-                               <ToggleIcon controller={wildController} icons={['compass']} />
-                               <ToggleIcon controller={wildController} icons={['small-key']} />
-                               <ToggleIcon controller={wildController} icons={['big-key']} />
-                               <ToggleIcon className="ms-3" controller={bossController} icons={['armos']} />
-                               <ToggleIcon controller={worldController} icons={['link-head', 'bunny-head']} />
+                               <ToggleIcon
+                                       controller={wildController}
+                                       icons={['map']}
+                                       title={t('tracker.config.shuffleMap')}
+                               />
+                               <ToggleIcon
+                                       controller={wildController}
+                                       icons={['compass']}
+                                       title={t('tracker.config.shuffleCompass')}
+                               />
+                               <ToggleIcon
+                                       controller={wildController}
+                                       icons={['small-key']}
+                                       title={t('tracker.config.shuffleSmall')}
+                               />
+                               <ToggleIcon
+                                       controller={wildController}
+                                       icons={['big-key']}
+                                       title={t('tracker.config.shuffleBig')}
+                               />
+                               <ToggleIcon
+                                       className="ms-3"
+                                       controller={bossController}
+                                       icons={['armos']}
+                                       title={t('tracker.config.bossShuffle')}
+                               />
+                               <ToggleIcon
+                                       controller={worldController}
+                                       icons={['link-head', 'bunny-head']}
+                                       title={t('tracker.config.inverted')}
+                               />
                        </div>
                        <div>
                                <Form.Group
index c4b685c5b9ced45af45281b71e0728bae7aac022..f3d4bb4120b92665b0716f2213d94e652fc794af 100644 (file)
@@ -85,6 +85,7 @@ export const BOSSES = [
 export const CONFIG = {
        bossShuffle: false,
        checkCalculation: 'room-data',
+       compactKeysanity: true,
        glitches: 'none',
        mapLayout: 'horizontal',
        showMap: 'situational',
@@ -1625,6 +1626,15 @@ export const shouldShowDungeonItem = (config, which) => {
        }
 };
 
+export const showsFullKeysanity = (config) =>
+       shouldShowDungeonItem(config, 'Map') &&
+       shouldShowDungeonItem(config, 'Compass') &&
+       shouldShowDungeonItem(config, 'Small') &&
+       shouldShowDungeonItem(config, 'Big');
+
+export const shouldCompactKeysanity = (config) =>
+       config.compactKeysanity && showsFullKeysanity(config);
+
 export const toggleBoolean = name => state => ({
        ...state,
        [name]: !state[name],
index 21275f05a4e887886c453be315e73288b8710f1b..dcf4d21bdea0ddd9885bc5cd893e0ec9f030147f 100644 (file)
@@ -527,6 +527,7 @@ export default {
                                        inventory: 'Inventar (Doors)',
                                        'room-data': 'Raumdaten (Glitched)',
                                },
+                               compactKeysanity: 'Kompaktes Keysanity',
                                ganonCrystals: 'Ganon Crystals',
                                glitches: 'Glitches',
                                glitchRules: {
@@ -547,6 +548,7 @@ export default {
                                        trinity: 'Trinity',
                                },
                                gtCrystals: 'GT Crystals',
+                               inverted: 'Inverted',
                                layout: 'Layout',
                                logic: 'Logik',
                                mapLayout: 'Karte',
@@ -564,6 +566,10 @@ export default {
                                showItems: 'Zeige Dungeon Items',
                                showMap: 'Maps',
                                showSmall: 'Small Keys',
+                               shuffleBig: 'Big Key Shuffle',
+                               shuffleCompass: 'Kompass Shuffle',
+                               shuffleMap: 'Map Shuffle',
+                               shuffleSmall: 'Small Key Shuffle',
                                title: 'Konfiguration',
                                wildBig: 'Big Keys',
                                wildCompass: 'Kompanden',
index 2645cc99b61da132164b4f94d263afd587ebecbc..dfa33f4fe0149e33487d49e936e140dbd265cec9 100644 (file)
@@ -527,6 +527,7 @@ export default {
                                        inventory: 'Inventory (Doors)',
                                        'room-data': 'Room data (glitched)',
                                },
+                               compactKeysanity: 'Compact Keysanity',
                                ganonCrystals: 'Ganon Crystals',
                                glitches: 'Glitches',
                                glitchRules: {
@@ -547,6 +548,7 @@ export default {
                                        trinity: 'Trinity',
                                },
                                gtCrystals: 'GT Crystals',
+                               inverted: 'Inverted',
                                layout: 'Layout',
                                logic: 'Logic',
                                mapLayout: 'Map',
@@ -564,6 +566,10 @@ export default {
                                showItems: 'Show Dungeon Items',
                                showMap: 'Maps',
                                showSmall: 'Small Keys',
+                               shuffleBig: 'Big Key Shuffle',
+                               shuffleCompass: 'Compass Shuffle',
+                               shuffleMap: 'Map Shuffle',
+                               shuffleSmall: 'Small Key Shuffle',
                                title: 'Configuration',
                                wildBig: 'Big Keys',
                                wildCompass: 'Compasses',
index cf6cb6df77302212fcdb64902b93f2b04ac017f7..ab1faaba3e4b67850ebf75125306133a555ccfc0 100644 (file)
        .dungeons {
                .count-display,
                .dungeon-tag {
-                       font-size: 0.5px;
+                       font-size: 0.45px;
                        font-weight: bold;
                        fill: white;
                        stroke: black;
-                       stroke-width: 0.25px;
+                       stroke-width: 0.2px;
                        stroke-linejoin: round;
                        paint-order: stroke fill;
                        dominant-baseline: middle;
@@ -38,6 +38,7 @@
                }
                .count-display {
                        font-size: 0.65px;
+                       stroke-width: 0.3px;
                }
        }
        .items {