mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-01 16:48:32 +00:00
4.19.0
* Added: Setting to stop Hype Trains from appearing in chat. * Changed: Megacheer messages will be disabled when bits UI has been hidden. * Fixed: Mass subscription messages displaying an empty square in chat when attempting to hide them.
This commit is contained in:
parent
af8ca41212
commit
98328cfcb5
3 changed files with 43 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "frankerfacez",
|
||||
"author": "Dan Salvato LLC",
|
||||
"version": "4.18.8",
|
||||
"version": "4.19.0",
|
||||
"description": "FrankerFaceZ is a Twitch enhancement suite.",
|
||||
"license": "Apache-2.0",
|
||||
"scripts": {
|
||||
|
|
|
@ -343,7 +343,7 @@
|
|||
:key="key"
|
||||
:value="key"
|
||||
>
|
||||
{{ a.title_i18n ? t(a.title_i18n, a.title, a) : a.title }}
|
||||
{{ t(a.title_i18n || `chat.actions.${key}`, a.title, a) }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
|
|
@ -265,6 +265,15 @@ export default class ChatHook extends Module {
|
|||
}
|
||||
});
|
||||
|
||||
this.settings.add('chat.banners.hype-train', {
|
||||
default: true,
|
||||
ui: {
|
||||
path: 'Chat > Appearance >> Community',
|
||||
title: 'Allow the Hype Train to be displayed in chat.',
|
||||
component: 'setting-check-box',
|
||||
}
|
||||
});
|
||||
|
||||
this.settings.add('chat.community-chest.show', {
|
||||
default: true,
|
||||
ui: {
|
||||
|
@ -635,6 +644,10 @@ export default class ChatHook extends Module {
|
|||
this.PointsClaimButton.forceUpdate();
|
||||
});
|
||||
|
||||
this.chat.context.on('changed:chat.banners.hype-train', this.cleanHighlights, this);
|
||||
this.chat.context.on('changed:chat.subs.gift-banner', this.cleanHighlights, this);
|
||||
this.chat.context.on('changed:chat.banners.polls', this.cleanHighlights, this);
|
||||
|
||||
this.chat.context.on('changed:chat.subs.gift-banner', () => this.GiftBanner.forceUpdate(), this);
|
||||
this.chat.context.on('changed:chat.width', this.updateChatCSS, this);
|
||||
this.settings.main_context.on('changed:chat.use-width', this.updateChatCSS, this);
|
||||
|
@ -1029,6 +1042,32 @@ export default class ChatHook extends Module {
|
|||
}
|
||||
|
||||
|
||||
cleanHighlights() {
|
||||
const types = {
|
||||
'community_sub_gift': this.chat.context.get('chat.subs.gift-banner'),
|
||||
'megacheer': this.chat.context.get('chat.bits.show'),
|
||||
'hype_train': this.chat.context.get('chat.banners.hype-train'),
|
||||
'poll': this.chat.context.get('chat.banners.polls')
|
||||
};
|
||||
|
||||
const highlights = this.community_stack?.highlights;
|
||||
if ( ! Array.isArray(highlights) )
|
||||
return;
|
||||
|
||||
for(const entry of highlights) {
|
||||
if ( ! entry || ! entry.event || ! entry.id )
|
||||
continue;
|
||||
|
||||
const type = entry.event.type;
|
||||
if ( type && has(types, type) && ! types[type] )
|
||||
this.community_dispatch({
|
||||
type: 'remove-highlight',
|
||||
id: entry.id
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
defineClasses() {
|
||||
if ( this.CommunityStackHandler )
|
||||
return true;
|
||||
|
@ -1048,6 +1087,8 @@ export default class ChatHook extends Module {
|
|||
t.community_stack = stack;
|
||||
t.community_dispatch = dispatch;
|
||||
|
||||
t.cleanHighlights();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue