1
0
Fork 0
mirror of https://github.com/NovaGM/Modules.git synced 2024-08-14 22:47:01 +00:00

FreeNitro: Make settings to freely change size

Note: width is unaffected

Add missing semicolon
How did I miss this? My bad :P
This commit is contained in:
Yahya Wessam 2021-06-08 22:59:59 +03:00 committed by Keanu
parent d22e8ba1d8
commit 0544402a65
Signed by: keanucode
GPG key ID: A7431C0D513CA93B

View file

@ -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');
},
},
};