1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-23 14:30:54 +00:00
I'm almost finished implementing a replacement for emote cards, but they aren't quite ready yet. Please wait just a bit longer.

* Added: Support for modifier emote effects, as well as settings to disable them.
* Changed: Update the chat types enum to match changes to Twitch's internals.
* Changed: Implement a new data structure for more efficiently storing bulk user to emote set mappings.
* Changed: Implement support for loading data from staging.

* Experiments: Push the new chat line rendering experiment to 20%. Let's see if it works properly.
This commit is contained in:
SirStendec 2023-03-03 15:24:20 -05:00
parent 8e48021c43
commit e433aa3340
17 changed files with 575 additions and 32 deletions

View file

@ -36,6 +36,7 @@ export default class ChatLine extends Module {
this.inject('chat.actions');
this.inject('chat.overrides');
this.inject('chat.emotes');
this.line_types = {};
@ -349,6 +350,7 @@ export default class ChatLine extends Module {
this.on('chat:update-line-tokens', this.updateLineTokens, this);
this.on('chat:update-line-badges', this.updateLineBadges, this);
this.on('i18n:update', this.rerenderLines, this);
this.on('chat.emotes:update-effects', this.checkEffects, this);
this.on('experiments:changed:line_renderer', () => {
const value = this.experiments.get('line_renderer'),
@ -1766,6 +1768,31 @@ other {# messages were deleted by a moderator.}
}
checkEffects() {
for(const inst of this.ChatLine.instances) {
const msg = inst.props.message,
tokens = msg?.ffz_tokens;
if ( tokens )
for(const token of tokens) {
if ( token.type === 'emote' && token.modifier_flags )
this.emotes.ensureEffect(token.modifier_flags);
}
}
for(const inst of this.WhisperLine.instances) {
const msg = inst.props.message?._ffz_message,
tokens = msg?.ffz_tokens;
if ( tokens )
for(const token of tokens) {
if ( token.type === 'emote' && token.modifier_flags )
this.emotes.ensureEffect(token.modifier_flags);
}
}
}
updateLinesByUser(id, login, clear_tokens = true, clear_badges = true) {
for(const inst of this.ChatLine.instances) {
const msg = inst.props.message,