-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Map Layout #145
base: main
Are you sure you want to change the base?
Add Map Layout #145
Conversation
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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} />; |
There was a problem hiding this comment.
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.
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, | ||
}; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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.