Skip to content

Commit

Permalink
Whoops, forgot to feature-flag instructions debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
jcreedcmu committed Oct 15, 2023
1 parent 46a949d commit a2e6200
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/ui/instructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ import * as React from 'react';
import { useEffect } from 'react';
import { Dispatch } from '../core/action';
import { bonusGenerator } from '../core/bonus';
import { checkConnected, mkGridOf } from '../core/grid';
import { PANIC_INTERVAL_MS } from '../core/clock';
import { mkGridOf } from '../core/grid';
import { mkLayer } from '../core/layer';
import { GameState, SceneState } from '../core/state';
import { GameState } from '../core/state';
import { checkValid } from '../core/state-helpers';
import { DEBUG } from '../util/debug';
import { relpos } from '../util/dutil';
import { Point } from '../util/types';
import { paint } from './render';
import { resizeView } from './ui-helpers';
import { CanvasInfo, useCanvas } from './use-canvas';
import { checkValid } from '../core/state-helpers';
import { PANIC_INTERVAL_MS } from '../core/clock';
import { Point } from '../util/types';
import { relpos } from '../util/dutil';

export type ForRenderState = GameState;
type CanvasProps = {
Expand All @@ -21,8 +22,12 @@ type CanvasProps = {
export function Instructions(props: { dispatch: Dispatch }): JSX.Element {
const { dispatch } = props;
function mouseDownListener(e: MouseEvent) {
console.log(relpos(e, mc.current!.c));
// dispatch({ t: 'setSceneState', state: { t: 'menu' } });
if (DEBUG.instructions) {
console.log(relpos(e, mc.current!.c));
}
else {
dispatch({ t: 'setSceneState', state: { t: 'menu' } });
}
e.preventDefault();
e.stopPropagation();
}
Expand Down
1 change: 1 addition & 0 deletions src/util/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const DEBUG = {
letterSample: false,
words: false,
stateExporter: true,
instructions: false,
};

export type DebugLevel = keyof (typeof DEBUG);
Expand Down

0 comments on commit a2e6200

Please sign in to comment.