1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00
* API Fixed: The new changes to `addNotice()` were not correctly displaying add-on emotes from the current channel.
This commit is contained in:
SirStendec 2024-01-17 14:46:48 -05:00
parent 8688d1a41b
commit e8bb25f982
3 changed files with 26 additions and 6 deletions

View file

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

View file

@ -57,9 +57,24 @@ export default class ChatLine extends Module {
if ( typeof content === 'string' )
content = e('span', {}, content);
content.ffz_icon = e('span', {
className: `${data.icon} tw-mg-r-05`
});
if ( typeof data.icon === 'function' ) {
try {
content.ffz_icon = data.icon(data, inst, e);
} catch(err) {
this.log.capture(err);
this.log.error('Error using custom renderer for notice:', err);
}
} else if ( data.icon instanceof URL )
content.ffz_icon = e('img', {
className: 'ffz-notice-icon tw-mg-r-05',
src: data.icon.toString()
});
else
content.ffz_icon = e('span', {
className: `${data.icon} tw-mg-r-05`
});
return content;
},
@ -95,8 +110,10 @@ export default class ChatLine extends Module {
const tokens = data.ffz_tokens = data.ffz_tokens || this.chat.tokenizeMessage({
message: text,
id: msg.id,
user: msg.user
}, current_user);
user: msg.user,
room: msg.room,
roomID: msg.roomID
});
return this.chat.renderTokens(tokens, e);
}

View file

@ -158,11 +158,14 @@
}
}
.ffz-notice-icon,
.ffz-emoji {
width: 1.8rem; height: 1.8rem;
width: calc(var(--ffz-chat-font-size) * 1.5);
height: calc(var(--ffz-chat-font-size) * 1.5);
}
.ffz-emoji {
&.preview-image {
width: 7.2rem;
height: 7.2rem;