1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-08-08 15:20:55 +00:00
* Added: Support for custom VIP Badge images.
* Fixed: Certain emotes breaking when `Large Emotes` is combined with `Fix bad Twitch emotes`. (Closes #1020)
* Fixed: Remember the Compressor state, if it was toggled, when resetting the player. (Closes #1024)
* API Added: The `chat` module has two methods for maintaining a list of possible message highlight reasons, for use populating UI. Accessible via methods `addHighlightReason(key, data)` and `getHighlightReasons()`.
* API Added: `basic_array_merge` setting type.
* API Added: Logs now include the initial URL that the script was loaded into.
* API Changed: `<select>` settings can now support multiple selected values.
This commit is contained in:
SirStendec 2021-04-14 16:53:15 -04:00
parent ae90b8e4fe
commit a80728a10d
13 changed files with 183 additions and 28 deletions

View file

@ -111,6 +111,7 @@ export default class Room {
this.style.delete('css');
this.buildModBadgeCSS();
this.buildVIPBadgeCSS();
}
if ( other.badges && ! this.badges ) {
@ -331,6 +332,7 @@ export default class Room {
this.style.delete('css');
this.buildModBadgeCSS();
this.buildVIPBadgeCSS();
return true;
}
@ -429,6 +431,28 @@ export default class Room {
this.buildBadgeCSS();
}
buildVIPBadgeCSS() {
if ( this.destroyed )
return;
if ( ! this.data || ! this.data.vip_badge || ! this.manager.context.get('chat.badges.custom-vip') )
return this.style.delete('vip-badge');
const urls = this.data.vip_badge,
image = `url("${urls[1]}")`;
let image_set;
if ( urls[2] || urls[4] )
image_set = `${WEBKIT}image-set(${image} 1x${urls[2] ? `, url("${urls[2]}") 2x` : ''}${urls[4] ? `, url("${urls[4]}") 4x` : ''})`;
this.style.set('vip-badge', `[data-room-id="${this.id}"] .ffz-badge[data-badge="vip"] {
background-color: transparent;
background-image: ${image};
${image_set ? `background-image: ${image_set};` : ''}
${WEBKIT}mask-image: unset;
}`);
}
buildModBadgeCSS() {
if ( this.destroyed )
return;