mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-27 21:16:09 +02:00
Major progress on revamp
* Deprecated explicit prompt.hjson/general.promptFile, etc.: menu.hjson can simply include any number of files * All menus and themes, their events, etc. are managed by ThemeManager allowing includes, refs, etc. and much cleaner code
This commit is contained in:
parent
1a96ad41d2
commit
4d4be5d6a9
15 changed files with 331 additions and 400 deletions
|
@ -83,7 +83,7 @@ function Client(/*input, output*/) {
|
|||
const self = this;
|
||||
|
||||
this.user = new User();
|
||||
this.currentTheme = { info : { name : 'N/A', description : 'None' } };
|
||||
this.currentThemeConfig = { info : { name : 'N/A', description : 'None' } };
|
||||
this.lastActivityTime = Date.now();
|
||||
this.menuStack = new MenuStack(this);
|
||||
this.acs = new ACS( { client : this, user : this.user } );
|
||||
|
@ -94,6 +94,26 @@ function Client(/*input, output*/) {
|
|||
this.mciCache = {};
|
||||
};
|
||||
|
||||
Object.defineProperty(this, 'currentTheme', {
|
||||
get : () => {
|
||||
if (this.currentThemeConfig) {
|
||||
return this.currentThemeConfig.get();
|
||||
} else {
|
||||
return {
|
||||
info : {
|
||||
name : 'N/A',
|
||||
author : 'N/A',
|
||||
description : 'N/A',
|
||||
group : 'N/A',
|
||||
}
|
||||
};
|
||||
}
|
||||
},
|
||||
set : (theme) => {
|
||||
this.currentThemeConfig = theme;
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(this, 'node', {
|
||||
get : function() {
|
||||
return self.session.id;
|
||||
|
@ -120,7 +140,7 @@ function Client(/*input, output*/) {
|
|||
|
||||
this.themeChangedListener = function( { themeId } ) {
|
||||
if(_.get(self.currentTheme, 'info.themeId') === themeId) {
|
||||
self.currentTheme = require('./theme.js').getAvailableThemes().get(themeId);
|
||||
self.currentThemeConfig = require('./theme.js').getAvailableThemes().get(themeId);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue