More paused behaviour
All checks were successful
Deploy Feature / deploy-feature (push) Successful in 24s

This commit is contained in:
Johnny322
2026-03-02 21:28:54 +01:00
parent 40d2e928aa
commit 9b6dd0b8e8
2 changed files with 47 additions and 8 deletions

View File

@@ -270,6 +270,13 @@
<button class="primary viewer-guess" :disabled="!canViewerGuess" @click="requestGuessStop"> <button class="primary viewer-guess" :disabled="!canViewerGuess" @click="requestGuessStop">
Stop Song And Guess Stop Song And Guess
</button> </button>
<button
v-if="canControlGame && getCurrentTileStatus() === 'paused' && !!guessingTeamId"
class="primary host-reveal"
@click="revealPausedGuess"
>
Reveal Answer
</button>
</div> </div>
<div v-if="!currentClipUrl" class="player-empty"></div> <div v-if="!currentClipUrl" class="player-empty"></div>
</div> </div>
@@ -1057,6 +1064,7 @@ export default {
} }
if (status === 'paused') { if (status === 'paused') {
if (this.guessingTeamId) return
if (Date.now() < this.pauseTransitionLockUntil) return if (Date.now() < this.pauseTransitionLockUntil) return
this.tiles[key].status = 'guessed' this.tiles[key].status = 'guessed'
this.pauseTransitionLockUntil = 0 this.pauseTransitionLockUntil = 0
@@ -1091,6 +1099,29 @@ export default {
this.queueStateSync() 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) { handleTileRightClick(cIndex: number, qIndex: number) {
if (!this.canControlGame) return if (!this.canControlGame) return
const key = this.tileKey(cIndex, qIndex) const key = this.tileKey(cIndex, qIndex)

View File

@@ -619,6 +619,14 @@ audio.hidden-audio {
box-shadow: none; box-shadow: none;
} }
.host-reveal {
position: absolute;
top: 16px;
right: 16px;
z-index: 4;
background: linear-gradient(135deg, #7df58f, #36bf62);
}
.end-panel { .end-panel {
text-align: center; text-align: center;
} }