From 880e80388a31825d67dc19c7fd16b3ca3c5af497 Mon Sep 17 00:00:00 2001 From: SirStendec Date: Thu, 30 Mar 2023 14:54:33 -0400 Subject: [PATCH] 4.45.0 * Added: Emote cards are now at parity with vanilla Twitch emote cards when it comes to displaying Twitch emotes, including the ability to follow/subscribe to the source channel, view their other emotes, and report emotes. * Added: Emote cards for FFZ emotes now allow you to add an emote to any collection you can manage. * Added: Emote cards for other emotes now have an action to open the emote on the source service's webpage. * Fixed: Effect emotes not appearing when used incorrectly in chat. * Fixed: Rebuild the tab-completion emote array in a way more likely to cause Twitch's native input element to update when we change our emotes. * Changed: Use a higher contrast "New" pill when displaying new items in the FFZ Control Center. (Closes #1348) * Changed: Push the modular chat line rendering experiment to 100% roll-out. --- package.json | 4 +- src/experiments.json | 4 +- src/modules/chat/emotes.js | 15 +- src/modules/chat/tokenizers.jsx | 2 +- src/modules/emote_card/components/card.vue | 114 +++++++- .../components/manage-ffz-collection.vue | 197 ++++++++++++++ .../emote_card/components/manage-ffz.vue | 124 +++++++++ .../emote_card/components/modifiers.vue | 185 +++++++++++++ .../emote_card/components/twitch-body.vue | 194 +++++++++++++ src/modules/emote_card/index.jsx | 255 ++++++++++++++++-- .../components/setting-check-box.vue | 2 +- .../components/setting-color-box.vue | 2 +- .../components/setting-combo-box.vue | 2 +- .../main_menu/components/setting-hotkey.vue | 2 +- .../components/setting-select-box.vue | 2 +- .../main_menu/components/setting-text-box.vue | 2 +- src/sites/twitch-twilight/index.js | 7 + .../twitch-twilight/modules/chat/input.jsx | 33 ++- .../twitch-twilight/styles/mod_card.scss | 26 ++ src/std-components/follow-button.vue | 149 ++++++++++ src/utilities/data/follow-user.gql | 11 + src/utilities/data/unfollow-user.gql | 8 + src/utilities/data/user-followed.gql | 11 + src/utilities/twitch-data.js | 52 ++++ styles/main.scss | 33 +++ 25 files changed, 1382 insertions(+), 54 deletions(-) create mode 100644 src/modules/emote_card/components/manage-ffz-collection.vue create mode 100644 src/modules/emote_card/components/manage-ffz.vue create mode 100644 src/modules/emote_card/components/modifiers.vue create mode 100644 src/modules/emote_card/components/twitch-body.vue create mode 100644 src/std-components/follow-button.vue create mode 100644 src/utilities/data/follow-user.gql create mode 100644 src/utilities/data/unfollow-user.gql create mode 100644 src/utilities/data/user-followed.gql diff --git a/package.json b/package.json index 3f66339d..1ffc8884 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "frankerfacez", "author": "Dan Salvato LLC", - "version": "4.44.1", + "version": "4.45.0", "description": "FrankerFaceZ is a Twitch enhancement suite.", "private": true, "license": "Apache-2.0", @@ -70,8 +70,8 @@ "file-saver": "^2.0.5", "graphql": "^16.0.1", "graphql-tag": "^2.12.6", - "jszip": "^3.7.1", "js-cookie": "^2.2.1", + "jszip": "^3.7.1", "markdown-it": "^12.2.0", "markdown-it-link-attributes": "^3.0.0", "mnemonist": "^0.38.5", diff --git a/src/experiments.json b/src/experiments.json index a7ed1cce..3cd5aa3f 100644 --- a/src/experiments.json +++ b/src/experiments.json @@ -3,8 +3,8 @@ "name": "Modular Chat Line Rendering", "description": "Enable a newer, modular chat line renderer.", "groups": [ - {"value": true, "weight": 80}, - {"value": false, "weight": 20} + {"value": true, "weight": 100}, + {"value": false, "weight": 0} ] }, "api_load": { diff --git a/src/modules/chat/emotes.js b/src/modules/chat/emotes.js index 3710f1d7..7bbf3fb6 100644 --- a/src/modules/chat/emotes.js +++ b/src/modules/chat/emotes.js @@ -933,7 +933,7 @@ export default class Emotes extends Module { else if ( ! value && idx !== -1 ) favorites.splice(idx, 1); else - return; + return value; if ( favorites.length ) p.set(key, favorites); @@ -941,6 +941,7 @@ export default class Emotes extends Module { p.delete(key); this.emit(':change-favorite', source, id, value); + return value; } isFavorite(source, id) { @@ -1075,11 +1076,21 @@ export default class Emotes extends Module { if ( favorite_only ) return false; + let modifiers; + try { + modifiers = JSON.parse(ds.modifierInfo); + } catch(err) { + /* no-op */ + } + const evt = new FFZEvent({ provider, id: ds.id, set: ds.set, + code: ds.code, + variant: ds.variant, name: ds.name || target.alt, + modifiers, source: event }); @@ -1680,7 +1691,7 @@ export default class Emotes extends Module { animSrc2: emote.animSrc2, animSrcSet2: emote.animSrcSet2, masked: !! emote.mask, - hidden: (emote.modifier_flags & 1) === 1, + mod_hidden: (emote.modifier_flags & 1) === 1, text: emote.hidden ? '???' : emote.name, length: emote.name.length, height: emote.height, diff --git a/src/modules/chat/tokenizers.jsx b/src/modules/chat/tokenizers.jsx index d742ebbb..30b8fccd 100644 --- a/src/modules/chat/tokenizers.jsx +++ b/src/modules/chat/tokenizers.jsx @@ -1260,7 +1260,7 @@ export const AddonEmotes = { if ( mod.effect_bg ) as_bg = true; - if ( ! mod.hidden && mod.set !== 'info' ) { + if ( ! mod.mod_hidden && mod.set !== 'info' ) { const factor = mod.big ? 2 : 1, width = mod.width * factor, height = mod.height * factor; diff --git a/src/modules/emote_card/components/card.vue b/src/modules/emote_card/components/card.vue index cc694842..23f393a3 100644 --- a/src/modules/emote_card/components/card.vue +++ b/src/modules/emote_card/components/card.vue @@ -1,37 +1,44 @@