Skip to content

Commit

Permalink
Add debug keybinding for waterAllPlots
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Dec 7, 2018
1 parent 6331c70 commit 5397ee2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/Farmhand.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ export default class Farmhand extends Component {
focusShop: () => this.setState({ stageFocus: stageFocusType.SHOP }),
};

if (process.env.NODE_ENV === 'development') {
Object.assign(this.keyMap, {
waterAllPlots: 'w',
});

Object.assign(this.keyHandlers, {
waterAllPlots: () => this.waterAllPlots(),
});
}

this.keyHandlers = Object.keys(this.keyHandlers).reduce((acc, key) => {
const original = this.keyHandlers[key];
const { activeElement } = document;
Expand Down
2 changes: 1 addition & 1 deletion src/components/DebugMenu/DebugMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const DebugMenu = ({ handlers: { handleWaterAllPlotsClick } }) => (
onClick={handleWaterAllPlotsClick}
variant="contained"
>
Water all plots
Water all plots (w)
</Button>
</Typography>
</ExpansionPanelDetails>
Expand Down

0 comments on commit 5397ee2

Please sign in to comment.