diff --git a/noname/library/index.js b/noname/library/index.js index b89b25cad..45e38c623 100644 --- a/noname/library/index.js +++ b/noname/library/index.js @@ -9,14 +9,7 @@ * @typedef { InstanceType } NodeWS * @typedef { InstanceType } Control */ -import { - nonameInitialized, - assetURL, - userAgent, - GeneratorFunction, - AsyncFunction, - characterDefaultPicturePath, -} from "../util/index.js"; +import { nonameInitialized, assetURL, userAgent, GeneratorFunction, AsyncFunction, characterDefaultPicturePath } from "../util/index.js"; import { ai } from "../ai/index.js"; import { get } from "../get/index.js"; import { game } from "../game/index.js"; @@ -42,10 +35,7 @@ export class Library { assetURL = assetURL; userAgent = userAgent; characterDefaultPicturePath = characterDefaultPicturePath; - compatibleEdition = Boolean( - typeof nonameInitialized == "string" && - nonameInitialized.match(/\/(?:com\.widget|yuri\.nakamura)\.noname\//) - ); + compatibleEdition = Boolean(typeof nonameInitialized == "string" && nonameInitialized.match(/\/(?:com\.widget|yuri\.nakamura)\.noname\//)); changeLog = []; updates = []; canvasUpdates = []; @@ -65,15 +55,18 @@ export class Library { // 新增武将包,且不是“收藏”和“禁用” if (!["mode_favourite", "mode_banned"].includes(prop) && !Reflect.has(target, prop)) { Promise.resolve().then(() => { - ui.updateCharacterPackMenu.forEach((fun) => fun(prop)); + ui.updateCharacterPackMenu.forEach(fun => fun(prop)); }); } } - const newPack = new Proxy({}, { - set(target, prop, newValue) { - return Reflect.set(target, prop, get.convertedCharacter(newValue)); + const newPack = new Proxy( + {}, + { + set(target, prop, newValue) { + return Reflect.set(target, prop, get.convertedCharacter(newValue)); + }, } - }); + ); Object.assign(newPack, newValue); return Reflect.set(target, prop, newPack); }, @@ -93,7 +86,7 @@ export class Library { if (typeof prop == "string") { if (!Reflect.has(target, prop)) { Promise.resolve().then(() => { - ui.updateCardPackMenu.forEach((fun) => fun(prop)); + ui.updateCardPackMenu.forEach(fun => fun(prop)); }); } } @@ -242,31 +235,7 @@ export class Library { layoutfixed = ["chess", "tafang", "stone"]; pinyins = { _metadata: { - shengmu: [ - "zh", - "ch", - "sh", - "b", - "p", - "m", - "f", - "d", - "t", - "l", - "n", - "g", - "k", - "h", - "j", - "q", - "x", - "r", - "z", - "c", - "s", - "y", - "w", - ], + shengmu: ["zh", "ch", "sh", "b", "p", "m", "f", "d", "t", "l", "n", "g", "k", "h", "j", "q", "x", "r", "z", "c", "s", "y", "w"], special_shengmu: ["j", "q", "x", "y"], feijiemu: { i: ["ing", "iu", "ie", "in"], @@ -319,26 +288,14 @@ export class Library { yingbianZhuzhan.setContent(() => { "step 0"; event._global_waiting = true; - event.send = ( - player, - card, - source, - targets, - id, - id2, - yingbianZhuzhanAI, - skillState - ) => { + event.send = (player, card, source, targets, id, id2, yingbianZhuzhanAI, skillState) => { if (skillState) player.applySkills(skillState); var type = get.type2(card), str = get.translation(source); if (targets && targets.length) str += `对${get.translation(targets)}`; - str += `使用了${get.translation(card)},是否弃置一张${get.translation( - type - )}为其助战?`; + str += `使用了${get.translation(card)},是否弃置一张${get.translation(type)}为其助战?`; player.chooseCard({ - filterCard: (card, player) => - get.type2(card) == type && lib.filter.cardDiscardable(card, player), + filterCard: (card, player) => get.type2(card) == type && lib.filter.cardDiscardable(card, player), prompt: str, position: "h", _global_waiting: true, @@ -347,20 +304,15 @@ export class Library { ai: typeof yingbianZhuzhanAI == "function" ? yingbianZhuzhanAI(player, card, source, targets) - : (cardx) => { - var info = get.info(card); - if (info && info.ai && info.ai.yingbian) { - var ai = info.ai.yingbian( - card, - source, - targets, - player - ); - if (!ai) return 0; - return ai - get.value(cardx); - } else if (get.attitude(player, source) <= 0) return 0; - return 5 - get.value(cardx); - }, + : cardx => { + var info = get.info(card); + if (info && info.ai && info.ai.yingbian) { + var ai = info.ai.yingbian(card, source, targets, player); + if (!ai) return 0; + return ai - get.value(cardx); + } else if (get.attitude(player, source) <= 0) return 0; + return 5 - get.value(cardx); + }, }); if (!game.online) return; _status.event._resultid = id; @@ -368,33 +320,12 @@ export class Library { }; "step 1"; var type = get.type2(card); - event.list = game - .filterPlayer( - (current) => - current != player && - current.countCards("h") && - (_status.connectMode || - current.hasCard((cardx) => get.type2(cardx) == type, "h")) - ) - .sortBySeat(_status.currentPhase || player); + event.list = game.filterPlayer(current => current != player && current.countCards("h") && (_status.connectMode || current.hasCard(cardx => get.type2(cardx) == type, "h"))).sortBySeat(_status.currentPhase || player); event.id = get.id(); "step 2"; if (!event.list.length) event.finish(); - else if ( - _status.connectMode && - (event.list[0].isOnline() || event.list[0] == game.me) - ) - event.goto(4); - else - event.send( - (event.current = event.list.shift()), - event.card, - player, - trigger.targets, - event.id, - trigger.parent.id, - trigger.yingbianZhuzhanAI - ); + else if (_status.connectMode && (event.list[0].isOnline() || event.list[0] == game.me)) event.goto(4); + else event.send((event.current = event.list.shift()), event.card, player, trigger.targets, event.id, trigger.parent.id, trigger.yingbianZhuzhanAI); "step 3"; if (result.bool) { event.zhuzhanresult = event.current; @@ -409,22 +340,13 @@ export class Library { event.zhuzhanresult = player; event.zhuzhanresult2 = result; game.broadcast("cancel", id); - if ( - _status.event.id == id && - _status.event.name == "chooseCard" && - _status.paused - ) + if (_status.event.id == id && _status.event.name == "chooseCard" && _status.paused) return () => { event.resultOL = _status.event.resultOL; ui.click.cancel(); if (ui.confirm) ui.confirm.close(); }; - } else if ( - _status.event.id == id && - _status.event.name == "chooseCard" && - _status.paused - ) - return () => (event.resultOL = _status.event.resultOL); + } else if (_status.event.id == id && _status.event.name == "chooseCard" && _status.paused) return () => (event.resultOL = _status.event.resultOL); }, withme = false, withol = false, @@ -434,35 +356,17 @@ export class Library { if (current.isOnline()) { withol = true; current.wait(sendback); - current.send( - event.send, - current, - event.card, - player, - trigger.targets, - event.id, - trigger.parent.id, - trigger.yingbianZhuzhanAI, - get.skillState(current) - ); + current.send(event.send, current, event.card, player, trigger.targets, event.id, trigger.parent.id, trigger.yingbianZhuzhanAI, get.skillState(current)); list.splice(i--, 1); } else if (current == game.me) { withme = true; - event.send( - current, - event.card, - player, - trigger.targets, - event.id, - trigger.parent.id, - trigger.yingbianZhuzhanAI - ); + event.send(current, event.card, player, trigger.targets, event.id, trigger.parent.id, trigger.yingbianZhuzhanAI); list.splice(i--, 1); } } if (!withme) event.goto(6); if (_status.connectMode && (withme || withol)) - game.players.forEach((value) => { + game.players.forEach(value => { if (value != player) value.showTimer(); }); event.withol = withol; @@ -474,20 +378,16 @@ export class Library { "step 6"; if (event.withol && !event.resultOL) game.pause(); "step 7"; - game.players.forEach((value) => value.hideTimer()); + game.players.forEach(value => value.hideTimer()); "step 8"; if (event.zhuzhanresult) { var target = event.zhuzhanresult; target.line(player, "green"); target.discard(event.zhuzhanresult2.cards).discarder = target; - if (typeof event.afterYingbianZhuzhan == "function") - event.afterYingbianZhuzhan(event, trigger); + if (typeof event.afterYingbianZhuzhan == "function") event.afterYingbianZhuzhan(event, trigger); var yingbianCondition = event.name.slice(8).toLowerCase(), yingbianConditionTag = `yingbian_${yingbianCondition}_tag`; - target.popup( - yingbianConditionTag, - lib.yingbian.condition.color.get(yingbianCondition) - ); + target.popup(yingbianConditionTag, lib.yingbian.condition.color.get(yingbianCondition)); game.log(target, "响应了", player, "发起的", yingbianConditionTag); target.addExpose(0.2); event.result = { @@ -504,9 +404,9 @@ export class Library { ], ]), simple: new Map([ - ["kongchao", (event) => !event.player.countCards("h")], - ["fujia", (event) => event.player.isMaxHandcard()], - ["canqu", (event) => event.player.getHp() == 1], + ["kongchao", event => !event.player.countCards("h")], + ["fujia", event => event.player.isMaxHandcard()], + ["canqu", event => event.player.getHp() == 1], ]), }, effect: new Map([ @@ -540,8 +440,7 @@ export class Library { "gain", () => { const cardx = trigger.respondTo; - if (cardx && cardx[1] && cardx[1].cards && cardx[1].cards.filterInD("od").length) - player.gain(cardx[1].cards.filterInD("od"), "gain2"); + if (cardx && cardx[1] && cardx[1].cards && cardx[1].cards.filterInD("od").length) player.gain(cardx[1].cards.filterInD("od"), "gain2"); }, ], [ @@ -597,7 +496,7 @@ export class Library { "数+1" ); const map = event.customArgs; - game.players.concat(game.dead).forEach((current) => { + game.players.concat(game.dead).forEach(current => { const id = current.playerid; if (!map[id]) map[id] = {}; if (typeof map[id].shanRequired == "number") map[id].shanRequired++; @@ -621,7 +520,7 @@ export class Library { ); event.player .when("useCard") - .filter((evt) => evt == event) + .filter(evt => evt == event) .then(() => { trigger.getParent(2).decrease("shanRequired", 1); }); @@ -637,7 +536,7 @@ export class Library { .when({ source: "damageBegin1", }) - .filter((evt) => evt.getParent(2) == event && event.targets.includes(evt.player)) + .filter(evt => evt.getParent(2) == event && event.targets.includes(evt.player)) .then(() => { trigger.increase("num"); }); @@ -764,25 +663,19 @@ export class Library { onclick(bool) { game.saveConfig("keep_awake", bool); if (bool) { - if (window.plugins && window.plugins.insomnia) - window.plugins.insomnia.keepAwake(); + if (window.plugins && window.plugins.insomnia) window.plugins.insomnia.keepAwake(); else if (window.noSleep) { document.addEventListener( lib.config.touchscreen ? "touchend" : "click", function enableNoSleepX() { - document.removeEventListener( - lib.config.touchscreen ? "touchend" : "click", - enableNoSleepX, - false - ); + document.removeEventListener(lib.config.touchscreen ? "touchend" : "click", enableNoSleepX, false); window.noSleep.enable(); }, false ); } } else { - if (window.plugins && window.plugins.insomnia) - window.plugins.insomnia.allowSleepAgain(); + if (window.plugins && window.plugins.insomnia) window.plugins.insomnia.allowSleepAgain(); else if (window.noSleep) window.noSleep.disable(); } }, @@ -1175,9 +1068,7 @@ export class Library { init: "GitHub Proxy", unfrequent: true, item: {}, - intro: () => - `获取在线扩展时的地址。当前地址:${document.createElement("br").outerHTML}${lib.config.extension_sources[lib.config.extension_source] - }`, + intro: () => `获取在线扩展时的地址。当前地址:${document.createElement("br").outerHTML}${lib.config.extension_sources[lib.config.extension_source]}`, }, extension_create: { name: "添加获取扩展地址", @@ -1372,14 +1263,10 @@ export class Library { visualMenu: function (node, link) { if (!node.menu) { node.className = "button character themebutton " + link; - node.menu = ui.create.div( - node, - "", - "
" - ); + node.menu = ui.create.div(node, "", "
"); } }, - onclick: async (theme) => { + onclick: async theme => { game.saveConfig("theme", theme); ui.arena.hide(); lib.init.background(); @@ -1391,13 +1278,13 @@ export class Library { } } lib.announce.publish("Noname.Apperaence.Theme.onChanging", theme); - await new Promise((resolve) => setTimeout(resolve, 500)); + await new Promise(resolve => setTimeout(resolve, 500)); const deletingTheme = ui.css.theme; ui.css.theme = lib.init.css(lib.assetURL + "theme/" + lib.config.theme, "style"); deletingTheme.remove(); lib.announce.publish("Noname.Apperaence.Theme.onChanged", theme); - await new Promise((resolve) => setTimeout(resolve, 100)); + await new Promise(resolve => setTimeout(resolve, 100)); ui.arena.show(); lib.announce.publish("Noname.Apperaence.Theme.onChangeFinished", theme); @@ -1448,9 +1335,7 @@ export class Library { var list = ["re_caocao", "re_liubei", "sp_zhangjiao", "sunquan"]; for (var i = 0; i < 4; i++) { var player = ui.create.div(".fakeplayer", node); - ui.create - .div(".avatar", player) - .setBackground(list.randomRemove(), "character"); + ui.create.div(".avatar", player).setBackground(list.randomRemove(), "character"); player.style.borderRadius = "2px"; if (i != 3) { player.style.top = "auto"; @@ -1720,7 +1605,7 @@ export class Library { game.documentZoom = game.deviceZoom * zoom; ui.updatez(); if (Array.isArray(lib.onresize)) { - lib.onresize.forEach((fun) => { + lib.onresize.forEach(fun => { if (typeof fun == "function") fun(); }); } @@ -1840,10 +1725,7 @@ export class Library { background = "default"; this.lastChild.innerHTML = "默认"; } else { - this.lastChild.innerHTML = - lib.configMenu.appearence.config.image_background.item[ - lib.config.image_background - ]; + this.lastChild.innerHTML = lib.configMenu.appearence.config.image_background.item[lib.config.image_background]; return; } } else if (node.firstChild.innerHTML == get.verticalStr("删除")) { @@ -1863,10 +1745,7 @@ export class Library { background = "default"; this.lastChild.innerHTML = "默认"; } else { - this.lastChild.innerHTML = - lib.configMenu.appearence.config.image_background.item[ - lib.config.image_background - ]; + this.lastChild.innerHTML = lib.configMenu.appearence.config.image_background.item[lib.config.image_background]; return; } } @@ -2006,8 +1885,7 @@ export class Library { case "default": case "custom": { if (lib.config.theme == "simple") { - node.style.backgroundImage = - "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; + node.style.backgroundImage = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; node.className = "button character"; } else { node.style.backgroundImage = "none"; @@ -2050,10 +1928,7 @@ export class Library { onclick(layout) { game.saveConfig("card_style", layout); var style = ui.css.card_style; - ui.css.card_style = lib.init.css( - lib.assetURL + "theme/style/card", - lib.config.card_style - ); + ui.css.card_style = lib.init.css(lib.assetURL + "theme/style/card", lib.config.card_style); style.remove(); if (ui.css.card_stylesheet) { ui.css.card_stylesheet.remove(); @@ -2067,11 +1942,7 @@ export class Library { if (ui.css.card_stylesheet) { ui.css.card_stylesheet.remove(); } - ui.css.card_stylesheet = lib.init.sheet( - ".card:not(*:empty){background-image:url(" + - fileLoadedEvent.target.result + - ")}" - ); + ui.css.card_stylesheet = lib.init.sheet(".card:not(*:empty){background-image:url(" + fileLoadedEvent.target.result + ")}"); }; fileReader.readAsDataURL(fileToLoad, "UTF-8"); }); @@ -2126,18 +1997,13 @@ export class Library { }); } }).inputNode.accept = "image/*"; - ui.create.filediv( - ".menubutton.deletebutton.addbutton", - "添加翻转图片", - node, - function (file) { - if (file) { - game.putDB("image", "cardback_style2", file, function () { - node.classList.add("hideadd"); - }); - } + ui.create.filediv(".menubutton.deletebutton.addbutton", "添加翻转图片", node, function (file) { + if (file) { + game.putDB("image", "cardback_style2", file, function () { + node.classList.add("hideadd"); + }); } - ).inputNode.accept = "image/*"; + }).inputNode.accept = "image/*"; deletepic = ui.create.div(".menubutton.deletebutton", "删除图片", node, function () { if (confirm("确定删除自定义图片?(此操作不可撤销)")) { game.deleteDB("image", "cardback_style"); @@ -2216,10 +2082,7 @@ export class Library { onclick(layout) { game.saveConfig("cardback_style", layout); var style = ui.css.cardback_style; - ui.css.cardback_style = lib.init.css( - lib.assetURL + "theme/style/cardback", - lib.config.cardback_style - ); + ui.css.cardback_style = lib.init.css(lib.assetURL + "theme/style/cardback", lib.config.cardback_style); style.remove(); if (ui.css.cardback_stylesheet) { ui.css.cardback_stylesheet.remove(); @@ -2237,11 +2100,7 @@ export class Library { if (ui.css.cardback_stylesheet) { ui.css.cardback_stylesheet.remove(); } - ui.css.cardback_stylesheet = lib.init.sheet( - ".card:empty,.card.infohidden{background-image:url(" + - fileLoadedEvent.target.result + - ")}" - ); + ui.css.cardback_stylesheet = lib.init.sheet(".card:empty,.card.infohidden{background-image:url(" + fileLoadedEvent.target.result + ")}"); game.getDB("image", "cardback_style2", function (fileToLoad) { if (!fileToLoad) return; var fileReader = new FileReader(); @@ -2249,11 +2108,7 @@ export class Library { if (ui.css.cardback_stylesheet2) { ui.css.cardback_stylesheet2.remove(); } - ui.css.cardback_stylesheet2 = lib.init.sheet( - ".card.infohidden:not(.infoflip){background-image:url(" + - fileLoadedEvent.target.result + - ")}" - ); + ui.css.cardback_stylesheet2 = lib.init.sheet(".card.infohidden:not(.infoflip){background-image:url(" + fileLoadedEvent.target.result + ")}"); }; fileReader.readAsDataURL(fileToLoad, "UTF-8"); }); @@ -2301,8 +2156,7 @@ export class Library { var fileReader = new FileReader(); fileReader.onload = function (fileLoadedEvent) { var data = fileLoadedEvent.target.result; - button.childNodes[node.currentDB - 1].style.backgroundImage = - "url(" + data + ")"; + button.childNodes[node.currentDB - 1].style.backgroundImage = "url(" + data + ")"; button.classList.add("shown"); node.classList.add("showdelete"); node.currentDB++; @@ -2407,11 +2261,7 @@ export class Library { if (ui.css.hp_stylesheet1) { ui.css.hp_stylesheet1.remove(); } - ui.css.hp_stylesheet1 = lib.init.sheet( - '.hp:not(.text):not(.actcount)[data-condition="high"]>div:not(.lost){background-image:url(' + - fileLoadedEvent.target.result + - ")}" - ); + ui.css.hp_stylesheet1 = lib.init.sheet('.hp:not(.text):not(.actcount)[data-condition="high"]>div:not(.lost){background-image:url(' + fileLoadedEvent.target.result + ")}"); }; fileReader.readAsDataURL(fileToLoad, "UTF-8"); }); @@ -2422,11 +2272,7 @@ export class Library { if (ui.css.hp_stylesheet2) { ui.css.hp_stylesheet2.remove(); } - ui.css.hp_stylesheet2 = lib.init.sheet( - '.hp:not(.text):not(.actcount)[data-condition="mid"]>div:not(.lost){background-image:url(' + - fileLoadedEvent.target.result + - ")}" - ); + ui.css.hp_stylesheet2 = lib.init.sheet('.hp:not(.text):not(.actcount)[data-condition="mid"]>div:not(.lost){background-image:url(' + fileLoadedEvent.target.result + ")}"); }; fileReader.readAsDataURL(fileToLoad, "UTF-8"); }); @@ -2437,11 +2283,7 @@ export class Library { if (ui.css.hp_stylesheet3) { ui.css.hp_stylesheet3.remove(); } - ui.css.hp_stylesheet3 = lib.init.sheet( - '.hp:not(.text):not(.actcount)[data-condition="low"]>div:not(.lost){background-image:url(' + - fileLoadedEvent.target.result + - ")}" - ); + ui.css.hp_stylesheet3 = lib.init.sheet('.hp:not(.text):not(.actcount)[data-condition="low"]>div:not(.lost){background-image:url(' + fileLoadedEvent.target.result + ")}"); }; fileReader.readAsDataURL(fileToLoad, "UTF-8"); }); @@ -2452,11 +2294,7 @@ export class Library { if (ui.css.hp_stylesheet4) { ui.css.hp_stylesheet4.remove(); } - ui.css.hp_stylesheet4 = lib.init.sheet( - ".hp:not(.text):not(.actcount)>.lost{background-image:url(" + - fileLoadedEvent.target.result + - ")}" - ); + ui.css.hp_stylesheet4 = lib.init.sheet(".hp:not(.text):not(.actcount)>.lost{background-image:url(" + fileLoadedEvent.target.result + ")}"); }; fileReader.readAsDataURL(fileToLoad, "UTF-8"); }); @@ -2540,8 +2378,7 @@ export class Library { node.style.backgroundImage = "linear-gradient(#4b4b4b, #464646)"; break; case "simple": - node.style.backgroundImage = - "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; + node.style.backgroundImage = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; break; } if (link == "custom") { @@ -2574,11 +2411,7 @@ export class Library { if (ui.css.player_stylesheet) { ui.css.player_stylesheet.remove(); } - ui.css.player_stylesheet = lib.init.sheet( - '#window .player{background-image:url("' + - fileLoadedEvent.target.result + - '");background-size:100% 100%;}' - ); + ui.css.player_stylesheet = lib.init.sheet('#window .player{background-image:url("' + fileLoadedEvent.target.result + '");background-size:100% 100%;}'); }; fileReader.readAsDataURL(fileToLoad, "UTF-8"); }); @@ -2595,9 +2428,7 @@ export class Library { str = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; break; } - ui.css.player_stylesheet = lib.init.sheet( - "#window .player{background-image:" + str + "}" - ); + ui.css.player_stylesheet = lib.init.sheet("#window .player{background-image:" + str + "}"); } }, unfrequent: true, @@ -2712,16 +2543,8 @@ export class Library { } ui.css.border_stylesheet = lib.init.sheet(); ui.css.border_stylesheet.id = "ui.css.border"; - ui.css.border_stylesheet.sheet.insertRule( - '#window .player>.framebg{display:block;background-image:url("' + - fileLoadedEvent.target.result + - '")}', - 0 - ); - ui.css.border_stylesheet.sheet.insertRule( - ".player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}", - 0 - ); + ui.css.border_stylesheet.sheet.insertRule('#window .player>.framebg{display:block;background-image:url("' + fileLoadedEvent.target.result + '")}', 0); + ui.css.border_stylesheet.sheet.insertRule(".player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}", 0); }; fileReader.readAsDataURL(fileToLoad, "UTF-8"); }); @@ -2733,26 +2556,9 @@ export class Library { } else { ui.arena.dataset.framedecoration = ""; } - 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/" + - layout + - '1.png")}', - 0 - ); - 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/" + - layout + - '3.png")}', - 0 - ); - ui.css.border_stylesheet.sheet.insertRule( - ".player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}", - 0 - ); + 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/" + layout + '1.png")}', 0); + 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/" + layout + '3.png")}', 0); + ui.css.border_stylesheet.sheet.insertRule(".player>.count{z-index: 3 !important;border-radius: 2px !important;text-align: center !important;}", 0); } }, unfrequent: true, @@ -2806,11 +2612,7 @@ export class Library { } else { ui.arena.classList.remove("mslim_player"); } - if ( - item == "normal" && - lib.config.mode != "brawl" && - (game.layout == "long" || game.layout == "long2") - ) { + if (item == "normal" && lib.config.mode != "brawl" && (game.layout == "long" || game.layout == "long2")) { ui.arena.classList.add("lslim_player"); } else { ui.arena.classList.remove("lslim_player"); @@ -2893,8 +2695,7 @@ export class Library { node.style.backgroundImage = "linear-gradient(#4b4b4b, #464646)"; break; case "simple": - node.style.backgroundImage = - "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; + node.style.backgroundImage = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; break; } if (link == "custom") { @@ -2927,11 +2728,7 @@ export class Library { if (ui.css.menu_stylesheet) { ui.css.menu_stylesheet.remove(); } - ui.css.menu_stylesheet = lib.init.sheet( - 'html #window>.dialog.popped,html .menu,html .menubg{background-image:url("' + - fileLoadedEvent.target.result + - '");background-size:cover}' - ); + ui.css.menu_stylesheet = lib.init.sheet('html #window>.dialog.popped,html .menu,html .menubg{background-image:url("' + fileLoadedEvent.target.result + '");background-size:cover}'); }; fileReader.readAsDataURL(fileToLoad, "UTF-8"); }); @@ -2942,19 +2739,13 @@ export class Library { str = 'url("' + lib.assetURL + 'theme/woodden/wood2.png")'; break; case "music": - str = - "linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px"; + str = "linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px"; break; case "simple": - str = - "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px"; + str = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px"; break; } - ui.css.menu_stylesheet = lib.init.sheet( - "html #window>.dialog.popped,html .menu,html .menubg{background-image:" + - str + - "}" - ); + ui.css.menu_stylesheet = lib.init.sheet("html #window>.dialog.popped,html .menu,html .menubg{background-image:" + str + "}"); } }, unfrequent: true, @@ -3032,8 +2823,7 @@ export class Library { node.style.backgroundImage = "linear-gradient(#4b4b4b, #464646)"; break; case "simple": - node.style.backgroundImage = - "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; + node.style.backgroundImage = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4))"; break; } if (link == "custom") { @@ -3065,11 +2855,7 @@ export class Library { if (ui.css.control_stylesheet) { ui.css.control_stylesheet.remove(); } - ui.css.control_stylesheet = lib.init.sheet( - '#window .control,.menubutton:not(.active):not(.highlight):not(.red):not(.blue),#window #system>div>div{background-image:url("' + - fileLoadedEvent.target.result + - '")}' - ); + ui.css.control_stylesheet = lib.init.sheet('#window .control,.menubutton:not(.active):not(.highlight):not(.red):not(.blue),#window #system>div>div{background-image:url("' + fileLoadedEvent.target.result + '")}'); }; fileReader.readAsDataURL(fileToLoad, "UTF-8"); }); @@ -3080,26 +2866,16 @@ export class Library { str = 'url("' + lib.assetURL + 'theme/woodden/wood.jpg")'; break; case "music": - str = - "linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px"; + str = "linear-gradient(#4b4b4b, #464646);color:white;text-shadow:black 0 0 2px"; break; case "simple": - str = - "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px"; + str = "linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4));color:white;text-shadow:black 0 0 2px"; break; } if (layout == "wood") { - ui.css.control_stylesheet = lib.init.sheet( - "#window .control,#window .menubutton,#window #system>div>div,#window #system>div>.pressdown2{background-image:" + - str + - "}" - ); + ui.css.control_stylesheet = lib.init.sheet("#window .control,#window .menubutton,#window #system>div>div,#window #system>div>.pressdown2{background-image:" + str + "}"); } else { - 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 + - "}" - ); + 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 + "}"); } } }, @@ -3131,23 +2907,7 @@ export class Library { cbnum6 += cbnum4; cbnum4 = 0; } - ui.css.buttonsheet = lib.init.sheet( - "#system>div>div, .caption>div>.tdnode{padding-top:" + - cbnum1 + - "px !important;padding-bottom:" + - cbnum2 + - "px !important}", - "#control>.control>div{padding-top:" + - cbnum3 + - "px;padding-bottom:" + - cbnum4 + - "px}", - "#control>.control{padding-top:" + - cbnum5 + - "px;padding-bottom:" + - cbnum6 + - "px}" - ); + ui.css.buttonsheet = lib.init.sheet("#system>div>div, .caption>div>.tdnode{padding-top:" + cbnum1 + "px !important;padding-bottom:" + cbnum2 + "px !important}", "#control>.control>div{padding-top:" + cbnum3 + "px;padding-bottom:" + cbnum4 + "px}", "#control>.control{padding-top:" + cbnum5 + "px;padding-bottom:" + cbnum6 + "px}"); } }, }, @@ -3445,13 +3205,7 @@ export class Library { linked = true; } game.saveConfig("cardshape", item); - if ( - item == "oblong" && - (game.layout == "long" || - game.layout == "mobile" || - game.layout == "long2" || - game.layout == "nova") - ) { + if (item == "oblong" && (game.layout == "long" || game.layout == "mobile" || game.layout == "long2" || game.layout == "nova")) { ui.arena.classList.add("oblongcard"); ui.window.classList.add("oblongcard"); } else { @@ -3613,8 +3367,7 @@ export class Library { if (link != "default") { node.style.fontFamily = link; } else { - node.style.fontFamily = - "'STHeiti','SimHei','Microsoft JhengHei','Microsoft YaHei','WenQuanYi Micro Hei','Suits',Helvetica,Arial,sans-serif"; + node.style.fontFamily = "'STHeiti','SimHei','Microsoft JhengHei','Microsoft YaHei','WenQuanYi Micro Hei','Suits',Helvetica,Arial,sans-serif"; } node.style.fontSize = "20px"; }, @@ -3716,12 +3469,7 @@ export class Library { name: "显示", config: { update: function (config, map) { - if ( - lib.config.mode == "versus" || - lib.config.mode == "chess" || - lib.config.mode == "tafang" || - lib.config.mode == "boss" - ) { + if (lib.config.mode == "versus" || lib.config.mode == "chess" || lib.config.mode == "tafang" || lib.config.mode == "boss") { map.show_handcardbutton.show(); } else { map.show_handcardbutton.hide(); @@ -4362,8 +4110,7 @@ export class Library { node.classList.add("button", "character"); const style = node.style; style.alignItems = "center"; - style.animation = - "background-position-left-center-right-center-left-center 15s ease infinite"; + style.animation = "background-position-left-center-right-center-left-center 15s ease infinite"; style.background = "linear-gradient(-45deg, #EE7752, #E73C7E, #23A6D5, #23D5AB)"; style.backgroundSize = "400% 400%"; style.display = "flex"; @@ -4379,10 +4126,7 @@ export class Library { const rt = document.createElement("rt"); rt.style.fontSize = "smaller"; if (link == "showPinyin2" || link == "showCodeIdentifier2") { - rt.textContent = - link == "showCodeIdentifier2" - ? "[" + link + "]" - : "[" + get.pinyin(name) + "]"; + rt.textContent = link == "showCodeIdentifier2" ? "[" + link + "]" : "[" + get.pinyin(name) + "]"; ruby.appendChild(rt); } else { const leftParenthesisRP = document.createElement("rp"); @@ -4436,9 +4180,7 @@ export class Library { } else { map.import_music.hide(); } - map.clear_background_music[ - get.is.object(lib.config.customBackgroundMusic) ? "show" : "hide" - ](); + map.clear_background_music[get.is.object(lib.config.customBackgroundMusic) ? "show" : "hide"](); ui.background_music_setting = map.background_music; map.background_music._link.config.updatex.call(map.background_music, []); }, @@ -4447,12 +4189,7 @@ export class Library { this.lastChild.innerHTML = this._link.config.item[lib.config.background_music]; var menu = this._link.menu; for (var i = 0; i < menu.childElementCount; i++) { - if ( - !["music_off", "music_custom", "music_random"] - .concat(lib.config.all.background_music) - .includes(menu.childNodes[i]._link) - ) - menu.childNodes[i].delete(); + if (!["music_off", "music_custom", "music_random"].concat(lib.config.all.background_music).includes(menu.childNodes[i]._link)) menu.childNodes[i].delete(); } }, name: "背景音乐", @@ -4466,10 +4203,7 @@ export class Library { }, }, import_music: { - name: - '
' + - '' + - '
', + name: '
' + '' + '
', clear: true, }, background_audio: { @@ -4677,10 +4411,7 @@ export class Library { clear: true, }, import_data_button: { - name: - '
' + - '' + - '
', + name: '
' + '' + '
', clear: true, }, export_data: { @@ -4688,10 +4419,7 @@ export class Library { onclick() { var data; var export_data = function (data) { - game.export( - lib.init.encode(JSON.stringify(data)), - "无名杀 - 数据 - " + new Date().toLocaleString() - ); + game.export(lib.init.encode(JSON.stringify(data)), "无名杀 - 数据 - " + new Date().toLocaleString()); }; if (!lib.db) { data = {}; @@ -5152,16 +4880,8 @@ export class Library { map.connect_player_number.show(); map.connect_limit_zhu.show(); map.connect_enhance_zhu.show(); - map.connect_double_nei[ - config.connect_player_number != "2" && !config.connect_enable_commoner - ? "show" - : "hide" - ](); - map.connect_enable_commoner[ - config.connect_player_number != "2" && !config.connect_double_nei - ? "show" - : "hide" - ](); + map.connect_double_nei[config.connect_player_number != "2" && !config.connect_enable_commoner ? "show" : "hide"](); + map.connect_enable_commoner[config.connect_player_number != "2" && !config.connect_double_nei ? "show" : "hide"](); map.connect_enable_year_limit.show(); map.connect_zhong_card.hide(); @@ -5394,17 +5114,13 @@ export class Library { map.player_number.show(); map.enhance_zhu.show(); map.auto_identity.show(); - map.double_nei[ - config.player_number != "2" && !config.enable_commoner ? "show" : "hide" - ](); + map.double_nei[config.player_number != "2" && !config.enable_commoner ? "show" : "hide"](); map.choice_zhu.show(); map.limit_zhu.show(); map.choice_zhong.show(); map.choice_nei.show(); map.choice_fan.show(); - map.enable_commoner[ - config.player_number != "2" && !config.double_nei ? "show" : "hide" - ](); + map.enable_commoner[config.player_number != "2" && !config.double_nei ? "show" : "hide"](); map.choice_commoner[config.enable_commoner ? "show" : "hide"](); map.enable_year_limit.show(); map.ban_identity.show(); @@ -5455,16 +5171,9 @@ export class Library { init: "8", get item() { const minimumNumberOfPlayers = 2, - maximumNumberOfPlayers = Math.max( - _status.maximumNumberOfPlayers || 10, - minimumNumberOfPlayers - ), + maximumNumberOfPlayers = Math.max(_status.maximumNumberOfPlayers || 10, minimumNumberOfPlayers), item = {}; - for ( - let playerNumber = minimumNumberOfPlayers; - playerNumber <= maximumNumberOfPlayers; - playerNumber++ - ) { + for (let playerNumber = minimumNumberOfPlayers; playerNumber <= maximumNumberOfPlayers; playerNumber++) { item[playerNumber] = `${get.cnNumber(playerNumber)}人`; } return item; @@ -5551,11 +5260,7 @@ export class Library { num = 0; break; } - if ( - num & !_status.identityShown && - game.phaseNumber > game.players.length * num && - game.showIdentity - ) { + if (num & !_status.identityShown && game.phaseNumber > game.players.length * num && game.showIdentity) { _status.identityShown = true; game.showIdentity(false); } @@ -5588,11 +5293,7 @@ export class Library { init: true, onclick(bool) { game.saveConfig("free_choose", bool, this._link.config.mode); - if ( - get.mode() != this._link.config.mode || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != this._link.config.mode || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; if (!ui.cheat2 && get.config("free_choose")) ui.create.cheat2(); else if (ui.cheat2 && !get.config("free_choose")) { ui.cheat2.close(); @@ -5605,17 +5306,12 @@ export class Library { init: true, onclick(bool) { game.saveConfig("change_identity", bool, this._link.config.mode); - if ( - get.mode() != "identity" || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != "identity" || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; var dialog; if (ui.cheat2 && ui.cheat2.backup) dialog = ui.cheat2.backup; else dialog = _status.event.dialog; if (!_status.brawl || !_status.brawl.noAddSetting) { - if (!dialog.querySelector("table") && get.config("change_identity")) - _status.event.getParent().addSetting(dialog); + if (!dialog.querySelector("table") && get.config("change_identity")) _status.event.getParent().addSetting(dialog); else _status.event.getParent().removeSetting(dialog); } ui.update(); @@ -5626,11 +5322,7 @@ export class Library { init: true, onclick(bool) { game.saveConfig("change_choice", bool, this._link.config.mode); - if ( - get.mode() != "identity" || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != "identity" || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; if (!ui.cheat && get.config("change_choice")) ui.create.cheat(); else if (ui.cheat && !get.config("change_choice")) { ui.cheat.close(); @@ -5667,12 +5359,7 @@ export class Library { onclick(bool) { game.saveConfig("continue_game", bool, this._link.config.mode); if (get.config("continue_game") && get.mode() == "identity") { - if ( - !ui.continue_game && - _status.over && - !_status.brawl && - !game.no_continue_game - ) { + if (!ui.continue_game && _status.over && !_status.brawl && !game.no_continue_game) { ui.continue_game = ui.create.control("再战", game.reloadCurrent); } } else if (ui.continue_game) { @@ -5968,16 +5655,9 @@ export class Library { init: "8", get item() { const minimumNumberOfPlayers = 2, - maximumNumberOfPlayers = Math.max( - _status.maximumNumberOfPlayers || 12, - minimumNumberOfPlayers - ), + maximumNumberOfPlayers = Math.max(_status.maximumNumberOfPlayers || 12, minimumNumberOfPlayers), item = {}; - for ( - let playerNumber = minimumNumberOfPlayers; - playerNumber <= maximumNumberOfPlayers; - playerNumber++ - ) { + for (let playerNumber = minimumNumberOfPlayers; playerNumber <= maximumNumberOfPlayers; playerNumber++) { item[playerNumber] = `${get.cnNumber(playerNumber)}人`; } return item; @@ -6017,17 +5697,12 @@ export class Library { }, aozhan_bgm: { updatex: function () { - this.lastChild.innerHTML = - this._link.config.item[lib.config.mode_config.guozhan.aozhan_bgm]; + this.lastChild.innerHTML = this._link.config.item[lib.config.mode_config.guozhan.aozhan_bgm]; if (!Array.isArray(_status.aozhanBGMToRemove)) return; const menu = this._link.menu; for (let i = 0; i < menu.childElementCount; i++) { const link = menu.childNodes[i]._link; - if ( - ["disabled", "random"].includes(link) || - !_status.aozhanBGMToRemove.includes(link) - ) - continue; + if (["disabled", "random"].includes(link) || !_status.aozhanBGMToRemove.includes(link)) continue; _status.aozhanBGMToRemove.remove(link); menu.childNodes[i].delete(); } @@ -6110,11 +5785,7 @@ export class Library { init: true, onclick(bool) { game.saveConfig("free_choose", bool, this._link.config.mode); - if ( - get.mode() != this._link.config.mode || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != this._link.config.mode || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; if (!ui.cheat2 && get.config("free_choose")) ui.create.cheat2(); else if (ui.cheat2 && !get.config("free_choose")) { ui.cheat2.close(); @@ -6133,17 +5804,12 @@ export class Library { init: true, onclick(bool) { game.saveConfig("change_identity", bool, this._link.config.mode); - if ( - get.mode() != "guozhan" || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != "guozhan" || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; var dialog; if (ui.cheat2 && ui.cheat2.backup) dialog = ui.cheat2.backup; else dialog = _status.event.dialog; if (!_status.brawl || !_status.brawl.noAddSetting) { - if (!dialog.querySelector("table") && get.config("change_identity")) - _status.event.getParent().addSetting(dialog); + if (!dialog.querySelector("table") && get.config("change_identity")) _status.event.getParent().addSetting(dialog); else _status.event.getParent().removeSetting(dialog); } ui.update(); @@ -6154,11 +5820,7 @@ export class Library { init: true, onclick(bool) { game.saveConfig("change_choice", bool, this._link.config.mode); - if ( - get.mode() != "guozhan" || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != "guozhan" || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; if (!ui.cheat && get.config("change_choice")) ui.create.cheat(); else if (ui.cheat && !get.config("change_choice")) { ui.cheat.close(); @@ -6183,12 +5845,7 @@ export class Library { onclick(bool) { game.saveConfig("continue_game", bool, this._link.config.mode); if (get.config("continue_game") && get.mode() == "guozhan") { - if ( - !ui.continue_game && - _status.over && - !_status.brawl && - !game.no_continue_game - ) { + if (!ui.continue_game && _status.over && !_status.brawl && !game.no_continue_game) { ui.continue_game = ui.create.control("再战", game.reloadCurrent); } } else if (ui.continue_game) { @@ -6379,14 +6036,7 @@ export class Library { map.enable_all_three.hide(); map.enable_all_cards.hide(); } - if ( - config.versus_mode == "jiange" || - config.versus_mode == "two" || - config.versus_mode == "endless" || - config.versus_mode == "three" || - config.versus_mode == "one" || - config.versus_mode == "siguo" - ) { + if (config.versus_mode == "jiange" || config.versus_mode == "two" || config.versus_mode == "endless" || config.versus_mode == "three" || config.versus_mode == "one" || config.versus_mode == "siguo") { map.free_choose.show(); } else { map.free_choose.hide(); @@ -6409,11 +6059,7 @@ export class Library { map.two_assign.hide(); map.two_phaseswap.hide(); } - if ( - config.versus_mode == "two" || - config.versus_mode == "siguo" || - config.versus_mode == "four" - ) { + if (config.versus_mode == "two" || config.versus_mode == "siguo" || config.versus_mode == "four") { if (config.versus_mode == "four" && (config.four_assign || config.four_phaseswap)) { map.change_identity.hide(); } else { @@ -6508,11 +6154,7 @@ export class Library { onclick(bool) { game.saveConfig("free_choose", bool, this._link.config.mode); if (!ui.create.cheat2) return; - if ( - get.mode() != this._link.config.mode || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != this._link.config.mode || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; if (!ui.cheat2 && get.config("free_choose")) ui.create.cheat2(); else if (ui.cheat2 && !get.config("free_choose")) { ui.cheat2.close(); @@ -6550,8 +6192,7 @@ export class Library { if (ui.cheat2 && ui.cheat2.backup) dialog = ui.cheat2.backup; else dialog = _status.event.dialog; if (!_status.brawl || !_status.brawl.noAddSetting) { - if (!dialog.querySelector("table") && get.config("change_identity")) - _status.event.getParent().addSetting(dialog); + if (!dialog.querySelector("table") && get.config("change_identity")) _status.event.getParent().addSetting(dialog); else _status.event.getParent().removeSetting(dialog); } ui.update(); @@ -6732,11 +6373,7 @@ export class Library { intro: "将统率三军模式下的将池重置为默认将池", clear: true, onclick() { - if ( - confirm( - "该操作不可撤销!是否清除统率三军模式的自定义将池,并将其重置为默认将池?" - ) - ) { + if (confirm("该操作不可撤销!是否清除统率三军模式的自定义将池,并将其重置为默认将池?")) { game.saveConfig("character_three", null, "versus"); alert("将池已重置"); } @@ -6893,11 +6530,7 @@ export class Library { frequent: true, onclick(bool) { game.saveConfig("free_choose", bool, this._link.config.mode); - if ( - get.mode() != this._link.config.mode || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != this._link.config.mode || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; if (!ui.cheat2 && get.config("free_choose")) ui.create.cheat2(); else if (ui.cheat2 && !get.config("free_choose")) { ui.cheat2.close(); @@ -7062,11 +6695,7 @@ export class Library { init: true, onclick(bool) { game.saveConfig("free_choose", bool, this._link.config.mode); - if ( - get.mode() != this._link.config.mode || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != this._link.config.mode || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; if (!ui.cheat2 && get.config("free_choose")) ui.create.cheat2(); else if (ui.cheat2 && !get.config("free_choose")) { ui.cheat2.close(); @@ -7084,8 +6713,7 @@ export class Library { if (ui.cheat2 && ui.cheat2.backup) dialog = ui.cheat2.backup; else dialog = _status.event.dialog; if (!_status.brawl || !_status.brawl.noAddSetting) { - if (!dialog.querySelector("table") && get.config("change_identity")) - _status.event.getParent().addSetting(dialog); + if (!dialog.querySelector("table") && get.config("change_identity")) _status.event.getParent().addSetting(dialog); else _status.event.getParent().removeSetting(dialog); } ui.update(); @@ -7120,12 +6748,7 @@ export class Library { onclick(bool) { game.saveConfig("continue_game", bool, this._link.config.mode); if (get.config("continue_game")) { - if ( - !ui.continue_game && - _status.over && - !_status.brawl && - !game.no_continue_game - ) { + if (!ui.continue_game && _status.over && !_status.brawl && !game.no_continue_game) { ui.continue_game = ui.create.control("再战", game.reloadCurrent); } } else if (ui.continue_game) { @@ -7202,10 +6825,7 @@ export class Library { var container = ui.create.div(".popup-container.editor"); var node = container; var map = get.config("character_online") || lib.characterOnline; - node.code = - "character=" + - get.stringify(map) + - "\n/*\n 这里是智斗三国模式的武将将池。\n 您可以在这里编辑对武将将池进行编辑,然后点击“保存”按钮即可保存。\n 将池中的Key势力武将,仅同时在没有被禁用的情况下,才会出现在选将框中。\n 而非Key势力的武将,只要所在的武将包没有被隐藏,即可出现在选将框中。\n 该将池为单机模式/联机模式通用将池。在这里编辑后,即使进入联机模式,也依然会生效。\n 但联机模式本身禁用的武将(如神貂蝉)不会出现在联机模式的选将框中。\n*/"; + node.code = "character=" + get.stringify(map) + "\n/*\n 这里是智斗三国模式的武将将池。\n 您可以在这里编辑对武将将池进行编辑,然后点击“保存”按钮即可保存。\n 将池中的Key势力武将,仅同时在没有被禁用的情况下,才会出现在选将框中。\n 而非Key势力的武将,只要所在的武将包没有被隐藏,即可出现在选将框中。\n 该将池为单机模式/联机模式通用将池。在这里编辑后,即使进入联机模式,也依然会生效。\n 但联机模式本身禁用的武将(如神貂蝉)不会出现在联机模式的选将框中。\n*/"; ui.window.classList.add("shortcutpaused"); ui.window.classList.add("systempaused"); var saveInput = function () { @@ -7284,11 +6904,7 @@ export class Library { intro: "将智斗三国模式下的将池重置为默认将池", clear: true, onclick() { - if ( - confirm( - "该操作不可撤销!是否清除智斗三国模式的自定义将池,并将其重置为默认将池?" - ) - ) { + if (confirm("该操作不可撤销!是否清除智斗三国模式的自定义将池,并将其重置为默认将池?")) { game.saveConfig("character_online", null, "doudizhu"); alert("将池已重置"); } @@ -7523,11 +7139,7 @@ export class Library { init: true, onclick(bool) { game.saveConfig("free_choose", bool, this._link.config.mode); - if ( - get.mode() != this._link.config.mode || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != this._link.config.mode || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; if (!ui.cheat2 && get.config("free_choose")) ui.create.cheat2(); else if (ui.cheat2 && !get.config("free_choose")) { ui.cheat2.close(); @@ -7801,10 +7413,7 @@ export class Library { init: false, frequent: true, restart: function () { - return ( - _status.event.getParent().name != "chooseCharacter" || - _status.event.name != "chooseButton" - ); + return _status.event.getParent().name != "chooseCharacter" || _status.event.name != "chooseButton"; }, }, free_choose: { @@ -7813,11 +7422,7 @@ export class Library { onclick(bool) { game.saveConfig("free_choose", bool, this._link.config.mode); if (_status.connectMode) return; - if ( - get.mode() != this._link.config.mode || - (!_status.event.getParent().showConfig && !_status.event.showConfig) - ) - return; + if (get.mode() != this._link.config.mode || (!_status.event.getParent().showConfig && !_status.event.showConfig)) return; if (!ui.cheat2 && get.config("free_choose")) ui.create.cheat2(); else if (ui.cheat2 && !get.config("free_choose")) { ui.cheat2.close(); @@ -7863,11 +7468,8 @@ export class Library { globalId: 0, }; help = { - 关于游戏: - '
关于无名杀