Merge pull request #943 from nonameShijian/PR-Branch

调整加载武将,卡牌包的逻辑,修复联机模式出现非联机武将卡牌包的情况
This commit is contained in:
Spmario233 2024-02-14 18:50:42 +08:00 committed by GitHub
commit bcf55b9541
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 6 deletions

View File

@ -641,8 +641,10 @@ export const cardPackMenu = function (connectMenu) {
return function (packName) {
// 判断菜单栏有没有加载过这个卡牌包
if ([...start.firstChild.children].map(node => node.mode).includes(packName)) return;
// 单机模式下显示不在lib.config.all.cards里的卡牌包
if (!lib.config.all.cards.includes(packName)) createModeConfig(packName, start.firstChild);
if (connectMenu) lib.connectCardPack.add(packName);
// 显示不是无名杀自带的卡牌包
if (!lib.connectCardPack.includes(packName) && !lib.config.all.cards.includes(packName)) {
createModeConfig(packName, start.firstChild, node1);
if (connectMenu) lib.connectCardPack.add(packName);
}
}
};

View File

@ -521,8 +521,10 @@ export const characterPackMenu = function (connectMenu) {
return function (packName) {
// 判断菜单栏有没有加载过这个武将包
if ([...start.firstChild.children].map(node => node.mode).includes(packName)) return;
// 单机模式下显示不在lib.config.all.characters里的武将包
if (!characterlist.includes(packName)) createModeConfig(packName, start.firstChild, node1);
if (connectMenu) lib.connectCharacterPack.add(packName);
// 显示不是无名杀自带的武将包
if (!lib.connectCharacterPack.includes(packName) && !lib.config.all.characters.includes(packName)) {
createModeConfig(packName, start.firstChild, node1);
if (connectMenu) lib.connectCharacterPack.add(packName);
}
}
};