1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00
* Fixed: Exclude the player settings menu from theming when using a light theme to avoid rendering issues.
* API Added: `addNotice(room, message)` method for the module `site.chat`.
* API Fixed: Add `addNotice()` and `sendMessage()` stubs to the `site.chat` module in clips flavor.
This commit is contained in:
SirStendec 2021-07-12 20:00:14 -04:00
parent 0c25692afd
commit cfd11c8e9e
4 changed files with 41 additions and 2 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "frankerfacez", "name": "frankerfacez",
"author": "Dan Salvato LLC", "author": "Dan Salvato LLC",
"version": "4.28.0", "version": "4.28.1",
"description": "FrankerFaceZ is a Twitch enhancement suite.", "description": "FrankerFaceZ is a Twitch enhancement suite.",
"private": true, "private": true,
"license": "Apache-2.0", "license": "Apache-2.0",

View file

@ -137,6 +137,19 @@ export default class Chat extends Module {
} }
// ========================================================================
// API Compliance
// ========================================================================
addNotice() { // eslint-disable-line class-methods-use-this
return false;
}
sendMessage() { // eslint-disable-line class-methods-use-this
return null;
}
// ======================================================================== // ========================================================================
// Room Handling // Room Handling
// ======================================================================== // ========================================================================

View file

@ -1922,6 +1922,30 @@ export default class ChatHook extends Module {
} }
addNotice(room, message) {
if ( ! room )
return false;
if ( room.startsWith('#') )
room = room.slice(1);
room = room.toLowerCase();
for(const inst of this.ChatService.instances) {
if ( inst.props.channelLogin.toLowerCase() === room ) {
inst.addMessage({
type: this.chat_types.Notice,
message
});
return true;
}
}
return false;
}
sendMessage(room, message) { sendMessage(room, message) {
const service = this.ChatService.first; const service = this.ChatService.first;

View file

@ -445,8 +445,10 @@ export default class ThemeEngine extends Module {
this.toggleNormalizer(chat_bits.length || bits.length); this.toggleNormalizer(chat_bits.length || bits.length);
const selector = dark ? '' : `:not(.settings-menu-button-component--forced-dark-theme)`;
if ( bits.length ) if ( bits.length )
this.css_tweaks.set('colors', `body,body .tw-root--theme-light,body .tw-root--theme-dark {${bits.join('\n')}}.channel-info-content .tw-accent-region,.channel-info-content div[class^="ScAccentRegion"]{${accent_bits.join('\n')}}`); this.css_tweaks.set('colors', `body,body .tw-root--theme-light,body .tw-root--theme-dark${selector} {${bits.join('\n')}}.channel-info-content .tw-accent-region,.channel-info-content div[class^="ScAccentRegion"]{${accent_bits.join('\n')}}`);
else else
this.css_tweaks.delete('colors'); this.css_tweaks.delete('colors');
} }