From e3e04e0f73f421f6218c1de5dc60184f91695bcc Mon Sep 17 00:00:00 2001 From: IceCola <739201322@qq.com> Date: Thu, 16 May 2024 23:40:35 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=B8=BA=E6=9B=B4=E6=96=B0=E5=90=8E?= =?UTF-8?q?=E9=A6=96=E6=AC=A1=E5=90=AF=E5=8A=A8=E6=B7=BB=E5=8A=A0=E6=89=A9?= =?UTF-8?q?=E5=B1=95=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA=EF=BC=9B=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=B9=8B=E5=89=8D=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/shenhua/skill.js | 8 +++----- noname/init/index.js | 37 ++++++++++++++++++++++++------------- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/character/shenhua/skill.js b/character/shenhua/skill.js index dd594404e..5949c2aef 100644 --- a/character/shenhua/skill.js +++ b/character/shenhua/skill.js @@ -845,7 +845,6 @@ const skills = { return get.prompt("xinfu_zuilun") + "(可获得" + get.cnNumber(num) + "张牌)"; }, async content(event, trigger, player) { - "step 0"; let num = 0; const cards = get.cards(3); await game.cardsGotoOrdering(cards); @@ -1389,7 +1388,6 @@ const skills = { return get.type(event.card) == "trick" && event.targets.length > 1 && player.countCards("he") > 0; }, async cost(event, trigger, player) { - "step 0"; event.result = await player .chooseCardTarget({ filterCard: true, @@ -1590,7 +1588,6 @@ const skills = { return player.countCards("he") > 0; }, async cost(event, trigger, player) { - "step 0"; event.result = await player .chooseCard(get.prompt("kongsheng"), "将任意张牌置于武将牌上", "he", [1, player.countCards("he")]) .set("ai", function (card) { @@ -1630,13 +1627,13 @@ const skills = { return get.type(i, false) == "equip" && player.hasUseTarget(i); }); if (cards.length > 0) { - let card = cards[0]; + let [card] = cards; if (cards.length > 1) { const { result } = await player.chooseButton(true, ["选择要使用的装备牌", cards]).set("ai", function (button) { return get.order(button.link); }); if (!result.bool) continue; - card = result.links[0]; + [card] = result.links; } await player.chooseUseTarget(card, true); } else break; @@ -1961,6 +1958,7 @@ const skills = { combo: "nzry_huaiju", }, }, + // ----- 审查分界线喵 ----- 上面的代码已经经过了审查喵 nzry_kuizhu: { audio: 2, trigger: { diff --git a/noname/init/index.js b/noname/init/index.js index ae4f58fc8..e53c54fe5 100644 --- a/noname/init/index.js +++ b/noname/init/index.js @@ -513,6 +513,8 @@ export async function boot() { } delete _status.htmlbg; + const isFirstStartAfterUpdate = !!window.noname_update; + // 无名杀更新日志 if (window.noname_update) { Reflect.set(lib, "version", window.noname_update.version); @@ -527,7 +529,7 @@ export async function boot() { html`
${description.author.login}于${description.published_at}发布 `.trim(), @@ -633,6 +635,7 @@ export async function boot() { for (const promise of _status.extensionLoading) { await promise.catch(async (error) => { if (extErrorList.includes(error)) return; + extErrorList.add(error); if (!promiseErrorHandler || !promiseErrorHandler.onHandle) return; // @ts-ignore await promiseErrorHandler.onHandle({ promise }); @@ -640,6 +643,14 @@ export async function boot() { } // await Promise.allSettled(_status.extensionLoading); + if (isFirstStartAfterUpdate && extErrorList.length) { + const stacktraces = extErrorList.map(e => e instanceof Error ? e.stack : String(e)).join("\n\n") + // game.saveConfig("update_first_log", stacktraces); + if(confirm(`扩展加载出错!是否重新载入游戏?\n本次更新可能导致了扩展出现了错误:\n${stacktraces}`)){ + game.reload(); + } + } + _status.extensionLoaded .filter((name) => game.hasExtension(name)) .forEach((name) => { @@ -778,18 +789,18 @@ function initSheet(libConfig) { } Reflect.get(ui, "css").border_stylesheet.sheet.insertRule( '#window .player>.framebg,#window #arena.long.mobile:not(.fewplayer) .player[data-position="0"]>.framebg{display:block;background-image:url("' + - lib.assetURL + - "theme/style/player/" + - bstyle + - '1.png")}', + lib.assetURL + + "theme/style/player/" + + bstyle + + '1.png")}', 0 ); Reflect.get(ui, "css").border_stylesheet.sheet.insertRule( '#window #arena.long:not(.fewplayer) .player>.framebg, #arena.oldlayout .player>.framebg{background-image:url("' + - lib.assetURL + - "theme/style/player/" + - bstyle + - '3.png")}', + lib.assetURL + + "theme/style/player/" + + bstyle + + '3.png")}', 0 ); Reflect.get(ui, "css").border_stylesheet.sheet.insertRule( @@ -818,14 +829,14 @@ function initSheet(libConfig) { if (libConfig.control_style == "wood") { Reflect.get(ui, "css").control_stylesheet = lib.init.sheet( "#window .control,#window .menubutton,#window #system>div>div,#window #system>div>.pressdown2{background-image:" + - str + - "}" + str + + "}" ); } else { Reflect.get(ui, "css").control_stylesheet = lib.init.sheet( "#window .control,.menubutton:not(.active):not(.highlight):not(.red):not(.blue),#window #system>div>div{background-image:" + - str + - "}" + str + + "}" ); } } From c3fe4591c65a222922f931eb5c55be9757ba8427 Mon Sep 17 00:00:00 2001 From: IceCola <739201322@qq.com> Date: Fri, 17 May 2024 00:07:45 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=A1=A5=E5=85=85=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=9B=E5=87=8F=E5=B0=91diff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/init/index.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/noname/init/index.js b/noname/init/index.js index e53c54fe5..730127f5c 100644 --- a/noname/init/index.js +++ b/noname/init/index.js @@ -513,8 +513,6 @@ export async function boot() { } delete _status.htmlbg; - const isFirstStartAfterUpdate = !!window.noname_update; - // 无名杀更新日志 if (window.noname_update) { Reflect.set(lib, "version", window.noname_update.version); @@ -529,7 +527,7 @@ export async function boot() { html` ${description.author.login}于${description.published_at}发布 `.trim(), @@ -643,11 +641,15 @@ export async function boot() { } // await Promise.allSettled(_status.extensionLoading); + const isFirstStartAfterUpdate = lib.version && lib.version != lib.config.version; + if (isFirstStartAfterUpdate && extErrorList.length) { const stacktraces = extErrorList.map(e => e instanceof Error ? e.stack : String(e)).join("\n\n") // game.saveConfig("update_first_log", stacktraces); - if(confirm(`扩展加载出错!是否重新载入游戏?\n本次更新可能导致了扩展出现了错误:\n${stacktraces}`)){ + if(confirm(`扩展加载出错!是否重新载入游戏?\n本次更新可能导致了扩展出现了错误:\n\n${stacktraces}`)){ game.reload(); + clearTimeout(resetGameTimeout); + return; } } @@ -788,11 +790,11 @@ function initSheet(libConfig) { bstyle = bstyle.slice(7); } Reflect.get(ui, "css").border_stylesheet.sheet.insertRule( - '#window .player>.framebg,#window #arena.long.mobile:not(.fewplayer) .player[data-position="0"]>.framebg{display:block;background-image:url("' + - lib.assetURL + - "theme/style/player/" + - bstyle + - '1.png")}', + '#window .player>.framebg,#window #arena.long.mobile:not(.fewplayer) .player[data-position="0"]>.framebg{display:block;background-image:url("' + + lib.assetURL + + "theme/style/player/" + + bstyle + + '1.png")}', 0 ); Reflect.get(ui, "css").border_stylesheet.sheet.insertRule( @@ -829,14 +831,14 @@ function initSheet(libConfig) { if (libConfig.control_style == "wood") { Reflect.get(ui, "css").control_stylesheet = lib.init.sheet( "#window .control,#window .menubutton,#window #system>div>div,#window #system>div>.pressdown2{background-image:" + - str + - "}" + str + + "}" ); } else { Reflect.get(ui, "css").control_stylesheet = lib.init.sheet( "#window .control,.menubutton:not(.active):not(.highlight):not(.red):not(.blue),#window #system>div>div{background-image:" + - str + - "}" + str + + "}" ); } } From ca2c46701edebde3f8c4dd2e378631a5f4f66b9b Mon Sep 17 00:00:00 2001 From: IceCola <739201322@qq.com> Date: Fri, 17 May 2024 00:34:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=BF=BD=E5=8A=A0url=E6=9E=84=E9=80=A0?= =?UTF-8?q?=EF=BC=9B=E5=8E=BB=E9=99=A4diff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/init/index.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/noname/init/index.js b/noname/init/index.js index 730127f5c..8a5980931 100644 --- a/noname/init/index.js +++ b/noname/init/index.js @@ -66,14 +66,18 @@ export function sendUpdate() { if (nonameInitialized && nonameInitialized.includes("com.noname.shijian") && window.noname_shijianInterfaces && typeof window.noname_shijianInterfaces.sendUpdate === 'function') { // 给诗笺版apk的java层传递升级完成的信息 // @ts-ignore - return window.noname_shijianInterfaces.sendUpdate() + "?sendUpdate=true"; + const url = new URL(window.noname_shijianInterfaces.sendUpdate()); + url.searchParams.set("sendUpdate", "true"); + return url.toString(); } // 由理版判断 // @ts-ignore if (window.NonameAndroidBridge && typeof window.NonameAndroidBridge.sendUpdate === 'function') { // 给由理版apk的java层传递升级完成的信息 // @ts-ignore - return window.NonameAndroidBridge.sendUpdate() + "?sendUpdate=true"; + const url = new URL(window.NonameAndroidBridge.sendUpdate()); + url.searchParams.set("sendUpdate", "true"); + return url.toString(); } } // 电脑端 @@ -790,7 +794,7 @@ function initSheet(libConfig) { bstyle = bstyle.slice(7); } Reflect.get(ui, "css").border_stylesheet.sheet.insertRule( - '#window .player>.framebg,#window #arena.long.mobile:not(.fewplayer) .player[data-position="0"]>.framebg{display:block;background-image:url("' + + '#window .player>.framebg,#window #arena.long.mobile:not(.fewplayer) .player[data-position="0"]>.framebg{display:block;background-image:url("' + lib.assetURL + "theme/style/player/" + bstyle + @@ -799,10 +803,10 @@ function initSheet(libConfig) { ); Reflect.get(ui, "css").border_stylesheet.sheet.insertRule( '#window #arena.long:not(.fewplayer) .player>.framebg, #arena.oldlayout .player>.framebg{background-image:url("' + - lib.assetURL + - "theme/style/player/" + - bstyle + - '3.png")}', + lib.assetURL + + "theme/style/player/" + + bstyle + + '3.png")}', 0 ); Reflect.get(ui, "css").border_stylesheet.sheet.insertRule(