More paused behaviour
All checks were successful
Deploy Feature / deploy-feature (push) Successful in 24s
All checks were successful
Deploy Feature / deploy-feature (push) Successful in 24s
This commit is contained in:
31
src/App.vue
31
src/App.vue
@@ -270,6 +270,13 @@
|
||||
<button class="primary viewer-guess" :disabled="!canViewerGuess" @click="requestGuessStop">
|
||||
Stop Song And Guess
|
||||
</button>
|
||||
<button
|
||||
v-if="canControlGame && getCurrentTileStatus() === 'paused' && !!guessingTeamId"
|
||||
class="primary host-reveal"
|
||||
@click="revealPausedGuess"
|
||||
>
|
||||
Reveal Answer
|
||||
</button>
|
||||
</div>
|
||||
<div v-if="!currentClipUrl" class="player-empty"></div>
|
||||
</div>
|
||||
@@ -1057,6 +1064,7 @@ export default {
|
||||
}
|
||||
|
||||
if (status === 'paused') {
|
||||
if (this.guessingTeamId) return
|
||||
if (Date.now() < this.pauseTransitionLockUntil) return
|
||||
this.tiles[key].status = 'guessed'
|
||||
this.pauseTransitionLockUntil = 0
|
||||
@@ -1091,6 +1099,29 @@ export default {
|
||||
this.queueStateSync()
|
||||
}
|
||||
},
|
||||
async revealPausedGuess() {
|
||||
if (!this.canControlGame) return
|
||||
if (!this.currentTileKey || !this.selectedGame) return
|
||||
if (this.getCurrentTileStatus() !== 'paused') return
|
||||
const [cIndex, qIndex] = this.currentTileKey.split('-').map(Number)
|
||||
const clue = this.selectedGame.categories[cIndex].clues[qIndex]
|
||||
this.tiles[this.currentTileKey].status = 'guessed'
|
||||
this.pauseTransitionLockUntil = 0
|
||||
this.lastAwardedTeamId = null
|
||||
if (clue.answer) {
|
||||
this.currentClipUrl = encodeURI(clue.answer)
|
||||
this.isAnswerClip = true
|
||||
await nextTick()
|
||||
const player = this.getPlayer()
|
||||
if (player) {
|
||||
this.ensureAudioContext()
|
||||
player.currentTime = 0
|
||||
player.load()
|
||||
player.play().catch(() => {})
|
||||
}
|
||||
}
|
||||
this.queueStateSync()
|
||||
},
|
||||
handleTileRightClick(cIndex: number, qIndex: number) {
|
||||
if (!this.canControlGame) return
|
||||
const key = this.tileKey(cIndex, qIndex)
|
||||
|
||||
@@ -619,6 +619,14 @@ audio.hidden-audio {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.host-reveal {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
z-index: 4;
|
||||
background: linear-gradient(135deg, #7df58f, #36bf62);
|
||||
}
|
||||
|
||||
.end-panel {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user