-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
add better navigation, item tracking, and speedups
- Loading branch information
Showing
191 changed files
with
15,765 additions
and
869 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
const longPressDuration = 300; | ||
|
||
export default class ContextMenuHandler { | ||
constructor(callback) { | ||
this.callback = callback; | ||
this.longPressCountdown = null; | ||
this.contextMenuPossible = false; | ||
} | ||
|
||
onTouchStart = e => { | ||
this.contextMenuPossible = true; | ||
|
||
const touch = e.currentTarget; | ||
const source = e.currentTarget.getAttribute('data-source'); | ||
|
||
this.longPressCountdown = setTimeout(() => { | ||
this.contextMenuPossible = false; | ||
this.callback(touch, source); | ||
}, longPressDuration); | ||
}; | ||
|
||
onTouchMove = e => { | ||
clearTimeout(this.longPressCountdown); | ||
}; | ||
|
||
onTouchCancel = e => { | ||
this.contextMenuPossible = false; | ||
clearTimeout(this.longPressCountdown); | ||
}; | ||
|
||
onTouchEnd = e => { | ||
this.contextMenuPossible = false; | ||
clearTimeout(this.longPressCountdown); | ||
}; | ||
|
||
onContextMenu = e => { | ||
this.contextMenuPossible = false; | ||
|
||
clearTimeout(this.longPressCountdown); | ||
|
||
this.callback(e.currentTarget, e.currentTarget.getAttribute('data-source')); | ||
e.preventDefault(); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import React from 'react'; | ||
import Menu from '@material-ui/core/Menu'; | ||
|
||
const ITEM_HEIGHT = 31; | ||
|
||
class EntranceMenu extends React.Component { | ||
shouldComponentUpdate(nextProps) { | ||
return true; | ||
} | ||
render() { | ||
let entranceList = this.props.allAreas.entrances; | ||
if (typeof this.props.entrancePool === "undefined") { | ||
return null; | ||
} else { | ||
return ( | ||
<Menu | ||
id={this.props.id + "Element"} | ||
anchorEl={this.props.anchorLocation} | ||
open={Boolean(this.props.anchorLocation)} | ||
onClose={this.props.handleClose} | ||
PaperProps={{ | ||
style: { | ||
maxHeight: ITEM_HEIGHT * 19, | ||
border: '1px black solid', | ||
}, | ||
}} | ||
TransitionProps={{ | ||
timeout: 0, | ||
}} | ||
getContentAnchorEl={null} | ||
anchorOrigin={{ | ||
vertical: 'bottom', | ||
horizontal: 'right', | ||
}} | ||
transformOrigin={{ | ||
vertical: 'top', | ||
horizontal: 'right', | ||
}} | ||
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) { | ||
return null; | ||
} else { | ||
let eOptions = this.props.entrancePool[areaCategory].sort(function(a,b) { | ||
let aName = entranceList[a].tag === "" ? | ||
entranceList[a].alias : | ||
entranceList[a].tag; | ||
let bName = entranceList[b].tag === "" ? | ||
entranceList[b].alias : | ||
entranceList[b].tag; | ||
return aName.localeCompare(bName); | ||
}).map((subArea, j) => { | ||
if ((this.props.allAreas.entrances[subArea].tagRep || this.props.allAreas.entrances[subArea].tag === "")) { | ||
return (<div | ||
key={this.props.pool + "option" + j} | ||
className={this.props.classes.entranceText} | ||
data-link-to={subArea} | ||
data-link-from={this.props.sourceEntrance} | ||
onClick={this.props.handleLink}> | ||
{(this.props.allAreas.entrances[subArea].tag === "") ? | ||
this.props.allAreas.entrances[subArea].alias : | ||
this.props.allAreas.entrances[subArea].tag} | ||
</div>); | ||
} else { return null } | ||
}); | ||
return [ | ||
<div className={this.props.classes.entranceAreaText} key={this.props.entrance + "header" + l}><em>{areaCategory}</em></div>, | ||
eOptions | ||
]; | ||
}})} | ||
</Menu> | ||
); | ||
} | ||
} | ||
} | ||
|
||
export default EntranceMenu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
|
||
import OotIcon from './OotIcon'; | ||
import AddIcon from '@material-ui/icons/Add'; | ||
|
||
class FixedShopCheck extends React.Component { | ||
render() { | ||
return ( | ||
<div | ||
key={this.props.lkey} | ||
onClick={this.props.handleContextMenu.onContextMenu} | ||
onContextMenu={this.props.handleContextMenu.onContextMenu} | ||
onTouchStart={this.props.handleContextMenu.onTouchStart} | ||
onTouchCancel={this.props.handleContextMenu.onTouchCancel} | ||
onTouchEnd={this.props.handleContextMenu.onTouchEnd} | ||
onTouchMove={this.props.handleContextMenu.onTouchMove} | ||
data-source={this.props.location} | ||
> | ||
{ | ||
this.props.allAreas.locations[this.props.location].foundItem === "" ? | ||
<AddIcon className={this.props.classes.fixedShopIcon} /> | ||
/*<p className={this.props.classes.fixedShopIcon}>+</p>*/ : | ||
<OotIcon | ||
itemName={this.props.allAreas.locations[this.props.location].foundItem} | ||
className={this.props.classes.locationKnownItem} | ||
classes={this.props.classes} | ||
/> | ||
} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default FixedShopCheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.