diff --git a/package.json b/package.json index dd852ddc..7f95299e 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.21.1", + "version": "4.21.2", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", diff --git a/src/modules/chat/emotes.js b/src/modules/chat/emotes.js index 3ff245f4..377bec14 100644 --- a/src/modules/chat/emotes.js +++ b/src/modules/chat/emotes.js @@ -86,6 +86,23 @@ export default class Emotes extends Module { this._set_refs = {}; this._set_timers = {}; + this.settings.add('chat.emotes.enabled', { + default: 2, + ui: { + path: 'Chat > Appearance >> Emotes', + title: 'Display Emotes', + sort: -100, + force_seen: true, + description: 'If you do not wish to see emotes, you can disable them here.', + component: 'setting-select-box', + data: [ + {value: 0, title: 'Disabled'}, + {value: 1, title: 'Twitch Only'}, + {value: 2, title: 'Enabled'} + ] + } + }); + this.settings.add('chat.emotes.2x', { default: false, ui: { diff --git a/src/modules/chat/index.js b/src/modules/chat/index.js index 5c07656d..c2604d9c 100644 --- a/src/modules/chat/index.js +++ b/src/modules/chat/index.js @@ -964,6 +964,7 @@ export default class Chat extends Module { }, ui: { path: 'Chat > Appearance >> Emotes', + sort: -50, title: 'Animated Emotes', default(ctx) { diff --git a/src/modules/chat/tokenizers.jsx b/src/modules/chat/tokenizers.jsx index e36b1ade..ac1e570f 100644 --- a/src/modules/chat/tokenizers.jsx +++ b/src/modules/chat/tokenizers.jsx @@ -1437,6 +1437,9 @@ export const AddonEmotes = { if ( ! tokens || ! tokens.length ) return tokens; + if ( this.context.get('chat.emotes.enabled') !== 2 ) + return tokens; + const emotes = this.emotes.getEmotes( msg.user.id, msg.user.login, @@ -1618,6 +1621,9 @@ export const TwitchEmotes = { if ( ! msg.ffz_emotes ) return tokens; + if ( this.context.get('chat.emotes.enabled') < 1 ) + return tokens; + const data = msg.ffz_emotes, big = this.context.get('chat.emotes.2x'), use_replacements = this.context.get('chat.fix-bad-emotes'), diff --git a/src/sites/clips/line.jsx b/src/sites/clips/line.jsx index e667ded5..7d3a4605 100644 --- a/src/sites/clips/line.jsx +++ b/src/sites/clips/line.jsx @@ -33,6 +33,7 @@ export default class Line extends Module { } onEnable() { + this.chat.context.on('changed:chat.emotes.enabled', this.updateLines, this); this.chat.context.on('changed:chat.emotes.2x', this.updateLines, this); this.chat.context.on('changed:chat.emotes.animated', this.updateLines, this); this.chat.context.on('changed:chat.emoji.style', this.updateLines, this); diff --git a/src/sites/twitch-twilight/modules/chat/emote_menu.jsx b/src/sites/twitch-twilight/modules/chat/emote_menu.jsx index 3c7c931f..758f5462 100644 --- a/src/sites/twitch-twilight/modules/chat/emote_menu.jsx +++ b/src/sites/twitch-twilight/modules/chat/emote_menu.jsx @@ -13,7 +13,7 @@ import Twilight from 'site'; import Module from 'utilities/module'; import SUB_STATUS from './sub_status.gql'; -import Tooltip from 'src/utilities/tooltip'; +//import Tooltip from 'src/utilities/tooltip'; const TIERS = { 1000: 'Tier 1', @@ -363,6 +363,7 @@ export default class EmoteMenu extends Module { inst.rebuildData(); } + this.chat.context.on('changed:chat.emotes.enabled', rebuild); this.chat.context.on('changed:chat.emote-menu.modifiers', rebuild); this.chat.context.on('changed:chat.emote-menu.show-emoji', rebuild); this.chat.context.on('changed:chat.fix-bad-emotes', rebuild); @@ -2058,36 +2059,38 @@ export default class EmoteMenu extends Module { // Finally, emotes added by FrankerFaceZ. - const me = t.site.getUser(); - if ( me ) { - const ffz_room = t.emotes.getRoomSetsWithSources(me.id, me.login, props.channel_id, null), - ffz_global = t.emotes.getGlobalSetsWithSources(me.id, me.login), - seen_favorites = {}; + if ( t.chat.context.get('chat.emotes.enabled') > 1 ) { + const me = t.site.getUser(); + if ( me ) { + const ffz_room = t.emotes.getRoomSetsWithSources(me.id, me.login, props.channel_id, null), + ffz_global = t.emotes.getGlobalSetsWithSources(me.id, me.login), + seen_favorites = {}; - let grouped_sets = {}; + let grouped_sets = {}; - for(const [emote_set, provider] of ffz_room) { - const section = this.processFFZSet(emote_set, provider, favorites, seen_favorites, grouped_sets); - if ( section ) { - section.emotes.sort(sort_emotes); + for(const [emote_set, provider] of ffz_room) { + const section = this.processFFZSet(emote_set, provider, favorites, seen_favorites, grouped_sets); + if ( section ) { + section.emotes.sort(sort_emotes); - if ( ! channel.includes(section) ) - channel.push(section); + if ( ! channel.includes(section) ) + channel.push(section); + } } - } - grouped_sets = {}; + grouped_sets = {}; - for(const [emote_set, provider] of ffz_global) { - const section = this.processFFZSet(emote_set, provider, favorites, seen_favorites, grouped_sets); - if ( section ) { - section.emotes.sort(sort_emotes); + for(const [emote_set, provider] of ffz_global) { + const section = this.processFFZSet(emote_set, provider, favorites, seen_favorites, grouped_sets); + if ( section ) { + section.emotes.sort(sort_emotes); - if ( ! all.includes(section) ) - all.push(section); + if ( ! all.includes(section) ) + all.push(section); - if ( ! channel.includes(section) && maybe_call(section.force_global, this, emote_set, props.channel_data && props.channel_data.user, me) ) - channel.push(section); + if ( ! channel.includes(section) && maybe_call(section.force_global, this, emote_set, props.channel_data && props.channel_data.user, me) ) + channel.push(section); + } } } } diff --git a/src/sites/twitch-twilight/modules/chat/input.jsx b/src/sites/twitch-twilight/modules/chat/input.jsx index e5c886c5..67631083 100644 --- a/src/sites/twitch-twilight/modules/chat/input.jsx +++ b/src/sites/twitch-twilight/modules/chat/input.jsx @@ -238,6 +238,7 @@ export default class Input extends Module { this.CommandSuggestions.on('mount', this.overrideCommandMatcher, this); this.chat.context.on('changed:chat.emotes.animated', this.uncacheTabCompletion, this); + this.chat.context.on('changed:chat.emotes.enabled', this.uncacheTabCompletion, this); this.on('chat.emotes:change-hidden', this.uncacheTabCompletion, this); this.on('chat.emotes:change-set-hidden', this.uncacheTabCompletion, this); this.on('chat.emotes:change-favorite', this.uncacheTabCompletion, this); @@ -500,10 +501,11 @@ export default class Input extends Module { } inst.getMatchedEmotes = function(input) { + const setting = t.chat.context.get('chat.emotes.enabled'); const limitResults = t.chat.context.get('chat.tab-complete.limit-results'); - let results = t.getTwitchEmoteSuggestions(input, this); + let results = setting ? t.getTwitchEmoteSuggestions(input, this) : []; - if ( t.chat.context.get('chat.tab-complete.ffz-emotes') ) { + if ( setting > 1 && t.chat.context.get('chat.tab-complete.ffz-emotes') ) { const ffz_emotes = t.getEmoteSuggestions(input, this); if ( Array.isArray(ffz_emotes) && ffz_emotes.length ) results = results.concat(ffz_emotes); diff --git a/src/sites/twitch-twilight/modules/chat/line.js b/src/sites/twitch-twilight/modules/chat/line.js index 57a7e261..7425dbb7 100644 --- a/src/sites/twitch-twilight/modules/chat/line.js +++ b/src/sites/twitch-twilight/modules/chat/line.js @@ -60,6 +60,7 @@ export default class ChatLine extends Module { this.on('chat:update-lines', this.updateLines, this); this.on('i18n:update', this.updateLines, this); + this.chat.context.on('changed:chat.emotes.enabled', this.updateLines, this); this.chat.context.on('changed:chat.emotes.2x', this.updateLines, this); this.chat.context.on('changed:chat.emotes.animated', this.updateLines, this); this.chat.context.on('changed:chat.emoji.style', this.updateLines, this); diff --git a/src/sites/twitch-twilight/modules/directory/index.jsx b/src/sites/twitch-twilight/modules/directory/index.jsx index 80176403..2e55802a 100644 --- a/src/sites/twitch-twilight/modules/directory/index.jsx +++ b/src/sites/twitch-twilight/modules/directory/index.jsx @@ -331,7 +331,7 @@ export default class Directory extends SiteModule { if ( ! props?.channelLogin ) return; - const game = props.gameTitle || props.trackingProps?.categoryName || props.trackingProps?.category, + const game = props.gameTitle || props.trackingProps?.categoryName || props.trackingProps?.category || props.contextualCardActionProps?.props?.categoryName, tags = props.tagListProps?.tags; let bad_tag = false; diff --git a/src/sites/twitch-twilight/styles/easteregg.scss b/src/sites/twitch-twilight/styles/easteregg.scss new file mode 100644 index 00000000..0ce270dd --- /dev/null +++ b/src/sites/twitch-twilight/styles/easteregg.scss @@ -0,0 +1,26 @@ +.tw-animated-glitch-logo { + &:hover { + animation: ffz-spinlogo 0.75s ease-in 2s 1 forwards; + } +} + +@keyframes ffz-spinlogo { + 0% { + transform: none; + } + 70% { + transform: rotate(200deg); + } + 85% { + transform: rotate(160deg); + } + 95% { + transform: rotate(185deg); + } + 97% { + transform: rotate(175deg); + } + 100% { + transform: rotate(180deg); + } +} \ No newline at end of file diff --git a/src/sites/twitch-twilight/styles/main.scss b/src/sites/twitch-twilight/styles/main.scss index dfd4f149..0f3a0321 100644 --- a/src/sites/twitch-twilight/styles/main.scss +++ b/src/sites/twitch-twilight/styles/main.scss @@ -11,4 +11,5 @@ @import 'host_options'; @import 'featured_follow'; -@import 'mod_card'; \ No newline at end of file +@import 'mod_card'; +@import 'easteregg'; \ No newline at end of file