1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-10 16:10:55 +00:00
This is the first release built with the updated build toolchain. Please let me know if you find anything unexpected that broke.

* Added: Setting to treat known usernames in chat as mentions even without an at sign (@) prefix.
* Added: Setting to automatically claim drops.
* Added: Setting to hide the Subtember banner.
* Changed: The stream latency metadata tool-tip now includes the buffer size value.
* Fixed: The stream latency metadata was not appearing on the new mod view layout.
* Fixed: The sub/bits leaderboard appearing in chat when it should be hidden by a setting.
* Fixed: Incorrect text color on the Subtember banner.
This commit is contained in:
SirStendec 2023-09-06 16:10:47 -04:00
parent 10ca28098b
commit 588d3e3da9
13 changed files with 243 additions and 11 deletions

View file

@ -190,6 +190,12 @@ export default class ChatHook extends Module {
this.inject(Input);
this.inject(ViewerCards);
this.ChatLeaderboard = this.fine.define(
'chat-leaderboard',
n => n.props?.topItems && has(n.props, 'forceMiniView') && has(n.props, 'leaderboardType'),
Twilight.CHAT_ROUTES
);
this.ChatService = this.fine.define(
'chat-service',
n => n.join && n.client && n.props.setChatConnectionAPI,
@ -399,7 +405,7 @@ export default class ChatHook extends Module {
this.settings.add('chat.banners.drops', {
default: true,
ui: {
path: 'Chat > Appearance >> Community',
path: 'Chat > Drops >> Appearance',
title: 'Allow messages about Drops to be displayed in chat.',
component: 'setting-check-box'
}
@ -490,6 +496,15 @@ export default class ChatHook extends Module {
}
});
this.settings.add('chat.drops.auto-rewards', {
default: false,
ui: {
path: 'Chat > Drops >> Behavior',
title: 'Automatically claim drops.',
component: 'setting-check-box',
}
});
this.settings.add('chat.pin-resubs', {
default: false,
ui: {
@ -1022,8 +1037,8 @@ export default class ChatHook extends Module {
this.chat.context.getChanges('chat.bits.show', val =>
this.css_tweaks.toggle('hide-bits', !val));
this.chat.context.getChanges('chat.bits.show-pinned', val =>
this.css_tweaks.toggleHide('pinned-cheer', !val));
this.chat.context.on('changed:chat.bits.show-pinned', () =>
this.ChatLeaderboard.forceUpdate());
this.chat.context.getChanges('chat.filtering.deleted-style', val => {
this.css_tweaks.toggle('chat-deleted-strike', val === 1 || val === 2);
@ -1108,6 +1123,18 @@ export default class ChatHook extends Module {
this.PointsInfo.on('unmount', () => this.updatePointsInfo(null));
this.PointsInfo.ready(() => this.updatePointsInfo(this.PointsInfo.first));
this.ChatLeaderboard.ready(cls => {
const old_render = cls.prototype.render;
cls.prototype.render = function() {
if ( ! t.chat.context.get('chat.bits.show-pinned') )
return null;
return old_render.call(this);
}
this.ChatLeaderboard.forceUpdate();
});
this.GiftBanner.ready(cls => {
const old_render = cls.prototype.render;
cls.prototype.render = function() {
@ -1180,6 +1207,12 @@ export default class ChatHook extends Module {
if ( (ctype === 'mega-recipient-rewards' || ctype === 'mega-benefactor-rewards') && ! t.chat.context.get('chat.bits.show-rewards') )
return null;
if ( ctype === 'drop' && ! this._ffz_auto_drop && t.chat.context.get('chat.drops.auto-rewards') )
this._ffz_auto_drop = setTimeout(() => {
this._ffz_auto_drop = null;
t.autoClickDrop(this);
}, 250);
} catch(err) {
t.log.capture(err);
t.log.error(err);
@ -1478,6 +1511,23 @@ export default class ChatHook extends Module {
}
autoClickDrop(inst) {
const callout = inst.props?.callouts?.[0] || inst.props?.pinnedCallout,
ctype = callout?.event?.type;
if ( ctype !== 'drop' || ! this.chat.context.get('chat.drops.auto-rewards') )
return;
const node = this.fine.getHostNode(inst),
btn = node.querySelector('button[data-a-target="chat-private-callout__primary-button"]');
if ( ! btn )
return;
btn.click();
}
wrapRaidController(inst) {
if ( inst._ffz_wrapped )
return this.noAutoRaids(inst);