Skip to content

Add Map Layout - #145

Open
YourAverageLink wants to merge 18 commits into
cjs8487:mainfrom
YourAverageLink:dungeon-map
Open

Add Map Layout#145
YourAverageLink wants to merge 18 commits into
cjs8487:mainfrom
YourAverageLink:dungeon-map

Conversation

@YourAverageLink

Copy link
Copy Markdown
Contributor

This adds a new layout option to the tracker - featuring a world map where users can select regions and submaps, each positioned on the map around where the region is located in-game.

The layout moves around the rest of the tracker to accomodate a large map. The map supports dungeon markers that allow users to keep track of where entrances are mapped if dungeon entrance randomizer is on.

@YourAverageLink

Copy link
Copy Markdown
Contributor Author

Okay, I think I've got it in a state where I'm mostly happy with it. Still iffy on how the dungeon items section can be wider than the main item tracker if window height is the limiting factor. I just added support for trial gate rando (in fact, the marker system for dungeons and trial gates has been generalized to one element).

import ColorScheme from '../customization/ColorScheme';
import Logic from '../logic/Logic';

class MapDungeonTracker extends React.Component {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component duplicates a lot of stuff from DungeonTracker - it might be useful to just pass a mapMode prop to DungeonTracker, which causes it to render the reduced dungeon tracker.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'll likely be better long term to try and componetize DungeonTracker further. Accomplishes the same goal of reducing the code duplication., without necessarily introducing additional maintenance overhead with multiple codepaths and conditional rendering, especially if/when the layout options are further expanded

Comment on lines +54 to +59
if (hint.includes('Path')) {
image = <img src={pathImages[hint.slice(8)]} alt={hint} />;
} else if (hint === 'Spirit of the Sword') {
image = <img src={sotsImage} alt={hint} />;
} else if (hint === 'Barren') {
image = <img src={barrenImage} alt={hint} />;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I'd use something more structured in the data - e.g.

export type Hint =
    | { type: 'barren' }
    | { type: 'sots' }
    | { type: 'path'; index: number }; // or path: string

with a function that decodes these hint types for UI.

Comment on lines +16 to +32
import g1 from '../../assets/hints/g1.png';
import scaldera from '../../assets/hints/scaldera.png';
import moldarach from '../../assets/hints/moldarach.png';
import koloktos from '../../assets/hints/koloktos.png';
import tentalus from '../../assets/hints/tentalus.png';
import g2 from '../../assets/hints/g2.png';



const pathImages: {[key: string]: string} = {
'Ghirahim 1': g1,
'Scaldera': scaldera,
'Moldarach': moldarach,
'Koloktos': koloktos,
'Tentalus': tentalus,
'Ghirahim 2': g2,
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is duplicated a bunch of times - it'd be useful to have this in one place.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It likely belongs in itemTracker/Images.ts, which ultimately is probably in the wrong place now that we're starting to add images in places outside the item tracker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants