1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00
* Added: Setting to limit the size of native Twitch emotes. Enabled by default.
This commit is contained in:
SirStendec 2022-03-05 15:15:27 -05:00
parent 6a7ac8c194
commit 370a579635
4 changed files with 27 additions and 5 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "frankerfacez", "name": "frankerfacez",
"author": "Dan Salvato LLC", "author": "Dan Salvato LLC",
"version": "4.32.1", "version": "4.32.2",
"description": "FrankerFaceZ is a Twitch enhancement suite.", "description": "FrankerFaceZ is a Twitch enhancement suite.",
"private": true, "private": true,
"license": "Apache-2.0", "license": "Apache-2.0",

View file

@ -122,6 +122,16 @@ export default class Emotes extends Module {
} }
}); });
this.settings.add('chat.emotes.limit-size', {
default: true,
ui: {
path: 'Chat > Appearance >> Emotes',
title: 'Limit Native Emote Size',
description: 'Sometimes, really obnoxiously large emotes slip through the cracks and wind up on Twitch. This limits the size of Twitch emotes to mitigate the issue.',
component: 'setting-check-box'
}
});
this.settings.add('chat.fix-bad-emotes', { this.settings.add('chat.fix-bad-emotes', {
default: true, default: true,
ui: { ui: {

View file

@ -1135,7 +1135,7 @@ const render_emote = (token, createElement, wrapped) => {
const mods = token.modifiers || [], ml = mods.length, const mods = token.modifiers || [], ml = mods.length,
emote = createElement('img', { emote = createElement('img', {
class: `${EMOTE_CLASS} ffz-tooltip${hoverSrc ? ' ffz-hover-emote' : ''}${token.provider === 'ffz' ? ' ffz-emote' : token.provider === 'emoji' ? ' ffz-emoji' : ''}`, class: `${EMOTE_CLASS} ffz-tooltip${hoverSrc ? ' ffz-hover-emote' : ''}${token.provider === 'twitch' ? ' twitch-emote' : token.provider === 'ffz' ? ' ffz-emote' : token.provider === 'emoji' ? ' ffz-emoji' : ''}`,
attrs: { attrs: {
src, src,
srcSet, srcSet,
@ -1214,7 +1214,7 @@ export const AddonEmotes = {
const mods = token.modifiers || [], ml = mods.length, const mods = token.modifiers || [], ml = mods.length,
emote = (<img emote = (<img
class={`${EMOTE_CLASS} ffz--pointer-events ffz-tooltip${hoverSrc ? ' ffz-hover-emote' : ''}${token.provider === 'ffz' ? ' ffz-emote' : token.provider === 'emoji' ? ' ffz-emoji' : ''}`} class={`${EMOTE_CLASS} ffz--pointer-events ffz-tooltip${hoverSrc ? ' ffz-hover-emote' : ''}${token.provider === 'twitch' ? ' twitch-emote' : token.provider === 'ffz' ? ' ffz-emote' : token.provider === 'emoji' ? ' ffz-emoji' : ''}`}
src={src} src={src}
srcSet={srcSet} srcSet={srcSet}
height={(token.big && ! token.can_big && token.height) ? `${token.height * 2}px` : undefined} height={(token.big && ! token.can_big && token.height) ? `${token.height * 2}px` : undefined}

View file

@ -890,8 +890,13 @@ export default class ChatHook extends Module {
this.CalloutSelector.forceUpdate(); this.CalloutSelector.forceUpdate();
}, this); }, this);
this.chat.context.getChanges('chat.emotes.2x', val => this.chat.context.getChanges('chat.emotes.2x', val => {
this.css_tweaks.toggle('big-emoji', val > 1)); this.css_tweaks.toggle('big-emoji', val > 1);
this.toggleEmoteJail();
});
this.chat.context.getChanges('chat.emotes.limit-size', () =>
this.toggleEmoteJail());
this.chat.context.getChanges('chat.input.show-mod-view', val => this.chat.context.getChanges('chat.input.show-mod-view', val =>
this.css_tweaks.toggleHide('mod-view', ! val)); this.css_tweaks.toggleHide('mod-view', ! val));
@ -1330,6 +1335,13 @@ export default class ChatHook extends Module {
}); });
} }
toggleEmoteJail() {
const bigger = this.chat.context.get('chat.emotes.2x'),
enabled = this.chat.context.get('chat.emotes.limit-size');
this.css_tweaks.toggle('big-emote-jail', enabled && ! bigger);
this.css_tweaks.toggle('bigger-emote-jail', enabled && bigger);
}
cleanHighlights() { cleanHighlights() {
const types = { const types = {