mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-06-27 21:05:53 +00:00
4.32.2
* Added: Setting to limit the size of native Twitch emotes. Enabled by default.
This commit is contained in:
parent
6a7ac8c194
commit
370a579635
4 changed files with 27 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "frankerfacez",
|
||||
"author": "Dan Salvato LLC",
|
||||
"version": "4.32.1",
|
||||
"version": "4.32.2",
|
||||
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
||||
"private": true,
|
||||
"license": "Apache-2.0",
|
||||
|
|
|
@ -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', {
|
||||
default: true,
|
||||
ui: {
|
||||
|
|
|
@ -1135,7 +1135,7 @@ const render_emote = (token, createElement, wrapped) => {
|
|||
|
||||
const mods = token.modifiers || [], ml = mods.length,
|
||||
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: {
|
||||
src,
|
||||
srcSet,
|
||||
|
@ -1214,7 +1214,7 @@ export const AddonEmotes = {
|
|||
|
||||
const mods = token.modifiers || [], ml = mods.length,
|
||||
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}
|
||||
srcSet={srcSet}
|
||||
height={(token.big && ! token.can_big && token.height) ? `${token.height * 2}px` : undefined}
|
||||
|
|
|
@ -890,8 +890,13 @@ export default class ChatHook extends Module {
|
|||
this.CalloutSelector.forceUpdate();
|
||||
}, this);
|
||||
|
||||
this.chat.context.getChanges('chat.emotes.2x', val =>
|
||||
this.css_tweaks.toggle('big-emoji', val > 1));
|
||||
this.chat.context.getChanges('chat.emotes.2x', val => {
|
||||
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.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() {
|
||||
const types = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue