"use strict"; game.import("mode", function (lib, game, ui, get, ai, _status) { return { name: "brawl", game: { syncMenu: true, }, start: function () { ui.auto.hide(); if (!lib.storage.scene) { lib.storage.scene = {}; } if (!lib.storage.stage) { lib.storage.stage = {}; } if (!_status.extensionmade) { _status.extensionmade = []; } if (_status.extensionscene) { game.save("scene", lib.storage.scene); } if (_status.extensionstage) { game.save("stage", lib.storage.stage); } var dialog = ui.create.dialog("hidden"); dialog.classList.add("fixed"); dialog.classList.add("scroll1"); dialog.classList.add("scroll2"); dialog.classList.add("fullwidth"); dialog.classList.add("fullheight"); dialog.classList.add("noupdate"); dialog.classList.add("character"); dialog.contentContainer.style.overflow = "visible"; dialog.style.overflow = "hidden"; dialog.content.style.height = "100%"; dialog.contentContainer.style.transition = "all 0s"; if (!lib.storage.directStage) dialog.open(); var packnode = ui.create.div(".packnode", dialog); lib.setScroll(packnode); var clickCapt = function () { var active = this.parentNode.querySelector(".active"); if (this.link == "stage") { if (get.is.empty(lib.storage.scene)) { alert("请创建至少1个场景"); return; } } if (active) { if (active == this) return; for (var i = 0; i < active.nodes.length; i++) { active.nodes[i].remove(); if (active.nodes[i].showcaseinterval) { clearInterval(active.nodes[i].showcaseinterval); delete active.nodes[i].showcaseinterval; } } active.classList.remove("active"); } this.classList.add("active"); for (var i = 0; i < this.nodes.length; i++) { dialog.content.appendChild(this.nodes[i]); } var showcase = this.nodes[this.nodes.length - 1]; showcase.style.height = dialog.content.offsetHeight - showcase.offsetTop + "px"; if (typeof showcase.action == "function") { if (showcase.action(showcase._showcased ? false : true) !== false) { showcase._showcased = true; } } if (this._nostart) start.style.display = "none"; else start.style.display = ""; game.save("currentBrawl", this.link); }; var createNode = function (name) { var info = lib.brawl[name]; var node = ui.create.div(".dialogbutton.menubutton.large", info.name, packnode, clickCapt); node.style.transition = "all 0s"; var caption = info.name; var modeinfo = ""; if (info.mode) { modeinfo = get.translation(info.mode) + "模式"; } if (info.submode) { if (modeinfo) { modeinfo += " - "; } modeinfo += info.submode; } var intro; if (Array.isArray(info.intro)) { intro = '