Fix false reveal on companion click

This commit is contained in:
Dennis Schoepf 2021-08-01 09:32:31 +02:00
parent ce11e75cf3
commit 4b26687724
2 changed files with 6 additions and 8 deletions

13
main.ts
View file

@ -36,13 +36,12 @@ const sketch = (s: p5) => {
s.mousePressed = () => { s.mousePressed = () => {
const { currentScene, companionState, infoMessageShown } = store.getState(); const { currentScene, companionState, infoMessageShown } = store.getState();
if (companionState === CompanionState.ACTIVE) return; if (companionState !== CompanionState.ACTIVE || !infoMessageShown) {
if (infoMessageShown) return; if (currentScene === Scenes.OVERVIEW) {
overviewScene.onSceneClick();
if (currentScene === Scenes.OVERVIEW) { } else if (currentScene === Scenes.DETAIL) {
overviewScene.onSceneClick(); detailScene.onSceneClick();
} else if (currentScene === Scenes.DETAIL) { }
detailScene.onSceneClick();
} }
}; };
}; };

View file

@ -5,7 +5,6 @@ import { CompanionMessage, CompanionState } from './ui/companion';
import project from '../metadata/project.json'; import project from '../metadata/project.json';
import { InfoMessageType } from './ui/info'; import { InfoMessageType } from './ui/info';
import { RevealableInterface, RevealableTypes } from './sketchObjects/Revealable'; import { RevealableInterface, RevealableTypes } from './sketchObjects/Revealable';
import { SubProject } from './types';
import { getRevealablesforSubproject } from './helpers'; import { getRevealablesforSubproject } from './helpers';
export interface State { export interface State {