使用game.addCardPack添加卡牌包时,可以使用closeable:true选项,令玩家可以手动编辑牌堆(也即使用game.import导入卡牌包时,卡牌包信息页底下的那个“编辑牌堆”)

使用game.addCardPack添加卡牌包时,可以使用closeable:true选项,令玩家可以手动编辑牌堆(也即使用game.import导入卡牌包时,卡牌包信息页底下的那个“编辑牌堆”)
This commit is contained in:
Iking123 2024-03-31 01:08:15 +08:00 committed by GitHub
parent 6e8531ad31
commit 38fa0dae6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -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]) {