Skip to content

Commit

Permalink
debug tools #15: Ctrl-D for switching BOTCH.debugMode
Browse files Browse the repository at this point in the history
- added Ctrl-D to switch debug tab visibility
  dirty and unreactive! Requires manually clicking on other tabs make tab appear !
- re-enabled rotation for debug tab icons
  • Loading branch information
DavidLeoni committed Sep 6, 2020
1 parent e928cf4 commit b41782f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
Binary file added docs/simple-deterministic.sb3
Binary file not shown.
4 changes: 2 additions & 2 deletions src/components/botch/botch-life-tree-item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class BotchLifeTreeItem extends React.PureComponent {
startRotatingIcons () {
// TO DO Botch: temporarily removed, but don't like this
// https://github.com/CoderDojoTrento/botch-gui/issues/22
// this.rotateIcon();
// this.intervalId = setInterval(this.rotateIcon, 300);
this.rotateIcon();
this.intervalId = setInterval(this.rotateIcon, 300);
}
stopRotatingIcons () {
if (this.intervalId) {
Expand Down
2 changes: 2 additions & 0 deletions src/components/gui/gui.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ const GUIComponent = props => {
<Tab
className={tabClassNames.tab}
onClick={onActivateBotchDebugTab}
// TO DO surely not the react way, and I do not care
style={BOTCH.debugMode ? {} : {display: 'none'}}
>
<img
draggable={false}
Expand Down
7 changes: 7 additions & 0 deletions src/components/menu-bar/menu-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,13 @@ class MenuBar extends React.Component {
this.props.onClickSave();
event.preventDefault();
}
// Botch
if (modifier && event.key === 'd') {
// TO DO surely not the react way, and I do not care
/* global BOTCH */
BOTCH.switchDebugMode();
event.preventDefault();
}
}
getSaveToComputerHandler (downloadProjectCallback) {
return () => {
Expand Down
2 changes: 2 additions & 0 deletions src/containers/gui.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,11 @@ const mapDispatchToProps = dispatch => ({
onActivateCostumesTab: () => dispatch(activateTab(COSTUMES_TAB_INDEX)),
onActivateSoundsTab: () => dispatch(activateTab(SOUNDS_TAB_INDEX)),
onActivateOrganismsTab: () => dispatch(activateTab(ORGANISMS_TAB_INDEX)), /* Botch */
onActivateBotchDebugTab: () => dispatch(activateTab(BOTCH_DEBUG_TAB_INDEX)), /* Botch */
onRequestCloseBackdropLibrary: () => dispatch(closeBackdropLibrary()),
onRequestCloseCostumeLibrary: () => dispatch(closeCostumeLibrary()),
onRequestCloseTelemetryModal: () => dispatch(closeTelemetryModal())

});

const ConnectedGUI = injectIntl(connect(
Expand Down

0 comments on commit b41782f

Please sign in to comment.