1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00
* Changed: Make the badge visibility settings page a bit nicer.
* Changed: Display add-on's maintainers field in the add-ons list.
* API Fixed: When iterating chat messages, include tokenized messages that have not been pushed out of the buffer yet.
This commit is contained in:
SirStendec 2023-11-03 16:04:35 -04:00
parent 71f347ab70
commit a5e5082d63
10 changed files with 81 additions and 11 deletions

View file

@ -1,7 +1,7 @@
{ {
"name": "frankerfacez", "name": "frankerfacez",
"author": "Dan Salvato LLC", "author": "Dan Salvato LLC",
"version": "4.57.2", "version": "4.57.3",
"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

@ -411,7 +411,7 @@ export default class Badges extends Module {
if ( ! existing.versions ) if ( ! existing.versions )
existing.versions = [{ existing.versions = [{
version: existing.key, version: existing.key,
name: existing.name, name: existing.tipname,
color: existing.color, color: existing.color,
image: existing.image1x, image: existing.image1x,
styleImage: `url("${existing.image1x}")` styleImage: `url("${existing.image1x}")`
@ -426,7 +426,8 @@ export default class Badges extends Module {
}); });
if ( is_this ) { if ( is_this ) {
existing.name = name; existing.name = badge.title;
existing.tipname = name;
existing.color = color; existing.color = color;
existing.image = image; existing.image = image;
existing.styleImage = `url("${image}")`; existing.styleImage = `url("${image}")`;
@ -437,13 +438,25 @@ export default class Badges extends Module {
id, id,
key, key,
provider: 'ffz', provider: 'ffz',
name, name: badge.title,
tipname: name,
color, color,
image, image,
image1x, image1x,
styleImage: `url("${image}")` styleImage: `url("${image}")`
}; };
if ( badge.base_id ) {
existing.always_versions = true;
existing.versions = [{
version: existing.key,
name: existing.tipname,
color: existing.color,
image: existing.image1x,
styleImage: `url("${existing.image1x}")`
}];
}
addon_badges_by_id[id] = existing; addon_badges_by_id[id] = existing;
store.push(existing); store.push(existing);
} }
@ -1197,6 +1210,8 @@ export default class Badges extends Module {
data.click_url = 'https://www.frankerfacez.com/subscribe'; data.click_url = 'https://www.frankerfacez.com/subscribe';
if ( ! data.addon && (data.name === 'subwoofer') ) if ( ! data.addon && (data.name === 'subwoofer') )
data.base_id = data.id;
data.tooltipExtra = data => { data.tooltipExtra = data => {
if ( ! data?.user_id ) if ( ! data?.user_id )
return null; return null;

View file

@ -1524,6 +1524,7 @@ export default class Chat extends Module {
iterateMessages(include_chat = true, include_whisper = true, include_video = true) { iterateMessages(include_chat = true, include_whisper = true, include_video = true) {
const messages = []; const messages = [];
this.emit('chat:get-messages', include_chat, include_whisper, include_video, messages); this.emit('chat:get-messages', include_chat, include_whisper, include_video, messages);
this.emit('chat:get-messages-late', include_chat, include_whisper, include_video, messages);
return messages; return messages;
} }
@ -1729,6 +1730,8 @@ export default class Chat extends Module {
if ( ! msg ) if ( ! msg )
return msg; return msg;
msg.ffz_standardized = true;
// Standardize User // Standardize User
if ( msg.sender && ! msg.user ) if ( msg.sender && ! msg.user )
msg.user = msg.sender; msg.user = msg.sender;

View file

@ -143,7 +143,7 @@ export const Links = {
url_table.push(<tr> url_table.push(<tr>
<td>{this.i18n.formatNumber(i + 1)}.</td> <td>{this.i18n.formatNumber(i + 1)}.</td>
<td class="tw-c-text-alt-2 tw-pd-x-05 tw-word-break-all">{url.url}</td> <td class="tw-c-text-alt-2 tw-pd-x-05 tw-word-break-all">{url.url}</td>
<td>{url.flags ? url.flags.map(flag => <span class="tw-pill">{flag.toLowerCase()}</span>) : null}</td> <td>{url.flags ? url.flags.map(flag => <span class="ffz-pill">{flag.toLowerCase()}</span>) : null}</td>
</tr>); </tr>);
} }

View file

@ -42,6 +42,11 @@
author: addon.author_i18n ? t(addon.author_i18n, addon.author) : addon.author author: addon.author_i18n ? t(addon.author_i18n, addon.author) : addon.author
}) }} }) }}
</span> </span>
<span v-if="maintainer" class="tw-c-text-alt tw-mg-r-1">
{{ t('addon.maintainer', 'Maintainer: {maintainer}', {
maintainer
}) }}
</span>
<span v-if="version" class="tw-c-text-alt tw-mg-r-1"> <span v-if="version" class="tw-c-text-alt tw-mg-r-1">
{{ t('addon.version', 'Version {version}', {version}) }} {{ t('addon.version', 'Version {version}', {version}) }}
</span> </span>
@ -189,6 +194,13 @@ export default {
return this.addon.description; return this.addon.description;
}, },
maintainer() {
if ( this.addon.maintainer_i18n )
return this.t(this.addon.maintainer_i18n, this.addon.maintainer);
return this.addon.maintainer;
},
lines() { lines() {
return this.description.split(/\n/); return this.description.split(/\n/);
}, },

View file

@ -66,12 +66,12 @@
<header v-else> <header v-else>
{{ sec.title }} {{ sec.title }}
</header> </header>
<ul v-if="! sec.id || badgeChecked(sec.id)" class="tw-flex tw-flex-wrap tw-align-content-start"> <ul v-if="! sec.id || badgeChecked(sec.id)" class="tw-flex tw-flex-wrap tw-align-content-start tw-align-items-start">
<li <li
v-for="i in sec.badges" v-for="i in sec.badges"
:key="i.id" :key="i.id"
:class="{default: badgeDefault(i.id)}" :class="{default: badgeDefault(i.id)}"
class="ffz--badge-info tw-pd-y-1 tw-pd-r-1 tw-flex ffz-checkbox" class="ffz--badge-info ffz--pointer-events--none tw-mg-y-05 tw-mg-r-05 tw-flex ffz-checkbox ffz-interactable ffz-interactable--hover-enabled ffz-interactable--default tw-border-radius-large"
> >
<input <input
:id="i.id" :id="i.id"
@ -81,7 +81,7 @@
@click="onChange(i.id, $event)" @click="onChange(i.id, $event)"
> >
<label :for="i.id" class="ffz-checkbox__label"> <label :for="i.id" class="ffz-checkbox__label tw-flex-grow-1 tw-mg-05 ffz--pointer-events">
<div class="tw-mg-l-1 tw-flex"> <div class="tw-mg-l-1 tw-flex">
<div <div
:style="{backgroundColor: i.color, backgroundImage: i.styleImage }" :style="{backgroundColor: i.color, backgroundImage: i.styleImage }"
@ -90,7 +90,7 @@
<div> <div>
<h5>{{ i.name }}</h5> <h5>{{ i.name }}</h5>
<section <section
v-if="i.versions && i.versions.length > 1" v-if="i.versions && (i.always_versions || i.versions.length > 1)"
class="tw-mg-t-05" class="tw-mg-t-05"
> >
<span <span

View file

@ -35,7 +35,7 @@
<ul> <ul>
<li v-for="commit of display" :key="commit.sha" class="tw-mg-b-2"> <li v-for="commit of display" :key="commit.sha" class="tw-mg-b-2">
<div class="tw-flex tw-align-items-center tw-border-b tw-mg-b-05"> <div class="tw-flex tw-align-items-center tw-border-b tw-mg-b-05">
<div v-if="! addons && commit.active" class="tw-pill tw-mg-r-05"> <div v-if="! addons && commit.active" class="ffz-pill tw-mg-r-05">
{{ t('home.changelog.current', 'Current Version') }} {{ t('home.changelog.current', 'Current Version') }}
</div> </div>
<div v-if="commit.title" class="tw-font-size-4"> <div v-if="commit.title" class="tw-font-size-4">

View file

@ -2,7 +2,7 @@
<div class="ffz-input"> <div class="ffz-input">
<header> <header>
{{ item.i18n_key ? t(item.i18n_key, item.title) : item.title }} {{ item.i18n_key ? t(item.i18n_key, item.title) : item.title }}
<span v-if="unseen" class="tw-pill">{{ t('setting.new', 'New') }}</span> <span v-if="unseen" class="ffz-pill">{{ t('setting.new', 'New') }}</span>
</header> </header>
<section <section
v-if="item.description" v-if="item.description"

View file

@ -1122,6 +1122,42 @@ export default class ChatHook extends Module {
this.updateLineBorders(); this.updateLineBorders();
//this.updateMentionCSS(); //this.updateMentionCSS();
this.on('chat:get-messages-late', (include_chat, include_whisper, include_video, messages) => {
if ( ! include_chat )
return;
const msg_ids = new Set(messages.map(x => x.message?.id));
for(const inst of this.ChatBuffer.instances) {
for(const msg of inst.buffer) {
const msg_id = msg?.id;
if ( ! msg_id || msg_ids.has(msg_id) || ! msg.ffz_standardized )
continue;
msg_ids.add(msg_id);
messages.push({
message: msg,
_instance: null,
update: () => null
});
}
for(const raw of inst.delayedMessageBuffer) {
const msg = raw?.event,
msg_id = msg?.id;
if ( ! msg_id || msg_ids.has(msg_id) || ! msg.ffz_standardized )
continue;
msg_ids.add(msg_id);
messages.push({
message: msg,
_instance: null,
update: () => null
});
}
}
});
this.on('chat:get-tab-commands', e => { this.on('chat:get-tab-commands', e => {
e.commands.push({ e.commands.push({
name: 'reconnect', name: 'reconnect',

View file

@ -36,6 +36,10 @@
pointer-events: all; pointer-events: all;
} }
.ffz--pointer-events--none {
pointer-events: none;
}
.ffz--freeze-indicator { .ffz--freeze-indicator {
pointer-events: none; pointer-events: none;
} }