From 2647afd6e546618f690986bc25dbcd89212ccaa7 Mon Sep 17 00:00:00 2001 From: nuttylmao Date: Sun, 30 Mar 2025 11:02:20 +1100 Subject: [PATCH] Added furry mode lmao --- horizontal-chat/script.js | 51 +++++++++++++++++++++++- horizontal-chat/settings/settings.json | 8 ++++ multichat-overlay/script.js | 51 +++++++++++++++++++++++- multichat-overlay/settings/settings.json | 8 ++++ 4 files changed, 116 insertions(+), 2 deletions(-) diff --git a/horizontal-chat/script.js b/horizontal-chat/script.js index 7fbc483..3614937 100644 --- a/horizontal-chat/script.js +++ b/horizontal-chat/script.js @@ -51,6 +51,8 @@ const showKofiDonations = GetBooleanParam("showKofiDonations", true); const showTipeeeStreamDonations = GetBooleanParam("showTipeeeStreamDonations", true); const showFourthwallAlerts = GetBooleanParam("showFourthwallAlerts", true); +const furryMode = GetBooleanParam("furryMode", false); + // Set fonts for the widget document.body.style.fontFamily = font; document.body.style.fontSize = `${fontSize}px`; @@ -303,9 +305,13 @@ async function TwitchChatMessage(data) { } // Set the message data - const message = data.message.message; + let message = data.message.message; const messageColor = data.message.color; + // Set furry mode + if (furryMode) + message = TranslateToFurry(message); + // Set message text if (showMessage) { messageDiv.innerText = message; @@ -598,6 +604,10 @@ function YouTubeMessage(data) { messageDiv.innerText = data.message; } + // Set furry mode + if (furryMode) + messageDiv.innerText = TranslateToFurry(data.message); + // Render platform if (showPlatform) { const platformElements = ``; @@ -1182,6 +1192,45 @@ function GetWinnersList(gifts) { } } +function TranslateToFurry(sentence) { + const words = sentence.toLowerCase().split(/\b/); + + const furryWords = words.map(word => { + if (/\w+/.test(word)) { + let newWord = word; + + // Common substitutions + newWord = newWord.replace(/l/g, 'w'); + newWord = newWord.replace(/r/g, 'w'); + newWord = newWord.replace(/th/g, 'f'); + newWord = newWord.replace(/you/g, 'yous'); + newWord = newWord.replace(/my/g, 'mah'); + newWord = newWord.replace(/me/g, 'meh'); + newWord = newWord.replace(/am/g, 'am'); + newWord = newWord.replace(/is/g, 'is'); + newWord = newWord.replace(/are/g, 'are'); + newWord = newWord.replace(/very/g, 'vewy'); + newWord = newWord.replace(/pretty/g, 'pwetty'); + newWord = newWord.replace(/little/g, 'wittle'); + newWord = newWord.replace(/nice/g, 'nyce'); + + // Random additions + if (Math.random() < 0.15) { + newWord += ' nya~'; + } else if (Math.random() < 0.1) { + newWord += ' >w<'; + } else if (Math.random() < 0.05) { + newWord += ' owo'; + } + + return newWord; + } + return word; + }); + + return furryWords.join(''); + } + /////////////////////////////////// diff --git a/horizontal-chat/settings/settings.json b/horizontal-chat/settings/settings.json index 6e2a11a..802496b 100644 --- a/horizontal-chat/settings/settings.json +++ b/horizontal-chat/settings/settings.json @@ -239,6 +239,14 @@ "defaultValue": true, "group": "Which donation messages do you want to see?" }, + { + "id": "furryMode", + "label": "Furry Mode", + "description": "Meow", + "type": "checkbox", + "defaultValue": false, + "group": "Very Important Stuff" + }, { "id": "address", "label": "Address", diff --git a/multichat-overlay/script.js b/multichat-overlay/script.js index c8d3464..a9cca0f 100644 --- a/multichat-overlay/script.js +++ b/multichat-overlay/script.js @@ -50,6 +50,8 @@ const showKofiDonations = GetBooleanParam("showKofiDonations", true); const showTipeeeStreamDonations = GetBooleanParam("showTipeeeStreamDonations", true); const showFourthwallAlerts = GetBooleanParam("showFourthwallAlerts", true); +const furryMode = GetBooleanParam("furryMode", false); + // Set fonts for the widget document.body.style.fontFamily = font; document.body.style.fontSize = `${fontSize}px`; @@ -338,10 +340,14 @@ async function TwitchChatMessage(data) { } // Set the message data - const message = data.message.message; + let message = data.message.message; const messageColor = data.message.color; const role = data.message.role; + // Set furry mode + if (furryMode) + message = TranslateToFurry(message); + // Set message text if (showMessage) { messageDiv.innerText = message; @@ -880,6 +886,10 @@ function YouTubeMessage(data) { messageDiv.innerText = data.message; } + // Set furry mode + if (furryMode) + messageDiv.innerText = TranslateToFurry(data.message); + // Render platform if (showPlatform) { @@ -1890,6 +1900,45 @@ function GetWinnersList(gifts) { } } +function TranslateToFurry(sentence) { + const words = sentence.toLowerCase().split(/\b/); + + const furryWords = words.map(word => { + if (/\w+/.test(word)) { + let newWord = word; + + // Common substitutions + newWord = newWord.replace(/l/g, 'w'); + newWord = newWord.replace(/r/g, 'w'); + newWord = newWord.replace(/th/g, 'f'); + newWord = newWord.replace(/you/g, 'yous'); + newWord = newWord.replace(/my/g, 'mah'); + newWord = newWord.replace(/me/g, 'meh'); + newWord = newWord.replace(/am/g, 'am'); + newWord = newWord.replace(/is/g, 'is'); + newWord = newWord.replace(/are/g, 'are'); + newWord = newWord.replace(/very/g, 'vewy'); + newWord = newWord.replace(/pretty/g, 'pwetty'); + newWord = newWord.replace(/little/g, 'wittle'); + newWord = newWord.replace(/nice/g, 'nyce'); + + // Random additions + if (Math.random() < 0.15) { + newWord += ' nya~'; + } else if (Math.random() < 0.1) { + newWord += ' >w<'; + } else if (Math.random() < 0.05) { + newWord += ' owo'; + } + + return newWord; + } + return word; + }); + + return furryWords.join(''); + } + /////////////////////////////////// diff --git a/multichat-overlay/settings/settings.json b/multichat-overlay/settings/settings.json index 521c84c..a3c748d 100644 --- a/multichat-overlay/settings/settings.json +++ b/multichat-overlay/settings/settings.json @@ -301,6 +301,14 @@ "defaultValue": true, "group": "Which donation messages do you want to see?" }, + { + "id": "furryMode", + "label": "Furry Mode", + "description": "Meow", + "type": "checkbox", + "defaultValue": false, + "group": "Very Important Stuff" + }, { "id": "address", "label": "Address",