diff --git a/project/plugins.js b/project/plugins.js index dca292a..a8900d6 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -1,266 +1,267 @@ -var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = -{ - "init": function () { - this._afterLoadResources = function () { - // 本函数将在所有资源加载完毕后,游戏开启前被执行 - core.ui.statusBar.init(); - core.dom.playGame.style.fontFamily = "pala"; - core.dom.loadGame.style.fontFamily = "pala"; - core.dom.CGMode.style.fontFamily = "pala"; - core.dom.musicMode.style.fontFamily = "pala"; - core.dom.replayGame.style.fontFamily = "pala"; - core.registerEvent("changeMouse", function (data) { - if (!main.replayChecking && !core.isReplaying()) - core.changeMouse( - data.icon, - data.div, - data.translate[0], - data.translate[1], - data.scale[0], - data.scale[1], - data.angel, - data.px, - data.py - ); - core.doAction(); - }); - core.registerEvent("removeMouse", function (data) { - if (!main.replayChecking && !core.isReplaying()) - core.removeMouse(data.div); - core.doAction(); - }); - core.registerEvent("addPop", function (data) { - if (!main.replayChecking && !core.isReplaying()) { - data.value = core.replaceText(data.value); - core.addPop( - data.value, - data.px, - data.py, - data.color, - data.boldColor, - data.left, - data.jump, - data.time, - data.show, - data.font, - data.speed - ); - } - core.doAction(); - }); - core.registerEvent("drawWarning", function (data) { - if (!main.replayChecking && !core.isReplaying()) { - data.text = core.replaceText(data.text); - data.text2 = core.replaceText(data.text2); - core.drawWarning( - data.x, - data.y, - data?.text, - data?.text2, - data?.warning, - data.large, - data.size - ); +var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = { + init: function () { + this._afterLoadResources = function () { + // 本函数将在所有资源加载完毕后,游戏开启前被执行 + core.ui.statusBar.init(); + core.dom.playGame.style.fontFamily = "pala"; + core.dom.loadGame.style.fontFamily = "pala"; + core.dom.CGMode.style.fontFamily = "pala"; + core.dom.musicMode.style.fontFamily = "pala"; + core.dom.replayGame.style.fontFamily = "pala"; + core.registerEvent("changeMouse", function (data) { + if (!main.replayChecking && !core.isReplaying()) + core.changeMouse( + data.icon, + data.div, + data.translate[0], + data.translate[1], + data.scale[0], + data.scale[1], + data.angel, + data.px, + data.py + ); + core.doAction(); + }); + core.registerEvent("removeMouse", function (data) { + if (!main.replayChecking && !core.isReplaying()) + core.removeMouse(data.div); + core.doAction(); + }); + core.registerEvent("addPop", function (data) { + if (!main.replayChecking && !core.isReplaying()) { + data.value = core.replaceText(data.value); + core.addPop( + data.value, + data.px, + data.py, + data.color, + data.boldColor, + data.left, + data.jump, + data.time, + data.show, + data.font, + data.speed + ); + } + core.doAction(); + }); + core.registerEvent("drawWarning", function (data) { + if (!main.replayChecking && !core.isReplaying()) { + data.text = core.replaceText(data.text); + data.text2 = core.replaceText(data.text2); + core.drawWarning( + data.x, + data.y, + data?.text, + data?.text2, + data?.warning, + data.large, + data.size + ); - setTimeout(() => core.doAction(), 3100); - } else { - core.doAction(); - } - }); + setTimeout(() => core.doAction(), 3100); + } else { + core.doAction(); + } + }); - core.registerEvent("over", function (data) { - let image = data.image ?? ""; - let time = data.time ?? 3000; - let sound = data.sound ?? ""; - let textColor = data.textColor ?? "#FFFFFF"; - let boldColor = data.boldColor ?? "#000000"; - let font = data.font ?? "bold 48px Verdana"; - let text = data.text ?? ""; - let hidetime = data.hidetime ?? 100; - if (!main.replayChecking && !core.isReplaying()) { - core.over( - image, - data.memory, - time, - hidetime, - sound, - textColor, - boldColor, - font, - text - ); - } else { - core.doAction(); - } - }); - core.registerEvent("changebg", function (data) { - if (!main.replayChecking && !core.isReplaying()) { - core.changebg( - data.img1, - data.memory1, - data.img2, - data.memory2, - data.time, - data.style - ); - } else { - core.doAction(); - } - }); - core.registerEvent("overlist", function (data) { - if (!main.replayChecking && !core.isReplaying()) { - core.overlist( - data.image, - data.memory, - data.hidetime || 30, - data.list || [{ - text: "", - sound: "", - time: 50, - textColor: "#FFFFFF", - boldColor: "#000000", - font: "bold 48px Verdana", - frame: 0, - }, ] - ); - } else { - core.doAction(); - } - }); - core.registerEvent("op", function (data) { - if (!main.replayChecking && !core.isReplaying()) { - core.openvideo(); - } else { - core.doAction(); - } - }); - core.registerEvent("animationDrawable", function (data) { - if (!main.replayChecking && !core.isReplaying()) { - core.animationDrawable( - data.allFarme, - data.color, - data.globalAlpha, - data.imageList, - data.soundList - ); - } else { - core.doAction(); - } - }); - core.registerEvent("setanimate", function (data) { - data.px = data.px ?? 0; - data.py = data.py ?? 0; - core.setanimate( - data.name, - data.px, - data.py, - data.width, - data.height, - data.allFarme, - data.imageList, - data.soundList - ); - core.doAction(); - }); - core.registerEvent("clearanimate", function (data) { - core.plugin.playing.clear(); + core.registerEvent("over", function (data) { + let image = data.image ?? ""; + let time = data.time ?? 3000; + let sound = data.sound ?? ""; + let textColor = data.textColor ?? "#FFFFFF"; + let boldColor = data.boldColor ?? "#000000"; + let font = data.font ?? "bold 48px Verdana"; + let text = data.text ?? ""; + let hidetime = data.hidetime ?? 100; + if (!main.replayChecking && !core.isReplaying()) { + core.over( + image, + data.memory, + time, + hidetime, + sound, + textColor, + boldColor, + font, + text + ); + } else { + core.doAction(); + } + }); + core.registerEvent("changebg", function (data) { + if (!main.replayChecking && !core.isReplaying()) { + core.changebg( + data.img1, + data.memory1, + data.img2, + data.memory2, + data.time, + data.style + ); + } else { + core.doAction(); + } + }); + core.registerEvent("overlist", function (data) { + if (!main.replayChecking && !core.isReplaying()) { + core.overlist( + data.image, + data.memory, + data.hidetime || 30, + data.list || [ + { + text: "", + sound: "", + time: 50, + textColor: "#FFFFFF", + boldColor: "#000000", + font: "bold 48px Verdana", + frame: 0, + }, + ] + ); + } else { + core.doAction(); + } + }); + core.registerEvent("op", function (data) { + if (!main.replayChecking && !core.isReplaying()) { + core.openvideo(); + } else { + core.doAction(); + } + }); + core.registerEvent("animationDrawable", function (data) { + if (!main.replayChecking && !core.isReplaying()) { + core.animationDrawable( + data.allFarme, + data.color, + data.globalAlpha, + data.imageList, + data.soundList + ); + } else { + core.doAction(); + } + }); + core.registerEvent("setanimate", function (data) { + data.px = data.px ?? 0; + data.py = data.py ?? 0; + core.setanimate( + data.name, + data.px, + data.py, + data.width, + data.height, + data.allFarme, + data.imageList, + data.soundList + ); + core.doAction(); + }); + core.registerEvent("clearanimate", function (data) { + core.plugin.playing.clear(); - core.doAction(); - }); - core.registerEvent("deleteanimate", function (data) { - core.deleteanimate(data.name); - core.doAction(); - }); - core.registerEvent("playanimate", function (data) { - if (!main.replayChecking && !core.isReplaying()) { - data.x = data.x ?? 0; - data.y = data.y ?? 0; - data.scalex = data.scalex ?? 1; - data.scaley = data.scaley ?? 1; - core.playanimate( - data.name, - data.x, - data.y, - data.hero, - data.scalex, - data.scaley - ); - core.doAction(); - } else { - core.doAction(); - } - }); - core.registerEvent("cgtextList", function (data) { - core.ui.cgText.textList = core.plugin[data.textList]; - core.doAction(); - }); - core.registerEvent("cgtext", function (data) { - if (!main.replayChecking && !core.isReplaying()) { - core.ui.cgText.image = data.bg; - core.ui.cgText.memory = data.memory; - core.ui.cgText.head = core.clone(data.head); - core.ui.cgText.index = data.index; - core.ui.cgText.name = core.ui.cgText.textList[data.index][0]; - core.ui.cgText.text = data.text ? - data.text : - core.ui.cgText.textList[data.index][1]; - core.ui.cgText.time = data.time; - core.ui.cgText.wait = data.wait; - core.ui.cgText.WindowSkin = data.WindowSkin; - core.ui.cgText.sound = - data.sound === "" ? - data.sound : - core.ui.cgText.textList[data.index][2] || ""; - core.ui.cgText.bodyList = core.clone(data.bodyList); - main.dom.cgText.style.display = "block"; - core.ui.cgText.update(); - } else { - core.doAction(); - } - }); - core.registerEvent("introAndLoop", function (data) { - if (!main.replayChecking && !core.isReplaying()) { - core.plugin.introAndLoop(data.intro, data.time, data.loop); - core.doAction(); - } else { - core.doAction(); - } - }); - core.registerEvent("setq", function (data) { - core.setFlag("任务地点", data.id); + core.doAction(); + }); + core.registerEvent("deleteanimate", function (data) { + core.deleteanimate(data.name); + core.doAction(); + }); + core.registerEvent("playanimate", function (data) { + if (!main.replayChecking && !core.isReplaying()) { + data.x = data.x ?? 0; + data.y = data.y ?? 0; + data.scalex = data.scalex ?? 1; + data.scaley = data.scaley ?? 1; + core.playanimate( + data.name, + data.x, + data.y, + data.hero, + data.scalex, + data.scaley + ); + core.doAction(); + } else { + core.doAction(); + } + }); + core.registerEvent("cgtextList", function (data) { + core.ui.cgText.textList = core.plugin[data.textList]; + core.doAction(); + }); + core.registerEvent("cgtext", function (data) { + if (!main.replayChecking && !core.isReplaying()) { + core.ui.cgText.image = data.bg; + core.ui.cgText.memory = data.memory; + core.ui.cgText.head = core.clone(data.head); + core.ui.cgText.index = data.index; + core.ui.cgText.name = core.ui.cgText.textList[data.index][0]; + core.ui.cgText.text = data.text + ? data.text + : core.ui.cgText.textList[data.index][1]; + core.ui.cgText.time = data.time; + core.ui.cgText.wait = data.wait; + core.ui.cgText.WindowSkin = data.WindowSkin; + core.ui.cgText.sound = + data.sound === "" + ? data.sound + : core.ui.cgText.textList[data.index][2] || ""; + core.ui.cgText.bodyList = core.clone(data.bodyList); + main.dom.cgText.style.display = "block"; + core.ui.cgText.update(); + } else { + core.doAction(); + } + }); + core.registerEvent("introAndLoop", function (data) { + if (!main.replayChecking && !core.isReplaying()) { + core.plugin.introAndLoop(data.intro, data.time, data.loop); + core.doAction(); + } else { + core.doAction(); + } + }); + core.registerEvent("setq", function (data) { + core.setFlag("任务地点", data.id); - core.doAction(); - }); + core.doAction(); + }); - core.registerEvent("setmusics", function (data) { - if ( - (core.getLocalStorage("musics") && - core.getLocalStorage("musics").length === 0) || - !core.getLocalStorage("musics") - ) - core.setLocalStorage("musics", ["theme.mp3"]); - let a = core.getLocalStorage("musics"); - if (!data.bgm) { - core.setLocalStorage("musics", ["theme.mp3"]); - } else { - if (!a.includes(data.bgm)) a.push(data.bgm); - core.setLocalStorage("musics", a); - } - core.doAction(); - }); - core.registerEvent("setcgs", function (data) { - if (!data.img) { - core.setLocalStorage("cgs", []); - } else { - let a = core.getLocalStorage("cgs") ?? []; - if (!a.includes(data.img)) a.push(data.img); - core.setLocalStorage("cgs", a); - } - core.doAction(); - }); - }; -}, - "drawLight": function () { + core.registerEvent("setmusics", function (data) { + if ( + (core.getLocalStorage("musics") && + core.getLocalStorage("musics").length === 0) || + !core.getLocalStorage("musics") + ) + core.setLocalStorage("musics", ["theme.mp3"]); + let a = core.getLocalStorage("musics"); + if (!data.bgm) { + core.setLocalStorage("musics", ["theme.mp3"]); + } else { + if (!a.includes(data.bgm)) a.push(data.bgm); + core.setLocalStorage("musics", a); + } + core.doAction(); + }); + core.registerEvent("setcgs", function (data) { + if (!data.img) { + core.setLocalStorage("cgs", []); + } else { + let a = core.getLocalStorage("cgs") ?? []; + if (!a.includes(data.img)) a.push(data.img); + core.setLocalStorage("cgs", a); + } + core.doAction(); + }); + }; + }, + drawLight: function () { // 绘制灯光/漆黑层效果。调用方式 core.plugin.drawLight(...) // 【参数说明】 // name:必填,要绘制到的画布名;可以是一个系统画布,或者是个自定义画布;如果不存在则创建 @@ -326,7 +327,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = // 可以在任何地方(如afterXXX或自定义脚本事件)调用函数,方法为 core.plugin.xxx(); }; }, - "shop": function () { + shop: function () { // 【全局商店】相关的功能 // // 打开一个全局商店 @@ -602,7 +603,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = 60 ); }, - "removeMap": function () { + removeMap: function () { // 高层塔砍层插件,删除后不会存入存档,不可浏览地图也不可飞到。 // 推荐用法: // 对于超高层或分区域塔,当在1区时将2区以后的地图删除;1区结束时恢复2区,进二区时删除1区地图,以此类推 @@ -691,7 +692,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }); }; }, - "fiveLayers": function () { + fiveLayers: function () { // 是否启用五图层(增加背景2层和前景2层) 将__enable置为true即会启用;启用后请保存后刷新编辑器 // 背景层2将会覆盖背景层 被事件层覆盖 前景层2将会覆盖前景层 // 另外 请注意加入两个新图层 会让大地图的性能降低一些 @@ -893,7 +894,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }; }; }, - "itemShop": function () { + itemShop: function () { // 道具商店相关的插件 // 可在全塔属性-全局商店中使用「道具商店」事件块进行编辑(如果找不到可以在入口方块中找) @@ -1295,7 +1296,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ]); }; }, - "enemyLevel": function () { + enemyLevel: function () { // 此插件将提供怪物手册中的怪物境界显示 // 使用此插件需要先给每个怪物定义境界,方法如下: // 点击怪物的【配置表格】,找到“【怪物】相关的表格配置”,然后在【名称】仿照增加境界定义: @@ -1463,7 +1464,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ); }; }, - "multiHeros": function () { + multiHeros: function () { // 多角色插件 // Step 1: 启用本插件 // Step 2: 定义每个新的角色各项初始数据(参见下方注释) @@ -1617,7 +1618,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.setFlag("heroId", toHeroId); // 保存切换到的角色ID }; }, - "heroFourFrames": function () { + heroFourFrames: function () { // 样板的勇士/跟随者移动时只使用2、4两帧,观感较差。本插件可以将四帧全用上。 // 是否启用本插件 @@ -1680,7 +1681,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = return false; }; }, - "routeFixing": function () { + routeFixing: function () { // 是否开启本插件,true 表示启用,false 表示禁用。 var __enable = true; if (!__enable) return; @@ -1804,7 +1805,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = 100 ); }, - "numpad": function () { + numpad: function () { // 样板自带的整数输入事件为白屏弹窗且可以误输入任意非法内容但不支持负整数,观感较差。本插件可以将其美化成仿RM样式,使其支持负整数同时带有音效 // 另一方面,4399等第三方平台不允许使用包括 core.myprompt() 和 core.myconfirm() 在内的弹窗,因此也需要此插件来替代,不然类似生命魔杖的道具就不好实现了 // 关于负整数输入,V2.8.2原生支持其录像的压缩和解压,只是默认的 core.events._action_input() 函数将负数取了绝对值,可以只复写下面的 core.isReplaying() 部分来取消 @@ -2061,7 +2062,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }; }, - "sprites": function () { + sprites: function () { // 基于canvas的sprite化,摘编整理自万宁魔塔 // // ---------------------------------------- 第一部分 js代码 (必装) --------------------------------------- // @@ -2265,7 +2266,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = window.Sprite = Sprite; }, - "hotReload": function () { + hotReload: function () { /* ---------- 功能说明 ---------- * 1. 当 libs/ main.js index.html 中的任意一个文件被更改后,会自动刷新塔的页面 @@ -2522,7 +2523,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } })(); }, - "statusBar": function () { + statusBar: function () { main.dom.floorMsgGroup.style.display = "none"; main.dom.statusBar.style.display = "none"; main.dom.toolBar.style.display = "none"; @@ -3735,7 +3736,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }; // init() called in `afterLoadResources`. }, - "override": function () { + override: function () { core.statusBar.icons = { floor: 0, name: null, @@ -4321,7 +4322,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (callback) callback(); }; }, - "额外信息": function () { + 额外信息: function () { /* 宝石血瓶左下角显示数值 * 注意!!!不要在道具属性中直接操作flags,使用core.status.hero.flags或core.setFlag系列函数代替! * 需要将 变量:itemDetail改为true才可正常运行 @@ -4478,7 +4479,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } } }, - "编辑器显伤": function () { + 编辑器显伤: function () { // 在此增加新插件 /////// 用户设置 /////// // 将__enable置为false将关闭插件 @@ -4752,7 +4753,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }; }, - "手册区分特殊属性": function () { + 手册区分特殊属性: function () { // 在此增加新插件 this.arrsame = function (Arraya, Arrayb) { let a = Arraya || []; @@ -5104,7 +5105,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = return [enemy, texts]; }; }, - "一防减伤": function () { + 一防减伤: function () { // 在此增加新插件 ui.prototype._drawBook_drawRow3 = function ( index, @@ -5178,7 +5179,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = return this.getDefDamage(enemy, null, x, y, floorId); }; }, - "新道具栏/装备栏": function () { + "新道具栏/装备栏": function () { // 在此增加新插件 // 注:///// *** 裹起来的区域: 该区域内参数可以随意更改调整ui绘制 不会影响总体布局 // 请尽量修改该区域而不是其他区域 修改的时候最好可以对照现有ui修改 @@ -6615,7 +6616,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.registerReplayAction("equip", core.control._replayAction_equip); core.registerReplayAction("unEquip", core.control._replayAction_unEquip); }, - "技能树": function () { + 技能树: function () { // 在此增加新插件 // // 已学习的技能等级 flags._hasSkill_ @@ -7417,7 +7418,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }; core.registerReplayAction("skill", control.prototype._replayAction_skill); }, - "animate": function () { + animate: function () { // -------------------- 插件说明 -------------------- // // github仓库:https://github.com/unanmed/animate @@ -8291,7 +8292,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = inverseTrigo: N, }; }, - "func": function () { + func: function () { // 功能函数集,具体有哪些函数看每个函数前的注释即可 // 安装方式:直接复制到插件里面,注意新建插件自带的 function () { } 不能删 // 使用方式:可以直接使用对象解构按需引入 @@ -8731,7 +8732,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }; }, - "音频系统": function () { + 音频系统: function () { // 在此增加新插件 /*首先,在造塔群下载所需的库文件,然后放置在塔目录下的 libs/thirdparty 或其他目录下,之后在 index.html 的最后加上下面这几行: @@ -10818,7 +10819,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.ui._drawSwitchs_sounds(); }; }, - "自定义常用事件": function () { + 自定义常用事件: function () { // editorBlocklyconfigPlus.js // 自訂常見事件模板插件 // 本插件引用了通用函數插件(Utility.js) @@ -12107,7 +12108,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = .split("// end mark sfergsvae")[0]; } }, - "夹击激光动画": function () { + 夹击激光动画: function () { function createCanvas(name, zIndex) { if (!name) return; var canvas = document.createElement("canvas"); @@ -12338,7 +12339,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }; }, - "瞬移轨迹": function () { + 瞬移轨迹: function () { // 在此增加新插件 function popMove() { var ctx = core.getContextByName("popMove"); @@ -12414,7 +12415,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }; }, - "墓碑(编辑器)": function () { + "墓碑(编辑器)": function () { // 在此增加新插件 if (main.mode != "editor") return; // 编辑器模式下使用 var mapData = null; @@ -12485,7 +12486,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.setAlpha("event2", alpha); }; }, - "小地图": function () { + 小地图: function () { // 在此增加新插件 // ----- 不可自定义 杂七杂八的变量 /** @type {{[x: string]: BFSResult}} */ @@ -12928,7 +12929,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }; }, - "楼传": function () { + 楼传: function () { // 在此增加新插件 core.canMoveFloor = function () { @@ -14053,513 +14054,510 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = 0 ); }, - "CG回廊": function () { - // 在此增加新插件 - const CGUI = document.createElement("canvas"); //CGui画布设置 - CGUI.style.position = "absolute"; - CGUI.style.zIndex = 300; - CGUI.style.display = "none"; - CGUI.id = "CGUI"; - main.dom.gameGroup.insertAdjacentElement("afterend", CGUI); - CGUI.style.top = "50%"; - CGUI.style.left = "50%"; - CGUI.style.transform = "translate(-50%,-50%)"; - const ctx = CGUI.getContext("2d"); - main.dom.CGUI = CGUI; - let page = 0; //初始页面 - let show = false; //展示状态 - CGUI.onclick = function (e) { - try { - e.preventDefault(); - if (core.isPlaying()) return false; - const left = core.dom.gameGroup.offsetLeft; - const top = core.dom.gameGroup.offsetTop; - const px = Math.floor((e.clientX - left) / core.domStyle.scale), - py = Math.floor((e.clientY - top) / core.domStyle.scale); - core.ui.CG.onclick(px * 3, py * 3); - } catch (ee) { - main.log(ee); - } - }; + CG回廊: function () { + // 在此增加新插件 + const CGUI = document.createElement("canvas"); //CGui画布设置 + CGUI.style.position = "absolute"; + CGUI.style.zIndex = 300; + CGUI.style.display = "none"; + CGUI.id = "CGUI"; + main.dom.gameGroup.insertAdjacentElement("afterend", CGUI); + CGUI.style.top = "50%"; + CGUI.style.left = "50%"; + CGUI.style.transform = "translate(-50%,-50%)"; + const ctx = CGUI.getContext("2d"); + main.dom.CGUI = CGUI; + let page = 0; //初始页面 + let show = false; //展示状态 + CGUI.onclick = function (e) { + try { + e.preventDefault(); + if (core.isPlaying()) return false; + const left = core.dom.gameGroup.offsetLeft; + const top = core.dom.gameGroup.offsetTop; + const px = Math.floor((e.clientX - left) / core.domStyle.scale), + py = Math.floor((e.clientY - top) / core.domStyle.scale); + core.ui.CG.onclick(px * 3, py * 3); + } catch (ee) { + main.log(ee); + } + }; - class CG { - constructor() { - this.cgs; - //cg列表 - this.UIMx = [ - //空位用‘none’填充,当前ui3*2 - [ - ["eve_010102.webp", "eve_010203.webp", "eve_010304.webp"], - ["eve_010501.webp", "eve_010601.webp", "eve_010701.webp"], - ], - [ - ["eve_010801.webp", "eve_010902.webp", "eve_011001.webp"], - ["eve_011101.webp", "eve_011202.webp", "eve_011302.webp"], - ], - [ - ["eve_011402.webp", "eve_020102.webp", "eve_020201.webp"], - ["eve_020301.webp", "eve_020401.webp", "eve_020501.webp"], - ], - [ - ["eve_020605.webp", "eve_020701.webp", "eve_020801.webp"], - ["eve_030101.webp", "eve_030206.webp", "eve_030302.webp"], - ], - [ - ["eve_030508.webp", "eve_030601.webp", "eve_030801.webp"], - ["eve_030901.webp", "eve_031002.webp", "eve_031101.webp"], - ], - [ - ["eve_040201.webp", "eve_040401.webp", "eve_040501.webp"], - ["eve_040601.webp", "eve_040702.webp", "eve_040801.webp"], - ], - [ - ["eve_050101.webp", "eve_050201.webp", "eve_050401.webp"], - ["eve_050501.webp", "eve_050601.webp", "eve_050704.webp"], - ], - [ - ["eve_050801.webp", "eve_070101.webp", "bg_1511.webp"], - ["bg_1521.webp", "bg_2011.webp", "bg_2521.webp"], - ], - [ - ["bg_3042.webp", "bg_3551.webp", "bg_3571.webp"], - ["bg_3721.webp", "bg_5033.webp", "bg_5044.webp"], - ], - ]; - } + class CG { + constructor() { + this.cgs; + //cg列表 + this.UIMx = [ + //空位用‘none’填充,当前ui3*2 + [ + ["eve_010102.webp", "eve_010203.webp", "eve_010304.webp"], + ["eve_010501.webp", "eve_010601.webp", "eve_010701.webp"], + ], + [ + ["eve_010801.webp", "eve_010902.webp", "eve_011001.webp"], + ["eve_011101.webp", "eve_011202.webp", "eve_011302.webp"], + ], + [ + ["eve_011402.webp", "eve_020102.webp", "eve_020201.webp"], + ["eve_020301.webp", "eve_020401.webp", "eve_020501.webp"], + ], + [ + ["eve_020605.webp", "eve_020701.webp", "eve_020801.webp"], + ["eve_030101.webp", "eve_030206.webp", "eve_030302.webp"], + ], + [ + ["eve_030508.webp", "eve_030601.webp", "eve_030801.webp"], + ["eve_030901.webp", "eve_031002.webp", "eve_031101.webp"], + ], + [ + ["eve_040201.webp", "eve_040401.webp", "eve_040501.webp"], + ["eve_040601.webp", "eve_040702.webp", "eve_040801.webp"], + ], + [ + ["eve_050101.webp", "eve_050201.webp", "eve_050401.webp"], + ["eve_050501.webp", "eve_050601.webp", "eve_050704.webp"], + ], + [ + ["eve_050801.webp", "eve_070101.webp", "bg_1511.webp"], + ["bg_1521.webp", "bg_2011.webp", "bg_2521.webp"], + ], + [ + ["bg_3042.webp", "bg_3551.webp", "bg_3571.webp"], + ["bg_3721.webp", "bg_5033.webp", "bg_5044.webp"], + ], + ]; + } - //更新 - update() { - this.background(); - this.drawUI(); - } - background() { - //画布大小设置 - if (core.domStyle.isVertical) { - CGUI.width = 1248; - CGUI.height = 2028; - } else { - CGUI.width = 2028; - CGUI.height = 1248; - } - core.setTextAlign(ctx, "center"); - } - onclick(px, py) { - //点击 + //更新 + update() { + this.background(); + this.drawUI(); + } + background() { + //画布大小设置 + if (core.domStyle.isVertical) { + CGUI.width = 1248; + CGUI.height = 2028; + } else { + CGUI.width = 2028; + CGUI.height = 1248; + } + core.setTextAlign(ctx, "center"); + } + onclick(px, py) { + //点击 - if (show) { - show = !show; - core.clearMap(ctx); - this.update(); - return; - } - const makeBox = ([x, y], [w, h]) => { - return [ - [x, y], - [x + w, y + h], - ]; - }; - const inRect = ([x, y], [ - [sx, sy], - [dx, dy] - ]) => { - return sx <= x && x <= dx && sy <= y && y <= dy; - }; - const pos = [px, py]; - const backbox = makeBox([15, 35], [210, 90]); - if (inRect(pos, backbox)) { - //离开按钮是一致的,其余的记区分横竖屏 - CGUI.style.display = "none"; - core.clearMap(ctx); - core.restart(); - return; - } - if (core.domStyle.isVertical) { - //竖屏 - const pageupbox = makeBox([200, 1830], [200, 100]); - const pagedownbox = makeBox([900, 1830], [200, 100]); + if (show) { + show = !show; + core.clearMap(ctx); + this.update(); + return; + } + const makeBox = ([x, y], [w, h]) => { + return [ + [x, y], + [x + w, y + h], + ]; + }; + const inRect = ([x, y], [[sx, sy], [dx, dy]]) => { + return sx <= x && x <= dx && sy <= y && y <= dy; + }; + const pos = [px, py]; + const backbox = makeBox([15, 35], [210, 90]); + if (inRect(pos, backbox)) { + //离开按钮是一致的,其余的记区分横竖屏 + CGUI.style.display = "none"; + core.clearMap(ctx); + core.restart(); + return; + } + if (core.domStyle.isVertical) { + //竖屏 + const pageupbox = makeBox([200, 1830], [200, 100]); + const pagedownbox = makeBox([900, 1830], [200, 100]); - const imagebox0 = makeBox([50, 200], [560, 420]); - const imagebox1 = makeBox([50, 750], [560, 420]); - const imagebox2 = makeBox([50, 1300], [560, 420]); + const imagebox0 = makeBox([50, 200], [560, 420]); + const imagebox1 = makeBox([50, 750], [560, 420]); + const imagebox2 = makeBox([50, 1300], [560, 420]); - const imagebox3 = makeBox([650, 200], [560, 420]); - const imagebox4 = makeBox([650, 750], [560, 420]); - const imagebox5 = makeBox([650, 1300], [560, 420]); - if (inRect(pos, pagedownbox)) { - //2代表当前最大页数-1 - if (page < this.UIMx.length - 1) { - page++; - core.clearMap(ctx); - this.update(); - } - } else if (inRect(pos, pageupbox)) { - if (page > 0) { - page--; - core.clearMap(ctx); - this.update(); - } - } else if (inRect(pos, imagebox0)) { - if (this.cgs.includes(this.UIMx[page][0][0])) { - const img = core.material.images.images[this.UIMx[page][0][0]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; - } - } - } else if (inRect(pos, imagebox1)) { - if (this.cgs.includes(this.UIMx[page][0][1])) { - const img = core.material.images.images[this.UIMx[page][0][1]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; - } - } - } else if (inRect(pos, imagebox2)) { - if (this.cgs.includes(this.UIMx[page][0][2])) { - const img = core.material.images.images[this.UIMx[page][0][2]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; - } - } - } else if (inRect(pos, imagebox3)) { - if (this.cgs.includes(this.UIMx[page][1][0])) { - const img = core.material.images.images[this.UIMx[page][1][0]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; - } - } - } else if (inRect(pos, imagebox4)) { - if (this.cgs.includes(this.UIMx[page][1][1])) { - const img = core.material.images.images[this.UIMx[page][1][1]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; - } - } - } else if (inRect(pos, imagebox5)) { - if (this.cgs.includes(this.UIMx[page][1][2])) { - const img = core.material.images.images[this.UIMx[page][1][2]]; - if (img) { - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.restore(); //重置画布设置 - show = !show; - } - } - } - } else { - const pageupbox = makeBox([200, 1110], [200, 100]); - const pagedownbox = makeBox([1600, 1110], [200, 100]); - const imagebox0 = makeBox([75, 150], [600, 450]); - const imagebox1 = makeBox([725, 150], [600, 450]); - const imagebox2 = makeBox([1300, 150], [600, 450]); - const imagebox3 = makeBox([75, 650], [600, 450]); - const imagebox4 = makeBox([725, 650], [600, 450]); - const imagebox5 = makeBox([1375, 650], [600, 450]); - if (inRect(pos, pagedownbox)) { - if (page < this.UIMx.length - 1) { - page++; - core.clearMap(ctx); - this.update(); - } - } else if (inRect(pos, pageupbox)) { - if (page > 0) { - page--; - core.clearMap(ctx); - this.update(); - } - } else if (inRect(pos, imagebox0)) { - if (this.cgs.includes(this.UIMx[page][0][0])) { - const img = core.material.images.images[this.UIMx[page][0][0]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; - } - } - } else if (inRect(pos, imagebox1)) { - if (this.cgs.includes(this.UIMx[page][0][1])) { - const img = core.material.images.images[this.UIMx[page][0][1]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; - } - } - } else if (inRect(pos, imagebox2)) { - if (this.cgs.includes(this.UIMx[page][0][2])) { - const img = core.material.images.images[this.UIMx[page][0][2]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; - } - } - } else if (inRect(pos, imagebox3)) { - if (this.cgs.includes(this.UIMx[page][1][0])) { - const img = core.material.images.images[this.UIMx[page][1][0]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; - } - } - } else if (inRect(pos, imagebox4)) { - if (this.cgs.includes(this.UIMx[page][1][1])) { - const img = core.material.images.images[this.UIMx[page][1][1]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; - } - } - } else if (inRect(pos, imagebox5)) { - if (this.cgs.includes(this.UIMx[page][1][2])) { - const img = core.material.images.images[this.UIMx[page][1][2]]; - if (img) { - ctx.drawImage(img, 0, 0, 2028, 1248); - show = !show; - } - } - } - } - } - drawUI() { - //绘制页面 - core.clearMap(CGUI); - const bgVertical = core.material.images.images["bg_2010.webp"]; //竖屏背景 - const bg = core.material.images.images["bg_5043.webp"]; //横屏背景 + const imagebox3 = makeBox([650, 200], [560, 420]); + const imagebox4 = makeBox([650, 750], [560, 420]); + const imagebox5 = makeBox([650, 1300], [560, 420]); + if (inRect(pos, pagedownbox)) { + //2代表当前最大页数-1 + if (page < this.UIMx.length - 1) { + page++; + core.clearMap(ctx); + this.update(); + } + } else if (inRect(pos, pageupbox)) { + if (page > 0) { + page--; + core.clearMap(ctx); + this.update(); + } + } else if (inRect(pos, imagebox0)) { + if (this.cgs.includes(this.UIMx[page][0][0])) { + const img = core.material.images.images[this.UIMx[page][0][0]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } + } + } else if (inRect(pos, imagebox1)) { + if (this.cgs.includes(this.UIMx[page][0][1])) { + const img = core.material.images.images[this.UIMx[page][0][1]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } + } + } else if (inRect(pos, imagebox2)) { + if (this.cgs.includes(this.UIMx[page][0][2])) { + const img = core.material.images.images[this.UIMx[page][0][2]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } + } + } else if (inRect(pos, imagebox3)) { + if (this.cgs.includes(this.UIMx[page][1][0])) { + const img = core.material.images.images[this.UIMx[page][1][0]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } + } + } else if (inRect(pos, imagebox4)) { + if (this.cgs.includes(this.UIMx[page][1][1])) { + const img = core.material.images.images[this.UIMx[page][1][1]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } + } + } else if (inRect(pos, imagebox5)) { + if (this.cgs.includes(this.UIMx[page][1][2])) { + const img = core.material.images.images[this.UIMx[page][1][2]]; + if (img) { + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.restore(); //重置画布设置 + show = !show; + } + } + } + } else { + const pageupbox = makeBox([200, 1110], [200, 100]); + const pagedownbox = makeBox([1600, 1110], [200, 100]); + const imagebox0 = makeBox([75, 150], [600, 450]); + const imagebox1 = makeBox([725, 150], [600, 450]); + const imagebox2 = makeBox([1300, 150], [600, 450]); + const imagebox3 = makeBox([75, 650], [600, 450]); + const imagebox4 = makeBox([725, 650], [600, 450]); + const imagebox5 = makeBox([1375, 650], [600, 450]); + if (inRect(pos, pagedownbox)) { + if (page < this.UIMx.length - 1) { + page++; + core.clearMap(ctx); + this.update(); + } + } else if (inRect(pos, pageupbox)) { + if (page > 0) { + page--; + core.clearMap(ctx); + this.update(); + } + } else if (inRect(pos, imagebox0)) { + if (this.cgs.includes(this.UIMx[page][0][0])) { + const img = core.material.images.images[this.UIMx[page][0][0]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } + } + } else if (inRect(pos, imagebox1)) { + if (this.cgs.includes(this.UIMx[page][0][1])) { + const img = core.material.images.images[this.UIMx[page][0][1]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } + } + } else if (inRect(pos, imagebox2)) { + if (this.cgs.includes(this.UIMx[page][0][2])) { + const img = core.material.images.images[this.UIMx[page][0][2]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } + } + } else if (inRect(pos, imagebox3)) { + if (this.cgs.includes(this.UIMx[page][1][0])) { + const img = core.material.images.images[this.UIMx[page][1][0]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } + } + } else if (inRect(pos, imagebox4)) { + if (this.cgs.includes(this.UIMx[page][1][1])) { + const img = core.material.images.images[this.UIMx[page][1][1]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } + } + } else if (inRect(pos, imagebox5)) { + if (this.cgs.includes(this.UIMx[page][1][2])) { + const img = core.material.images.images[this.UIMx[page][1][2]]; + if (img) { + ctx.drawImage(img, 0, 0, 2028, 1248); + show = !show; + } + } + } + } + } + drawUI() { + //绘制页面 + core.clearMap(CGUI); + const bgVertical = core.material.images.images["bg_2010.webp"]; //竖屏背景 + const bg = core.material.images.images["bg_5043.webp"]; //横屏背景 - if (core.domStyle.isVertical) { - //竖屏 + if (core.domStyle.isVertical) { + //竖屏 - core.fillRect(ctx, 0, 0, 1248, 2028, "#000000"); //黑色背景 - ctx.globalAlpha = 0.5; //透明度 - if (bgVertical) - ctx.drawImage(bgVertical, 0, 0, 1280, 1500, 0, 0, 1248, 2028); //绘制半透明背景图片 - ctx.globalAlpha = 1; //恢复为不透明 + core.fillRect(ctx, 0, 0, 1248, 2028, "#000000"); //黑色背景 + ctx.globalAlpha = 0.5; //透明度 + if (bgVertical) + ctx.drawImage(bgVertical, 0, 0, 1280, 1500, 0, 0, 1248, 2028); //绘制半透明背景图片 + ctx.globalAlpha = 1; //恢复为不透明 - core.setTextAlign(ctx, "center"); - core.fillBoldText1( - ctx, - "◀离开", - 100, - 110, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); + core.setTextAlign(ctx, "center"); + core.fillBoldText1( + ctx, + "◀离开", + 100, + 110, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); - core.fillBoldText1( - ctx, - "上一页", - 300, - 1900, - page === 0 ? "#444444" : "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); + core.fillBoldText1( + ctx, + "上一页", + 300, + 1900, + page === 0 ? "#444444" : "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); - core.fillBoldText1( - ctx, - page + 1 + "/" + this.UIMx.length, - 650, - 1900, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - core.fillBoldText1( - ctx, - "下一页", - 1000, - 1900, - page === this.UIMx.length - 1 ? "#444444" : "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - // 添加向上翻页和向下翻页的按钮 + core.fillBoldText1( + ctx, + page + 1 + "/" + this.UIMx.length, + 650, + 1900, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + core.fillBoldText1( + ctx, + "下一页", + 1000, + 1900, + page === this.UIMx.length - 1 ? "#444444" : "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + // 添加向上翻页和向下翻页的按钮 - // 添加3*2个4:3的画框,及图片 - for (let i = 0; i < 3; i++) { - for (let j = 0; j < 2; j++) { - const img = core.material.images.images[this.UIMx[page][j][i]]; - core.strokeRect( - ctx, - 50 + j * 600, - 200 + i * 550, - 560, - 420, - "#444444", - 5 - ); - if (this.cgs.includes(this.UIMx[page][j][i])) { - if (img) - ctx.drawImage( - img, - 50 + j * 600 + 15, - 200 + i * 550 + 15, - 560 - 30, - 420 - 30 - ); - } else { - ctx.fillStyle = "#000000"; - ctx.fillRect( - 50 + j * 600 + 15, - 200 + i * 550 + 15, - 560 - 30, - 420 - 30 - ); - const img = core.material.images.images["LOGO.webp"]; - if (img) - ctx.drawImage( - img, - 50 + j * 600 + 15, - 200 + i * 550 + 15, - 560 - 30, - 420 - 30 - ); - } - } - } - } else { - //横屏 - core.fillRect(ctx, 0, 0, 2028, 1248, "#000000"); //黑色背景 - ctx.globalAlpha = 0.5; //透明度 - if (bg) ctx.drawImage(bg, 0, 0, 1280, 720, 0, 0, 2028, 1248); //绘制半透明背景图片 - ctx.globalAlpha = 1; //恢复为不透明 + // 添加3*2个4:3的画框,及图片 + for (let i = 0; i < 3; i++) { + for (let j = 0; j < 2; j++) { + const img = core.material.images.images[this.UIMx[page][j][i]]; + core.strokeRect( + ctx, + 50 + j * 600, + 200 + i * 550, + 560, + 420, + "#444444", + 5 + ); + if (this.cgs.includes(this.UIMx[page][j][i])) { + if (img) + ctx.drawImage( + img, + 50 + j * 600 + 15, + 200 + i * 550 + 15, + 560 - 30, + 420 - 30 + ); + } else { + ctx.fillStyle = "#000000"; + ctx.fillRect( + 50 + j * 600 + 15, + 200 + i * 550 + 15, + 560 - 30, + 420 - 30 + ); + const img = core.material.images.images["LOGO.webp"]; + if (img) + ctx.drawImage( + img, + 50 + j * 600 + 15, + 200 + i * 550 + 15, + 560 - 30, + 420 - 30 + ); + } + } + } + } else { + //横屏 + core.fillRect(ctx, 0, 0, 2028, 1248, "#000000"); //黑色背景 + ctx.globalAlpha = 0.5; //透明度 + if (bg) ctx.drawImage(bg, 0, 0, 1280, 720, 0, 0, 2028, 1248); //绘制半透明背景图片 + ctx.globalAlpha = 1; //恢复为不透明 - core.setTextAlign(ctx, "center"); - core.fillBoldText1( - ctx, - "◀离开", - 110, - 100, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); + core.setTextAlign(ctx, "center"); + core.fillBoldText1( + ctx, + "◀离开", + 110, + 100, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); - // 添加向上翻页和向下翻页的按钮 - core.fillBoldText1( - ctx, - "上一页", - 300, - 1180, - page === 0 ? "#444444" : "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); + // 添加向上翻页和向下翻页的按钮 + core.fillBoldText1( + ctx, + "上一页", + 300, + 1180, + page === 0 ? "#444444" : "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); - core.fillBoldText1( - ctx, - page + 1 + "/" + this.UIMx.length, - 1000, - 1180, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - core.fillBoldText1( - ctx, - "下一页", - 1700, - 1180, - page === this.UIMx.length - 1 ? "#444444" : "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); + core.fillBoldText1( + ctx, + page + 1 + "/" + this.UIMx.length, + 1000, + 1180, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + core.fillBoldText1( + ctx, + "下一页", + 1700, + 1180, + page === this.UIMx.length - 1 ? "#444444" : "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); - // 添加3*2个4:3的画框 - for (let i = 0; i < 2; i++) { - for (let j = 0; j < 3; j++) { - core.strokeRect( - ctx, - 75 + j * 650, - 150 + i * 500, - 600, - 450, - "#444444", - 2 - ); - if (this.cgs.includes(this.UIMx[page][i][j])) { - const img = core.material.images.images[this.UIMx[page][i][j]]; - if (img) - ctx.drawImage( - img, - 75 + j * 650 + 15, - 150 + i * 500 + 15, - 600 - 30, - 450 - 30 - ); - } else { - ctx.fillStyle = "#000000"; - ctx.fillRect( - 75 + j * 650 + 15, - 150 + i * 500 + 15, - 600 - 30, - 450 - 30 - ); - const img = core.material.images.images["LOGO.webp"]; - if (img) - ctx.drawImage( - img, - 75 + j * 650 + 15, - 150 + i * 500 + 15, - 600 - 30, - 450 - 30 - ); - } - } - } - } - } - } - this.setcgs = function (img) { - const a = core.getLocalStorage("cgs", []); - if (img) { - if (!a.includes(img)) a.push(img); - core.setLocalStorage("cgs", a); - } else core.setLocalStorage("cgs"); - }; - core.ui.CG = new CG(); - main.dom.CGMode.onclick = function () { - //点击开始页面的CG MODE进入cg回廊 - main.core.control.checkBgm(); - page = 0; - main.core.ui.CG.cgs = core.getLocalStorage("cgs", []); - CGUI.style.display = "block"; - main.core.ui.CG.update(); - }; -}, - "光标设置": function () { + // 添加3*2个4:3的画框 + for (let i = 0; i < 2; i++) { + for (let j = 0; j < 3; j++) { + core.strokeRect( + ctx, + 75 + j * 650, + 150 + i * 500, + 600, + 450, + "#444444", + 2 + ); + if (this.cgs.includes(this.UIMx[page][i][j])) { + const img = core.material.images.images[this.UIMx[page][i][j]]; + if (img) + ctx.drawImage( + img, + 75 + j * 650 + 15, + 150 + i * 500 + 15, + 600 - 30, + 450 - 30 + ); + } else { + ctx.fillStyle = "#000000"; + ctx.fillRect( + 75 + j * 650 + 15, + 150 + i * 500 + 15, + 600 - 30, + 450 - 30 + ); + const img = core.material.images.images["LOGO.webp"]; + if (img) + ctx.drawImage( + img, + 75 + j * 650 + 15, + 150 + i * 500 + 15, + 600 - 30, + 450 - 30 + ); + } + } + } + } + } + } + this.setcgs = function (img) { + const a = core.getLocalStorage("cgs", []); + if (img) { + if (!a.includes(img)) a.push(img); + core.setLocalStorage("cgs", a); + } else core.setLocalStorage("cgs"); + }; + core.ui.CG = new CG(); + main.dom.CGMode.onclick = function () { + //点击开始页面的CG MODE进入cg回廊 + main.core.control.checkBgm(); + page = 0; + main.core.ui.CG.cgs = core.getLocalStorage("cgs", []); + CGUI.style.display = "block"; + main.core.ui.CG.update(); + }; + }, + 光标设置: function () { // 在此增加新插件 this.changeMouse = function ( icon, @@ -14596,7 +14594,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.dom[div].style.cursor = "auto"; }; }, - "信息弹出": function () { + 信息弹出: function () { // 在此增加新插件 /* 弹出显示某个内容 * 使用方法:core.addPop(px, py, value, color, boldColor, left, jump, time, show, font, speed) @@ -14703,7 +14701,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = else core.status.pop.push(data); }; }, - "warning": function () { + warning: function () { // 默认音效名 var defaultSound = "jingbao.mp3"; // 默认字体名 @@ -14819,7 +14817,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }, 1600); }; }, - "滑动转场": function () { + 滑动转场: function () { // 在此增加新插件 const defaultChange = { left: "leftPortal", // 左箭头 @@ -15009,920 +15007,929 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }, 25); }; }, - "剧情cg": function () { - // 在此增加新插件 - // 在此增加新插件 - const cg = document.createElement("canvas"); //cg画布设置 - cg.style.position = "absolute"; - cg.style.zIndex = 300; - cg.style.display = "none"; - cg.id = "cgText"; - main.dom.gameGroup.insertAdjacentElement("afterend", cg); - cg.style.top = "50%"; - cg.style.left = "50%"; - cg.style.transform = "translate(-50%,-50%)"; - const ctx = cg.getContext("2d"); - main.dom.cgText = cg; - const logcanvas = document.createElement("canvas"); //cg画布设置 - logcanvas.style.position = "absolute"; - logcanvas.style.zIndex = 301; - logcanvas.style.display = "none"; - logcanvas.id = "cgText"; - main.dom.gameGroup.insertAdjacentElement("afterend", logcanvas); - logcanvas.style.top = "50%"; - logcanvas.style.left = "50%"; - logcanvas.style.transform = "translate(-50%,-50%)"; - const logctx = logcanvas.getContext("2d"); - main.dom.logcanvas = logcanvas; - logcanvas.onmouseup = function (e) { - //鼠标抬起 + 剧情cg: function () { + // 在此增加新插件 + // 在此增加新插件 + const cg = document.createElement("canvas"); //cg画布设置 + cg.style.position = "absolute"; + cg.style.zIndex = 300; + cg.style.display = "none"; + cg.id = "cgText"; + main.dom.gameGroup.insertAdjacentElement("afterend", cg); + cg.style.top = "50%"; + cg.style.left = "50%"; + cg.style.transform = "translate(-50%,-50%)"; + const ctx = cg.getContext("2d"); + main.dom.cgText = cg; + const logcanvas = document.createElement("canvas"); //cg画布设置 + logcanvas.style.position = "absolute"; + logcanvas.style.zIndex = 301; + logcanvas.style.display = "none"; + logcanvas.id = "cgText"; + main.dom.gameGroup.insertAdjacentElement("afterend", logcanvas); + logcanvas.style.top = "50%"; + logcanvas.style.left = "50%"; + logcanvas.style.transform = "translate(-50%,-50%)"; + const logctx = logcanvas.getContext("2d"); + main.dom.logcanvas = logcanvas; + logcanvas.onmouseup = function (e) { + //鼠标抬起 - try { - if (!core.isPlaying()) return false; - core.unregisterAnimationFrame("skip"); - let a = core.getFlag("skip", false); - core.setFlag("skip", false); - if (a) { - const data = core.clone(core.status.event.data.current); + try { + if (!core.isPlaying()) return false; + core.unregisterAnimationFrame("skip"); + let a = core.getFlag("skip", false); + core.setFlag("skip", false); + if (a) { + const data = core.clone(core.status.event.data.current); - core.insertAction(data); - core.doAction(); - } - } catch (ee) { - console.error(ee); - } - }; - logcanvas.onmousedown = function (e) { - //鼠标按下 - try { - if (!core.isPlaying()) return false; - const left = core.dom.gameGroup.offsetLeft; - const top = core.dom.gameGroup.offsetTop; - const px = Math.floor((e.clientX - left) / core.domStyle.scale), - py = Math.floor((e.clientY - top) / core.domStyle.scale); - core.ui.cgText.click(px * 3, py * 3); - } catch (ee) { - main.log(ee); - } - }; - logcanvas.ontouchend = function (e) { - //触摸抬起 + core.insertAction(data); + core.doAction(); + } + } catch (ee) { + console.error(ee); + } + }; + logcanvas.onmousedown = function (e) { + //鼠标按下 + try { + if (!core.isPlaying()) return false; + const left = core.dom.gameGroup.offsetLeft; + const top = core.dom.gameGroup.offsetTop; + const px = Math.floor((e.clientX - left) / core.domStyle.scale), + py = Math.floor((e.clientY - top) / core.domStyle.scale); + core.ui.cgText.click(px * 3, py * 3); + } catch (ee) { + main.log(ee); + } + }; + logcanvas.ontouchend = function (e) { + //触摸抬起 - try { - if (!core.isPlaying()) return false; - core.unregisterAnimationFrame("skip"); - core.setFlag("skip", false); - let a = core.getFlag("skip", false); - core.setFlag("skip", false); - if (a) { - const data = core.clone(core.status.event.data.current); + try { + if (!core.isPlaying()) return false; + core.unregisterAnimationFrame("skip"); + core.setFlag("skip", false); + let a = core.getFlag("skip", false); + core.setFlag("skip", false); + if (a) { + const data = core.clone(core.status.event.data.current); - core.insertAction(data); - core.doAction(); - } - } catch (ee) {} - }; - logcanvas.ontouchstart = function (e) { - //触摸按下 - try { - if (!core.isPlaying()) return false; - const left = core.dom.gameGroup.offsetLeft; - const top = core.dom.gameGroup.offsetTop; - const px = Math.floor( - (e.targetTouches[0].clientX - left) / core.domStyle.scale - ), - py = Math.floor( - (e.targetTouches[0].clientY - top) / core.domStyle.scale - ); - core.ui.cgText.click(px * 3, py * 3); - } catch (ee) { - main.log(ee); - } - }; - cg.onmouseup = function (e) { - //鼠标抬起 + core.insertAction(data); + core.doAction(); + } + } catch (ee) {} + }; + logcanvas.ontouchstart = function (e) { + //触摸按下 + try { + if (!core.isPlaying()) return false; + const left = core.dom.gameGroup.offsetLeft; + const top = core.dom.gameGroup.offsetTop; + const px = Math.floor( + (e.targetTouches[0].clientX - left) / core.domStyle.scale + ), + py = Math.floor( + (e.targetTouches[0].clientY - top) / core.domStyle.scale + ); + core.ui.cgText.click(px * 3, py * 3); + } catch (ee) { + main.log(ee); + } + }; + cg.onmouseup = function (e) { + //鼠标抬起 - try { - if (!core.isPlaying()) return false; - core.unregisterAnimationFrame("skip"); - let a = core.getFlag("skip", false); - core.setFlag("skip", false); - if (a) { - const data = core.clone(core.status.event.data.current); + try { + if (!core.isPlaying()) return false; + core.unregisterAnimationFrame("skip"); + let a = core.getFlag("skip", false); + core.setFlag("skip", false); + if (a) { + const data = core.clone(core.status.event.data.current); - core.insertAction(data); - core.doAction(); - } - } catch (ee) { - console.error(ee); - } - }; - cg.onmousedown = function (e) { - //鼠标按下 - try { - if (!core.isPlaying()) return false; - const left = core.dom.gameGroup.offsetLeft; - const top = core.dom.gameGroup.offsetTop; - const px = Math.floor((e.clientX - left) / core.domStyle.scale), - py = Math.floor((e.clientY - top) / core.domStyle.scale); - core.ui.cgText.click(px * 3, py * 3); - } catch (ee) { - main.log(ee); - } - }; - cg.ontouchend = function (e) { - //触摸抬起 + core.insertAction(data); + core.doAction(); + } + } catch (ee) { + console.error(ee); + } + }; + cg.onmousedown = function (e) { + //鼠标按下 + try { + if (!core.isPlaying()) return false; + const left = core.dom.gameGroup.offsetLeft; + const top = core.dom.gameGroup.offsetTop; + const px = Math.floor((e.clientX - left) / core.domStyle.scale), + py = Math.floor((e.clientY - top) / core.domStyle.scale); + core.ui.cgText.click(px * 3, py * 3); + } catch (ee) { + main.log(ee); + } + }; + cg.ontouchend = function (e) { + //触摸抬起 - try { - if (!core.isPlaying()) return false; - core.unregisterAnimationFrame("skip"); - core.setFlag("skip", false); - let a = core.getFlag("skip", false); - core.setFlag("skip", false); - if (a) { - const data = core.clone(core.status.event.data.current); + try { + if (!core.isPlaying()) return false; + core.unregisterAnimationFrame("skip"); + core.setFlag("skip", false); + let a = core.getFlag("skip", false); + core.setFlag("skip", false); + if (a) { + const data = core.clone(core.status.event.data.current); - core.insertAction(data); - core.doAction(); - } - } catch (ee) { - console.error(ee); - } - }; - cg.ontouchstart = function (e) { - //触摸按下 - try { - if (!core.isPlaying()) return false; - const left = core.dom.gameGroup.offsetLeft; - const top = core.dom.gameGroup.offsetTop; - const px = Math.floor( - (e.targetTouches[0].clientX - left) / core.domStyle.scale - ), - py = Math.floor( - (e.targetTouches[0].clientY - top) / core.domStyle.scale - ); - core.ui.cgText.click(px * 3, py * 3); - } catch (ee) { - main.log(ee); - } - }; - let auto = false; + core.insertAction(data); + core.doAction(); + } + } catch (ee) { + console.error(ee); + } + }; + cg.ontouchstart = function (e) { + //触摸按下 + try { + if (!core.isPlaying()) return false; + const left = core.dom.gameGroup.offsetLeft; + const top = core.dom.gameGroup.offsetTop; + const px = Math.floor( + (e.targetTouches[0].clientX - left) / core.domStyle.scale + ), + py = Math.floor( + (e.targetTouches[0].clientY - top) / core.domStyle.scale + ); + core.ui.cgText.click(px * 3, py * 3); + } catch (ee) { + main.log(ee); + } + }; + let auto = false; - class cgText { - constructor() { - //绘制需要的变量 - this.image = ""; - this.head = { name: "face_050445.webp", px: -300 }; - this.bodyList = [ - { name: "tati_050145a.webp", px: 100, filter: false }, - { name: "tati_120124.webp", px: 1100, filter: true }, - ]; - this.name = ""; - this.text = ""; - this.time = 0; - this.WindowSkin = false; - this.sound = ""; - this.beforeSound = 0; - this.wait = 1000; - this.memory = false; - this.textList = []; - this.page = 1; - this.overpage = 1; - this.log = false; - this.index = 0; - } - click(px, py) { - //点击效果 + class cgText { + constructor() { + //绘制需要的变量 + this.image = ""; + this.head = { name: "face_050445.webp", px: -300 }; + this.bodyList = [ + { name: "tati_050145a.webp", px: 100, filter: false }, + { name: "tati_120124.webp", px: 1100, filter: true }, + ]; + this.name = ""; + this.text = ""; + this.time = 0; + this.WindowSkin = false; + this.sound = ""; + this.beforeSound = 0; + this.wait = 1000; + this.memory = false; + this.textList = []; + this.page = 1; + this.overpage = 1; + this.log = false; + this.index = 0; + } + click(px, py) { + //点击效果 - const makeBox = ([x, y], [w, h]) => { - return [ - [x, y], - [x + w, y + h], - ]; - }; - const inRect = ([x, y], [ - [sx, sy], - [dx, dy] - ]) => { - return sx <= x && x <= dx && sy <= y && y <= dy; - }; - const pos = [px, py]; - const savebox = makeBox([1700, 1100], [192, 96]); - const saveboxVertical = makeBox([52, 1700], [96, 192]); - const skipbox = makeBox([1700, 1000], [192, 96]); - const skipboxVertical = makeBox([152, 1700], [96, 192]); - const autobox = makeBox([1700, 900], [192, 96]); - const autoboxVertical = makeBox([252, 1700], [96, 192]); - const textbox = makeBox([1700, 800], [192, 96]); - const textboxVertical = makeBox([352, 1700], [96, 192]); - const backbox = makeBox([15, 35], [210, 90]); - const backboxVertical = makeBox([1123, 15], [90, 210]); - const pageupbox = makeBox([300, 1130], [200, 100]); - const pageupboxVertical = makeBox([18, 300], [100, 200]); - const pagedownbox = makeBox([1500, 1130], [200, 100]); - const pagedownboxVertical = makeBox([18, 1500], [100, 200]); - const soundbox = makeBox([550, 150], [100, 900]); - const soundboxVertical = makeBox([198, 550], [900, 100]); - if (this.log) { - if ( - (core.domStyle.isVertical && inRect(pos, backboxVertical)) || - (!core.domStyle.isVertical && inRect(pos, backbox)) - ) { - core.clearMap(logctx); - core.stopSound() - main.dom.logcanvas.style.display = "none"; - this.log = false; - } else if ( - (core.domStyle.isVertical && inRect(pos, pageupboxVertical)) || - (!core.domStyle.isVertical && inRect(pos, pageupbox)) - ) { - core.clearMap(logctx); - if (this.page > 1) this.page--; - this.logdraw(this.page); - } else if ( - (core.domStyle.isVertical && inRect(pos, pagedownboxVertical)) || - (!core.domStyle.isVertical && inRect(pos, pagedownbox)) - ) { - core.clearMap(logctx); - if (this.page < this.overpage) this.page++; - this.logdraw(this.page); - } else if ((core.domStyle.isVertical && inRect(pos, soundboxVertical)) || - (!core.domStyle.isVertical && inRect(pos, soundbox))) { - if (core.domStyle.isVertical) { - const sound = this.textList[(this.page - 1) * 6 + Math.min(Math.floor((px - 198) / 150), 5)][2] - core.stopSound() - core.playSound(sound) - } else { - const sound = this.textList[(this.page - 1) * 6 + Math.min(Math.floor((py - 150) / 150), 5)][2] - core.stopSound() - core.playSound(sound) - } - } - } else { - if ( - (core.domStyle.isVertical && - inRect(pos, skipboxVertical) && - !this.WindowSkin) || - (!core.domStyle.isVertical && - !this.WindowSkin && - inRect(pos, skipbox)) - ) { - auto = false; - let time = 0; - core.stopSound(this.beforeSound); - core.registerAnimationFrame("skip", true, (timestamp) => { - if (timestamp > time + 50) { - time = timestamp; - if ( - core.status.event.id == "action" && - core.status.event.data.type == "cgtext" - ) { - core.setFlag("skip", true); - main.dom.cgText.style.display = "none"; - core.doAction(); - } - } - }); - } else if ( - (core.domStyle.isVertical && - inRect(pos, textboxVertical) && - !this.WindowSkin) || - (!core.domStyle.isVertical && - !this.WindowSkin && - inRect(pos, textbox)) - ) { - auto = false; - this.log = true; - this.overpage = Math.floor(this.index / 6) + 1; - this.page = this.overpage; - logcanvas.style.display = "block"; - const data = core.clone(core.status.event.data.current); - data.showAll = true; - data.time = 0; - data.text = this.text.replaceAll(/(\\(z))(\[.*?\])?/g, ""); //去除打字机暂停效果 - data.sound = ""; - core.insertAction(data); - core.doAction(); - this.logdraw(this.page); - } else if ( - (core.domStyle.isVertical && - inRect(pos, autoboxVertical) && - !this.WindowSkin) || - (!core.domStyle.isVertical && - !this.WindowSkin && - inRect(pos, autobox)) - ) { - auto = !auto; + const makeBox = ([x, y], [w, h]) => { + return [ + [x, y], + [x + w, y + h], + ]; + }; + const inRect = ([x, y], [[sx, sy], [dx, dy]]) => { + return sx <= x && x <= dx && sy <= y && y <= dy; + }; + const pos = [px, py]; + const savebox = makeBox([1700, 1100], [192, 96]); + const saveboxVertical = makeBox([52, 1700], [96, 192]); + const skipbox = makeBox([1700, 1000], [192, 96]); + const skipboxVertical = makeBox([152, 1700], [96, 192]); + const autobox = makeBox([1700, 900], [192, 96]); + const autoboxVertical = makeBox([252, 1700], [96, 192]); + const textbox = makeBox([1700, 800], [192, 96]); + const textboxVertical = makeBox([352, 1700], [96, 192]); + const backbox = makeBox([15, 35], [210, 90]); + const backboxVertical = makeBox([1123, 15], [90, 210]); + const pageupbox = makeBox([300, 1130], [200, 100]); + const pageupboxVertical = makeBox([18, 300], [100, 200]); + const pagedownbox = makeBox([1500, 1130], [200, 100]); + const pagedownboxVertical = makeBox([18, 1500], [100, 200]); + const soundbox = makeBox([550, 150], [100, 900]); + const soundboxVertical = makeBox([198, 550], [900, 100]); + if (this.log) { + if ( + (core.domStyle.isVertical && inRect(pos, backboxVertical)) || + (!core.domStyle.isVertical && inRect(pos, backbox)) + ) { + core.clearMap(logctx); + core.stopSound(); + main.dom.logcanvas.style.display = "none"; + this.log = false; + } else if ( + (core.domStyle.isVertical && inRect(pos, pageupboxVertical)) || + (!core.domStyle.isVertical && inRect(pos, pageupbox)) + ) { + core.clearMap(logctx); + if (this.page > 1) this.page--; + this.logdraw(this.page); + } else if ( + (core.domStyle.isVertical && inRect(pos, pagedownboxVertical)) || + (!core.domStyle.isVertical && inRect(pos, pagedownbox)) + ) { + core.clearMap(logctx); + if (this.page < this.overpage) this.page++; + this.logdraw(this.page); + } else if ( + (core.domStyle.isVertical && inRect(pos, soundboxVertical)) || + (!core.domStyle.isVertical && inRect(pos, soundbox)) + ) { + if (core.domStyle.isVertical) { + const sound = + this.textList[ + (this.page - 1) * 6 + + Math.min(Math.floor((px - 198) / 150), 5) + ][2]; + core.stopSound(); + core.playSound(sound); + } else { + const sound = + this.textList[ + (this.page - 1) * 6 + + Math.min(Math.floor((py - 150) / 150), 5) + ][2]; + core.stopSound(); + core.playSound(sound); + } + } + } else { + if ( + (core.domStyle.isVertical && + inRect(pos, skipboxVertical) && + !this.WindowSkin) || + (!core.domStyle.isVertical && + !this.WindowSkin && + inRect(pos, skipbox)) + ) { + auto = false; + let time = 0; + core.stopSound(this.beforeSound); + core.registerAnimationFrame("skip", true, (timestamp) => { + if (timestamp > time + 50) { + time = timestamp; + if ( + core.status.event.id == "action" && + core.status.event.data.type == "cgtext" + ) { + core.setFlag("skip", true); + main.dom.cgText.style.display = "none"; + core.doAction(); + } + } + }); + } else if ( + (core.domStyle.isVertical && + inRect(pos, textboxVertical) && + !this.WindowSkin) || + (!core.domStyle.isVertical && + !this.WindowSkin && + inRect(pos, textbox)) + ) { + auto = false; + this.log = true; + this.overpage = Math.floor(this.index / 6) + 1; + this.page = this.overpage; + logcanvas.style.display = "block"; + const data = core.clone(core.status.event.data.current); + data.showAll = true; + data.time = 0; + data.text = this.text.replaceAll(/(\\(z))(\[.*?\])?/g, ""); //去除打字机暂停效果 + data.sound = ""; + core.insertAction(data); + core.doAction(); + this.logdraw(this.page); + } else if ( + (core.domStyle.isVertical && + inRect(pos, autoboxVertical) && + !this.WindowSkin) || + (!core.domStyle.isVertical && + !this.WindowSkin && + inRect(pos, autobox)) + ) { + auto = !auto; - const data = core.clone(core.status.event.data.current); - data.showAll = true; - data.time = 0; - data.text = this.text.replaceAll(/(\\(z))(\[.*?\])?/g, ""); //去除打字机暂停效果 - data.sound = ""; - core.insertAction(data); - core.doAction(); - } else if ( - (core.domStyle.isVertical && - inRect(pos, saveboxVertical) && - !this.WindowSkin) || - (!core.domStyle.isVertical && - !this.WindowSkin && - inRect(pos, savebox)) - ) { - //存档 - auto = false; - if (core.status.event.animateUI) return; - if (core.status.event.interval != null) return; - const current = core.clone(core.status.event.data.current); - current.showAll = true; - current.time = 0; - current.sound = ""; - current.text = this.text.replaceAll(/(\\(z))(\[.*?\])?/g, ""); //去除当前事件所有打字机效果 - cg.style.display = "none"; - const data = [{ type: "callSave" }, current]; //插入存档事件 - core.insertAction(data); + const data = core.clone(core.status.event.data.current); + data.showAll = true; + data.time = 0; + data.text = this.text.replaceAll(/(\\(z))(\[.*?\])?/g, ""); //去除打字机暂停效果 + data.sound = ""; + core.insertAction(data); + core.doAction(); + } else if ( + (core.domStyle.isVertical && + inRect(pos, saveboxVertical) && + !this.WindowSkin) || + (!core.domStyle.isVertical && + !this.WindowSkin && + inRect(pos, savebox)) + ) { + //存档 + auto = false; + if (core.status.event.animateUI) return; + if (core.status.event.interval != null) return; + const current = core.clone(core.status.event.data.current); + current.showAll = true; + current.time = 0; + current.sound = ""; + current.text = this.text.replaceAll(/(\\(z))(\[.*?\])?/g, ""); //去除当前事件所有打字机效果 + cg.style.display = "none"; + const data = [{ type: "callSave" }, current]; //插入存档事件 + core.insertAction(data); - core.doAction(); - } else if (!core.status.event.data) { - cg.style.display = "none"; - core.ui._animateUI("hide", null, () => { - core.doAction(); - }); - } else { - // 正在淡入淡出的话不执行 - if (core.status.event.animateUI) return; - auto = false; + core.doAction(); + } else if (!core.status.event.data) { + cg.style.display = "none"; + core.ui._animateUI("hide", null, () => { + core.doAction(); + }); + } else { + // 正在淡入淡出的话不执行 + if (core.status.event.animateUI) return; + auto = false; - // 打字机效果显示全部文字 - if (core.status.event.interval != null) { - const data = core.clone(core.status.event.data?.current); - data.showAll = true; - data.time = 0; - data.text = this.text.replaceAll(/(\\(z))(\[.*?\])?/g, ""); //去除打字机暂停效果 - data.sound = ""; - core.insertAction(data); - core.doAction(); - return; - } else { - core.stopSound(this.beforeSound); - } + // 打字机效果显示全部文字 + if (core.status.event.interval != null) { + const data = core.clone(core.status.event.data?.current); + data.showAll = true; + data.time = 0; + data.text = this.text.replaceAll(/(\\(z))(\[.*?\])?/g, ""); //去除打字机暂停效果 + data.sound = ""; + core.insertAction(data); + core.doAction(); + return; + } else { + core.stopSound(this.beforeSound); + } - cg.style.display = "none"; - core.ui._animateUI("hide", null, () => { - core.doAction(); - }); - } - } - } + cg.style.display = "none"; + core.ui._animateUI("hide", null, () => { + core.doAction(); + }); + } + } + } - drawTextContent(ctx, content, config) { - //绘制多行文字并执行打字机效果 + drawTextContent(ctx, content, config) { + //绘制多行文字并执行打字机效果 - ctx = core.getContextByName(ctx); - // 设置默认配置项 - var textAttribute = - core.status.textAttribute || core.initStatus.textAttribute; - var globalAttribute = - core.status.globalAttribute || core.initStatus.globalAttribute; - config = core.clone(config || {}); - config.left = config.left || 0; - config.right = - config.left + (config.maxWidth == null ? core._PX_ : config.maxWidth); - config.top = config.top || 0; - config.color = core.arrayToRGBA(config.color || textAttribute.text); - if (config.bold == null) config.bold = textAttribute.bold; - config.italic = config.italic || false; - config.align = config.align || textAttribute.align || "left"; - config.fontSize = config.fontSize || textAttribute.textfont; - config.lineHeight = config.lineHeight || config.fontSize * 1.3; - config.defaultFont = config.font = config.font || globalAttribute.font; - config.time = config.time || 0; - config.letterSpacing = - config.letterSpacing == null ? - textAttribute.letterSpacing || 0 : - config.letterSpacing; + ctx = core.getContextByName(ctx); + // 设置默认配置项 + var textAttribute = + core.status.textAttribute || core.initStatus.textAttribute; + var globalAttribute = + core.status.globalAttribute || core.initStatus.globalAttribute; + config = core.clone(config || {}); + config.left = config.left || 0; + config.right = + config.left + (config.maxWidth == null ? core._PX_ : config.maxWidth); + config.top = config.top || 0; + config.color = core.arrayToRGBA(config.color || textAttribute.text); + if (config.bold == null) config.bold = textAttribute.bold; + config.italic = config.italic || false; + config.align = config.align || textAttribute.align || "left"; + config.fontSize = config.fontSize || textAttribute.textfont; + config.lineHeight = config.lineHeight || config.fontSize * 1.3; + config.defaultFont = config.font = config.font || globalAttribute.font; + config.time = config.time || 0; + config.letterSpacing = + config.letterSpacing == null + ? textAttribute.letterSpacing || 0 + : config.letterSpacing; - config.index = 0; - config.currcolor = config.color; - config.currfont = config.fontSize; - config.lineMargin = Math.max( - Math.round(config.fontSize / 4), - config.lineHeight - config.fontSize - ); - config.topMargin = parseInt(config.lineMargin / 2); - config.lineMaxHeight = config.lineMargin + config.fontSize; - config.offsetX = 0; - config.offsetY = 0; - config.line = 0; - config.blocks = []; - config.isHD = ctx == null || ctx.canvas.hasAttribute("isHD"); + config.index = 0; + config.currcolor = config.color; + config.currfont = config.fontSize; + config.lineMargin = Math.max( + Math.round(config.fontSize / 4), + config.lineHeight - config.fontSize + ); + config.topMargin = parseInt(config.lineMargin / 2); + config.lineMaxHeight = config.lineMargin + config.fontSize; + config.offsetX = 0; + config.offsetY = 0; + config.line = 0; + config.blocks = []; + config.isHD = ctx == null || ctx.canvas.hasAttribute("isHD"); - // 创建一个新的临时画布 - var tempCtx = document.createElement("canvas").getContext("2d"); - if (config.isHD && ctx) { - core.maps._setHDCanvasSize( - tempCtx, - ctx.canvas.width, - ctx.canvas.height - ); - } else { - tempCtx.canvas.width = ctx == null ? 1 : ctx.canvas.width; - tempCtx.canvas.height = ctx == null ? 1 : ctx.canvas.height; - } + // 创建一个新的临时画布 + var tempCtx = document.createElement("canvas").getContext("2d"); + if (config.isHD && ctx) { + core.maps._setHDCanvasSize( + tempCtx, + ctx.canvas.width, + ctx.canvas.height + ); + } else { + tempCtx.canvas.width = ctx == null ? 1 : ctx.canvas.width; + tempCtx.canvas.height = ctx == null ? 1 : ctx.canvas.height; + } - tempCtx.textBaseline = "top"; - tempCtx.font = core.ui._buildFont( - config.fontSize, - config.bold, - config.italic, - config.font - ); - tempCtx.fillStyle = config.color; - config = this._drawTextContent_draw(ctx, tempCtx, content, config); - return config; - } - _drawTextContent_draw(ctx, tempCtx, content, config) { - // Step 1: 绘制到tempCtx上,并记录下图块信息 - while (core.ui._drawTextContent_next(tempCtx, content, config)); + tempCtx.textBaseline = "top"; + tempCtx.font = core.ui._buildFont( + config.fontSize, + config.bold, + config.italic, + config.font + ); + tempCtx.fillStyle = config.color; + config = this._drawTextContent_draw(ctx, tempCtx, content, config); + return config; + } + _drawTextContent_draw(ctx, tempCtx, content, config) { + // Step 1: 绘制到tempCtx上,并记录下图块信息 + while (core.ui._drawTextContent_next(tempCtx, content, config)); - if (ctx == null) return config; + if (ctx == null) return config; - // Step 2: 从tempCtx绘制到画布上 - config.index = 0; - var _drawNext = function () { - if (config.index >= config.blocks.length) return false; - var block = config.blocks[config.index++]; - if (block != null) { - // It works, why? - const scale = config.isHD ? - devicePixelRatio * core.domStyle.scale : - 1; - ctx.restore(); - ctx.save(); //保存设置 - if (core.domStyle.isVertical) { - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - } - ctx.drawImage( - tempCtx.canvas, - block.left * scale, - block.top * scale, - block.width * scale, - block.height * scale, - config.left + block.left + block.marginLeft, - config.top + block.top + block.marginTop, - block.width, - block.height - ); - ctx.restore(); - } - return true; - }; + // Step 2: 从tempCtx绘制到画布上 + config.index = 0; + var _drawNext = function () { + if (config.index >= config.blocks.length) return false; + var block = config.blocks[config.index++]; + if (block != null) { + // It works, why? + const scale = config.isHD + ? devicePixelRatio * core.domStyle.scale + : 1; + ctx.restore(); + ctx.save(); //保存设置 + if (core.domStyle.isVertical) { + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + } + ctx.drawImage( + tempCtx.canvas, + block.left * scale, + block.top * scale, + block.width * scale, + block.height * scale, + config.left + block.left + block.marginLeft, + config.top + block.top + block.marginTop, + block.width, + block.height + ); + ctx.restore(); + } + return true; + }; - if (config.time == 0) { - while (_drawNext()); + if (config.time == 0) { + while (_drawNext()); - if ( - (auto && !core.ui.cgText.WindowSkin && !core.ui.cgText.sound) || - (core.ui.cgText.sound && !core.musicStatus.soundStatus) - ) { - setTimeout(() => { - if (auto) { - cg.style.display = "none"; - core.ui._animateUI("hide", null, () => { - core.doAction(); - }); - } - }, core.ui.cgText.wait); - } - } else { - clearInterval(core.status.event.interval); - core.status.event.interval = setInterval(function () { - if (!_drawNext()) { - clearInterval(core.status.event.interval); - core.status.event.interval = null; + if ( + (auto && !core.ui.cgText.WindowSkin && !core.ui.cgText.sound) || + (core.ui.cgText.sound && !core.musicStatus.soundStatus) + ) { + setTimeout(() => { + if (auto) { + cg.style.display = "none"; + core.ui._animateUI("hide", null, () => { + core.doAction(); + }); + } + }, core.ui.cgText.wait); + } + } else { + clearInterval(core.status.event.interval); + core.status.event.interval = setInterval(function () { + if (!_drawNext()) { + clearInterval(core.status.event.interval); + core.status.event.interval = null; - if ( - (auto && !core.ui.cgText.WindowSkin && !core.ui.cgText.sound) || - (core.ui.cgText.sound && !core.musicStatus.soundStatus) - ) - setTimeout(() => { - if (auto) { - cg.style.display = "none"; - core.ui._animateUI("hide", null, () => { - core.doAction(); - }); - } - }, core.ui.cgText.wait); - } - }, config.time); - } + if ( + (auto && !core.ui.cgText.WindowSkin && !core.ui.cgText.sound) || + (core.ui.cgText.sound && !core.musicStatus.soundStatus) + ) + setTimeout(() => { + if (auto) { + cg.style.display = "none"; + core.ui._animateUI("hide", null, () => { + core.doAction(); + }); + } + }, core.ui.cgText.wait); + } + }, config.time); + } - return config; - } + return config; + } - update() { - this.background(); - if (this.log) this.logdraw(this.page); - } - logdraw(page) { - if (core.domStyle.isVertical) { - logctx.canvas.width = 1248; - logctx.canvas.height = 2028; - logctx.save(); //保存设置 - logctx.translate(1248, 0); //重新定位右上角为基准 - logctx.rotate(Math.PI / 2); //旋转90度 - } else { - logctx.canvas.width = 2028; - logctx.canvas.height = 1248; - } - core.fillRect(logctx, 0, 0, 2028, 1248, "rgba(0,0,0,0.5)"); - core.setTextAlign(logctx, "center"); - core.fillBoldText1( - logctx, - "◀离开", - 110, - 100, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - logctx.strokeStyle = "#FFFFFF"; - logctx.lineWidth = 3; - logctx.beginPath(); - logctx.moveTo(100, 150); - logctx.lineTo(1928, 150); + update() { + this.background(); + if (this.log) this.logdraw(this.page); + } + logdraw(page) { + if (core.domStyle.isVertical) { + logctx.canvas.width = 1248; + logctx.canvas.height = 2028; + logctx.save(); //保存设置 + logctx.translate(1248, 0); //重新定位右上角为基准 + logctx.rotate(Math.PI / 2); //旋转90度 + } else { + logctx.canvas.width = 2028; + logctx.canvas.height = 1248; + } + core.fillRect(logctx, 0, 0, 2028, 1248, "rgba(0,0,0,0.5)"); + core.setTextAlign(logctx, "center"); + core.fillBoldText1( + logctx, + "◀离开", + 110, + 100, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + logctx.strokeStyle = "#FFFFFF"; + logctx.lineWidth = 3; + logctx.beginPath(); + logctx.moveTo(100, 150); + logctx.lineTo(1928, 150); - logctx.stroke(); - let posy = 150; - const indexList = this.textList; - core.setTextAlign(logctx, "left"); - for ( - let i = (page - 1) * 6; i <= Math.min(this.index, page * 6 - 1); i++ - ) { - const text = this.textList[i][1].replaceAll( - /(\\(d|e|f|g|i|n|r|b|c|t|z))(\[.*?\])?/g, - "" - ); //取消打字机 - const name = this.textList[i][0] ? - "【" + this.textList[i][0] + "】" : - ""; - const sound = this.textList[i][2] - if (name) { - core.fillBoldText1( - logctx, - name, - 150, - posy + 50, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(42, true) - ); - } - if (sound) core.drawImage(logctx, "sound.webp", 550, posy + 30) - if (text.length < 30) { - core.fillBoldText1( - logctx, - text, - 650, - posy + 50, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(42, true) - ); - } else { - let text1 = text.slice(0, 30); - core.fillBoldText1( - logctx, - text1, - 650, - posy + 50, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(42, true) - ); - if (text.length > 60) { - let text2 = text.slice(30, 60); - let text3 = text.slice(60); - core.fillBoldText1( - logctx, - text2, - 650, - posy + 100, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(42, true) - ); - core.fillBoldText1( - logctx, - text3, - 650, - posy + 150, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(42, true) - ); - } else { - let text2 = text.slice(30); - core.fillBoldText1( - logctx, - text2, - 650, - posy + 100, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(42, true) - ); - } - } + logctx.stroke(); + let posy = 150; + const indexList = this.textList; + core.setTextAlign(logctx, "left"); + for ( + let i = (page - 1) * 6; + i <= Math.min(this.index, page * 6 - 1); + i++ + ) { + const text = this.textList[i][1].replaceAll( + /(\\(d|e|f|g|i|n|r|b|c|t|z))(\[.*?\])?/g, + "" + ); //取消打字机 + const name = this.textList[i][0] + ? "【" + this.textList[i][0] + "】" + : ""; + const sound = this.textList[i][2]; + if (name) { + core.fillBoldText1( + logctx, + name, + 150, + posy + 50, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(42, true) + ); + } + if (sound) core.drawImage(logctx, "sound.webp", 550, posy + 30); + if (text.length < 30) { + core.fillBoldText1( + logctx, + text, + 650, + posy + 50, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(42, true) + ); + } else { + let text1 = text.slice(0, 30); + core.fillBoldText1( + logctx, + text1, + 650, + posy + 50, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(42, true) + ); + if (text.length > 60) { + let text2 = text.slice(30, 60); + let text3 = text.slice(60); + core.fillBoldText1( + logctx, + text2, + 650, + posy + 100, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(42, true) + ); + core.fillBoldText1( + logctx, + text3, + 650, + posy + 150, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(42, true) + ); + } else { + let text2 = text.slice(30); + core.fillBoldText1( + logctx, + text2, + 650, + posy + 100, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(42, true) + ); + } + } - logctx.strokeStyle = "#FFFFFF"; - logctx.lineWidth = 3; - logctx.beginPath(); - logctx.moveTo(100, posy); - logctx.lineTo(1928, posy); - logctx.stroke(); + logctx.strokeStyle = "#FFFFFF"; + logctx.lineWidth = 3; + logctx.beginPath(); + logctx.moveTo(100, posy); + logctx.lineTo(1928, posy); + logctx.stroke(); - posy += 160; - } - logctx.beginPath(); - logctx.moveTo(100, 1120); - logctx.lineTo(1928, 1120); - logctx.moveTo(100, 1110); - logctx.lineTo(1928, 1110); - logctx.stroke(); - core.fillBoldText1( - logctx, - "上一页", - 300, - 1200, - page === 1 ? "#444444" : "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); + posy += 160; + } + logctx.beginPath(); + logctx.moveTo(100, 1120); + logctx.lineTo(1928, 1120); + logctx.moveTo(100, 1110); + logctx.lineTo(1928, 1110); + logctx.stroke(); + core.fillBoldText1( + logctx, + "上一页", + 300, + 1200, + page === 1 ? "#444444" : "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); - core.fillBoldText1( - logctx, - page + "/" + this.overpage, - 1000, - 1200, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - core.fillBoldText1( - logctx, - "下一页", - 1500, - 1200, - page === this.overpage ? "#444444" : "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - } - background() { - const img = core.material.images.images?.[this.image]; + core.fillBoldText1( + logctx, + page + "/" + this.overpage, + 1000, + 1200, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + core.fillBoldText1( + logctx, + "下一页", + 1500, + 1200, + page === this.overpage ? "#444444" : "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + } + background() { + const img = core.material.images.images?.[this.image]; - if (core.domStyle.isVertical) { - ctx.canvas.width = 1248; - ctx.canvas.height = 2028; - ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 - ctx.rotate(Math.PI / 2); //旋转90度 - } else { - ctx.canvas.width = 2028; - ctx.canvas.height = 1248; - } + if (core.domStyle.isVertical) { + ctx.canvas.width = 1248; + ctx.canvas.height = 2028; + ctx.save(); //保存设置 + ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + } else { + ctx.canvas.width = 2028; + ctx.canvas.height = 1248; + } - if (img) { - //绘制背景 - if (this.memory) ctx.filter = "sepia(50%)"; - ctx.drawImage(img, 0, 0, 2028, 1248); - ctx.filter = "none"; - } else { - core.fillRect(ctx, 0, 0, 2028, 1248); - } - this.bodyList.forEach((v) => { - //绘制立绘 - const body = core.material.images.images?.[v.name]; - if (v.filter) ctx.filter = "brightness(50%)"; - if (body) { - if (!v.w && !v.h && !v.scale) v.scale = 1.7; - if (!v.w && !v.h) { - ctx.drawImage( - body, - 0, - 0, - body.width, - body.height, - v.px, - 1248 - body.height * v.scale, - body.width * v.scale, - body.height * v.scale - ); - } else { - ctx.drawImage( - body, - 0, - 0, - body.width, - body.height, - v.px, - 1248 - (v.h ?? body.height), - v.w ?? body.width, - v.h ?? body.height - ); - } - } - ctx.filter = "none"; - }); - if (core.isPlaying() && !this.WindowSkin) - core.drawWindowSkin( - "winskin.webp", - ctx, - 30, - 780, - 1968, - 436, - null, - null, - null, - 3 - ); //绘制对话框 - const head = core.material.images.images?.[this.head.name]; - if (head) { - //绘制头像 - ctx.drawImage( - head, - 0, - 0, - head.width, - head.height, - this.head.px, - 1248 - head.height * 2.2, - head.width * 2.2, - head.height * 2.2 - ); - } - if (core.isPlaying() && !this.WindowSkin) { - core.drawWindowSkin( - "winskin.webp", - ctx, - 1700, - 800, - 192, - 96, - null, - null, - null, - 3 - ); - core.fillBoldText1( - ctx, - "记 录", - 1736, - 866, - "#FFFFFF", - "#000000", - 6, - "bold 48px Verdana" - ); - core.drawWindowSkin( - "winskin.webp", - ctx, - 1700, - 1100, - 192, - 96, - null, - null, - null, - 3 - ); - core.fillBoldText1( - ctx, - "存 档", - 1736, - 1166, - "#FFFFFF", - "#000000", - 6, - "bold 48px Verdana" - ); - core.drawWindowSkin( - "winskin.webp", - ctx, - 1700, - 1000, - 192, - 96, - null, - null, - null, - 3 - ); - core.fillBoldText1( - ctx, - "▶▶", - 1756, - 1066, - "#FFFFFF", - "#000000", - 6, - "bold 48px Verdana" - ); - core.drawWindowSkin( - "winskin.webp", - ctx, - 1700, - 900, - 192, - 96, - null, - null, - null, - 3 - ); - let autoText = "AUTO"; - if (auto) autoText = "STOP"; - core.fillBoldText1( - ctx, - autoText, - 1722, - 966, - "#FFFFFF", - "#000000", - 6, - "bold 48px Verdana" - ); - } - if (this.name) - core.fillBoldText1( - ctx, - `【${this.name}】`, - 550, - 880, - "#FFFFFF", - "#000000", - 6, - "bold 48px Verdana" - ); //绘制名字 + if (img) { + //绘制背景 + if (this.memory) ctx.filter = "sepia(50%)"; + ctx.drawImage(img, 0, 0, 2028, 1248); + ctx.filter = "none"; + } else { + core.fillRect(ctx, 0, 0, 2028, 1248); + } + this.bodyList.forEach((v) => { + //绘制立绘 + const body = core.material.images.images?.[v.name]; + if (v.filter) ctx.filter = "brightness(50%)"; + if (body) { + if (!v.w && !v.h && !v.scale) v.scale = 1.7; + if (!v.w && !v.h) { + ctx.drawImage( + body, + 0, + 0, + body.width, + body.height, + v.px, + 1248 - body.height * v.scale, + body.width * v.scale, + body.height * v.scale + ); + } else { + ctx.drawImage( + body, + 0, + 0, + body.width, + body.height, + v.px, + 1248 - (v.h ?? body.height), + v.w ?? body.width, + v.h ?? body.height + ); + } + } + ctx.filter = "none"; + }); + if (core.isPlaying() && !this.WindowSkin) + core.drawWindowSkin( + "winskin.webp", + ctx, + 30, + 780, + 1968, + 436, + null, + null, + null, + 3 + ); //绘制对话框 + const head = core.material.images.images?.[this.head.name]; + if (head) { + //绘制头像 + ctx.drawImage( + head, + 0, + 0, + head.width, + head.height, + this.head.px, + 1248 - head.height * 2.2, + head.width * 2.2, + head.height * 2.2 + ); + } + if (core.isPlaying() && !this.WindowSkin) { + core.drawWindowSkin( + "winskin.webp", + ctx, + 1700, + 800, + 192, + 96, + null, + null, + null, + 3 + ); + core.fillBoldText1( + ctx, + "记 录", + 1736, + 866, + "#FFFFFF", + "#000000", + 6, + "bold 48px Verdana" + ); + core.drawWindowSkin( + "winskin.webp", + ctx, + 1700, + 1100, + 192, + 96, + null, + null, + null, + 3 + ); + core.fillBoldText1( + ctx, + "存 档", + 1736, + 1166, + "#FFFFFF", + "#000000", + 6, + "bold 48px Verdana" + ); + core.drawWindowSkin( + "winskin.webp", + ctx, + 1700, + 1000, + 192, + 96, + null, + null, + null, + 3 + ); + core.fillBoldText1( + ctx, + "▶▶", + 1756, + 1066, + "#FFFFFF", + "#000000", + 6, + "bold 48px Verdana" + ); + core.drawWindowSkin( + "winskin.webp", + ctx, + 1700, + 900, + 192, + 96, + null, + null, + null, + 3 + ); + let autoText = "AUTO"; + if (auto) autoText = "STOP"; + core.fillBoldText1( + ctx, + autoText, + 1722, + 966, + "#FFFFFF", + "#000000", + 6, + "bold 48px Verdana" + ); + } + if (this.name) + core.fillBoldText1( + ctx, + `【${this.name}】`, + 550, + 880, + "#FFFFFF", + "#000000", + 6, + "bold 48px Verdana" + ); //绘制名字 - if ( - this.sound && - core.sounds && - !core.getFlag("skip", false) && - core.musicStatus.soundStatus - ) { - this.beforeSound = core.playSound(this.sound, null, () => { - if ( - this.sound && - auto && - !this.WindowSkin && - core.musicStatus.soundStatus - ) { - setTimeout(() => { - if (auto) { - cg.style.display = "none"; - core.ui._animateUI("hide", null, () => { - core.doAction(); - }); - } - }, this.wait); - } - }); - } - if (this.text && !core.getFlag("skip", false)) { - //绘制对话 - this.drawTextContent(ctx, this.text, { - left: 550, - top: 950, - bold: true, - color: "#FFFFFF", - align: "left", - fontSize: 48, - time: this.time || 0, - font: "Verdana", - maxWidth: 1000, - }); - } + if ( + this.sound && + core.sounds && + !core.getFlag("skip", false) && + core.musicStatus.soundStatus + ) { + this.beforeSound = core.playSound(this.sound, null, () => { + if ( + this.sound && + auto && + !this.WindowSkin && + core.musicStatus.soundStatus + ) { + setTimeout(() => { + if (auto) { + cg.style.display = "none"; + core.ui._animateUI("hide", null, () => { + core.doAction(); + }); + } + }, this.wait); + } + }); + } + if (this.text && !core.getFlag("skip", false)) { + //绘制对话 + this.drawTextContent(ctx, this.text, { + left: 550, + top: 950, + bold: true, + color: "#FFFFFF", + align: "left", + fontSize: 48, + time: this.time || 0, + font: "Verdana", + maxWidth: 1000, + }); + } - ctx.restore(); - } - } - core.ui.cgText = new cgText(); -}, - "旁白": function () { + ctx.restore(); + } + } + core.ui.cgText = new cgText(); + }, + 旁白: function () { // 在此增加新插件 const over = document.createElement("canvas"); //over画布设置 over.style.position = "absolute"; @@ -16408,7 +16415,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }; }, - "回合制boss战": function () { + 回合制boss战: function () { // 在此增加新插件 const boss = document.createElement("canvas"); //boss战画布设置 boss.style.position = "absolute"; @@ -16456,7 +16463,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } core.ui.boss = new boss1(); }, - "剧情视频引用": function () { + 剧情视频引用: function () { // 在此增加新插件 let a; let bgm; @@ -16639,7 +16646,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }); }; }, - "帧动画/图片叠拼": function () { + "帧动画/图片叠拼": function () { // 在此增加新插件 this.animationDrawable = function ( allFarme, @@ -16761,1155 +16768,1152 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ); }; }, - "musicMode": function () { - // 在此增加新插件 - const music = document.createElement("canvas"); - music.style.position = "absolute"; - music.style.zIndex = 300; - music.style.display = "none"; - music.id = "music"; - main.dom.gameGroup.insertAdjacentElement("afterend", music); - music.style.top = "50%"; - music.style.left = "50%"; - music.style.transform = "translate(-50%,-50%)"; - const ctx = music.getContext("2d"); - main.dom.music = music; - - const audio = core.plugin.audioSystem.bgmController; - - let page = 0; //初始页面 - - let isvolume = false; - - function shuffle(arr) { - let n = arr.length, - random; - while (n) { - random = (Math.random() * n--) >>> 0; - [arr[n], arr[random]] = [arr[random], arr[n]]; - } - return arr; - } - music.addEventListener("mousedown", function (e) { - e.stopPropagation(); - const left = core.dom.gameGroup.offsetLeft; - const top = core.dom.gameGroup.offsetTop; - const px = Math.floor((e.clientX - left) / core.domStyle.scale), - py = Math.floor((e.clientY - top) / core.domStyle.scale); - core.ui.music.mousedown(px * 3, py * 3); - }); - music.addEventListener("mousemove", function (e) { - e.stopPropagation(); - const left = core.dom.gameGroup.offsetLeft; - const top = core.dom.gameGroup.offsetTop; - const px = Math.floor((e.clientX - left) / core.domStyle.scale), - py = Math.floor((e.clientY - top) / core.domStyle.scale); - core.ui.music.mousemove(px * 3, py * 3); - }); - music.addEventListener("mouseup", function (e) { - e.stopPropagation(); - - isvolume = false; - }); - music.addEventListener("mouseleave", function (e) { - e.stopPropagation(); - - isvolume = false; - }); - music.addEventListener("touchstart", function (e) { - e.preventDefault(); - const left = core.dom.gameGroup.offsetLeft; - const top = core.dom.gameGroup.offsetTop; - const px = Math.floor( - (e.touches[0].clientX - left) / core.domStyle.scale - ), - py = Math.floor((e.touches[0].clientY - top) / core.domStyle.scale); - core.ui.music.mousedown(px * 3, py * 3); - }); - music.addEventListener("touchmove", function (e) { - e.stopPropagation(); - const left = core.dom.gameGroup.offsetLeft; - const top = core.dom.gameGroup.offsetTop; - const px = Math.floor( - (e.touches[0].clientX - left) / core.domStyle.scale - ), - py = Math.floor((e.touches[0].clientY - top) / core.domStyle.scale); - core.ui.music.mousemove(px * 3, py * 3); - }); - music.addEventListener("touchend", function (e) { - e.stopPropagation(); - - isvolume = false; - }); - music.addEventListener("touchcancel", function (e) { - e.stopPropagation(); - - isvolume = false; - }); - - class musicclass { - constructor() { - this.musics = ["theme.mp3"]; - //music列表 - //需全塔属性注册并保存在bgms文件夹,每个数组为显示的一页内容 - this.musicMx = [ - [ - "Crawler.opus", - "Blood_Stain.opus", - "Blind_Alley.opus", - "Halbmond.opus", - ], - ["theme.mp3", "op.opus", "Asphodelus_Ceui.opus", "ed.opus"], - ]; - //音乐别名(将在播放器内显示的音乐名,music列表内的都要有对应歌名) - this.musicname = { - "Asphodelus_Ceui.opus": "Asphodelus (Full.ver)", - "Blind_Alley.opus": "Blind Alley", - "Crawler.opus": "Crawler", - "op.opus": "Asphodelus", - "theme.mp3": "One of Episodes", - "ed.opus": "親愛なる世界へ", - "Blood_Stain.opus": "Blood Stain", - "Halbmond.opus": "Halbmond", - }; - this.selection = [0, 0]; - this.stop = false; - this.type = "xunhuan"; - this.randomList = []; - this.random = 0; - } - - //更新 - update() { - this.background(); - this.drawUI(); - } - background() { - //画布大小设置 - if (core.domStyle.isVertical) { - music.width = 1248; - music.height = 2028; - } else { - music.width = 2028; - music.height = 1248; - } - } - - mousedown(px, py) { - //鼠标按下时 - - const makeBox = ([x, y], [w, h]) => { - return [ - [x, y], - [x + w, y + h], - ]; - }; - const inRect = ([x, y], [ - [sx, sy], - [dx, dy] - ]) => { - return sx <= x && x <= dx && sy <= y && y <= dy; - }; - const pos = [px, py]; - const backbox = makeBox([15, 35], [210, 90]); - if (inRect(pos, backbox)) { - //离开按钮是一致的,其余的记区分横竖屏 - music.style.display = "none"; - core.clearMap(ctx); - - core.unregisterAnimationFrame("music"); - core.restart(); - - return; - } - if (core.domStyle.isVertical) { - //竖屏 - - const pageupbox = makeBox([100, 1230], [200, 100]); - const pagedownbox = makeBox([950, 1230], [200, 100]); - const musicbox = makeBox( - [100, 200], - [1048, this.musicMx[page].length * 100] - ); - const beforebox = makeBox([120, 1620], [100, 100]); - const afterbox = makeBox([780, 1620], [100, 100]); - const playbox = makeBox([420, 1580], [200, 200]); - const typebox = makeBox([1040, 1600], [120, 120]); - - const volumebox = makeBox([250, 1940], [1050, 20]); - if (inRect(pos, pageupbox)) { - if (page !== 0) page -= 1; - return; - } - if (inRect(pos, pagedownbox)) { - if (page !== this.musicMx.length - 1) page += 1; - return; - } - if (inRect(pos, playbox)) { - if (this.stop) { - this.stop = !this.stop; - - core.resumeBgm(); - } else { - this.stop = !this.stop; - core.pauseBgm(); - } - return; - } - if (inRect(pos, beforebox)) { - this.stop = false; - switch (this.type) { - case "danqu": - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - page = this.selection[0]; - - break; - case "xunhuan": - for (;;) { - if (this.selection[1] === 0) { - if (this.selection[0] === 0) { - this.selection[0] = this.musicMx.length - 1; - this.selection[1] = - this.musicMx[this.selection[0]].length - 1; - } else { - this.selection[0] -= 1; - this.selection[1] = - this.musicMx[this.selection[0]].length - 1; - } - } else { - this.selection[1] -= 1; - } - this.random = this.randomList.indexOf( - this.musicMx[this.selection[0]][this.selection[1]] - ); - page = this.selection[0]; - if ( - this.musics.includes( - this.musicMx[this.selection[0]][this.selection[1]] - ) || - page !== this.musicMx.length - 1 - ) - break; - } - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - break; - case "suiji": - for (;;) { - if (this.random > 0) { - this.random -= 1; - } else { - this.random = this.randomList.length - 1; - } - this.selection[0] = this.musicMx.findIndex((v) => - v.includes(this.randomList[this.random]) - ); - this.selection[1] = this.musicMx[this.selection[0]].indexOf( - this.randomList[this.random] - ); - - page = this.selection[0]; - if ( - this.musics.includes( - this.musicMx[this.selection[0]][this.selection[1]] - ) || - page !== this.musicMx.length - 1 - ) - break; - } - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - break; - } - return; - } - if (inRect(pos, afterbox)) { - this.stop = false; - switch (this.type) { - case "danqu": - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - page = this.selection[0]; - break; - case "xunhuan": - for (;;) { - if ( - this.selection[1] === - this.musicMx[this.selection[0]].length - 1 - ) { - if (this.selection[0] === this.musicMx.length - 1) { - this.selection[0] = 0; - this.selection[1] = 0; - } else { - this.selection[0] += 1; - this.selection[1] = 0; - } - } else { - this.selection[1] += 1; - } - this.random = this.randomList.indexOf( - this.musicMx[this.selection[0]][this.selection[1]] - ); - page = this.selection[0]; - if ( - this.musics.includes( - this.musicMx[this.selection[0]][this.selection[1]] - ) || - page !== this.musicMx.length - 1 - ) - break; - } - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - break; - case "suiji": - for (;;) { - if (this.random < this.randomList.length - 1) { - this.random += 1; - } else { - this.random = 0; - } - this.selection[0] = this.musicMx.findIndex((v) => - v.includes(this.randomList[this.random]) - ); - this.selection[1] = this.musicMx[this.selection[0]].indexOf( - this.randomList[this.random] - ); - - page = this.selection[0]; - if ( - this.musics.includes( - this.musicMx[this.selection[0]][this.selection[1]] - ) || - page !== this.musicMx.length - 1 - ) - break; - } - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - break; - } - return; - } - if (inRect(pos, typebox)) { - switch (this.type) { - case "danqu": - this.type = "xunhuan"; - break; - case "xunhuan": - this.type = "suiji"; - break; - case "suiji": - this.type = "danqu"; - break; - } - return; - } - if (inRect(pos, musicbox)) { - const index = Math.floor((py - 200) / 100); - if (page !== this.selection[0] || index !== this.selection[1]) { - if ( - this.musics.includes(this.musicMx[page][index]) || - page !== this.musicMx.length - 1 - ) { - this.selection[0] = page; - - this.selection[1] = index; - this.randomList.indexOf( - this.musicMx[this.selection[0]][this.selection[1]] - ); - - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - this.stop = false; - } - } else { - if (this.stop) { - this.stop = !this.stop; - core.resumeBgm(); - } else { - this.stop = !this.stop; - core.pauseBgm(); - } - } - return; - } - - if (inRect(pos, volumebox)) { - const time = Math.min(Math.max((px - 250) / 800, 0), 1); - audio.setVolume(time); - core.plugin.audioSystem.soundPlayer.setVolume(time); - isvolume = true; - } - } else { - //横屏 - const pageupbox = makeBox([1050, 1100], [200, 100]); - const pagedownbox = makeBox([1550, 1100], [200, 100]); - const musicbox = makeBox( - [900, 100], - [1000, this.musicMx[page].length * 100] - ); - const beforebox = makeBox([60, 620], [100, 100]); - const afterbox = makeBox([450, 620], [100, 100]); - const playbox = makeBox([200, 570], [200, 200]); - const typebox = makeBox([620, 600], [120, 120]); - - const volumebox = makeBox([100, 990], [600, 20]); - if (inRect(pos, pageupbox)) { - if (page !== 0) page -= 1; - return; - } - if (inRect(pos, pagedownbox)) { - if (page !== this.musicMx.length - 1) page += 1; - return; - } - if (inRect(pos, playbox)) { - if (this.stop) { - this.stop = !this.stop; - core.resumeBgm(); - } else { - this.stop = !this.stop; - core.pauseBgm(); - } - return; - } - if (inRect(pos, beforebox)) { - this.stop = false; - switch (this.type) { - case "danqu": - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - page = this.selection[0]; - - break; - case "xunhuan": - for (;;) { - if (this.selection[1] === 0) { - if (this.selection[0] === 0) { - this.selection[0] = this.musicMx.length - 1; - this.selection[1] = - this.musicMx[this.selection[0]].length - 1; - } else { - this.selection[0] -= 1; - this.selection[1] = - this.musicMx[this.selection[0]].length - 1; - } - } else { - this.selection[1] -= 1; - } - this.random = this.randomList.indexOf( - this.musicMx[this.selection[0]][this.selection[1]] - ); - page = this.selection[0]; - - if ( - this.musics.includes( - this.musicMx[this.selection[0]][this.selection[1]] - ) || - page !== this.musicMx.length - 1 - ) - break; - } - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - break; - case "suiji": - for (;;) { - if (this.random > 0) { - this.random -= 1; - } else { - this.random = this.randomList.length - 1; - } - this.selection[0] = this.musicMx.findIndex((v) => - v.includes(this.randomList[this.random]) - ); - this.selection[1] = this.musicMx[this.selection[0]].indexOf( - this.randomList[this.random] - ); - - page = this.selection[0]; - - if ( - this.musics.includes( - this.musicMx[this.selection[0]][this.selection[1]] - ) || - page !== this.musicMx.length - 1 - ) - break; - } - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - break; - } - return; - } - if (inRect(pos, afterbox)) { - this.stop = false; - switch (this.type) { - case "danqu": - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - page = this.selection[0]; - break; - case "xunhuan": - for (;;) { - if ( - this.selection[1] === - this.musicMx[this.selection[0]].length - 1 - ) { - if (this.selection[0] === this.musicMx.length - 1) { - this.selection[0] = 0; - this.selection[1] = 0; - } else { - this.selection[0] += 1; - this.selection[1] = 0; - } - } else { - this.selection[1] += 1; - } - this.randomList.findIndex( - (v) => - v === this.musicMx[this.selection[0]][this.selection[1]] - ); - page = this.selection[0]; - - if ( - this.musics.includes( - this.musicMx[this.selection[0]][this.selection[1]] - ) || - page !== this.musicMx.length - 1 - ) - break; - } - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - break; - case "suiji": - for (;;) { - if (this.random < this.randomList.length - 1) { - this.random += 1; - } else { - this.random = 0; - } - this.selection[0] = this.musicMx.findIndex((v) => - v.includes(this.randomList[this.random]) - ); - this.selection[1] = this.musicMx[this.selection[0]].indexOf( - main.core.ui.music.randomList[main.core.ui.music.random] - ); - - page = this.selection[0]; - if ( - this.musics.includes( - this.musicMx[this.selection[0]][this.selection[1]] - ) || - page !== this.musicMx.length - 1 - ) - break; - } - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - break; - } - return; - } - if (inRect(pos, typebox)) { - switch (this.type) { - case "danqu": - this.type = "xunhuan"; - break; - case "xunhuan": - this.type = "suiji"; - break; - case "suiji": - this.type = "danqu"; - break; - } - return; - } - if (inRect(pos, musicbox)) { - const index = Math.floor((py - 100) / 100); - if (page !== this.selection[0] || index !== this.selection[1]) { - if ( - this.musics.includes(this.musicMx[page][index]) || - page !== this.musicMx.length - 1 - ) { - this.selection[0] = page; - this.selection[1] = index; - this.randomList.indexOf( - (v) => - v === this.musicMx[this.selection[0]][this.selection[1]] - ); - - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - this.stop = false; - } - } else { - if (this.stop) { - this.stop = !this.stop; - core.resumeBgm(); - } else { - this.stop = !this.stop; - core.pauseBgm(); - } - } - return; - } - - if (inRect(pos, volumebox)) { - const time = Math.min(Math.max((px - 100) / 600, 0), 1); - audio.setVolume(time); - core.plugin.audioSystem.soundPlayer.setVolume(time); - isvolume = true; - } - } - } - mousemove(px, py) { - if (isvolume) { - if (core.domStyle.isVertical) { - const time = Math.min(Math.max((px - 250) / 800, 0), 1); - audio.setVolume(time); - core.plugin.audioSystem.soundPlayer.setVolume(time); - } else { - const time = Math.min(Math.max((px - 100) / 600, 0), 1); - audio.setVolume(time); - core.plugin.audioSystem.soundPlayer.setVolume(time); - } - } - } - - drawUI() { - //绘制页面 - core.clearMap(music); - const bgVertical = core.material.images.images["bg_2010.webp"]; //竖屏背景 - const bg = core.material.images.images["bg_5043.webp"]; //竖屏背景 - if (core.domStyle.isVertical) { - //竖屏 - - core.fillRect(ctx, 0, 0, 1248, 2028, "#000000"); //黑色背景 - ctx.globalAlpha = 0.3; //透明度 - if (bgVertical) - ctx.drawImage(bgVertical, 0, 0, 1280, 1500, 0, 0, 1248, 2028); //绘制半透明背景图片 - ctx.globalAlpha = 1; //恢复为不透明 - - core.setTextAlign(ctx, "center"); - core.fillBoldText1( - ctx, - "◀离开", - 110, - 100, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - - ctx.strokeStyle = "#FFFFFF"; - ctx.lineWidth = 3; - ctx.beginPath(); - ctx.moveTo(100, 200); - ctx.lineTo(1148, 200); - - ctx.stroke(); - let posy = 300; - const indexList = this.musicMx[page]; - core.setTextAlign(ctx, "left"); - for (let i = 0; i < indexList.length; i++) { - const text = this.musicname[indexList[i]]; - if ( - this.musics.includes(this.musicMx[page][i]) || - page !== this.musicMx.length - 1 - ) { - core.fillBoldText1( - ctx, - text, - 150, - posy - 30, - page === this.selection[0] && i === this.selection[1] ? - "#FFFFFF" : - "#444444", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - - ctx.strokeStyle = "#FFFFFF"; - ctx.lineWidth = 3; - ctx.beginPath(); - ctx.moveTo(100, posy); - ctx.lineTo(1148, posy); - ctx.stroke(); - } - posy += 100; - } - ctx.beginPath(); - ctx.moveTo(100, 1210); - ctx.lineTo(1148, 1210); - ctx.moveTo(100, 1200); - ctx.lineTo(1148, 1200); - ctx.stroke(); - - core.fillBoldText1( - ctx, - "上一页", - 100, - 1300, - page === 0 ? "#444444" : "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - - core.fillBoldText1( - ctx, - page + 1 + "/" + this.musicMx.length, - 580, - 1300, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - core.fillBoldText1( - ctx, - "下一页", - 950, - 1300, - page === this.musicMx.length - 1 ? "#444444" : "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - - ctx.strokeStyle = "#ffffff"; - ctx.lineWidth = 3; - - core.fillBoldText( - ctx, - "|", - 100, - 1697, - "#FFFFFF", - 6, - core.ui._buildFont(96, true) - ); - core.fillBoldText( - ctx, - "◀", - 115, - 1700, - "#FFFFFF", - 6, - core.ui._buildFont(96, true) - ); - - ctx.beginPath(); - ctx.arc(505, 1670, 80, 0, 3 * Math.PI); - ctx.stroke(); - core.fillText( - ctx, - "|", - 835, - 1697, - "#FFFFFF", - core.ui._buildFont(96, true) - ); - core.fillText( - ctx, - "▶", - 785, - 1700, - "#FFFFFF", - core.ui._buildFont(96, true) - ); - - if (this.stop) { - core.fillText( - ctx, - "▶", - 473, - 1700, - "#FFFFFF", - core.ui._buildFont(96, true) - ); - } else { - core.fillText( - ctx, - "||", - 453, - 1700, - "#FFFFFF", - core.ui._buildFont(96, true) - ); - } - - const img = core.material.images.images[this.type + ".webp"]; - if (img) ctx.drawImage(img, 1000, 1555, 200, 200); - core.setTextAlign(ctx, "center"); - ctx.font = "bold 52px Verdana"; - ctx.fillText("当前歌曲", 625, 1397); - ctx.fillText( - this.musicname[this.musicMx[this.selection[0]][this.selection[1]]], - 625, - 1507 - ); - - ctx.fillStyle = "#ffffff"; - ctx.font = "bold 48px Verdana"; - ctx.fillText("音量", 150, 1970); - ctx.lineWidth = 3; - ctx.beginPath(); - ctx.moveTo(250, 1950); - ctx.lineTo(1050, 1950); - ctx.stroke(); - ctx.strokeStyle = "#ffffff"; - ctx.lineWidth = 9; - ctx.fillStyle = "rgba(255,255,255,0.5)"; - - ctx.beginPath(); - ctx.moveTo(250, 1950); - ctx.lineTo(800 * audio.getVolume() + 250, 1950); - ctx.stroke(); - ctx.beginPath(); - ctx.arc(800 * audio.getVolume() + 250, 1950, 10, 0, 2 * Math.PI); - ctx.fill(); - core.fillBoldText1( - ctx, - Math.floor(100 * audio.getVolume()), - 1120, - 1970, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(56, true) - ); - } else { - //横屏 - - core.fillRect(ctx, 0, 0, 2028, 1248, "#000000"); //黑色背景 - ctx.globalAlpha = 0.5; //透明度 - if (bg) ctx.drawImage(bg, 0, 0, 1280, 720, 0, 0, 2028, 1248); //绘制半透明背景图片 - ctx.globalAlpha = 1; //恢复为不透明 - core.setTextAlign(ctx, "center"); - - core.fillBoldText1( - ctx, - "◀离开", - 110, - 100, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - - ctx.strokeStyle = "#FFFFFF"; - ctx.lineWidth = 3; - ctx.beginPath(); - ctx.moveTo(800, 100); - ctx.lineTo(800, 1148); - ctx.moveTo(900, 100); - ctx.lineTo(1900, 100); - ctx.stroke(); - let posy = 200; - const indexList = this.musicMx[page]; - core.setTextAlign(ctx, "left"); - for (let i = 0; i < indexList.length; i++) { - const text = this.musicname[indexList[i]]; - if ( - this.musics.includes(this.musicMx[page][i]) || - page !== this.musicMx.length - 1 - ) { - core.fillBoldText1( - ctx, - text, - 950, - posy - 30, - page === this.selection[0] && i === this.selection[1] ? - "#FFFFFF" : - "#444444", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - - ctx.strokeStyle = "#FFFFFF"; - ctx.lineWidth = 3; - ctx.beginPath(); - ctx.moveTo(900, posy); - ctx.lineTo(1900, posy); - ctx.stroke(); - } - posy += 100; - } - core.fillBoldText1( - ctx, - "上一页", - 1050, - 1200 - 30, - page === 0 ? "#444444" : "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - - core.fillBoldText1( - ctx, - page + 1 + "/" + this.musicMx.length, - 1350, - 1200 - 30, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - core.fillBoldText1( - ctx, - "下一页", - 1550, - 1200 - 30, - page === this.musicMx.length - 1 ? "#444444" : "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(66, true) - ); - ctx.strokeStyle = "#ffffff"; - ctx.lineWidth = 3; - - core.fillText( - ctx, - "|", - 55, - 697, - "#FFFFFF", - core.ui._buildFont(96, true) - ); - core.fillText( - ctx, - "◀", - 70, - 700, - "#FFFFFF", - core.ui._buildFont(96, true) - ); - - ctx.beginPath(); - ctx.arc(295, 670, 80, 0, 2 * Math.PI); - ctx.stroke(); - if (this.stop) { - core.fillText( - ctx, - "▶", - 265, - 700, - "#FFFFFF", - core.ui._buildFont(96, true) - ); - } else { - core.fillText( - ctx, - "||", - 245, - 700, - "#FFFFFF", - core.ui._buildFont(96, true) - ); - } - core.fillText( - ctx, - "|", - 495, - 697, - "#FFFFFF", - core.ui._buildFont(96, true) - ); - core.fillText( - ctx, - "▶", - 450, - 700, - "#FFFFFF", - core.ui._buildFont(96, true) - ); - - ctx.font = "bold 48px Verdana"; - ctx.fillText("音量", 350, 900); - ctx.beginPath(); - ctx.moveTo(100, 1000); - ctx.lineTo(700, 1000); - ctx.stroke(); - ctx.strokeStyle = "#ffffff"; - ctx.lineWidth = 9; - ctx.fillStyle = "rgba(255,255,255,0.5)"; - - ctx.beginPath(); - ctx.moveTo(100, 1000); - ctx.lineTo(600 * audio.getVolume() + 100, 1000); - ctx.stroke(); - ctx.beginPath(); - ctx.arc(600 * audio.getVolume() + 100, 1000, 10, 0, 2 * Math.PI); - ctx.fill(); - core.fillBoldText1( - ctx, - Math.floor(100 * audio.getVolume()), - 720, - 1010, - "#FFFFFF", - "#000000", - 6, - core.ui._buildFont(56, true) - ); - const img = core.material.images.images[this.type + ".webp"]; - if (img) ctx.drawImage(img, 580, 560, 200, 200); - core.setTextAlign(ctx, "center"); - ctx.font = "bold 48px Verdana"; - ctx.fillText("当前歌曲", 400, 297); - ctx.fillText( - this.musicname[this.musicMx[this.selection[0]][this.selection[1]]], - 400, - 397 - ); - } - } - } - core.ui.music = new musicclass(); - main.dom.musicMode.onclick = function () { - //点击开始页面的CG MODE进入cg回廊 - if ( - (core.getLocalStorage("musics") && - core.getLocalStorage("musics").length === 0) || - !core.getLocalStorage("musics") - ) - core.setLocalStorage("musics", ["theme.mp3"]); - core.ui.music.musics = core.getLocalStorage("musics"); - core.playBgm( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ], - 0 - ); - - const arr = main.core.ui.music.musicMx.flat(Infinity); - main.core.ui.music.randomList = shuffle(arr); - main.core.ui.music.random = main.core.ui.music.randomList.indexOf( - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ] - ); - page = 0; - music.style.display = "block"; - let time = 0; - core.registerAnimationFrame("music", null, (temptime) => { - if (temptime > time + 1000 / 60) { - time = temptime; - main.core.ui.music.update(); - const duration = - core.plugin.audioSystem.bgmController.player.getRoute( - "bgms." + - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ] - ).duration; - - const currentTime = - core.plugin.audioSystem.bgmController.player.getRoute( - "bgms." + - main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ - main.core.ui.music.selection[1] - ] - ).currentTime; - if (currentTime && duration && duration - currentTime < 0.05) { - if (core.domStyle.isVertical) { - core.ui.music.mousedown(830, 1770); - } else { - core.ui.music.mousedown(475, 765); - } - } - } - }); - }; - loader.prototype.loadOneMusic = function (name) { - /* var music = new Audio(); + musicMode: function () { + // 在此增加新插件 + const music = document.createElement("canvas"); + music.style.position = "absolute"; + music.style.zIndex = 300; + music.style.display = "none"; + music.id = "music"; + main.dom.gameGroup.insertAdjacentElement("afterend", music); + music.style.top = "50%"; + music.style.left = "50%"; + music.style.transform = "translate(-50%,-50%)"; + const ctx = music.getContext("2d"); + main.dom.music = music; + + const audio = core.plugin.audioSystem.bgmController; + + let page = 0; //初始页面 + + let isvolume = false; + + function shuffle(arr) { + let n = arr.length, + random; + while (n) { + random = (Math.random() * n--) >>> 0; + [arr[n], arr[random]] = [arr[random], arr[n]]; + } + return arr; + } + music.addEventListener("mousedown", function (e) { + e.stopPropagation(); + const left = core.dom.gameGroup.offsetLeft; + const top = core.dom.gameGroup.offsetTop; + const px = Math.floor((e.clientX - left) / core.domStyle.scale), + py = Math.floor((e.clientY - top) / core.domStyle.scale); + core.ui.music.mousedown(px * 3, py * 3); + }); + music.addEventListener("mousemove", function (e) { + e.stopPropagation(); + const left = core.dom.gameGroup.offsetLeft; + const top = core.dom.gameGroup.offsetTop; + const px = Math.floor((e.clientX - left) / core.domStyle.scale), + py = Math.floor((e.clientY - top) / core.domStyle.scale); + core.ui.music.mousemove(px * 3, py * 3); + }); + music.addEventListener("mouseup", function (e) { + e.stopPropagation(); + + isvolume = false; + }); + music.addEventListener("mouseleave", function (e) { + e.stopPropagation(); + + isvolume = false; + }); + music.addEventListener("touchstart", function (e) { + e.preventDefault(); + const left = core.dom.gameGroup.offsetLeft; + const top = core.dom.gameGroup.offsetTop; + const px = Math.floor( + (e.touches[0].clientX - left) / core.domStyle.scale + ), + py = Math.floor((e.touches[0].clientY - top) / core.domStyle.scale); + core.ui.music.mousedown(px * 3, py * 3); + }); + music.addEventListener("touchmove", function (e) { + e.stopPropagation(); + const left = core.dom.gameGroup.offsetLeft; + const top = core.dom.gameGroup.offsetTop; + const px = Math.floor( + (e.touches[0].clientX - left) / core.domStyle.scale + ), + py = Math.floor((e.touches[0].clientY - top) / core.domStyle.scale); + core.ui.music.mousemove(px * 3, py * 3); + }); + music.addEventListener("touchend", function (e) { + e.stopPropagation(); + + isvolume = false; + }); + music.addEventListener("touchcancel", function (e) { + e.stopPropagation(); + + isvolume = false; + }); + + class musicclass { + constructor() { + this.musics = ["theme.mp3"]; + //music列表 + //需全塔属性注册并保存在bgms文件夹,每个数组为显示的一页内容 + this.musicMx = [ + [ + "Crawler.opus", + "Blood_Stain.opus", + "Blind_Alley.opus", + "Halbmond.opus", + ], + ["theme.mp3", "op.opus", "Asphodelus_Ceui.opus", "ed.opus"], + ]; + //音乐别名(将在播放器内显示的音乐名,music列表内的都要有对应歌名) + this.musicname = { + "Asphodelus_Ceui.opus": "Asphodelus (Full.ver)", + "Blind_Alley.opus": "Blind Alley", + "Crawler.opus": "Crawler", + "op.opus": "Asphodelus", + "theme.mp3": "One of Episodes", + "ed.opus": "親愛なる世界へ", + "Blood_Stain.opus": "Blood Stain", + "Halbmond.opus": "Halbmond", + }; + this.selection = [0, 0]; + this.stop = false; + this.type = "xunhuan"; + this.randomList = []; + this.random = 0; + } + + //更新 + update() { + this.background(); + this.drawUI(); + } + background() { + //画布大小设置 + if (core.domStyle.isVertical) { + music.width = 1248; + music.height = 2028; + } else { + music.width = 2028; + music.height = 1248; + } + } + + mousedown(px, py) { + //鼠标按下时 + + const makeBox = ([x, y], [w, h]) => { + return [ + [x, y], + [x + w, y + h], + ]; + }; + const inRect = ([x, y], [[sx, sy], [dx, dy]]) => { + return sx <= x && x <= dx && sy <= y && y <= dy; + }; + const pos = [px, py]; + const backbox = makeBox([15, 35], [210, 90]); + if (inRect(pos, backbox)) { + //离开按钮是一致的,其余的记区分横竖屏 + music.style.display = "none"; + core.clearMap(ctx); + + core.unregisterAnimationFrame("music"); + core.restart(); + + return; + } + if (core.domStyle.isVertical) { + //竖屏 + + const pageupbox = makeBox([100, 1230], [200, 100]); + const pagedownbox = makeBox([950, 1230], [200, 100]); + const musicbox = makeBox( + [100, 200], + [1048, this.musicMx[page].length * 100] + ); + const beforebox = makeBox([120, 1620], [100, 100]); + const afterbox = makeBox([780, 1620], [100, 100]); + const playbox = makeBox([420, 1580], [200, 200]); + const typebox = makeBox([1040, 1600], [120, 120]); + + const volumebox = makeBox([250, 1940], [1050, 20]); + if (inRect(pos, pageupbox)) { + if (page !== 0) page -= 1; + return; + } + if (inRect(pos, pagedownbox)) { + if (page !== this.musicMx.length - 1) page += 1; + return; + } + if (inRect(pos, playbox)) { + if (this.stop) { + this.stop = !this.stop; + + core.resumeBgm(); + } else { + this.stop = !this.stop; + core.pauseBgm(); + } + return; + } + if (inRect(pos, beforebox)) { + this.stop = false; + switch (this.type) { + case "danqu": + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + page = this.selection[0]; + + break; + case "xunhuan": + for (;;) { + if (this.selection[1] === 0) { + if (this.selection[0] === 0) { + this.selection[0] = this.musicMx.length - 1; + this.selection[1] = + this.musicMx[this.selection[0]].length - 1; + } else { + this.selection[0] -= 1; + this.selection[1] = + this.musicMx[this.selection[0]].length - 1; + } + } else { + this.selection[1] -= 1; + } + this.random = this.randomList.indexOf( + this.musicMx[this.selection[0]][this.selection[1]] + ); + page = this.selection[0]; + if ( + this.musics.includes( + this.musicMx[this.selection[0]][this.selection[1]] + ) || + page !== this.musicMx.length - 1 + ) + break; + } + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + break; + case "suiji": + for (;;) { + if (this.random > 0) { + this.random -= 1; + } else { + this.random = this.randomList.length - 1; + } + this.selection[0] = this.musicMx.findIndex((v) => + v.includes(this.randomList[this.random]) + ); + this.selection[1] = this.musicMx[this.selection[0]].indexOf( + this.randomList[this.random] + ); + + page = this.selection[0]; + if ( + this.musics.includes( + this.musicMx[this.selection[0]][this.selection[1]] + ) || + page !== this.musicMx.length - 1 + ) + break; + } + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + break; + } + return; + } + if (inRect(pos, afterbox)) { + this.stop = false; + switch (this.type) { + case "danqu": + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + page = this.selection[0]; + break; + case "xunhuan": + for (;;) { + if ( + this.selection[1] === + this.musicMx[this.selection[0]].length - 1 + ) { + if (this.selection[0] === this.musicMx.length - 1) { + this.selection[0] = 0; + this.selection[1] = 0; + } else { + this.selection[0] += 1; + this.selection[1] = 0; + } + } else { + this.selection[1] += 1; + } + this.random = this.randomList.indexOf( + this.musicMx[this.selection[0]][this.selection[1]] + ); + page = this.selection[0]; + if ( + this.musics.includes( + this.musicMx[this.selection[0]][this.selection[1]] + ) || + page !== this.musicMx.length - 1 + ) + break; + } + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + break; + case "suiji": + for (;;) { + if (this.random < this.randomList.length - 1) { + this.random += 1; + } else { + this.random = 0; + } + this.selection[0] = this.musicMx.findIndex((v) => + v.includes(this.randomList[this.random]) + ); + this.selection[1] = this.musicMx[this.selection[0]].indexOf( + this.randomList[this.random] + ); + + page = this.selection[0]; + if ( + this.musics.includes( + this.musicMx[this.selection[0]][this.selection[1]] + ) || + page !== this.musicMx.length - 1 + ) + break; + } + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + break; + } + return; + } + if (inRect(pos, typebox)) { + switch (this.type) { + case "danqu": + this.type = "xunhuan"; + break; + case "xunhuan": + this.type = "suiji"; + break; + case "suiji": + this.type = "danqu"; + break; + } + return; + } + if (inRect(pos, musicbox)) { + const index = Math.floor((py - 200) / 100); + if (page !== this.selection[0] || index !== this.selection[1]) { + if ( + this.musics.includes(this.musicMx[page][index]) || + page !== this.musicMx.length - 1 + ) { + this.selection[0] = page; + + this.selection[1] = index; + this.randomList.indexOf( + this.musicMx[this.selection[0]][this.selection[1]] + ); + + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + this.stop = false; + } + } else { + if (this.stop) { + this.stop = !this.stop; + core.resumeBgm(); + } else { + this.stop = !this.stop; + core.pauseBgm(); + } + } + return; + } + + if (inRect(pos, volumebox)) { + const time = Math.min(Math.max((px - 250) / 800, 0), 1); + audio.setVolume(time); + core.plugin.audioSystem.soundPlayer.setVolume(time); + isvolume = true; + } + } else { + //横屏 + const pageupbox = makeBox([1050, 1100], [200, 100]); + const pagedownbox = makeBox([1550, 1100], [200, 100]); + const musicbox = makeBox( + [900, 100], + [1000, this.musicMx[page].length * 100] + ); + const beforebox = makeBox([60, 620], [100, 100]); + const afterbox = makeBox([450, 620], [100, 100]); + const playbox = makeBox([200, 570], [200, 200]); + const typebox = makeBox([620, 600], [120, 120]); + + const volumebox = makeBox([100, 990], [600, 20]); + if (inRect(pos, pageupbox)) { + if (page !== 0) page -= 1; + return; + } + if (inRect(pos, pagedownbox)) { + if (page !== this.musicMx.length - 1) page += 1; + return; + } + if (inRect(pos, playbox)) { + if (this.stop) { + this.stop = !this.stop; + core.resumeBgm(); + } else { + this.stop = !this.stop; + core.pauseBgm(); + } + return; + } + if (inRect(pos, beforebox)) { + this.stop = false; + switch (this.type) { + case "danqu": + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + page = this.selection[0]; + + break; + case "xunhuan": + for (;;) { + if (this.selection[1] === 0) { + if (this.selection[0] === 0) { + this.selection[0] = this.musicMx.length - 1; + this.selection[1] = + this.musicMx[this.selection[0]].length - 1; + } else { + this.selection[0] -= 1; + this.selection[1] = + this.musicMx[this.selection[0]].length - 1; + } + } else { + this.selection[1] -= 1; + } + this.random = this.randomList.indexOf( + this.musicMx[this.selection[0]][this.selection[1]] + ); + page = this.selection[0]; + + if ( + this.musics.includes( + this.musicMx[this.selection[0]][this.selection[1]] + ) || + page !== this.musicMx.length - 1 + ) + break; + } + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + break; + case "suiji": + for (;;) { + if (this.random > 0) { + this.random -= 1; + } else { + this.random = this.randomList.length - 1; + } + this.selection[0] = this.musicMx.findIndex((v) => + v.includes(this.randomList[this.random]) + ); + this.selection[1] = this.musicMx[this.selection[0]].indexOf( + this.randomList[this.random] + ); + + page = this.selection[0]; + + if ( + this.musics.includes( + this.musicMx[this.selection[0]][this.selection[1]] + ) || + page !== this.musicMx.length - 1 + ) + break; + } + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + break; + } + return; + } + if (inRect(pos, afterbox)) { + this.stop = false; + switch (this.type) { + case "danqu": + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + page = this.selection[0]; + break; + case "xunhuan": + for (;;) { + if ( + this.selection[1] === + this.musicMx[this.selection[0]].length - 1 + ) { + if (this.selection[0] === this.musicMx.length - 1) { + this.selection[0] = 0; + this.selection[1] = 0; + } else { + this.selection[0] += 1; + this.selection[1] = 0; + } + } else { + this.selection[1] += 1; + } + this.randomList.findIndex( + (v) => + v === this.musicMx[this.selection[0]][this.selection[1]] + ); + page = this.selection[0]; + + if ( + this.musics.includes( + this.musicMx[this.selection[0]][this.selection[1]] + ) || + page !== this.musicMx.length - 1 + ) + break; + } + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + break; + case "suiji": + for (;;) { + if (this.random < this.randomList.length - 1) { + this.random += 1; + } else { + this.random = 0; + } + this.selection[0] = this.musicMx.findIndex((v) => + v.includes(this.randomList[this.random]) + ); + this.selection[1] = this.musicMx[this.selection[0]].indexOf( + main.core.ui.music.randomList[main.core.ui.music.random] + ); + + page = this.selection[0]; + if ( + this.musics.includes( + this.musicMx[this.selection[0]][this.selection[1]] + ) || + page !== this.musicMx.length - 1 + ) + break; + } + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + break; + } + return; + } + if (inRect(pos, typebox)) { + switch (this.type) { + case "danqu": + this.type = "xunhuan"; + break; + case "xunhuan": + this.type = "suiji"; + break; + case "suiji": + this.type = "danqu"; + break; + } + return; + } + if (inRect(pos, musicbox)) { + const index = Math.floor((py - 100) / 100); + if (page !== this.selection[0] || index !== this.selection[1]) { + if ( + this.musics.includes(this.musicMx[page][index]) || + page !== this.musicMx.length - 1 + ) { + this.selection[0] = page; + this.selection[1] = index; + this.randomList.indexOf( + (v) => + v === this.musicMx[this.selection[0]][this.selection[1]] + ); + + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + this.stop = false; + } + } else { + if (this.stop) { + this.stop = !this.stop; + core.resumeBgm(); + } else { + this.stop = !this.stop; + core.pauseBgm(); + } + } + return; + } + + if (inRect(pos, volumebox)) { + const time = Math.min(Math.max((px - 100) / 600, 0), 1); + audio.setVolume(time); + core.plugin.audioSystem.soundPlayer.setVolume(time); + isvolume = true; + } + } + } + mousemove(px, py) { + if (isvolume) { + if (core.domStyle.isVertical) { + const time = Math.min(Math.max((px - 250) / 800, 0), 1); + audio.setVolume(time); + core.plugin.audioSystem.soundPlayer.setVolume(time); + } else { + const time = Math.min(Math.max((px - 100) / 600, 0), 1); + audio.setVolume(time); + core.plugin.audioSystem.soundPlayer.setVolume(time); + } + } + } + + drawUI() { + //绘制页面 + core.clearMap(music); + const bgVertical = core.material.images.images["bg_2010.webp"]; //竖屏背景 + const bg = core.material.images.images["bg_5043.webp"]; //竖屏背景 + if (core.domStyle.isVertical) { + //竖屏 + + core.fillRect(ctx, 0, 0, 1248, 2028, "#000000"); //黑色背景 + ctx.globalAlpha = 0.3; //透明度 + if (bgVertical) + ctx.drawImage(bgVertical, 0, 0, 1280, 1500, 0, 0, 1248, 2028); //绘制半透明背景图片 + ctx.globalAlpha = 1; //恢复为不透明 + + core.setTextAlign(ctx, "center"); + core.fillBoldText1( + ctx, + "◀离开", + 110, + 100, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + + ctx.strokeStyle = "#FFFFFF"; + ctx.lineWidth = 3; + ctx.beginPath(); + ctx.moveTo(100, 200); + ctx.lineTo(1148, 200); + + ctx.stroke(); + let posy = 300; + const indexList = this.musicMx[page]; + core.setTextAlign(ctx, "left"); + for (let i = 0; i < indexList.length; i++) { + const text = this.musicname[indexList[i]]; + if ( + this.musics.includes(this.musicMx[page][i]) || + page !== this.musicMx.length - 1 + ) { + core.fillBoldText1( + ctx, + text, + 150, + posy - 30, + page === this.selection[0] && i === this.selection[1] + ? "#FFFFFF" + : "#444444", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + + ctx.strokeStyle = "#FFFFFF"; + ctx.lineWidth = 3; + ctx.beginPath(); + ctx.moveTo(100, posy); + ctx.lineTo(1148, posy); + ctx.stroke(); + } + posy += 100; + } + ctx.beginPath(); + ctx.moveTo(100, 1210); + ctx.lineTo(1148, 1210); + ctx.moveTo(100, 1200); + ctx.lineTo(1148, 1200); + ctx.stroke(); + + core.fillBoldText1( + ctx, + "上一页", + 100, + 1300, + page === 0 ? "#444444" : "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + + core.fillBoldText1( + ctx, + page + 1 + "/" + this.musicMx.length, + 580, + 1300, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + core.fillBoldText1( + ctx, + "下一页", + 950, + 1300, + page === this.musicMx.length - 1 ? "#444444" : "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + + ctx.strokeStyle = "#ffffff"; + ctx.lineWidth = 3; + + core.fillBoldText( + ctx, + "|", + 100, + 1697, + "#FFFFFF", + 6, + core.ui._buildFont(96, true) + ); + core.fillBoldText( + ctx, + "◀", + 115, + 1700, + "#FFFFFF", + 6, + core.ui._buildFont(96, true) + ); + + ctx.beginPath(); + ctx.arc(505, 1670, 80, 0, 3 * Math.PI); + ctx.stroke(); + core.fillText( + ctx, + "|", + 835, + 1697, + "#FFFFFF", + core.ui._buildFont(96, true) + ); + core.fillText( + ctx, + "▶", + 785, + 1700, + "#FFFFFF", + core.ui._buildFont(96, true) + ); + + if (this.stop) { + core.fillText( + ctx, + "▶", + 473, + 1700, + "#FFFFFF", + core.ui._buildFont(96, true) + ); + } else { + core.fillText( + ctx, + "||", + 453, + 1700, + "#FFFFFF", + core.ui._buildFont(96, true) + ); + } + + const img = core.material.images.images[this.type + ".webp"]; + if (img) ctx.drawImage(img, 1000, 1555, 200, 200); + core.setTextAlign(ctx, "center"); + ctx.font = "bold 52px Verdana"; + ctx.fillText("当前歌曲", 625, 1397); + ctx.fillText( + this.musicname[this.musicMx[this.selection[0]][this.selection[1]]], + 625, + 1507 + ); + + ctx.fillStyle = "#ffffff"; + ctx.font = "bold 48px Verdana"; + ctx.fillText("音量", 150, 1970); + ctx.lineWidth = 3; + ctx.beginPath(); + ctx.moveTo(250, 1950); + ctx.lineTo(1050, 1950); + ctx.stroke(); + ctx.strokeStyle = "#ffffff"; + ctx.lineWidth = 9; + ctx.fillStyle = "rgba(255,255,255,0.5)"; + + ctx.beginPath(); + ctx.moveTo(250, 1950); + ctx.lineTo(800 * audio.getVolume() + 250, 1950); + ctx.stroke(); + ctx.beginPath(); + ctx.arc(800 * audio.getVolume() + 250, 1950, 10, 0, 2 * Math.PI); + ctx.fill(); + core.fillBoldText1( + ctx, + Math.floor(100 * audio.getVolume()), + 1120, + 1970, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(56, true) + ); + } else { + //横屏 + + core.fillRect(ctx, 0, 0, 2028, 1248, "#000000"); //黑色背景 + ctx.globalAlpha = 0.5; //透明度 + if (bg) ctx.drawImage(bg, 0, 0, 1280, 720, 0, 0, 2028, 1248); //绘制半透明背景图片 + ctx.globalAlpha = 1; //恢复为不透明 + core.setTextAlign(ctx, "center"); + + core.fillBoldText1( + ctx, + "◀离开", + 110, + 100, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + + ctx.strokeStyle = "#FFFFFF"; + ctx.lineWidth = 3; + ctx.beginPath(); + ctx.moveTo(800, 100); + ctx.lineTo(800, 1148); + ctx.moveTo(900, 100); + ctx.lineTo(1900, 100); + ctx.stroke(); + let posy = 200; + const indexList = this.musicMx[page]; + core.setTextAlign(ctx, "left"); + for (let i = 0; i < indexList.length; i++) { + const text = this.musicname[indexList[i]]; + if ( + this.musics.includes(this.musicMx[page][i]) || + page !== this.musicMx.length - 1 + ) { + core.fillBoldText1( + ctx, + text, + 950, + posy - 30, + page === this.selection[0] && i === this.selection[1] + ? "#FFFFFF" + : "#444444", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + + ctx.strokeStyle = "#FFFFFF"; + ctx.lineWidth = 3; + ctx.beginPath(); + ctx.moveTo(900, posy); + ctx.lineTo(1900, posy); + ctx.stroke(); + } + posy += 100; + } + core.fillBoldText1( + ctx, + "上一页", + 1050, + 1200 - 30, + page === 0 ? "#444444" : "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + + core.fillBoldText1( + ctx, + page + 1 + "/" + this.musicMx.length, + 1350, + 1200 - 30, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + core.fillBoldText1( + ctx, + "下一页", + 1550, + 1200 - 30, + page === this.musicMx.length - 1 ? "#444444" : "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(66, true) + ); + ctx.strokeStyle = "#ffffff"; + ctx.lineWidth = 3; + + core.fillText( + ctx, + "|", + 55, + 697, + "#FFFFFF", + core.ui._buildFont(96, true) + ); + core.fillText( + ctx, + "◀", + 70, + 700, + "#FFFFFF", + core.ui._buildFont(96, true) + ); + + ctx.beginPath(); + ctx.arc(295, 670, 80, 0, 2 * Math.PI); + ctx.stroke(); + if (this.stop) { + core.fillText( + ctx, + "▶", + 265, + 700, + "#FFFFFF", + core.ui._buildFont(96, true) + ); + } else { + core.fillText( + ctx, + "||", + 245, + 700, + "#FFFFFF", + core.ui._buildFont(96, true) + ); + } + core.fillText( + ctx, + "|", + 495, + 697, + "#FFFFFF", + core.ui._buildFont(96, true) + ); + core.fillText( + ctx, + "▶", + 450, + 700, + "#FFFFFF", + core.ui._buildFont(96, true) + ); + + ctx.font = "bold 48px Verdana"; + ctx.fillText("音量", 350, 900); + ctx.beginPath(); + ctx.moveTo(100, 1000); + ctx.lineTo(700, 1000); + ctx.stroke(); + ctx.strokeStyle = "#ffffff"; + ctx.lineWidth = 9; + ctx.fillStyle = "rgba(255,255,255,0.5)"; + + ctx.beginPath(); + ctx.moveTo(100, 1000); + ctx.lineTo(600 * audio.getVolume() + 100, 1000); + ctx.stroke(); + ctx.beginPath(); + ctx.arc(600 * audio.getVolume() + 100, 1000, 10, 0, 2 * Math.PI); + ctx.fill(); + core.fillBoldText1( + ctx, + Math.floor(100 * audio.getVolume()), + 720, + 1010, + "#FFFFFF", + "#000000", + 6, + core.ui._buildFont(56, true) + ); + const img = core.material.images.images[this.type + ".webp"]; + if (img) ctx.drawImage(img, 580, 560, 200, 200); + core.setTextAlign(ctx, "center"); + ctx.font = "bold 48px Verdana"; + ctx.fillText("当前歌曲", 400, 297); + ctx.fillText( + this.musicname[this.musicMx[this.selection[0]][this.selection[1]]], + 400, + 397 + ); + } + } + } + core.ui.music = new musicclass(); + main.dom.musicMode.onclick = function () { + //点击开始页面的CG MODE进入cg回廊 + if ( + (core.getLocalStorage("musics") && + core.getLocalStorage("musics").length === 0) || + !core.getLocalStorage("musics") + ) + core.setLocalStorage("musics", ["theme.mp3"]); + core.ui.music.musics = core.getLocalStorage("musics"); + core.playBgm( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ], + 0 + ); + + const arr = main.core.ui.music.musicMx.flat(Infinity); + main.core.ui.music.randomList = shuffle(arr); + main.core.ui.music.random = main.core.ui.music.randomList.indexOf( + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ] + ); + page = 0; + music.style.display = "block"; + let time = 0; + core.registerAnimationFrame("music", null, (temptime) => { + if (temptime > time + 1000 / 60) { + time = temptime; + main.core.ui.music.update(); + const duration = + core.plugin.audioSystem.bgmController.player.getRoute( + "bgms." + + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ] + ).duration; + + const currentTime = + core.plugin.audioSystem.bgmController.player.getRoute( + "bgms." + + main.core.ui.music.musicMx[main.core.ui.music.selection[0]][ + main.core.ui.music.selection[1] + ] + ).currentTime; + if (currentTime && duration && duration - currentTime < 0.05) { + if (core.domStyle.isVertical) { + core.ui.music.mousedown(830, 1770); + } else { + core.ui.music.mousedown(475, 765); + } + } + } + }); + }; + loader.prototype.loadOneMusic = function (name) { + /* var music = new Audio(); music.preload = "none"; if (main.bgmRemote) music.src = main.bgmRemoteRoot + core.firstData.name + "/" + name; else music.src = "project/bgms/" + name; music.loop = "loop"; core.material.bgms[name] = music;*/ - }; -}, - "横屏切换": function () { + }; + }, + 横屏切换: function () { // 在此增加新插件 this.triggerFullscreen = async function (full) { if (!!document.fullscreenElement && !full) { @@ -17947,7 +17951,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }; }, - "图片压缩webp导出": function () { + 图片压缩webp导出: function () { // 在此增加新插件 //使用方法:进入游戏后开始游戏,F12打开控制台,输入core.towebp(image),image为已在全塔属性中注册过的图片名字,需要""括起来 this.towebp = function (image) { @@ -17978,7 +17982,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }); }; }, - "帧动画特效(游戏界面)": function () { + "帧动画特效(游戏界面)": function () { // 在此增加新插件 const animate2 = document.createElement("canvas"); //画布设置 animate2.style.zIndex = 91; @@ -18180,7 +18184,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = } }); }, - "intro&loop": function () { + "intro&loop": function () { // 在此增加新插件 this.introAndLoop = function (intro, time, loop) { core.playBgm(intro); @@ -18189,7 +18193,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }, time * 1000); }; }, - "开局选项悬停": function () { + 开局选项悬停: function () { // 在此增加新插件 main.dom.playGame.addEventListener("mouseenter", () => { @@ -18272,7 +18276,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.dom.replayGame.style.backgroundColor = "transparent"; }); }, - "天气叠加": function () { + 天气叠加: function () { //使用方法:使用core.setWeather(天气,等级)来增加天气,使用core.setWeather()来清空天气 // 天气叠加功能 ////// 更改天气效果 ////// @@ -18524,7 +18528,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ); }; }, - "回合战斗动画": function () { + 回合战斗动画: function () { // 在此增加新插件 const animateAttack = document.createElement("canvas"); //画布设置 animateAttack.style.zIndex = 80; @@ -18949,7 +18953,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }); }; }, - "剧情内容": function () { + 剧情内容: function () { // 每项为一个数组,第一项是名字,第二项是对话内容,第三项为音频文件名(没有则不需要第三项) // 回放只会在同一个this下回放,进入剧情前请以事件块声明进入哪个剧情数组 this.chapter0 = [ @@ -19180,18 +19184,22 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ]; this.chapter02 = [ ["不蚀金锁成员", "「凯伊姆先生,凯伊姆先生」", "aiy860000010.ogg"], - ["不蚀金锁成员", "「您已经和艾莉斯大夫见过面了吗?」", "aiy860000020.ogg"], + [ + "不蚀金锁成员", + "「您已经和艾莉斯大夫见过面了吗?」", + "aiy860000020.ogg", + ], ["凯伊姆", "「啊啊,所以才会追过来的」", "aiy310000310.ogg"], //男主31 ["凯伊姆", "「看到小偷了吗?」", "aiy310000320.ogg"], //男主32 [ "不蚀金锁成员", - "「没有,他向广场那边逃了过去,今天这么拥挤,我们也只能放弃了」", - "aiy860000030.ogg" + "「没有,他向广场那边逃了过去,今天这么拥挤,我们也只能放弃了」", + "aiy860000030.ogg", ], [ "不蚀金锁成员", - "「不过,我也只是刚好在店里所以才追了过去,并不是受人所托」", - "aiy860000040.ogg" + "「不过,我也只是刚好在店里所以才追了过去,并不是受人所托」", + "aiy860000040.ogg", ], ["不蚀金锁成员", "「我已经准备撤退了」", "aiy860000050.ogg"], ["不蚀金锁成员", "「凯伊姆先生还要继续追吗?」", "aiy860000060.ogg"], @@ -19215,24 +19223,28 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = [ "神官", "「在参见那位大人之前,我希望牢狱的诸位再次思考这个《诺瓦斯·艾蒂尔》存在的意义······」", - "aiy440000020.ogg" + "aiy440000020.ogg", ], [ "神官", "「初代圣女伊莲大人,便是也难怪这崇高的祈祷之力,令《诺瓦斯·艾蒂尔》浮在空中,拯救了我们的祖先」", - "aiy440000030.ogg" + "aiy440000030.ogg", ], [ "神官", "「这之后的几百年来,传承了初代大人力量的历代圣女伊莲大人,让这里留在了空中」", - "aiy440000040.ogg" + "aiy440000040.ogg", ], [ "神官", "「这座都市是被圣女大人守护的人类最后的圣域,而我们则是被选召的虔诚的信徒」", - "aiy440000050.ogg" + "aiy440000050.ogg", + ], + [ + "神官", + "「怀着对圣女的感激祈祷吧,感谢圣女伊莲吧!并献上祈祷!」", + "aiy440000060.ogg", ], - ["神官", "「怀着对圣女的感激祈祷吧,感谢圣女伊莲吧!并献上祈祷!」", "aiy440000060.ogg"], ["圣女", "「不忘感谢与祈祷,神才会拯救我们」", "aiy030000010.ogg"], //圣女01 ["圣女", "「与我一起,向神虔诚地祈祷吧」", "aiy030000020.ogg"], //圣女02 ["", "广场上欢声雷动。"], @@ -19251,13 +19263,29 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ["女声", "「——っ!?」", "aiy510000010.ogg"], ["围观的女人", "「羽,羽化病人!?」", "aiy510000020.ogg"], ["围观的中年人", "「喂,谁去叫下羽狩」", "aiy720000010.ogg"], - ["惊慌的观众", "「你这家伙不要靠近我,要是传染了可怎么办」", "aiy730000010.ogg"], + [ + "惊慌的观众", + "「你这家伙不要靠近我,要是传染了可怎么办」", + "aiy730000010.ogg", + ], ["粗鲁的观众", "「你这小鬼赶快滚开」", "aiy740000010.ogg"], ["凯伊姆", "「接下来」", "aiy310000360.ogg"], //男主36 ["圣女", "「发生什么事了?看上去似乎很嘈杂」", "aiy030000030.ogg"], //圣女03 - ["随从", "「似乎是某个人逃跑了······具体的我也不是很清楚」", "aiy130000010.ogg"], //侍从01 - ["神官", "「圣女大人,继续待在天台上可能会出事,请您先回到室内吧」", "aiy440000070.ogg"], - ["圣女", "「不用在意我,比起那个,我更关心究竟发生了什么事」", "aiy030000050.ogg"], //圣女05 + [ + "随从", + "「似乎是某个人逃跑了······具体的我也不是很清楚」", + "aiy130000010.ogg", + ], //侍从01 + [ + "神官", + "「圣女大人,继续待在天台上可能会出事,请您先回到室内吧」", + "aiy440000070.ogg", + ], + [ + "圣女", + "「不用在意我,比起那个,我更关心究竟发生了什么事」", + "aiy030000050.ogg", + ], //圣女05 ["神官", "「对不起,我真的不知道」", "aiy440000080.ogg"], ["圣女", "「······是吗」", "aiy030000060.ogg"], //圣女06 ["男", "「恕我僭越,请准许我说明情况」", "aiy320000010.ogg"], //男主他哥01 @@ -19266,28 +19294,40 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = [ "男", "「现在,《防疫局》已经派遣了部队。我想不久之后,他们就会安静下来了」", - "aiy320000040.ogg" + "aiy320000040.ogg", ], //男主他哥04 ["圣女", "「羽化病······」", "aiy030000070.ogg"], //圣女07 ["男", "「怎么了?」", "aiy320000050.ogg"], //男主他哥05 ["圣女", "「没什么」", "aiy030000080.ogg"], //圣女08 ["圣女", "「辛苦了,你的名字是?」", "aiy030000090.ogg"], //圣女09 - ["男", "「属下是在防疫局任职的,鲁基乌斯· 迪斯·米利尤」", "aiy320000060.ogg"], //男主他哥06 - ["神官", "「噢噢,阁下就是鲁基乌斯卿吗,我听说过你的传闻」", "aiy440000090.ogg"], + [ + "男", + "「属下是在防疫局任职的,鲁基乌斯· 迪斯·米利尤」", + "aiy320000060.ogg", + ], //男主他哥06 + [ + "神官", + "「噢噢,阁下就是鲁基乌斯卿吗,我听说过你的传闻」", + "aiy440000090.ogg", + ], ["神官", "「阁下是在工作上相当出色的人呢」", "aiy440000100.ogg"], - ["鲁基乌斯", "「不敢当」", "aiy320000070.ogg", //男主他哥07 + ["鲁基乌斯", "「不敢当」", "aiy320000070.ogg"], //男主他哥07 [ "鲁基乌斯", "「话说回来,这次是属下警备工作的失职。让圣女大人见到这不成体统的一面,请您见谅」", - "aiy320000080.ogg" + "aiy320000080.ogg", ], //男主他哥08 [ "圣女", "「即使是目不见物的我,也能感受到聚集于此的民众数量之多。警备工作难以展开也在情理之中」", - "aiy030000100.ogg" + "aiy030000100.ogg", ], //圣女10 ["鲁基乌斯", "「属下不胜惶恐」", "aiy320000090.ogg"], //男主他哥09 - ["鲁基乌斯", "「接下来属下还要回到工作岗位上,在这里就先告退了」", "aiy320000100.ogg"], //男主他哥10 + [ + "鲁基乌斯", + "「接下来属下还要回到工作岗位上,在这里就先告退了」", + "aiy320000100.ogg", + ], //男主他哥10 ["圣女", "「鲁基乌斯先生」", "aiy030000110.ogg"], //圣女11 ["鲁基乌斯", "「属下在」", "aiy320000110.ogg"], //男主他哥11 ["圣女", "「你是怎样看待羽狩的工作的呢?」", "aiy030000120.ogg"], //圣女12 @@ -19295,7 +19335,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = [ "鲁基乌斯", "「防疫局的工作是国王陛下赐予的重要职务。属下非常荣幸能够为这个都市的繁荣尽一份微薄之力」", - "aiy320000120.ogg" + "aiy320000120.ogg", ], //男主他哥12 ["神官", "「不,不亏是鲁基乌斯卿,相当优秀的想法」", "aiy440000120.ogg"], ["圣女", "「是吗。辛苦你了」", "aiy030000130.ogg"], //圣女13 @@ -19312,7 +19352,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ["凯伊姆", "「逃到贫民区是个不错的想法」"], //男主38 ["羽化病患少年", "「你,你是,羽狩吗?」", "aiy750000020.ogg"], ["凯伊姆", "「不是」"], //男主39 - ["羽化病患少年", "「什,什么啊······混蛋,不要吓我啊」", "aiy750000030.ogg"], + [ + "羽化病患少年", + "「什,什么啊······混蛋,不要吓我啊」", + "aiy750000030.ogg", + ], ["凯伊姆", "「我对令你受惊这件事致以歉意」"], //男主40 ["凯伊姆", "「作为回报,麻烦你把从店里偷的钱交出来吧」"], //男主41 ["羽化病患少年", "「钱?你在说什么」", "aiy750000040.ogg"], @@ -19323,7 +19367,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ["凯伊姆", "「······」"], //男主43 ["凯伊姆", "「把偷的钱交出来」"], //男主44 ["羽化病患少年", "「我不知道你在······咕」", "aiy750000080.ogg"], - ["羽化病患少年", "「你,你说是我偷的······有什么证据吗」", "aiy750000090.ogg"], + [ + "羽化病患少年", + "「你,你说是我偷的······有什么证据吗」", + "aiy750000090.ogg", + ], ["凯伊姆", "「你还挺倔的啊」"], //男主45 ["凯伊姆", "「不过,给我听好了」"], //男主46 ["凯伊姆", "「你偷的那些钱,是要上缴给《不蚀金锁》的上纳金」"], //男主47 @@ -19335,26 +19383,50 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ["羽化病患少年", "「是,是,是,在我的怀里」", "aiy750000120.ogg"], ["凯伊姆", "「你没有擅自拿掉一部分吧」"], //男主51 ["羽化病患少年", "「是,是的」", "aiy7500000130.ogg"], - ["羽化病患少年", "「那,那个,您是《不蚀金锁》的人吗?」", "aiy750000140.ogg"], + [ + "羽化病患少年", + "「那,那个,您是《不蚀金锁》的人吗?」", + "aiy750000140.ogg", + ], ["凯伊姆", "「算是吧」"], //男主52 - ["羽化病患少年", "「我什么都可以做,请您一定要帮帮我」", "aiy750000150.ogg"], + [ + "羽化病患少年", + "「我什么都可以做,请您一定要帮帮我」", + "aiy750000150.ogg", + ], ["凯伊姆", "「抱歉,我并没有兴趣去帮助他人」"], //男主53+54 - ["羽化病患少年", "「我什么······什么,都会做的······」", "aiy750000160.ogg"], + [ + "羽化病患少年", + "「我什么······什么,都会做的······」", + "aiy750000160.ogg", + ], ["羽化病患少年", "「我一直都是生活在下层的」", "aiy750000170.ogg"], [ "羽化病患少年", "「可是,不知何时染上了羽化病······背后长出了翅膀······」", "aiy750000180.ogg", ], - ["羽化病患少年", "「被寄宿工作的店赶了出来,只得流落到牢狱这里」", "aiy750000190.ogg"], - ["羽化病患少年", "「因为独自实在是饿的不行了,所以才会偷这些钱的」", "aiy750000200.ogg"], + [ + "羽化病患少年", + "「被寄宿工作的店赶了出来,只得流落到牢狱这里」", + "aiy750000190.ogg", + ], + [ + "羽化病患少年", + "「因为独自实在是饿的不行了,所以才会偷这些钱的」", + "aiy750000200.ogg", + ], [ "羽化病患少年", "「我明明没有做任何坏事······为什么······会遇到这种事······」", "aiy750000210.ogg", ], ["凯伊姆", "「谁知道」"], //男主55 - ["羽化病患少年", "「呜······呜呜······接下来,要对我做什么?」", "aiy750000220.ogg"], + [ + "羽化病患少年", + "「呜······呜呜······接下来,要对我做什么?」", + "aiy750000220.ogg", + ], ["凯伊姆", "「我要把你带到组织那里」"], //男主56 ["羽化病患少年", "「怎,怎么这样」", "aiy750000230.ogg"], ["凯伊姆", "「不过,那样做的前提是你不是羽化病人」"], @@ -19408,8 +19480,16 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = "「如何对我们保持合作,你就可以在治愈院得到优先的治疗」", ], ["羽化病患少年", "「······」", "aiy750000320.ogg"], - ["羽化病患少年", "「那个人,是《不蚀金锁》的组织成员······」", "aiy750000330.ogg"], - ["羽化病患少年", "「突然说让我拿出钱来,我刚一拒绝他就打我」", "aiy750000340.ogg"], + [ + "羽化病患少年", + "「那个人,是《不蚀金锁》的组织成员······」", + "aiy750000330.ogg", + ], + [ + "羽化病患少年", + "「突然说让我拿出钱来,我刚一拒绝他就打我」", + "aiy750000340.ogg", + ], ["羽狩的副队长", "「原来如此······」"], [ "羽狩的副队长", @@ -19574,5 +19654,5 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = ["梅尔特", "「我忘记了」"], ["吉克", "「骗人」"], ]; - } -} \ No newline at end of file + }, +};