From c97989ac767225d1148670162c026e47be258bfc Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Tue, 9 Apr 2024 19:19:40 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E8=81=94=E6=9C=BA=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E7=9A=84=E6=89=A9=E5=B1=95=E5=8A=A0=E8=BD=BD=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/init/index.js | 6 +++--- noname/init/onload.js | 40 +++++++++++++++++----------------------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/noname/init/index.js b/noname/init/index.js index 5ea3777a0..e2e662a55 100644 --- a/noname/init/index.js +++ b/noname/init/index.js @@ -441,13 +441,13 @@ export async function boot() { //lib.init.onload=backup_onload; _status.evaluatingExtension = false; } - else if (config.get('mode') != 'connect' || (!localStorage.getItem(lib.configprefix + 'directstart') && show_splash)) { + else if (!localStorage.getItem(lib.configprefix + 'directstart') && show_splash) { extensionlist.push(config.get('extensions')[name]); } } } else { - if (config.get('mode') != 'connect' || (!localStorage.getItem(lib.configprefix + 'directstart') && show_splash)) { + if (!localStorage.getItem(lib.configprefix + 'directstart') && show_splash) { for (var name = 0; name < config.get('extensions').length; name++) { if (Reflect.get(window, 'bannedExtensions').includes(config.get('extensions')[name])) { continue; @@ -576,7 +576,7 @@ export async function boot() { Reflect.get(ui, 'css')[stylesName[i]] = stylesLoaded[i]; } - if (extensionlist.length && (config.get('mode') != 'connect' || show_splash)) { + if (extensionlist.length) { _status.extensionLoading = []; _status.extensionLoaded = []; diff --git a/noname/init/onload.js b/noname/init/onload.js index 51c615a03..a58a207fa 100644 --- a/noname/init/onload.js +++ b/noname/init/onload.js @@ -675,33 +675,27 @@ export async function onload(resetGameTimeout) { clickedNode = true; lib.config.mode = this.link; game.saveConfig('mode', this.link); - if (this.link === 'connect') { - localStorage.setItem(lib.configprefix + 'directstart', true); - game.reload(); + if (game.layout != 'mobile' && lib.layoutfixed.indexOf(lib.config.mode) !== -1) { + game.layout = 'mobile'; + ui.css.layout.href = lib.assetURL + 'layout/' + game.layout + '/layout.css'; } - else { - if (game.layout != 'mobile' && lib.layoutfixed.indexOf(lib.config.mode) !== -1) { - game.layout = 'mobile'; + else if (game.layout == 'mobile' && lib.config.layout != 'mobile' && lib.layoutfixed.indexOf(lib.config.mode) === -1) { + game.layout = lib.config.layout; + if (game.layout == 'default') { + ui.css.layout.href = ''; + } + else { ui.css.layout.href = lib.assetURL + 'layout/' + game.layout + '/layout.css'; } - else if (game.layout == 'mobile' && lib.config.layout != 'mobile' && lib.layoutfixed.indexOf(lib.config.mode) === -1) { - game.layout = lib.config.layout; - if (game.layout == 'default') { - ui.css.layout.href = ''; - } - else { - ui.css.layout.href = lib.assetURL + 'layout/' + game.layout + '/layout.css'; - } - } - splash.delete(1000); - delete window.inSplash; - // 这不好删/m/,顺带lib.init.reset也不好删 - window.resetGameTimeout = setTimeout(lib.init.reset, 10000); - - this.listenTransition(function () { - lib.init.js(lib.assetURL + 'mode', lib.config.mode, proceed); - }, 500); } + splash.delete(1000); + delete window.inSplash; + // 这不好删/m/,顺带lib.init.reset也不好删 + window.resetGameTimeout = setTimeout(lib.init.reset, 10000); + + this.listenTransition(function () { + lib.init.js(lib.assetURL + 'mode', lib.config.mode, proceed); + }, 500); } var downNode = function () { this.classList.add('glow');