mirror of
https://gitlab.com/qwerinope/qweribot.git
synced 2026-02-04 09:26:58 +01:00
slightly change timing on blastinRoulette
This commit is contained in:
@@ -8,6 +8,7 @@ export type pointRedeemOptions = {
|
|||||||
cost: number;
|
cost: number;
|
||||||
color?: string;
|
color?: string;
|
||||||
sfxredeem?: boolean;
|
sfxredeem?: boolean;
|
||||||
|
input?: boolean;
|
||||||
execution: (message: EventSubChannelRedemptionAddEvent, sender: User) => Promise<void>;
|
execution: (message: EventSubChannelRedemptionAddEvent, sender: User) => Promise<void>;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -19,6 +20,7 @@ export default class PointRedeem {
|
|||||||
public readonly cost: number;
|
public readonly cost: number;
|
||||||
public readonly color?: string;
|
public readonly color?: string;
|
||||||
public readonly sfxredeem?: boolean;
|
public readonly sfxredeem?: boolean;
|
||||||
|
public readonly input?: boolean;
|
||||||
public readonly execute: (message: EventSubChannelRedemptionAddEvent, sender: User) => Promise<void>;
|
public readonly execute: (message: EventSubChannelRedemptionAddEvent, sender: User) => Promise<void>;
|
||||||
constructor(options: pointRedeemOptions) {
|
constructor(options: pointRedeemOptions) {
|
||||||
this.name = options.name.toLowerCase();
|
this.name = options.name.toLowerCase();
|
||||||
@@ -28,6 +30,7 @@ export default class PointRedeem {
|
|||||||
this.color = options.color;
|
this.color = options.color;
|
||||||
this.execute = options.execution;
|
this.execute = options.execution;
|
||||||
this.sfxredeem = options.sfxredeem;
|
this.sfxredeem = options.sfxredeem;
|
||||||
|
this.input = options.input;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -72,7 +75,8 @@ for (const [_, redeem] of Array.from(namedRedeems)) {
|
|||||||
title: redeem.title,
|
title: redeem.title,
|
||||||
prompt: redeem.prompt,
|
prompt: redeem.prompt,
|
||||||
cost: redeem.cost,
|
cost: redeem.cost,
|
||||||
backgroundColor: redeem.color
|
backgroundColor: redeem.color,
|
||||||
|
userInputRequired: redeem.input
|
||||||
});
|
});
|
||||||
logger.ok(`Created custom point redeem ${redeem.title}`);
|
logger.ok(`Created custom point redeem ${redeem.title}`);
|
||||||
idMap.set(redeem.name, creation.id);
|
idMap.set(redeem.name, creation.id);
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ export default async function execute(alert: blastinRoulette) {
|
|||||||
div.appendChild(text);
|
div.appendChild(text);
|
||||||
|
|
||||||
// animation parameters
|
// animation parameters
|
||||||
const totalDuration = 4000; // 4 sec
|
const totalDuration = 4200; // 4 sec
|
||||||
const finalHold = 2000; // hold final word for 2 sec
|
const finalHold = 1800; // hold final word for 2 sec
|
||||||
const steps = 60; // how many changes before settling
|
const steps = 60; // how many changes before settling
|
||||||
|
|
||||||
let lastPick = '';
|
let lastPick = '';
|
||||||
@@ -57,8 +57,8 @@ export default async function execute(alert: blastinRoulette) {
|
|||||||
chosenFinal = pick;
|
chosenFinal = pick;
|
||||||
|
|
||||||
// brief flicker effect: toggle opacity a few times
|
// brief flicker effect: toggle opacity a few times
|
||||||
const flickerTimes = 6;
|
const flickerTimes = 8;
|
||||||
const flickerInterval = 80; // ms
|
const flickerInterval = 120; // ms
|
||||||
// ensure opacity starts at 1
|
// ensure opacity starts at 1
|
||||||
text.style.opacity = '1';
|
text.style.opacity = '1';
|
||||||
for (let k = 0; k < flickerTimes; k++) {
|
for (let k = 0; k < flickerTimes; k++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user