From d22e8ba1d8e20fdbf18481033eda875a789a9c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=95=E3=82=BA=E3=82=AD?= Date: Sat, 22 May 2021 23:13:07 +0200 Subject: [PATCH 1/6] Updated settings experiment: text input --- settings-experiment/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/settings-experiment/index.js b/settings-experiment/index.js index a5cb62b..fdeb908 100644 --- a/settings-experiment/index.js +++ b/settings-experiment/index.js @@ -109,6 +109,14 @@ export default { }, initialValue: () => "#000000" }, + { + type: "text-input", + text: "Text input", + initialValue: () => "Initial value", + oninput: value => { + showToast(`Text input: ${value}`); + }, + }, { type: "custom", element: (() => { From 7959d4fe722373d8a679cd157088c40e8c0e8aca Mon Sep 17 00:00:00 2001 From: Yahya Wessam Date: Tue, 8 Jun 2021 22:59:59 +0300 Subject: [PATCH 2/6] FreeNitro: Make settings to freely change size Note: width is unaffected --- FreeNitro/index.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/FreeNitro/index.js b/FreeNitro/index.js index 7304580..259466f 100644 --- a/FreeNitro/index.js +++ b/FreeNitro/index.js @@ -1,9 +1,15 @@ import * as webpackModules from '@goosemod/webpack'; +import { createItem, removeItem } from '@goosemod/settings' +import { version } from './goosemodModule.json'; var searchHook; var parseHook; var useEmojiSelectHandlerHook; +let settings = { + emojisize: '64', +}; + const emojisModule = webpackModules.findByProps('getDisambiguatedEmojiContext', 'search'); const messageEmojiParserModule = webpackModules.findByProps( 'parse', @@ -50,7 +56,7 @@ export default { for (let emoji of result.invalidEmojis) { result.content = result.content.replace( `<${emoji.animated ? 'a' : ''}:${emoji.originalName || emoji.name}:${emoji.id}>`, - `${emoji.url}&size=64&width=16`, + `${emoji.url}&size=${settings.emojisize}&width=16`, ); } result.invalidEmojis = []; @@ -70,10 +76,32 @@ export default { }; }, + onLoadingFinished: () => { + createItem('FreeNitro', [ + version, + + { + type: 'header', + text: 'Change the emoji size to your liking!', + }, + { + type: 'text-input', + text: 'Emoji Size', + initialValue: () => settings.emojisize, + oninput: (value) => { + settings.emojisize = value; + }, + }, + ]); + }, + + getSettings: () => [settings], + onRemove: async () => { searchHook = originalFunctions.original_search; parseHook = originalFunctions.original_parse; useEmojiSelectHandlerHook = originalFunctions.original_useEmojiSelectHandler; + removeItem('FreeNitro'); }, }, }; From 23a11ecd2125698a03df09ecf545e002075b3b00 Mon Sep 17 00:00:00 2001 From: Yahya Wessam Date: Tue, 8 Jun 2021 23:03:16 +0300 Subject: [PATCH 3/6] Add missing semicolon How did I miss this? My bad :P --- FreeNitro/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FreeNitro/index.js b/FreeNitro/index.js index 259466f..4a920ad 100644 --- a/FreeNitro/index.js +++ b/FreeNitro/index.js @@ -1,5 +1,5 @@ import * as webpackModules from '@goosemod/webpack'; -import { createItem, removeItem } from '@goosemod/settings' +import { createItem, removeItem } from '@goosemod/settings'; import { version } from './goosemodModule.json'; var searchHook; From 8edca16f9694c793ca28c4aba7f8700006aaf6b2 Mon Sep 17 00:00:00 2001 From: Yahya Wessam Date: Tue, 8 Jun 2021 23:18:46 +0300 Subject: [PATCH 4/6] FreeNitro: onLoadingFinished is deprecated Thus, create the settings in onImport instead --- FreeNitro/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/FreeNitro/index.js b/FreeNitro/index.js index 4a920ad..123547a 100644 --- a/FreeNitro/index.js +++ b/FreeNitro/index.js @@ -74,9 +74,7 @@ export default { } }; }; - }, - onLoadingFinished: () => { createItem('FreeNitro', [ version, From 0544402a6581d4911f30611f912681bb39755921 Mon Sep 17 00:00:00 2001 From: Yahya Wessam Date: Tue, 8 Jun 2021 22:59:59 +0300 Subject: [PATCH 5/6] FreeNitro: Make settings to freely change size Note: width is unaffected Add missing semicolon How did I miss this? My bad :P --- FreeNitro/index.js | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/FreeNitro/index.js b/FreeNitro/index.js index 7304580..4a920ad 100644 --- a/FreeNitro/index.js +++ b/FreeNitro/index.js @@ -1,9 +1,15 @@ import * as webpackModules from '@goosemod/webpack'; +import { createItem, removeItem } from '@goosemod/settings'; +import { version } from './goosemodModule.json'; var searchHook; var parseHook; var useEmojiSelectHandlerHook; +let settings = { + emojisize: '64', +}; + const emojisModule = webpackModules.findByProps('getDisambiguatedEmojiContext', 'search'); const messageEmojiParserModule = webpackModules.findByProps( 'parse', @@ -50,7 +56,7 @@ export default { for (let emoji of result.invalidEmojis) { result.content = result.content.replace( `<${emoji.animated ? 'a' : ''}:${emoji.originalName || emoji.name}:${emoji.id}>`, - `${emoji.url}&size=64&width=16`, + `${emoji.url}&size=${settings.emojisize}&width=16`, ); } result.invalidEmojis = []; @@ -70,10 +76,32 @@ export default { }; }, + onLoadingFinished: () => { + createItem('FreeNitro', [ + version, + + { + type: 'header', + text: 'Change the emoji size to your liking!', + }, + { + type: 'text-input', + text: 'Emoji Size', + initialValue: () => settings.emojisize, + oninput: (value) => { + settings.emojisize = value; + }, + }, + ]); + }, + + getSettings: () => [settings], + onRemove: async () => { searchHook = originalFunctions.original_search; parseHook = originalFunctions.original_parse; useEmojiSelectHandlerHook = originalFunctions.original_useEmojiSelectHandler; + removeItem('FreeNitro'); }, }, }; From 75e78f8538eb377262468abd35e25a2d0d3652d1 Mon Sep 17 00:00:00 2001 From: Yahya Wessam Date: Tue, 8 Jun 2021 23:18:46 +0300 Subject: [PATCH 6/6] FreeNitro: onLoadingFinished is deprecated Thus, create the settings in onImport instead --- FreeNitro/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/FreeNitro/index.js b/FreeNitro/index.js index 4a920ad..123547a 100644 --- a/FreeNitro/index.js +++ b/FreeNitro/index.js @@ -74,9 +74,7 @@ export default { } }; }; - }, - onLoadingFinished: () => { createItem('FreeNitro', [ version,