mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-26 17:30:52 +01:00
Updates
This commit is contained in:
parent
f53c8199c2
commit
a1ae6a384f
@ -21,7 +21,7 @@ export class ConfigurationManager extends NitroManager implements IConfiguration
|
|||||||
|
|
||||||
protected onInit(): void
|
protected onInit(): void
|
||||||
{
|
{
|
||||||
this.parseConfiguration(this.getDefaultConfig());
|
this.parseConfiguration(this.getDefaultConfig(), true);
|
||||||
|
|
||||||
this._pendingUrls = this.getValue<string[]>('config.urls').slice();
|
this._pendingUrls = this.getValue<string[]>('config.urls').slice();
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ export class ConfigurationManager extends NitroManager implements IConfiguration
|
|||||||
this.events && this.events.dispatchEvent(new ConfigurationEvent(type));
|
this.events && this.events.dispatchEvent(new ConfigurationEvent(type));
|
||||||
}
|
}
|
||||||
|
|
||||||
private parseConfiguration(data: { [index: string]: any }): boolean
|
private parseConfiguration(data: { [index: string]: any }, overrides: boolean = false): boolean
|
||||||
{
|
{
|
||||||
if(!data) return false;
|
if(!data) return false;
|
||||||
|
|
||||||
@ -93,13 +93,18 @@ export class ConfigurationManager extends NitroManager implements IConfiguration
|
|||||||
|
|
||||||
for(const key in data)
|
for(const key in data)
|
||||||
{
|
{
|
||||||
if(this._definitions.has(key)) continue;
|
|
||||||
|
|
||||||
let value = data[key];
|
let value = data[key];
|
||||||
|
|
||||||
if(typeof value === 'string') value = this.interpolate((value as string), regex);
|
if(typeof value === 'string') value = this.interpolate((value as string), regex);
|
||||||
|
|
||||||
this.setValue(key, value);
|
if(this._definitions.has(key))
|
||||||
|
{
|
||||||
|
if(overrides) this.setValue(key, value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.setValue(key, value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -160,7 +160,6 @@ export class BadgeImageManager implements IDisposable
|
|||||||
url = (Nitro.instance.getConfiguration<string>('badge.asset.url')).replace('%badgename%', badge);
|
url = (Nitro.instance.getConfiguration<string>('badge.asset.url')).replace('%badgename%', badge);
|
||||||
break;
|
break;
|
||||||
case BadgeImageManager.GROUP_BADGE:
|
case BadgeImageManager.GROUP_BADGE:
|
||||||
//url = (Nitro.instance.getConfiguration<string>('badge.asset.group.url')).replace('%badgedata%', badge);
|
|
||||||
url = badge;
|
url = badge;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user