Video Power-ups: Custom Power-ups, ?parts=video overlay, new redeems editor
- Custom Power-ups (bits) are redeem triggers: channel.custom_power_up_redemption.add
-> redeems.handle('custom_power_up', ...) with the bits amount; listed live from
Helix /bits/custom_power_ups on the Redeems page; labels/replay in Recent activity.
- Variations can show a video (reward_variations.video): style 'video' plays only on
the opt-in ?parts=video overlay (public/alerts/video.js), full-screen, one at a time,
with a yellow camcorder box ("TRIGGERED <name>", viewer, bits, POWER-UP) in the alert
corner. Any source size; 2560x1440 like HUDFX gives sharper video.
- Redeems page rewritten as one editor: Display (Cassette / Sound only / Video),
volume slider, sticker thumbnails, live % chances, one Save button + Ctrl+S
(POST /redeems/save), tests/add/delete save first, unsaved edits kept as a browser
draft with an inline restore bar (no dialogs).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
19a0965eb2
commit
b3caac7a31
11 changed files with 512 additions and 135 deletions
|
|
@ -12,11 +12,11 @@ const RARITY = { common: 'Common', uncommon: 'Uncommon', rare: 'Rare', ultra_rar
|
|||
const LABEL = {
|
||||
follow: 'Follow', sub: 'Sub', gift_sub: 'Gift sub', bits: 'Bits', watch_streak: 'Watch streak',
|
||||
raid: 'Raid in', raid_out: 'Raid out', hype_train: 'Hype Train', tip: 'Tip',
|
||||
channel_points: 'Channel points', auto_reward: 'Built-in reward', power_up: 'Power-up',
|
||||
channel_points: 'Channel points', auto_reward: 'Built-in reward', power_up: 'Power-up', custom_power_up: 'Custom Power-up',
|
||||
poll_begin: 'Poll started', poll_end: 'Poll ended', command: 'Command',
|
||||
};
|
||||
|
||||
const REDEEM_KIND = { channel_points: 'reward', auto_reward: 'auto_reward', power_up: 'power_up' };
|
||||
const REDEEM_KIND = { channel_points: 'reward', auto_reward: 'auto_reward', power_up: 'power_up', custom_power_up: 'custom_power_up' };
|
||||
|
||||
function parse(json) { try { return json ? JSON.parse(json) : null; } catch { return null; } }
|
||||
|
||||
|
|
@ -27,6 +27,7 @@ function rewardTitle(type, raw, alert) {
|
|||
if (type === 'channel_points') return raw?.reward?.title || null;
|
||||
if (type === 'auto_reward') return AUTO_REWARDS[raw?.reward?.type] || raw?.reward?.type || null;
|
||||
if (type === 'power_up') return POWER_UPS[raw?.power_up?.type] || raw?.power_up?.type || null;
|
||||
if (type === 'custom_power_up') return raw?.custom_power_up?.title || null;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -43,10 +44,12 @@ function describe(log) {
|
|||
if (raw?.reward?.cost) out.tags.push(`${raw.reward.cost} points`);
|
||||
else if (raw?.reward?.channel_points) out.tags.push(`${raw.reward.channel_points} points`);
|
||||
else if (raw?.bits) out.tags.push(`${raw.bits} bits`);
|
||||
else if (raw?.custom_power_up?.bits) out.tags.push(`${raw.custom_power_up.bits} bits`);
|
||||
if (a) {
|
||||
if (a.variation && a.variation !== a.reward) out.tags.push(`played: ${a.variation}`);
|
||||
if (a.rarity && a.rarity !== 'common') out.tags.push(RARITY[a.rarity] || a.rarity);
|
||||
if (a.tts) out.tags.push('TTS');
|
||||
if (a.video) out.tags.push('video');
|
||||
}
|
||||
out.message = a?.input || raw?.user_input || raw?.message?.text || null;
|
||||
} else if (a) {
|
||||
|
|
@ -111,7 +114,8 @@ async function replayMessage(log) {
|
|||
const key = log.event_detail;
|
||||
const input = raw.user_input || raw.message?.text || null;
|
||||
const emote = raw.reward?.emote?.id || raw.power_up?.emote?.id || null;
|
||||
const alert = await require('./redeems').rebuild(kind, key, { user: raw.user_name || raw.user_login || log.username, input, emote });
|
||||
const bits = raw.custom_power_up?.bits ?? null;
|
||||
const alert = await require('./redeems').rebuild(kind, key, { user: raw.user_name || raw.user_login || log.username, input, emote, bits });
|
||||
return alert ? { type: 'alert', alert } : null;
|
||||
}
|
||||
if (log.event_type === 'raid_out') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue