From ad1547d77b43ca17948b7422b0d31e077d1a40b2 Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Thu, 7 Sep 2023 22:26:10 +0000 Subject: [PATCH] Fixed theme selection --- .../2FACONFSCR.ans | Bin .../40 => luciano_blocktronics_40}/2FAOTP.ans | Bin .../2FAOTPSECREQ.ans | Bin .../ACCOUNTINACTIVE.ANS | Bin .../ACCOUNTLOCKED.ANS | Bin .../40 => luciano_blocktronics_40}/BBSADD.ANS | Bin .../BBSLIST.ANS | Bin .../CCHANGE.ANS | Bin .../40 => luciano_blocktronics_40}/CHANGE.ANS | Bin .../CONFSCR.ANS | Bin .../40 => luciano_blocktronics_40}/DONE.ANS | Bin .../DOORMNU.ANS | Bin .../FAREASEL.ANS | Bin .../40 => luciano_blocktronics_40}/FBHELP.ANS | Bin .../FBLISTEXP.ANS | Bin .../FBLISTEXPSEARCH.ANS | Bin .../FBNORES.ANS | Bin .../40 => luciano_blocktronics_40}/FBRWSE.ANS | Bin .../FDETAIL.ANS | Bin .../FDETGEN.ANS | Bin .../FDETLST.ANS | Bin .../FDETNFO.ANS | Bin .../40 => luciano_blocktronics_40}/FDLMGR.ANS | Bin .../FEMPTYQ.ANS | Bin .../FFILEDT.ANS | Bin .../FILPMPT.ANS | Bin .../40 => luciano_blocktronics_40}/FMENU.ANS | Bin .../FNEWBRWSE.ANS | Bin .../FORGOTPW.ANS | Bin .../FORGOTPWSENT.ANS | Bin .../FPROSEL.ANS | Bin .../FSEARCH.ANS | Bin .../FWDLMGR.ANS | Bin .../IDLELOG.ANS | Bin .../LASTCALL.ANS | Bin .../40 => luciano_blocktronics_40}/LETTER.ANS | Bin .../MAILMNU.ANS | Bin .../40 => luciano_blocktronics_40}/MATRIX.ANS | 0 .../40 => luciano_blocktronics_40}/MMENU.ANS | Bin .../MNUPRMT.ANS | Bin .../MSEARCH.ANS | Bin .../MSGBODY.ANS | Bin .../MSGDELPMPT.ANS | Bin .../MSGEFTR.ANS | Bin .../MSGEHDR.ANS | Bin .../MSGEHLP.ANS | Bin .../MSGEMFT.ANS | Bin .../MSGLIST.ANS | Bin .../40 => luciano_blocktronics_40}/MSGMNU.ANS | Bin .../MSGPMPT.ANS | Bin .../MSGQUOT.ANS | Bin .../MSGVFTR.ANS | Bin .../MSGVHDR.ANS | Bin .../MSGVHLP.ANS | Bin .../MSRCHLST.ANS | Bin .../MSRCNORES.ANS | Bin .../MYMSGLST.ANS | Bin .../NEWMSGS.ANS | Bin .../NODEMSG.ANS | Bin .../NODEMSGFTR.ANS | Bin .../NODEMSGHDR.ANS | Bin .../40 => luciano_blocktronics_40}/NUA.ANS | Bin .../40 => luciano_blocktronics_40}/ONEADD.ANS | Bin .../ONELINER.ANS | Bin .../40 => luciano_blocktronics_40}/PAUSE.ANS | Bin .../PRVMSGLIST.ANS | Bin .../RATEFILE.ANS | Bin .../RUMORADD.ANS | Bin .../40 => luciano_blocktronics_40}/RUMORS.ANS | Bin .../SETFNSDATE.ANS | Bin .../SETMNSDATE.ANS | Bin .../40 => luciano_blocktronics_40}/STATUS.ANS | Bin .../SYSSTAT.ANS | Bin .../TBRIDGE.ANS | Bin .../TOONODE.ANS | Bin .../ULCHECK.ANS | Bin .../ULDETAIL.ANS | Bin .../ULDUPES.ANS | Bin .../ULNOAREA.ANS | Bin .../40 => luciano_blocktronics_40}/ULOPTS.ANS | Bin .../USERACHIEV.ans | Bin .../USERLOG.ANS | 0 .../USERLST.ANS | Bin .../40 => luciano_blocktronics_40}/WHOSON.ANS | Bin .../achievement_global_footer.ans | Bin .../achievement_global_header.ans | Bin .../achievement_local_footer.ans | Bin .../achievement_local_header.ans | Bin .../autosig.ans | Bin .../mb_export_dl_queue.ans | Bin .../40 => luciano_blocktronics_40}/mrc.ans | Bin .../offline_mail.ans | Bin .../qwk_export_progress.ans | Bin .../theme.hjson | 0 .../40 => luciano_blocktronics_40}/wfc.ans | Bin .../wfchelp.ans | Bin .../wfckicknodeprompt.ans | Bin core/login_server_module.js | 7 ++- core/nua.js | 6 ++- core/theme.js | 42 ++++++++++++++++-- 100 files changed, 47 insertions(+), 8 deletions(-) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/2FACONFSCR.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/2FAOTP.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/2FAOTPSECREQ.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/ACCOUNTINACTIVE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/ACCOUNTLOCKED.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/BBSADD.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/BBSLIST.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/CCHANGE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/CHANGE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/CONFSCR.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/DONE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/DOORMNU.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FAREASEL.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FBHELP.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FBLISTEXP.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FBLISTEXPSEARCH.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FBNORES.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FBRWSE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FDETAIL.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FDETGEN.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FDETLST.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FDETNFO.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FDLMGR.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FEMPTYQ.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FFILEDT.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FILPMPT.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FMENU.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FNEWBRWSE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FORGOTPW.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FORGOTPWSENT.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FPROSEL.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FSEARCH.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/FWDLMGR.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/IDLELOG.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/LASTCALL.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/LETTER.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MAILMNU.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MATRIX.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MMENU.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MNUPRMT.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSEARCH.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGBODY.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGDELPMPT.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGEFTR.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGEHDR.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGEHLP.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGEMFT.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGLIST.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGMNU.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGPMPT.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGQUOT.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGVFTR.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGVHDR.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSGVHLP.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSRCHLST.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MSRCNORES.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/MYMSGLST.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/NEWMSGS.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/NODEMSG.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/NODEMSGFTR.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/NODEMSGHDR.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/NUA.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/ONEADD.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/ONELINER.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/PAUSE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/PRVMSGLIST.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/RATEFILE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/RUMORADD.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/RUMORS.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/SETFNSDATE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/SETMNSDATE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/STATUS.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/SYSSTAT.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/TBRIDGE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/TOONODE.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/ULCHECK.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/ULDETAIL.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/ULDUPES.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/ULNOAREA.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/ULOPTS.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/USERACHIEV.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/USERLOG.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/USERLST.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/WHOSON.ANS (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/achievement_global_footer.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/achievement_global_header.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/achievement_local_footer.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/achievement_local_header.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/autosig.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/mb_export_dl_queue.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/mrc.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/offline_mail.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/qwk_export_progress.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/theme.hjson (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/wfc.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/wfchelp.ans (100%) rename art/themes/{luciano_blocktronics/40 => luciano_blocktronics_40}/wfckicknodeprompt.ans (100%) diff --git a/art/themes/luciano_blocktronics/40/2FACONFSCR.ans b/art/themes/luciano_blocktronics_40/2FACONFSCR.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/2FACONFSCR.ans rename to art/themes/luciano_blocktronics_40/2FACONFSCR.ans diff --git a/art/themes/luciano_blocktronics/40/2FAOTP.ans b/art/themes/luciano_blocktronics_40/2FAOTP.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/2FAOTP.ans rename to art/themes/luciano_blocktronics_40/2FAOTP.ans diff --git a/art/themes/luciano_blocktronics/40/2FAOTPSECREQ.ans b/art/themes/luciano_blocktronics_40/2FAOTPSECREQ.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/2FAOTPSECREQ.ans rename to art/themes/luciano_blocktronics_40/2FAOTPSECREQ.ans diff --git a/art/themes/luciano_blocktronics/40/ACCOUNTINACTIVE.ANS b/art/themes/luciano_blocktronics_40/ACCOUNTINACTIVE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/ACCOUNTINACTIVE.ANS rename to art/themes/luciano_blocktronics_40/ACCOUNTINACTIVE.ANS diff --git a/art/themes/luciano_blocktronics/40/ACCOUNTLOCKED.ANS b/art/themes/luciano_blocktronics_40/ACCOUNTLOCKED.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/ACCOUNTLOCKED.ANS rename to art/themes/luciano_blocktronics_40/ACCOUNTLOCKED.ANS diff --git a/art/themes/luciano_blocktronics/40/BBSADD.ANS b/art/themes/luciano_blocktronics_40/BBSADD.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/BBSADD.ANS rename to art/themes/luciano_blocktronics_40/BBSADD.ANS diff --git a/art/themes/luciano_blocktronics/40/BBSLIST.ANS b/art/themes/luciano_blocktronics_40/BBSLIST.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/BBSLIST.ANS rename to art/themes/luciano_blocktronics_40/BBSLIST.ANS diff --git a/art/themes/luciano_blocktronics/40/CCHANGE.ANS b/art/themes/luciano_blocktronics_40/CCHANGE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/CCHANGE.ANS rename to art/themes/luciano_blocktronics_40/CCHANGE.ANS diff --git a/art/themes/luciano_blocktronics/40/CHANGE.ANS b/art/themes/luciano_blocktronics_40/CHANGE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/CHANGE.ANS rename to art/themes/luciano_blocktronics_40/CHANGE.ANS diff --git a/art/themes/luciano_blocktronics/40/CONFSCR.ANS b/art/themes/luciano_blocktronics_40/CONFSCR.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/CONFSCR.ANS rename to art/themes/luciano_blocktronics_40/CONFSCR.ANS diff --git a/art/themes/luciano_blocktronics/40/DONE.ANS b/art/themes/luciano_blocktronics_40/DONE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/DONE.ANS rename to art/themes/luciano_blocktronics_40/DONE.ANS diff --git a/art/themes/luciano_blocktronics/40/DOORMNU.ANS b/art/themes/luciano_blocktronics_40/DOORMNU.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/DOORMNU.ANS rename to art/themes/luciano_blocktronics_40/DOORMNU.ANS diff --git a/art/themes/luciano_blocktronics/40/FAREASEL.ANS b/art/themes/luciano_blocktronics_40/FAREASEL.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FAREASEL.ANS rename to art/themes/luciano_blocktronics_40/FAREASEL.ANS diff --git a/art/themes/luciano_blocktronics/40/FBHELP.ANS b/art/themes/luciano_blocktronics_40/FBHELP.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FBHELP.ANS rename to art/themes/luciano_blocktronics_40/FBHELP.ANS diff --git a/art/themes/luciano_blocktronics/40/FBLISTEXP.ANS b/art/themes/luciano_blocktronics_40/FBLISTEXP.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FBLISTEXP.ANS rename to art/themes/luciano_blocktronics_40/FBLISTEXP.ANS diff --git a/art/themes/luciano_blocktronics/40/FBLISTEXPSEARCH.ANS b/art/themes/luciano_blocktronics_40/FBLISTEXPSEARCH.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FBLISTEXPSEARCH.ANS rename to art/themes/luciano_blocktronics_40/FBLISTEXPSEARCH.ANS diff --git a/art/themes/luciano_blocktronics/40/FBNORES.ANS b/art/themes/luciano_blocktronics_40/FBNORES.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FBNORES.ANS rename to art/themes/luciano_blocktronics_40/FBNORES.ANS diff --git a/art/themes/luciano_blocktronics/40/FBRWSE.ANS b/art/themes/luciano_blocktronics_40/FBRWSE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FBRWSE.ANS rename to art/themes/luciano_blocktronics_40/FBRWSE.ANS diff --git a/art/themes/luciano_blocktronics/40/FDETAIL.ANS b/art/themes/luciano_blocktronics_40/FDETAIL.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FDETAIL.ANS rename to art/themes/luciano_blocktronics_40/FDETAIL.ANS diff --git a/art/themes/luciano_blocktronics/40/FDETGEN.ANS b/art/themes/luciano_blocktronics_40/FDETGEN.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FDETGEN.ANS rename to art/themes/luciano_blocktronics_40/FDETGEN.ANS diff --git a/art/themes/luciano_blocktronics/40/FDETLST.ANS b/art/themes/luciano_blocktronics_40/FDETLST.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FDETLST.ANS rename to art/themes/luciano_blocktronics_40/FDETLST.ANS diff --git a/art/themes/luciano_blocktronics/40/FDETNFO.ANS b/art/themes/luciano_blocktronics_40/FDETNFO.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FDETNFO.ANS rename to art/themes/luciano_blocktronics_40/FDETNFO.ANS diff --git a/art/themes/luciano_blocktronics/40/FDLMGR.ANS b/art/themes/luciano_blocktronics_40/FDLMGR.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FDLMGR.ANS rename to art/themes/luciano_blocktronics_40/FDLMGR.ANS diff --git a/art/themes/luciano_blocktronics/40/FEMPTYQ.ANS b/art/themes/luciano_blocktronics_40/FEMPTYQ.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FEMPTYQ.ANS rename to art/themes/luciano_blocktronics_40/FEMPTYQ.ANS diff --git a/art/themes/luciano_blocktronics/40/FFILEDT.ANS b/art/themes/luciano_blocktronics_40/FFILEDT.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FFILEDT.ANS rename to art/themes/luciano_blocktronics_40/FFILEDT.ANS diff --git a/art/themes/luciano_blocktronics/40/FILPMPT.ANS b/art/themes/luciano_blocktronics_40/FILPMPT.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FILPMPT.ANS rename to art/themes/luciano_blocktronics_40/FILPMPT.ANS diff --git a/art/themes/luciano_blocktronics/40/FMENU.ANS b/art/themes/luciano_blocktronics_40/FMENU.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FMENU.ANS rename to art/themes/luciano_blocktronics_40/FMENU.ANS diff --git a/art/themes/luciano_blocktronics/40/FNEWBRWSE.ANS b/art/themes/luciano_blocktronics_40/FNEWBRWSE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FNEWBRWSE.ANS rename to art/themes/luciano_blocktronics_40/FNEWBRWSE.ANS diff --git a/art/themes/luciano_blocktronics/40/FORGOTPW.ANS b/art/themes/luciano_blocktronics_40/FORGOTPW.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FORGOTPW.ANS rename to art/themes/luciano_blocktronics_40/FORGOTPW.ANS diff --git a/art/themes/luciano_blocktronics/40/FORGOTPWSENT.ANS b/art/themes/luciano_blocktronics_40/FORGOTPWSENT.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FORGOTPWSENT.ANS rename to art/themes/luciano_blocktronics_40/FORGOTPWSENT.ANS diff --git a/art/themes/luciano_blocktronics/40/FPROSEL.ANS b/art/themes/luciano_blocktronics_40/FPROSEL.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FPROSEL.ANS rename to art/themes/luciano_blocktronics_40/FPROSEL.ANS diff --git a/art/themes/luciano_blocktronics/40/FSEARCH.ANS b/art/themes/luciano_blocktronics_40/FSEARCH.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FSEARCH.ANS rename to art/themes/luciano_blocktronics_40/FSEARCH.ANS diff --git a/art/themes/luciano_blocktronics/40/FWDLMGR.ANS b/art/themes/luciano_blocktronics_40/FWDLMGR.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/FWDLMGR.ANS rename to art/themes/luciano_blocktronics_40/FWDLMGR.ANS diff --git a/art/themes/luciano_blocktronics/40/IDLELOG.ANS b/art/themes/luciano_blocktronics_40/IDLELOG.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/IDLELOG.ANS rename to art/themes/luciano_blocktronics_40/IDLELOG.ANS diff --git a/art/themes/luciano_blocktronics/40/LASTCALL.ANS b/art/themes/luciano_blocktronics_40/LASTCALL.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/LASTCALL.ANS rename to art/themes/luciano_blocktronics_40/LASTCALL.ANS diff --git a/art/themes/luciano_blocktronics/40/LETTER.ANS b/art/themes/luciano_blocktronics_40/LETTER.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/LETTER.ANS rename to art/themes/luciano_blocktronics_40/LETTER.ANS diff --git a/art/themes/luciano_blocktronics/40/MAILMNU.ANS b/art/themes/luciano_blocktronics_40/MAILMNU.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MAILMNU.ANS rename to art/themes/luciano_blocktronics_40/MAILMNU.ANS diff --git a/art/themes/luciano_blocktronics/40/MATRIX.ANS b/art/themes/luciano_blocktronics_40/MATRIX.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MATRIX.ANS rename to art/themes/luciano_blocktronics_40/MATRIX.ANS diff --git a/art/themes/luciano_blocktronics/40/MMENU.ANS b/art/themes/luciano_blocktronics_40/MMENU.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MMENU.ANS rename to art/themes/luciano_blocktronics_40/MMENU.ANS diff --git a/art/themes/luciano_blocktronics/40/MNUPRMT.ANS b/art/themes/luciano_blocktronics_40/MNUPRMT.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MNUPRMT.ANS rename to art/themes/luciano_blocktronics_40/MNUPRMT.ANS diff --git a/art/themes/luciano_blocktronics/40/MSEARCH.ANS b/art/themes/luciano_blocktronics_40/MSEARCH.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSEARCH.ANS rename to art/themes/luciano_blocktronics_40/MSEARCH.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGBODY.ANS b/art/themes/luciano_blocktronics_40/MSGBODY.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGBODY.ANS rename to art/themes/luciano_blocktronics_40/MSGBODY.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGDELPMPT.ANS b/art/themes/luciano_blocktronics_40/MSGDELPMPT.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGDELPMPT.ANS rename to art/themes/luciano_blocktronics_40/MSGDELPMPT.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGEFTR.ANS b/art/themes/luciano_blocktronics_40/MSGEFTR.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGEFTR.ANS rename to art/themes/luciano_blocktronics_40/MSGEFTR.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGEHDR.ANS b/art/themes/luciano_blocktronics_40/MSGEHDR.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGEHDR.ANS rename to art/themes/luciano_blocktronics_40/MSGEHDR.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGEHLP.ANS b/art/themes/luciano_blocktronics_40/MSGEHLP.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGEHLP.ANS rename to art/themes/luciano_blocktronics_40/MSGEHLP.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGEMFT.ANS b/art/themes/luciano_blocktronics_40/MSGEMFT.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGEMFT.ANS rename to art/themes/luciano_blocktronics_40/MSGEMFT.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGLIST.ANS b/art/themes/luciano_blocktronics_40/MSGLIST.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGLIST.ANS rename to art/themes/luciano_blocktronics_40/MSGLIST.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGMNU.ANS b/art/themes/luciano_blocktronics_40/MSGMNU.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGMNU.ANS rename to art/themes/luciano_blocktronics_40/MSGMNU.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGPMPT.ANS b/art/themes/luciano_blocktronics_40/MSGPMPT.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGPMPT.ANS rename to art/themes/luciano_blocktronics_40/MSGPMPT.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGQUOT.ANS b/art/themes/luciano_blocktronics_40/MSGQUOT.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGQUOT.ANS rename to art/themes/luciano_blocktronics_40/MSGQUOT.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGVFTR.ANS b/art/themes/luciano_blocktronics_40/MSGVFTR.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGVFTR.ANS rename to art/themes/luciano_blocktronics_40/MSGVFTR.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGVHDR.ANS b/art/themes/luciano_blocktronics_40/MSGVHDR.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGVHDR.ANS rename to art/themes/luciano_blocktronics_40/MSGVHDR.ANS diff --git a/art/themes/luciano_blocktronics/40/MSGVHLP.ANS b/art/themes/luciano_blocktronics_40/MSGVHLP.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSGVHLP.ANS rename to art/themes/luciano_blocktronics_40/MSGVHLP.ANS diff --git a/art/themes/luciano_blocktronics/40/MSRCHLST.ANS b/art/themes/luciano_blocktronics_40/MSRCHLST.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSRCHLST.ANS rename to art/themes/luciano_blocktronics_40/MSRCHLST.ANS diff --git a/art/themes/luciano_blocktronics/40/MSRCNORES.ANS b/art/themes/luciano_blocktronics_40/MSRCNORES.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MSRCNORES.ANS rename to art/themes/luciano_blocktronics_40/MSRCNORES.ANS diff --git a/art/themes/luciano_blocktronics/40/MYMSGLST.ANS b/art/themes/luciano_blocktronics_40/MYMSGLST.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/MYMSGLST.ANS rename to art/themes/luciano_blocktronics_40/MYMSGLST.ANS diff --git a/art/themes/luciano_blocktronics/40/NEWMSGS.ANS b/art/themes/luciano_blocktronics_40/NEWMSGS.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/NEWMSGS.ANS rename to art/themes/luciano_blocktronics_40/NEWMSGS.ANS diff --git a/art/themes/luciano_blocktronics/40/NODEMSG.ANS b/art/themes/luciano_blocktronics_40/NODEMSG.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/NODEMSG.ANS rename to art/themes/luciano_blocktronics_40/NODEMSG.ANS diff --git a/art/themes/luciano_blocktronics/40/NODEMSGFTR.ANS b/art/themes/luciano_blocktronics_40/NODEMSGFTR.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/NODEMSGFTR.ANS rename to art/themes/luciano_blocktronics_40/NODEMSGFTR.ANS diff --git a/art/themes/luciano_blocktronics/40/NODEMSGHDR.ANS b/art/themes/luciano_blocktronics_40/NODEMSGHDR.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/NODEMSGHDR.ANS rename to art/themes/luciano_blocktronics_40/NODEMSGHDR.ANS diff --git a/art/themes/luciano_blocktronics/40/NUA.ANS b/art/themes/luciano_blocktronics_40/NUA.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/NUA.ANS rename to art/themes/luciano_blocktronics_40/NUA.ANS diff --git a/art/themes/luciano_blocktronics/40/ONEADD.ANS b/art/themes/luciano_blocktronics_40/ONEADD.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/ONEADD.ANS rename to art/themes/luciano_blocktronics_40/ONEADD.ANS diff --git a/art/themes/luciano_blocktronics/40/ONELINER.ANS b/art/themes/luciano_blocktronics_40/ONELINER.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/ONELINER.ANS rename to art/themes/luciano_blocktronics_40/ONELINER.ANS diff --git a/art/themes/luciano_blocktronics/40/PAUSE.ANS b/art/themes/luciano_blocktronics_40/PAUSE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/PAUSE.ANS rename to art/themes/luciano_blocktronics_40/PAUSE.ANS diff --git a/art/themes/luciano_blocktronics/40/PRVMSGLIST.ANS b/art/themes/luciano_blocktronics_40/PRVMSGLIST.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/PRVMSGLIST.ANS rename to art/themes/luciano_blocktronics_40/PRVMSGLIST.ANS diff --git a/art/themes/luciano_blocktronics/40/RATEFILE.ANS b/art/themes/luciano_blocktronics_40/RATEFILE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/RATEFILE.ANS rename to art/themes/luciano_blocktronics_40/RATEFILE.ANS diff --git a/art/themes/luciano_blocktronics/40/RUMORADD.ANS b/art/themes/luciano_blocktronics_40/RUMORADD.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/RUMORADD.ANS rename to art/themes/luciano_blocktronics_40/RUMORADD.ANS diff --git a/art/themes/luciano_blocktronics/40/RUMORS.ANS b/art/themes/luciano_blocktronics_40/RUMORS.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/RUMORS.ANS rename to art/themes/luciano_blocktronics_40/RUMORS.ANS diff --git a/art/themes/luciano_blocktronics/40/SETFNSDATE.ANS b/art/themes/luciano_blocktronics_40/SETFNSDATE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/SETFNSDATE.ANS rename to art/themes/luciano_blocktronics_40/SETFNSDATE.ANS diff --git a/art/themes/luciano_blocktronics/40/SETMNSDATE.ANS b/art/themes/luciano_blocktronics_40/SETMNSDATE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/SETMNSDATE.ANS rename to art/themes/luciano_blocktronics_40/SETMNSDATE.ANS diff --git a/art/themes/luciano_blocktronics/40/STATUS.ANS b/art/themes/luciano_blocktronics_40/STATUS.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/STATUS.ANS rename to art/themes/luciano_blocktronics_40/STATUS.ANS diff --git a/art/themes/luciano_blocktronics/40/SYSSTAT.ANS b/art/themes/luciano_blocktronics_40/SYSSTAT.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/SYSSTAT.ANS rename to art/themes/luciano_blocktronics_40/SYSSTAT.ANS diff --git a/art/themes/luciano_blocktronics/40/TBRIDGE.ANS b/art/themes/luciano_blocktronics_40/TBRIDGE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/TBRIDGE.ANS rename to art/themes/luciano_blocktronics_40/TBRIDGE.ANS diff --git a/art/themes/luciano_blocktronics/40/TOONODE.ANS b/art/themes/luciano_blocktronics_40/TOONODE.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/TOONODE.ANS rename to art/themes/luciano_blocktronics_40/TOONODE.ANS diff --git a/art/themes/luciano_blocktronics/40/ULCHECK.ANS b/art/themes/luciano_blocktronics_40/ULCHECK.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/ULCHECK.ANS rename to art/themes/luciano_blocktronics_40/ULCHECK.ANS diff --git a/art/themes/luciano_blocktronics/40/ULDETAIL.ANS b/art/themes/luciano_blocktronics_40/ULDETAIL.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/ULDETAIL.ANS rename to art/themes/luciano_blocktronics_40/ULDETAIL.ANS diff --git a/art/themes/luciano_blocktronics/40/ULDUPES.ANS b/art/themes/luciano_blocktronics_40/ULDUPES.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/ULDUPES.ANS rename to art/themes/luciano_blocktronics_40/ULDUPES.ANS diff --git a/art/themes/luciano_blocktronics/40/ULNOAREA.ANS b/art/themes/luciano_blocktronics_40/ULNOAREA.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/ULNOAREA.ANS rename to art/themes/luciano_blocktronics_40/ULNOAREA.ANS diff --git a/art/themes/luciano_blocktronics/40/ULOPTS.ANS b/art/themes/luciano_blocktronics_40/ULOPTS.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/ULOPTS.ANS rename to art/themes/luciano_blocktronics_40/ULOPTS.ANS diff --git a/art/themes/luciano_blocktronics/40/USERACHIEV.ans b/art/themes/luciano_blocktronics_40/USERACHIEV.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/USERACHIEV.ans rename to art/themes/luciano_blocktronics_40/USERACHIEV.ans diff --git a/art/themes/luciano_blocktronics/40/USERLOG.ANS b/art/themes/luciano_blocktronics_40/USERLOG.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/USERLOG.ANS rename to art/themes/luciano_blocktronics_40/USERLOG.ANS diff --git a/art/themes/luciano_blocktronics/40/USERLST.ANS b/art/themes/luciano_blocktronics_40/USERLST.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/USERLST.ANS rename to art/themes/luciano_blocktronics_40/USERLST.ANS diff --git a/art/themes/luciano_blocktronics/40/WHOSON.ANS b/art/themes/luciano_blocktronics_40/WHOSON.ANS similarity index 100% rename from art/themes/luciano_blocktronics/40/WHOSON.ANS rename to art/themes/luciano_blocktronics_40/WHOSON.ANS diff --git a/art/themes/luciano_blocktronics/40/achievement_global_footer.ans b/art/themes/luciano_blocktronics_40/achievement_global_footer.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/achievement_global_footer.ans rename to art/themes/luciano_blocktronics_40/achievement_global_footer.ans diff --git a/art/themes/luciano_blocktronics/40/achievement_global_header.ans b/art/themes/luciano_blocktronics_40/achievement_global_header.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/achievement_global_header.ans rename to art/themes/luciano_blocktronics_40/achievement_global_header.ans diff --git a/art/themes/luciano_blocktronics/40/achievement_local_footer.ans b/art/themes/luciano_blocktronics_40/achievement_local_footer.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/achievement_local_footer.ans rename to art/themes/luciano_blocktronics_40/achievement_local_footer.ans diff --git a/art/themes/luciano_blocktronics/40/achievement_local_header.ans b/art/themes/luciano_blocktronics_40/achievement_local_header.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/achievement_local_header.ans rename to art/themes/luciano_blocktronics_40/achievement_local_header.ans diff --git a/art/themes/luciano_blocktronics/40/autosig.ans b/art/themes/luciano_blocktronics_40/autosig.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/autosig.ans rename to art/themes/luciano_blocktronics_40/autosig.ans diff --git a/art/themes/luciano_blocktronics/40/mb_export_dl_queue.ans b/art/themes/luciano_blocktronics_40/mb_export_dl_queue.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/mb_export_dl_queue.ans rename to art/themes/luciano_blocktronics_40/mb_export_dl_queue.ans diff --git a/art/themes/luciano_blocktronics/40/mrc.ans b/art/themes/luciano_blocktronics_40/mrc.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/mrc.ans rename to art/themes/luciano_blocktronics_40/mrc.ans diff --git a/art/themes/luciano_blocktronics/40/offline_mail.ans b/art/themes/luciano_blocktronics_40/offline_mail.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/offline_mail.ans rename to art/themes/luciano_blocktronics_40/offline_mail.ans diff --git a/art/themes/luciano_blocktronics/40/qwk_export_progress.ans b/art/themes/luciano_blocktronics_40/qwk_export_progress.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/qwk_export_progress.ans rename to art/themes/luciano_blocktronics_40/qwk_export_progress.ans diff --git a/art/themes/luciano_blocktronics/40/theme.hjson b/art/themes/luciano_blocktronics_40/theme.hjson similarity index 100% rename from art/themes/luciano_blocktronics/40/theme.hjson rename to art/themes/luciano_blocktronics_40/theme.hjson diff --git a/art/themes/luciano_blocktronics/40/wfc.ans b/art/themes/luciano_blocktronics_40/wfc.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/wfc.ans rename to art/themes/luciano_blocktronics_40/wfc.ans diff --git a/art/themes/luciano_blocktronics/40/wfchelp.ans b/art/themes/luciano_blocktronics_40/wfchelp.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/wfchelp.ans rename to art/themes/luciano_blocktronics_40/wfchelp.ans diff --git a/art/themes/luciano_blocktronics/40/wfckicknodeprompt.ans b/art/themes/luciano_blocktronics_40/wfckicknodeprompt.ans similarity index 100% rename from art/themes/luciano_blocktronics/40/wfckicknodeprompt.ans rename to art/themes/luciano_blocktronics_40/wfckicknodeprompt.ans diff --git a/core/login_server_module.js b/core/login_server_module.js index 1939601b..9f8b1be6 100644 --- a/core/login_server_module.js +++ b/core/login_server_module.js @@ -11,6 +11,7 @@ const UserProps = require('./user_property.js'); // deps const _ = require('lodash'); const moment = require('moment'); +const Log = require('./logger.js'); module.exports = class LoginServerModule extends ServerModule { constructor() { @@ -30,10 +31,12 @@ module.exports = class LoginServerModule extends ServerModule { // Choose initial theme before we have user context // const preLoginTheme = _.get(Config(), 'theme.preLogin'); - if ('*' === preLoginTheme) { + const selectedTheme = theme.findMatching(client, preLoginTheme); + + if ('*' === selectedTheme) { client.user.properties[UserProps.ThemeId] = theme.getRandomTheme() || ''; } else { - client.user.properties[UserProps.ThemeId] = preLoginTheme; + client.user.properties[UserProps.ThemeId] = selectedTheme; } theme.setClientTheme(client, client.user.properties[UserProps.ThemeId]); diff --git a/core/nua.js b/core/nua.js index 9eabc232..4e11ed69 100644 --- a/core/nua.js +++ b/core/nua.js @@ -118,10 +118,12 @@ exports.getModule = class NewUserAppModule extends MenuModule { }; const defaultTheme = _.get(config, 'theme.default'); - if ('*' === defaultTheme) { + const selectedTheme = theme.findMatching(self.client, defaultTheme); + + if ('*' === selectedTheme) { newUser.properties[UserProps.ThemeId] = theme.getRandomTheme(); } else { - newUser.properties[UserProps.ThemeId] = defaultTheme; + newUser.properties[UserProps.ThemeId] = selectedTheme; } // :TODO: User.create() should validate email uniqueness! diff --git a/core/theme.js b/core/theme.js index a08ccd39..9a30c467 100644 --- a/core/theme.js +++ b/core/theme.js @@ -14,6 +14,7 @@ const UserProps = require('./user_property.js'); const ConfigLoader = require('./config_loader'); const { getConfigPath } = require('./config_util'); +const theme = require('./theme.js'); // deps const fs = require('graceful-fs'); @@ -26,6 +27,8 @@ exports.getThemeArt = getThemeArt; exports.getAvailableThemes = getAvailableThemes; exports.getRandomTheme = getRandomTheme; exports.setClientTheme = setClientTheme; +exports.findMatching = findMatching; +exports.selectDefaultTheme = selectDefaultTheme; exports.displayPreparedArt = displayPreparedArt; exports.displayThemeArt = displayThemeArt; exports.displayThemedPause = displayThemedPause; @@ -415,6 +418,34 @@ function getRandomTheme() { return themeIds[Math.floor(Math.random() * themeIds.length)]; } } +function selectDefaultTheme(client) { + const selectedTheme = theme.findMatching(client, Config().theme.default); + if ('*' === selectedTheme) { + return theme.getRandomTheme() || ''; + } else { + return selectedTheme; + } + +} + +function findMatching(client, themeSection) { + if (!(_.isArray(themeSection))) { + Log.debug({ theme: themeSection }, 'Setting the theme from a simple string'); + return themeSection; + } + + Log.debug('Finding a matching theme from ACS settings'); + const matchingTheme = client.acs.getConditionalValue(themeSection, 'name'); + if (_.isNil(matchingTheme)) { + Log.warn('No matching theme in configuration found.'); + // Default to random if nothing found + return '*'; + } + else { + Log.debug({ theme: matchingTheme }, 'Found matching theme'); + return matchingTheme; + } +} function setClientTheme(client, themeId) { const availThemes = getAvailableThemes(); @@ -422,10 +453,11 @@ function setClientTheme(client, themeId) { let msg; let setThemeId; const config = Config(); + const defaultTheme = selectDefaultTheme(client); if (availThemes.has(themeId)) { msg = 'Set client theme'; setThemeId = themeId; - } else if (availThemes.has(config.theme.default)) { + } else if (availThemes.has(defaultTheme)) { msg = 'Failed setting theme by supplied ID; Using default'; setThemeId = config.theme.default; } else { @@ -461,7 +493,9 @@ function getThemeArt(options, cb) { options.themeId = options.client.user.properties[UserProps.ThemeId]; } - options.themeId = options.themeId || config.theme.default; + if (!options.themeId) { + options.themeId = this.selectDefaultTheme(options.client); + } // :TODO: replace asAnsi stuff with something like retrieveAs = 'ansi' | 'pipe' | ... // :TODO: Some of these options should only be set if not provided! @@ -514,8 +548,8 @@ function getThemeArt(options, cb) { if (artInfo || config.theme.default === options.themeId) { return callback(null, artInfo); } - - options.basePath = paths.join(config.paths.themes, config.theme.default); + const defaultTheme = selectDefaultTheme(options.client); + options.basePath = paths.join(config.paths.themes, defaultTheme); art.getArt(options.name, options, (err, artInfo) => { return callback(null, artInfo); });