From 1b09de35972cc6fbc47b4691035477f290538255 Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Wed, 3 Oct 2018 19:01:27 -0700 Subject: [PATCH] rename some keyboard state/events to put keyboard noun first --- src/state/index.js | 16 ++++++++-------- src/templates/menu.html | 20 +++++++++++++------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/state/index.js b/src/state/index.js index 1a468ec..f51f846 100644 --- a/src/state/index.js +++ b/src/state/index.js @@ -29,6 +29,7 @@ AFRAME.registerState({ inVR: false, isPaused: false, // Playing, but paused. Not active during menu. isPlaying: false, // Not in the menu AND not paused. + keyboardActive: false, menu: { active: true, playButtonText: 'Play' @@ -56,8 +57,7 @@ AFRAME.registerState({ hasPrev: false, results: [], }, - searchResultsPage: [], - showKeyboard: false + searchResultsPage: [] }, handlers: { @@ -86,8 +86,12 @@ AFRAME.registerState({ state.challenge.isLoading = true; }, - closekeyboard: (state) => { - state.showKeyboard = false; + keyboardclose: (state) => { + state.keyboardActive = false; + }, + + keyboardopen: (state) => { + state.keyboardActive = true; }, /** @@ -115,10 +119,6 @@ AFRAME.registerState({ state.menuSelectedChallenge.difficulty = difficulty; }, - openkeyboard: (state) => { - state.showKeyboard = true; - }, - pausegame: (state) => { state.isPaused = true; }, diff --git a/src/templates/menu.html b/src/templates/menu.html index 715fbfb..09d8b8f 100644 --- a/src/templates/menu.html +++ b/src/templates/menu.html @@ -194,17 +194,23 @@ animation__mouseleave1="property: slice9.color; type: color; from: #FFF; to: #999; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150" animation__mouseenter2="property: scale; from: 1 1 1; to: 1.1 1.1 1.1; startEvents: mouseenter; pauseEvents: mouseleave; dur: 150" animation__mouseleave2="property: scale; to: 1 1 1; from: 1.1 1.1 1.1; startEvents: mouseleave; pauseEvents: mouseenter; dur: 150" - bind-toggle__raycastable="menu.active && !showKeyboard" - bind__visible="menu.active && !showKeyboard" - proxy-event="event: click; to: a-scene; as: openkeyboard"> + bind-toggle__raycastable="menu.active && !keyboardActive" + bind__visible="menu.active && !keyboardActive" + proxy-event="event: click; to: a-scene; as: keyboardopen"> - +