TTS redeems, skip button, per-source chat placement
- Redeem variations can have a TTS voice: the viewer's text is cleaned (links out, repeats collapsed, max length, blocked words -> not read), spoken as "<name> says: ..." and shown as the big paper note; the variation's sound is not played when TTS is on (picker greyed out) - Settings: TTS max length, say-the-name, blocked words (never sent to overlay pages: db.getOverlaySettings) - Dashboard "Skip current alert" -> /alerts/skip -> overlay skips it - db.migrate()/addColumn: new columns on existing databases - Chat: ?chat=left,top,width,height and ?chatflow=up per browser source (e.g. the Intermission panel); default unchanged Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b5a81bdb15
commit
4fda6060bf
16 changed files with 228 additions and 28 deletions
|
|
@ -6,6 +6,7 @@
|
|||
but never interrupts or drops a real one (it queues behind it).
|
||||
A real alert cuts off a test that is showing.
|
||||
window.PolaroidAlerts.reset() stop the current alert and clear the queue
|
||||
window.PolaroidAlerts.skip() stop the current alert (e.g. a TTS message), carry on with the queue
|
||||
|
||||
Alert shapes come from src/alerts.js:
|
||||
{ type:'follow', user }
|
||||
|
|
@ -127,7 +128,8 @@
|
|||
return { cassette: true, style: e.style || 'cassette', emote: e.emote || null, sticker: rebase(e.art) || null,
|
||||
name: e.user || 'Someone', line: fill(e.caption || 'redeemed it! ♡'), msg: e.input,
|
||||
title: e.variation || e.reward, sub: e.reward, rarity: e.rarity,
|
||||
sound: e.sound || null, volume: e.volume, soundOnly: e.polaroid === false };
|
||||
sound: e.sound || null, volume: e.volume, soundOnly: e.polaroid === false && !e.tts,
|
||||
tts: e.tts ? rebase(e.tts) : null, ttsMs: e.tts_ms || 0 };
|
||||
}
|
||||
case 'bits': {
|
||||
if (!(e.bits >= BITS_MIN)) return null;
|
||||
|
|
@ -211,6 +213,13 @@
|
|||
play({ ...alert, test: true }); // a real one on screen: wait
|
||||
}
|
||||
|
||||
// dashboard Skip button: cut what is on screen (sound/TTS too), then play the next queued alert
|
||||
function skip() {
|
||||
if (!current) return;
|
||||
skipCurrent();
|
||||
setTimeout(() => { if (!busy) next(); }, GAP);
|
||||
}
|
||||
|
||||
function reset() {
|
||||
gen++;
|
||||
queue.length = 0;
|
||||
|
|
@ -362,6 +371,6 @@
|
|||
.catch(() => {}); // cancelled by reset()
|
||||
}
|
||||
|
||||
window.PolaroidAlerts = { play, playTest, reset, describe };
|
||||
window.PolaroidAlerts = { play, playTest, reset, skip, describe };
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', preload); else preload();
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue