diff --git a/src/index.html b/src/index.html index debf7a8..5cb0619 100644 --- a/src/index.html +++ b/src/index.html @@ -17,7 +17,7 @@ mixin="gameoverAnimation fogAnimation" bind__beat-loader="challengeId: challenge.id; difficulty: challenge.difficulty; isPlaying: isPlaying" bind__gameover="isGameOver: isGameOver" - bind__intro-song="isPlaying: menu.active && !menuSelectedChallenge.id" + bind__intro-song="isPlaying: menuActive && !menuSelectedChallenge.id" bind__overlay="enabled: !isPlaying" bind__song="challengeId: challenge.id; isPlaying: isPlaying; isBeatsPreloaded: challenge.isBeatsPreloaded; isGameOver: isGameOver" bind__song-preview-system="challengeId: challenge.id; isSongLoading: isSongLoading; selectedChallengeId: menuSelectedChallenge.id" @@ -176,7 +176,7 @@ trail="color: {{ bladeColor }}; hand: {{ hand }}"> @@ -235,7 +235,7 @@ + bind__cursor-mesh="active: menuActive"> {% endif %} diff --git a/src/state/index.js b/src/state/index.js index 27e1342..1f46561 100644 --- a/src/state/index.js +++ b/src/state/index.js @@ -41,7 +41,7 @@ AFRAME.registerState({ isSongLoading: false, // Either fetching or decoding. isVictory: false, // Victory screen. keyboardActive: false, // Whether search is open. - menu: {active: true}, + menuActive: true, menuDifficulties: [], menuSelectedChallenge: { author: '', @@ -127,7 +127,7 @@ AFRAME.registerState({ state.isGameOver = false; state.isPaused = false; state.isVictory = false; - state.menu.active = true; + state.menuActive = true; state.challenge.id = ''; }, @@ -185,7 +185,7 @@ AFRAME.registerState({ Object.assign(state.challenge, state.menuSelectedChallenge); // Reset menu. - state.menu.active = false; + state.menuActive = false; state.menuSelectedChallenge.id = ''; state.keyboardActive = false; @@ -261,10 +261,10 @@ AFRAME.registerState({ */ computeState: (state) => { state.isPlaying = - !state.menu.active && !state.isPaused && !state.isVictory && !state.isGameOver && + !state.menuActive && !state.isPaused && !state.isVictory && !state.isGameOver && !state.challenge.isLoading && !state.isSongLoading; - const anyMenuOpen = state.menu.active || state.isPaused || state.isVictory || state.isGameOver; + const anyMenuOpen = state.menuActive || state.isPaused || state.isVictory || state.isGameOver; state.leftRaycasterActive = anyMenuOpen && state.activeHand === 'left' && state.inVR; state.rightRaycasterActive = anyMenuOpen && state.activeHand === 'right' && state.inVR; diff --git a/src/templates/menu.html b/src/templates/menu.html index 5df9f1d..5587446 100644 --- a/src/templates/menu.html +++ b/src/templates/menu.html @@ -51,8 +51,8 @@ @@ -61,7 +61,7 @@ @@ -84,7 +84,7 @@ bind-item__animation__mouseentervisible="enabled: menuSelectedChallenge.id !== item.id" bind-item__animation__mouseleave="enabled: menuSelectedChallenge.id !== item.id" bind-item__animation__mouseleavevisible="enabled: menuSelectedChallenge.id !== item.id" - bind-toggle__raycastable="menu.active" + bind-toggle__raycastable="menuActive" geometry="primitive: plane; width: 1.1; height: 0.2" material="shader: flat; color: #067197; transparent: true; opacity: 0.0" position="0 -0.13 -0.002" @@ -100,7 +100,7 @@ {% endraw %} - + + bind-toggle__raycastable="menuActive && !!menuSelectedChallenge.id" + bind__visible="menuActive && !!menuSelectedChallenge.id"> @@ -207,8 +207,8 @@ 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 && !keyboardActive" - bind__visible="menu.active && !keyboardActive" + bind-toggle__raycastable="menuActive && !keyboardActive" + bind__visible="menuActive && !keyboardActive" proxy-event="event: click; to: a-scene; as: keyboardopen"> diff --git a/src/templates/stage.html b/src/templates/stage.html index 0006ace..b60716d 100644 --- a/src/templates/stage.html +++ b/src/templates/stage.html @@ -47,7 +47,7 @@ @@ -141,11 +141,11 @@ logo-light animation__rotate="property: object3D.rotation.y; from: 50; to: -50; dur: 300; easing: linear; startEvents: audioanalyserbeat"> - -