From 38fa0dae6afe9610f7cb574e207925b0dfba20e7 Mon Sep 17 00:00:00 2001 From: Iking123 <39300535+Iking123@users.noreply.github.com> Date: Sun, 31 Mar 2024 01:08:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8game.addCardPack=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=8D=A1=E7=89=8C=E5=8C=85=E6=97=B6=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E4=BD=BF=E7=94=A8closeable:true=E9=80=89=E9=A1=B9?= =?UTF-8?q?=EF=BC=8C=E4=BB=A4=E7=8E=A9=E5=AE=B6=E5=8F=AF=E4=BB=A5=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E7=BC=96=E8=BE=91=E7=89=8C=E5=A0=86=EF=BC=88=E4=B9=9F?= =?UTF-8?q?=E5=8D=B3=E4=BD=BF=E7=94=A8game.import=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=8D=A1=E7=89=8C=E5=8C=85=E6=97=B6=EF=BC=8C=E5=8D=A1=E7=89=8C?= =?UTF-8?q?=E5=8C=85=E4=BF=A1=E6=81=AF=E9=A1=B5=E5=BA=95=E4=B8=8B=E7=9A=84?= =?UTF-8?q?=E9=82=A3=E4=B8=AA=E2=80=9C=E7=BC=96=E8=BE=91=E7=89=8C=E5=A0=86?= =?UTF-8?q?=E2=80=9D=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 使用game.addCardPack添加卡牌包时,可以使用closeable:true选项,令玩家可以手动编辑牌堆(也即使用game.import导入卡牌包时,卡牌包信息页底下的那个“编辑牌堆”) --- noname/ui/create/menu/pages/cardPackMenu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/noname/ui/create/menu/pages/cardPackMenu.js b/noname/ui/create/menu/pages/cardPackMenu.js index 778629e6b..e7e1d99f1 100644 --- a/noname/ui/create/menu/pages/cardPackMenu.js +++ b/noname/ui/create/menu/pages/cardPackMenu.js @@ -165,6 +165,7 @@ export const cardPackMenu = function (connectMenu) { var createModeConfig = function (mode, position) { var info = lib.cardPack[mode]; let cardPack = lib.cardPackInfo[mode]; + if (!lib.cardPile[mode] && cardPack && cardPack.list && Array.isArray(cardPack.list)) lib.cardPile[mode]=cardPack.list; var page = ui.create.div(''); var node = ui.create.div('.menubutton.large', lib.translate[mode + '_card_config'], position, clickMode); if (node.innerHTML.length >= 5) { @@ -303,7 +304,7 @@ export const cardPackMenu = function (connectMenu) { game.saveConfig('hiddenCardPack', lib.config.hiddenCardPack); }); } - if (!mode.startsWith('mode_') && lib.cardPile[mode]) { + if ((!mode.startsWith('mode_') || (cardPack && cardPack.closeable)) && lib.cardPile[mode]) { var cardpileNodes = []; var cardpileexpanded = false; if (!lib.config.bannedpile[mode]) { @@ -648,4 +649,4 @@ export const cardPackMenu = function (connectMenu) { if (connectMenu) lib.connectCardPack.add(packName); } } -}; \ No newline at end of file +};