add info to menu selected challenge panel

This commit is contained in:
Kevin Ngo
2018-10-26 11:36:37 -07:00
parent ea7bb841a0
commit 80316c066e
2 changed files with 10 additions and 7 deletions

View File

@@ -490,11 +490,14 @@ function computeMenuSelectedChallengeIndex (state) {
}
function computeMenuSelectedChallengeInfoText (state) {
const numBeats = state.menuSelectedChallenge.numBeats;
const songLength = state.menuSelectedChallenge.songLength;
const challenge = state.menuSelectedChallenge;
const numBeats = challenge.numBeats;
const songLength = challenge.songLength;
if (!numBeats || !songLength) { return; }
state.menuSelectedChallenge.songInfoText =
`${formatSongLength(songLength)} / ${numBeats} beats`;
challenge.songInfoText =
`${challenge.author}\n${challenge.downloadsText}\n${formatSongLength(songLength)} / ${numBeats} beats`;
}
function formatSongLength (songLength) {

View File

@@ -215,10 +215,10 @@
bind__text="value: menuSelectedChallenge.songName"></a-entity>
<a-entity
id="menuSelectedChallengeInfo"
position="0 -0.282 0"
position="0 -0.482 0"
mixin="font"
text="align: center; color: #999; wrapCount: 30; lineHeight: 40; width: 0.8; baseline: bottom"
bind__text="value: menuSelectedChallenge.info"></a-entity>
text="align: center; color: #999; wrapCount: 30; lineHeight: 60; width: 0.8; baseline: bottom"
bind__text="value: menuSelectedChallenge.songInfoText"></a-entity>
</a-entity>
<a-plane