From 06eb1b7cb852d1e0160cbba54d48255709a8f226 Mon Sep 17 00:00:00 2001 From: keyframes <68995302+7754496@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:33:04 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=89=A9=E5=B1=95=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 扩展的content和precontent载入失败后会弹窗提示,显示报错信息 报错信息格式: alert(`扩展${lib.extensions[i][0]}载入失败\ncontentError\n${decodeURI(e.stack)}`); --- noname/game/index.js | 14 ++++++++++---- noname/init/onload.js | 6 +++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/noname/game/index.js b/noname/game/index.js index f8e339b0e..9e2405a4f 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -1880,11 +1880,17 @@ export class Game extends Uninstantable { help: help, config: objectConfig } - if (precontent) { - _status.extension = name; - await (gnc.is.generatorFunc(precontent) ? gnc.of(precontent) : precontent).call(object, config); - delete _status.extension; + try{ + if (precontent) { + _status.extension = name; + + await (gnc.is.generatorFunc(precontent) ? gnc.of(precontent) : precontent).call(object, config); + delete _status.extension; + } + }catch(e1){ + alert(`扩展${name}载入失败\nprecontentError\n${decodeURI(e1.stack)}`); } + if (content) lib.extensions.push([name, content, config, _status.evaluatingExtension, objectPackage || {}]); } catch (e) { diff --git a/noname/init/onload.js b/noname/init/onload.js index ab3e67cdd..068a6ac79 100644 --- a/noname/init/onload.js +++ b/noname/init/onload.js @@ -587,7 +587,11 @@ export async function onload(resetGameTimeout) { _status.extension = lib.extensions[i][0]; _status.evaluatingExtension = lib.extensions[i][3]; if (typeof lib.extensions[i][1] == "function") - await (gnc.is.coroutine(lib.extensions[i][1]) ? gnc.of(lib.extensions[i][1]) : lib.extensions[i][1]).call(lib.extensions[i], lib.extensions[i][2], lib.extensions[i][4]); + try{ + await (gnc.is.coroutine(lib.extensions[i][1]) ? gnc.of(lib.extensions[i][1]) : lib.extensions[i][1]).call(lib.extensions[i], lib.extensions[i][2], lib.extensions[i][4]); + }catch(e){ + alert(`扩展${lib.extensions[i][0]}载入失败\ncontentError\n${decodeURI(e.stack)}`); + } if (lib.extensions[i][4]) { if (lib.extensions[i][4].character) { for (var j in lib.extensions[i][4].character.character) { From 81d7c9e56fbdd8320a23521ae33e125917110ecc Mon Sep 17 00:00:00 2001 From: keyframes <68995302+7754496@users.noreply.github.com> Date: Thu, 15 Feb 2024 13:57:51 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E6=89=A9=E5=B1=95=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 扩展的content和precontent载入失败后会弹窗提示,显示报错信息 报错信息格式: alert(`扩展${lib.extensions[i][0]}载入失败\ncontentError\n${decodeURI(e.stack)}`); --- noname/game/index.js | 14 ++++++++++---- noname/init/onload.js | 6 +++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/noname/game/index.js b/noname/game/index.js index f8e339b0e..9e2405a4f 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -1880,11 +1880,17 @@ export class Game extends Uninstantable { help: help, config: objectConfig } - if (precontent) { - _status.extension = name; - await (gnc.is.generatorFunc(precontent) ? gnc.of(precontent) : precontent).call(object, config); - delete _status.extension; + try{ + if (precontent) { + _status.extension = name; + + await (gnc.is.generatorFunc(precontent) ? gnc.of(precontent) : precontent).call(object, config); + delete _status.extension; + } + }catch(e1){ + alert(`扩展${name}载入失败\nprecontentError\n${decodeURI(e1.stack)}`); } + if (content) lib.extensions.push([name, content, config, _status.evaluatingExtension, objectPackage || {}]); } catch (e) { diff --git a/noname/init/onload.js b/noname/init/onload.js index ab3e67cdd..068a6ac79 100644 --- a/noname/init/onload.js +++ b/noname/init/onload.js @@ -587,7 +587,11 @@ export async function onload(resetGameTimeout) { _status.extension = lib.extensions[i][0]; _status.evaluatingExtension = lib.extensions[i][3]; if (typeof lib.extensions[i][1] == "function") - await (gnc.is.coroutine(lib.extensions[i][1]) ? gnc.of(lib.extensions[i][1]) : lib.extensions[i][1]).call(lib.extensions[i], lib.extensions[i][2], lib.extensions[i][4]); + try{ + await (gnc.is.coroutine(lib.extensions[i][1]) ? gnc.of(lib.extensions[i][1]) : lib.extensions[i][1]).call(lib.extensions[i], lib.extensions[i][2], lib.extensions[i][4]); + }catch(e){ + alert(`扩展${lib.extensions[i][0]}载入失败\ncontentError\n${decodeURI(e.stack)}`); + } if (lib.extensions[i][4]) { if (lib.extensions[i][4].character) { for (var j in lib.extensions[i][4].character.character) { From 7a2643986b98f1221a82f9422aaaac60a992e46b Mon Sep 17 00:00:00 2001 From: keyframes <68995302+7754496@users.noreply.github.com> Date: Thu, 15 Feb 2024 14:59:22 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E6=89=A9=E5=B1=95=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=A4=B1=E8=B4=A5=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 扩展的content和precontent载入失败后会弹窗提示,显示报错信息 报错信息格式: alert(`扩展${lib.extensions[i][0]}载入失败\ncontentError\n${decodeURI(e.stack)}`); --- noname/game/index.js | 14 ++++++++++---- noname/init/onload.js | 6 +++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/noname/game/index.js b/noname/game/index.js index f8e339b0e..9e2405a4f 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -1880,11 +1880,17 @@ export class Game extends Uninstantable { help: help, config: objectConfig } - if (precontent) { - _status.extension = name; - await (gnc.is.generatorFunc(precontent) ? gnc.of(precontent) : precontent).call(object, config); - delete _status.extension; + try{ + if (precontent) { + _status.extension = name; + + await (gnc.is.generatorFunc(precontent) ? gnc.of(precontent) : precontent).call(object, config); + delete _status.extension; + } + }catch(e1){ + alert(`扩展${name}载入失败\nprecontentError\n${decodeURI(e1.stack)}`); } + if (content) lib.extensions.push([name, content, config, _status.evaluatingExtension, objectPackage || {}]); } catch (e) { diff --git a/noname/init/onload.js b/noname/init/onload.js index ab3e67cdd..068a6ac79 100644 --- a/noname/init/onload.js +++ b/noname/init/onload.js @@ -587,7 +587,11 @@ export async function onload(resetGameTimeout) { _status.extension = lib.extensions[i][0]; _status.evaluatingExtension = lib.extensions[i][3]; if (typeof lib.extensions[i][1] == "function") - await (gnc.is.coroutine(lib.extensions[i][1]) ? gnc.of(lib.extensions[i][1]) : lib.extensions[i][1]).call(lib.extensions[i], lib.extensions[i][2], lib.extensions[i][4]); + try{ + await (gnc.is.coroutine(lib.extensions[i][1]) ? gnc.of(lib.extensions[i][1]) : lib.extensions[i][1]).call(lib.extensions[i], lib.extensions[i][2], lib.extensions[i][4]); + }catch(e){ + alert(`扩展${lib.extensions[i][0]}载入失败\ncontentError\n${decodeURI(e.stack)}`); + } if (lib.extensions[i][4]) { if (lib.extensions[i][4].character) { for (var j in lib.extensions[i][4].character.character) { From 7b1b836a1ee45ee68265ec5330df67c286a5814f Mon Sep 17 00:00:00 2001 From: lieren2023 <131325076+lieren2023@users.noreply.github.com> Date: Fri, 16 Feb 2024 07:16:00 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=89=8B=E6=9D=80=E7=95=8C=E9=A2=9C?= =?UTF-8?q?=E8=89=AF=E6=96=87=E4=B8=91=E8=AF=AD=E9=9F=B3=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/refresh.js | 2 +- character/shenhua.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/character/refresh.js b/character/refresh.js index ec9947263..7d72b8204 100755 --- a/character/refresh.js +++ b/character/refresh.js @@ -11445,7 +11445,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ group:['reshuangxiong1',"reshuangxiong2"], }, reshuangxiong1:{ - audio:"shuangxiong1", + audio:"shuangxiong", audioname:['re_yanwen'], trigger:{ player:"phaseDrawBegin1", diff --git a/character/shenhua.js b/character/shenhua.js index ffc7ce0a6..772234fcc 100755 --- a/character/shenhua.js +++ b/character/shenhua.js @@ -5942,7 +5942,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ group:'shuangxiong1', }, shuangxiong1:{ - audio:true, + audio:"shuangxiong", audioname:['re_yanwen'], trigger:{player:'phaseDrawBegin1'}, check:function(event,player){ @@ -5968,7 +5968,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ shuangxiong2:{ charlotte:true, onremove:true, - audio:true, + audio:"shuangxiong", audioname:['re_yanwen'], enable:'chooseToUse', viewAs:{name:'juedou'}, From ed7304d4cadb7d78bf9da6abb69d20704e875f4d Mon Sep 17 00:00:00 2001 From: lieren2023 <131325076+lieren2023@users.noreply.github.com> Date: Fri, 16 Feb 2024 07:19:00 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E8=B0=8B=E5=8D=A7=E9=BE=99=E7=9C=8B?= =?UTF-8?q?=E7=A0=B4=E8=AE=B0=E5=BD=95=E6=8C=89=E9=92=AE=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sb.js | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/character/sb.js b/character/sb.js index dedf6de5a..c2246166b 100644 --- a/character/sb.js +++ b/character/sb.js @@ -1321,31 +1321,26 @@ game.import('character',function(lib,game,ui,get,ai,_status){ const event=get.event(); const controls=[link=>{ const evt=get.event(); - if(link=='cancel2') ui.click.cancel(); - else{ - if(evt.dialog&&evt.dialog.buttons){ - for(let i=0;i{ - return ui.create.control(controls.concat(control=='清除选择'?[control,'stayleft']:control)); - }); + event.controls=[ui.create.control(controls.concat(['清除选择','stayleft']))]; }; if(event.isMine()) func(); else if(event.isOnline()) event.player.send(func); - var result=yield player.chooseButton(['看破:是否记录至多'+get.cnNumber(sum)+'个牌名?',[list,'vcard']],[1,sum],true).set('ai',function(button){ + var result=yield player.chooseButton(['看破:是否记录至多'+get.cnNumber(sum)+'个牌名?',[list,'vcard']],[1,sum],false).set('ai',function(button){ if(ui.selected.buttons.length>=Math.max(3,game.countPlayer()/2)) return 0; switch(button.link[2]){ case 'wuxie':return 5+Math.random(); @@ -1385,7 +1380,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ } if(!ui.selected.buttons.length){ const evt=event.parent; - if(evt.controls) evt.controls[0].hide(); + if(evt.controls) evt.controls[0].classList.add('disabled'); } }, }, @@ -1409,7 +1404,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ counterNode.style.bottom='2px'; } const evt=event.parent; - if(evt.controls) evt.controls[0].show(); + if(evt.controls) evt.controls[0].classList.remove('disabled'); game.check(); }, } From 2cc8a57a6ab0875ae8eea7406dc7e858894f009d Mon Sep 17 00:00:00 2001 From: lieren2023 <131325076+lieren2023@users.noreply.github.com> Date: Fri, 16 Feb 2024 14:50:08 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=BE=9C=E7=96=86=E6=8A=80=E8=83=BD?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- character/sp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/character/sp.js b/character/sp.js index a22549190..30aa3bd94 100755 --- a/character/sp.js +++ b/character/sp.js @@ -26854,7 +26854,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){ spolzhouxuan_info:'①弃牌阶段开始时,你可将任意张置于武将牌上,称为“旋”(你至多拥有五张“旋”)。②当你使用牌时,你随机将一张“旋”置入弃牌堆,然后摸一张牌(若你的手牌数不为全场唯一最多则额外摸X张牌,X为“旋”数)。③出牌阶段结束时,你将所有“旋”置入弃牌堆。', wuyan:'吾彦', lanjiang:'澜疆', - lanjiang_info:'结束阶段,你可以选择所有手牌数不小于你的角色。这些角色依次选择是否令你摸一张牌。然后你可以对其中一名手牌数等于你的角色造成1点伤害,随后可以对其中一名手牌数小于你的角色摸一张牌。', + lanjiang_info:'结束阶段,你可以选择所有手牌数不小于你的角色。这些角色依次选择是否令你摸一张牌。然后你可以对其中一名手牌数等于你的角色造成1点伤害,随后可以令其中一名手牌数小于你的角色摸一张牌。', ol_zhuling:'OL朱灵', ol_zhuling_prefix:'OL', jixian:'急陷', From 4d8bccaf7a9d1ed8719214a28266102bcdbee852 Mon Sep 17 00:00:00 2001 From: Spmario233 Date: Fri, 16 Feb 2024 18:15:29 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BB=8E=E8=AF=AD=E6=96=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=A9=E5=B1=95=E5=8A=A0=E8=BD=BD=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- noname/game/index.js | 2 +- noname/init/onload.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/noname/game/index.js b/noname/game/index.js index da1ea9656..74e047a89 100644 --- a/noname/game/index.js +++ b/noname/game/index.js @@ -1888,7 +1888,7 @@ export class Game extends Uninstantable { delete _status.extension; } }catch(e1){ - alert(`扩展${name}载入失败\nprecontentError\n${decodeURI(e1.stack)}`); + alert(`加载《${name}》扩展的precontent时出错。\n${decodeURI(e1.stack)}`); } if (content) lib.extensions.push([name, content, config, _status.evaluatingExtension, objectPackage || {}]); diff --git a/noname/init/onload.js b/noname/init/onload.js index 068a6ac79..9d615b60e 100644 --- a/noname/init/onload.js +++ b/noname/init/onload.js @@ -590,7 +590,7 @@ export async function onload(resetGameTimeout) { try{ await (gnc.is.coroutine(lib.extensions[i][1]) ? gnc.of(lib.extensions[i][1]) : lib.extensions[i][1]).call(lib.extensions[i], lib.extensions[i][2], lib.extensions[i][4]); }catch(e){ - alert(`扩展${lib.extensions[i][0]}载入失败\ncontentError\n${decodeURI(e.stack)}`); + alert(`加载《${name}》扩展的content时出错。\n${decodeURI(e.stack)}`); } if (lib.extensions[i][4]) { if (lib.extensions[i][4].character) {