Skip to content

Commit

Permalink
fix dungeon navigation in mixed pools
Browse files Browse the repository at this point in the history
  • Loading branch information
mracsys committed Jul 10, 2021
1 parent 830b0f0 commit ae5d9df
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/EntranceMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class EntranceMenu extends React.Component {
disableScrollLock={true}
>
{Object.keys(this.props.entrancePool).sort().map((areaCategory, l) => {
if (((areaCategory === this.props.title && areaCategory !== "Spawn Points") || areaCategory === "Warp Songs" || this.props.entrancePool[areaCategory].length === 0) && this.props.connector === false) {
if (((areaCategory === this.props.title && !(this.props.oneWay)) || areaCategory === "Warp Songs" || this.props.entrancePool[areaCategory].length === 0) && this.props.connector === false) {
return null;
} else {
let eOptions = this.props.entrancePool[areaCategory].sort(function(a,b) {
Expand Down
4 changes: 1 addition & 3 deletions src/LinkedEntrance.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ class LinkedEntrance extends React.Component {
}
}
if (this.props.allAreas.entrances[reverseLink].type === "dungeon") {
if (this.props.dungeon) {
if (this.props.allAreas.entrances[reverseLink].isReverse === true) {
href = '#' + this.props.allAreas.entrances[reverseLink].area;
} else if (this.props.allAreas.entrances[reverseLink].isReverse === true) {
href = '#' + this.props.allAreas.entrances[reverseLink].reverseAlias;
} else {
href = '#' + this.props.allAreas.entrances[reverseLink].alias;
}
Expand Down
28 changes: 21 additions & 7 deletions src/Tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,12 @@ const useStyles = (theme) => ({
backgroundColor: blueGrey[800],
}
},
warpMenuAreaHidden: {
display: 'block',
color: grey[500],
fontWeight: 'bold',
padding: theme.spacing(1),
},
warpSongsBig: {
[theme.breakpoints.down('xs')]: {
display: 'none',
Expand Down Expand Up @@ -1970,6 +1976,9 @@ class Tracker extends React.Component {
anchor="left"
open={this.state.openSettings}
classes={{paper: classes.drawerPaper}}
SlideProps={{
unmountOnExit: true,
}}
>
<div className={classes.drawerHeader} />
<List className={classes.drawerContainer}>
Expand Down Expand Up @@ -2002,6 +2011,7 @@ class Tracker extends React.Component {
allAreas={this.state.allAreas}
connector={this.state.entranceConnector === 'true'}
title={this.state.entranceToLink ? this.state.allAreas.entrances[this.state.entranceToLink].area : ''}
oneWay={this.state.entranceToLink ? this.state.allAreas.entrances[this.state.entranceToLink].oneWay : false}
sourceEntrance={this.state.entranceToLink}
classes={classes}
id="globalEntranceMenu"
Expand Down Expand Up @@ -2111,7 +2121,7 @@ class Tracker extends React.Component {
/>
</div>
<div className={classes.warpSongsSmall}>
<ClickAwayListener onClickAway={() => this.setState({ expandSongMenu: false })}>
<ClickAwayListener onClickAway={() => this.state.expandSongMenu ? this.setState({ expandSongMenu: false }) : null}>
<div
className={classes.iconDiv}
onClick={() => this.setState({ expandSongMenu: !this.state.expandSongMenu })}
Expand All @@ -2123,7 +2133,7 @@ class Tracker extends React.Component {
</div>
</ClickAwayListener>
</div>
<ClickAwayListener onClickAway={() => this.setState({ expandWarpMenu: false })}>
<ClickAwayListener onClickAway={() => this.state.expandWarpMenu ? this.setState({ expandWarpMenu: false }) : null}>
<div
className={classes.iconDiv}
onClick={() => this.setState({ expandWarpMenu: !this.state.expandWarpMenu })}
Expand All @@ -2136,7 +2146,7 @@ class Tracker extends React.Component {
{<PublicIcon className={classes.expandWarpMenu} />}
</div>
</ClickAwayListener>
<ClickAwayListener onClickAway={() => this.setState({ expandDungeonMenu: false })}>
<ClickAwayListener onClickAway={() => this.state.expandDungeonMenu ? this.setState({ expandDungeonMenu: false }) : null}>
<div
className={classes.iconDiv}
onClick={() => this.setState({ expandDungeonMenu: !this.state.expandDungeonMenu })}
Expand Down Expand Up @@ -2174,12 +2184,16 @@ class Tracker extends React.Component {
unmountOnExit
className={classes.warpAreaList}
>
{ Object.keys(this.state.areas).sort().filter((a) => (this.state.areas[a].show)).map((area, ia) => {
{ Object.keys(this.state.areas).sort().filter((a) => (!(this.state.areas[a].dungeon))).map((area, ia) => {
return (
<span
key={'quickAreaMenu'+ia}
className={classes.warpMenuArea}
onClick={() => this.handleWarpMenu(area)}
className={this.state.areas[area].show ?
classes.warpMenuArea :
classes.warpMenuAreaHidden}
onClick={this.state.areas[area].show ?
() => this.handleWarpMenu(area)
: null}
>
{area}
</span>
Expand Down Expand Up @@ -2213,7 +2227,7 @@ class Tracker extends React.Component {
<div className={classes.drawerHeader} />
{
this.state.settings["View"] === "Overworld" ?
Object.keys(this.state.areas).sort().filter((a) => (this.state.areas[a].show)).map((area, ia) => {
Object.keys(this.state.areas).sort().filter((a) => (this.state.areas[a].show && !(this.state.areas[a].dungeon))).map((area, ia) => {
return (
<GameArea
title={area}
Expand Down
4 changes: 2 additions & 2 deletions src/data/locations/market.json
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@
},
"locations": {
"Prelude of Light": {
"area": "Temple of Time",
"area": "",
"lKey": "ToT Entrance -> Temple of Time",
"alias": "Prelude of Light",
"type": "song",
Expand All @@ -457,7 +457,7 @@
"walletTier": 0
},
"Light Arrow Cutscene": {
"area": "Temple of Time",
"area": "",
"lKey": "ToT Entrance -> Temple of Time",
"alias": "Light Arrow Cutscene",
"type": "item",
Expand Down

0 comments on commit ae5d9df

Please sign in to comment.