mirror of
https://github.com/nuttylmao/nutty.gg.git
synced 2026-09-19 04:00:59 -04:00
Added a "Hide Action" setting
This commit is contained in:
@@ -44,7 +44,8 @@ const hideAfter = GetIntParam("hideAfter", 8);
|
|||||||
const showAnimation = urlParams.get("showAnimation") || "";
|
const showAnimation = urlParams.get("showAnimation") || "";
|
||||||
const hideAnimation = urlParams.get("hideAnimation") || "";
|
const hideAnimation = urlParams.get("hideAnimation") || "";
|
||||||
const playSounds = GetBooleanParam("playSounds", true);
|
const playSounds = GetBooleanParam("playSounds", true);
|
||||||
const globalAction = urlParams.get("globalAction") || "";
|
const globalShowAction = urlParams.get("globalShowAction") || "";
|
||||||
|
const globalHideAction = urlParams.get("globalHideAction") || "";
|
||||||
const showMesesages = GetBooleanParam("showMesesages", true);
|
const showMesesages = GetBooleanParam("showMesesages", true);
|
||||||
|
|
||||||
// Which Twitch alerts do you want to see?
|
// Which Twitch alerts do you want to see?
|
||||||
@@ -1236,9 +1237,9 @@ function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attrib
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run the Streamer.bot action if there is one
|
// Run the Streamer.bot action if there is one
|
||||||
if (globalAction) {
|
if (globalShowAction) {
|
||||||
console.debug('Running Streamer.bot action: ' + globalAction);
|
console.debug('Running Streamer.bot action: ' + globalShowAction);
|
||||||
client.doAction({name: globalAction}, sbData);
|
client.doAction({name: globalShowAction}, sbData);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the Streamer.bot action if there is one
|
// Run the Streamer.bot action if there is one
|
||||||
@@ -1263,6 +1264,12 @@ function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attrib
|
|||||||
theContentThatShowsLastInsteadOfFirst.style.opacity = 1;
|
theContentThatShowsLastInsteadOfFirst.style.opacity = 1;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
// Run the Streamer.bot action if there is one
|
||||||
|
if (globalHideAction) {
|
||||||
|
console.debug('Running Streamer.bot action: ' + globalHideAction);
|
||||||
|
client.doAction({name: globalHideAction}, sbData);
|
||||||
|
}
|
||||||
|
|
||||||
alertBox.style.animation = `${hideAnimation} 0.5s ease-out forwards`;
|
alertBox.style.animation = `${hideAnimation} 0.5s ease-out forwards`;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
@@ -1278,7 +1285,13 @@ function UpdateAlertBox(platform, avatarURL, headerText, descriptionText, attrib
|
|||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
}, hideAfter * 1000);
|
}, hideAfter * 1000);
|
||||||
} else {
|
} else {
|
||||||
|
// Run the Streamer.bot action if there is one
|
||||||
|
if (globalHideAction) {
|
||||||
|
console.debug('Running Streamer.bot action: ' + globalHideAction);
|
||||||
|
client.doAction({name: globalHideAction}, sbData);
|
||||||
|
}
|
||||||
|
|
||||||
alertBox.style.animation = `${hideAnimation} 0.5s ease-out forwards`;
|
alertBox.style.animation = `${hideAnimation} 0.5s ease-out forwards`;
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -204,9 +204,17 @@
|
|||||||
"group": "General"
|
"group": "General"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "globalAction",
|
"id": "globalShowAction",
|
||||||
"label": "Streamer.bot Action",
|
"label": "Show Action",
|
||||||
"description": "Run this Streamer.bot Action on every alert",
|
"description": "Run this Streamer.bot Action at the start of every alert",
|
||||||
|
"type": "sb-actions",
|
||||||
|
"defaultValue": "",
|
||||||
|
"group": "General"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "globalHideAction",
|
||||||
|
"label": "Hide Action",
|
||||||
|
"description": "Run this Streamer.bot Action at the end of every alert",
|
||||||
"type": "sb-actions",
|
"type": "sb-actions",
|
||||||
"defaultValue": "",
|
"defaultValue": "",
|
||||||
"group": "General"
|
"group": "General"
|
||||||
|
|||||||
Reference in New Issue
Block a user