mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-08-13 09:30:53 +00:00
4.1.2
* Fixed: Mentions not appearing in bold font. * Fixed: Highlighting messages in chat when opening a viewer card by clicking a mention that wasn't all lower-case. * Fixed: Detection of External add-ons when there is a name collision. * Changed: Do not report name collision errors. * Changed: Allow for multi-line add-on descriptions.
This commit is contained in:
parent
cdedf29d04
commit
535192d931
11 changed files with 382 additions and 243 deletions
|
@ -9,12 +9,37 @@ export class Addon extends Module {
|
|||
}
|
||||
|
||||
static register(id, info) {
|
||||
const ffz = FrankerFaceZ.get();
|
||||
ffz.register(`addon.${id}`, this);
|
||||
if ( typeof id === 'object' ) {
|
||||
info = id;
|
||||
id = info.id || undefined;
|
||||
}
|
||||
|
||||
if ( ! id ) {
|
||||
if ( this.name )
|
||||
id = this.name.toSnakeCase();
|
||||
else
|
||||
throw new Error(`Unable to register module without ID.`);
|
||||
}
|
||||
|
||||
if ( ! info && this.info )
|
||||
info = this.info;
|
||||
|
||||
const ffz = FrankerFaceZ.get();
|
||||
if ( info ) {
|
||||
info.id = id;
|
||||
ffz.addons.addAddon(info);
|
||||
}
|
||||
|
||||
try {
|
||||
ffz.register(`addon.${id}`, this);
|
||||
} catch(err) {
|
||||
if ( err.message && err.message.includes('Name Collision for Module') ) {
|
||||
const module = ffz.resolve(`addon.${id}`);
|
||||
if ( module )
|
||||
module.external = true;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue