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:
parent
d22e8ba1d8
commit
0544402a65
1 changed files with 29 additions and 1 deletions
|
@ -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');
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue