diff --git a/_server/MotaAction.g4 b/_server/MotaAction.g4 index 8349916..be6a618 100644 --- a/_server/MotaAction.g4 +++ b/_server/MotaAction.g4 @@ -1061,18 +1061,18 @@ return code+',\n'; */; cgtext_s - : '背景' EvalString? '头像' EvalString?'名字' EvalString?'坐标PX' Number'打字间隔' Int? BGNL? Newline - EvalString BGNL? Newline textcgDrawingList* Newline + : '背景' EvalString? '移除对话框' Bool? '头像' EvalString?'名字' EvalString?'坐标PX' Number'打字间隔' Int? BGNL? Newline + EvalString? BGNL? Newline textcgDrawingList*? Newline /* cgtext_s tooltip : cgtext:显示一段包含cg的文字(剧情) helpUrl : /_docs/#/instruction allImages : ['EvalString_0','EvalString_1'] -default : ["bg_5043.png","face_050445.png","菲奥奈",-300,0,"这句话显示在对话框内",[{ "name":"tati_050145a.png" , "px": 100,"filter":false }]] +default : ["bg_5043.png","face_050445.png",false,"菲奥奈",-300,0,"这句话显示在对话框内",[{ "name":"tati_050145a.png" , "px": 100,"filter":false }]] var head ='{ "name": "'+EvalString_1+'", "px": '+Number_0+' }' var list=',"bodyList": [\n'+textcgDrawingList_0+'\n]' -var code = '{"type": "cgtext", "bg":"'+EvalString_0+'","head":'+head+' ,"name":"'+EvalString_2+'","time":'+Int_0+',"text": "'+EvalString_3+'"'+list+' },\n'; +var code = '{"type": "cgtext", "bg":"'+EvalString_0+'","WindowSkin":'+Bool_0+',"head":'+head+' ,"name":"'+EvalString_2+'","time":'+Int_0+',"text": "'+EvalString_3+'"'+list+' },\n'; return code; */; textcgDrawingList @@ -1080,7 +1080,7 @@ textcgDrawingList | textcgDrawingEmpty; textcgDrawing - : '立绘' EvalString '绘制坐标' 'x' Number '变暗'Bool? Newline + : '立绘' EvalString? '绘制坐标' 'x' Number '变暗'Bool? Newline /* textcgDrawing tooltip : 立绘 @@ -1872,16 +1872,16 @@ return code; */; drawWarning_s - : '警告坐标x' PosString 'y' PosString '警告内容' EvalString? '副标题' EvalString? '不播放音效' Bool? Newline + : '警告坐标x' PosString 'y' PosString '文字大小'Int '警告内容' EvalString? '副标题' EvalString? '不播放音效' Bool? Newline /* drawWarning_s tooltip : drawWarning: 绘制warning警告并拉进镜头,本事件为异步事件,下一事件将在3100ms后执行 helpUrl : /_docs/#/instruction -default : [0, 0,"这里是提示内容","绿色史莱姆",false] +default : [0, 0,24,"这里是提示内容","绿色史莱姆",false] colour : this.soundColor selectPoint : ["PosString_0", "PosString_1"] -var code = '{"type": "drawWarning", "x": '+PosString_0+', "y": '+PosString_1+', "text": "'+EvalString_0+'", "text2": "'+EvalString_1+'", "warning": '+Bool_0+'},\n'; +var code = '{"type": "drawWarning", "x": '+PosString_0+', "y": '+PosString_1+',"size":'+Int_0+',"text": "'+EvalString_0+'", "text2": "'+EvalString_1+'", "warning": '+Bool_0+'},\n'; return code; */; diff --git a/_server/MotaActionParser.js b/_server/MotaActionParser.js index 146867a..0df5eed 100644 --- a/_server/MotaActionParser.js +++ b/_server/MotaActionParser.js @@ -315,7 +315,7 @@ ActionParser.prototype.parseAction = function() { return res; } this.next = MotaActionBlocks['cgtext_s'].xmlText([ - data.bg, data.head.name, data.name||"", data.head.px||-300,data.time, data.text,buildcgDrawing(data.bodyList), this.next]); + data.bg,data.WindowSkin,data.head.name, data.name||"", data.head.px||-300,data.time, data.text,buildcgDrawing(data.bodyList), this.next]); break; case "moveTextBox": // 移动对话框 @@ -1005,7 +1005,7 @@ ActionParser.prototype.parseAction = function() { case "drawWarning": this.next = MotaActionBlocks['drawWarning_s'].xmlText([ - data.x,data.y,data?.text,data?.text2,data?.warning,this.next]); + data.x,data.y,data.size,data?.text,data?.text2,data?.warning,this.next]); break; case "changeMouse": diff --git a/project/plugins.js b/project/plugins.js index 1cc4b97..d0db82a 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -23,7 +23,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = 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) + core.drawWarning(data.x, data.y, data.size, data?.text, data?.text2, data?.warning) setTimeout(() => core.doAction(), 3100) } else { core.doAction(); @@ -47,6 +47,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = core.ui.cgText.name = data.name; core.ui.cgText.text = data.text; core.ui.cgText.time = data.time; + core.ui.cgText.WindowSkin = data.WindowSkin core.ui.cgText.bodyList = core.clone(data.bodyList); main.dom.cgText.style.display = 'block'; core.ui.cgText.update() @@ -7160,6 +7161,7 @@ core.plugin.animate = { MotaActionFunctions.actionParser.parseList([{ "type": "cgtext", "bg": "bg_5043.png", + "WindowSkin": false, "head": { "name": "face_050445.png", "px": -300 }, "name": "菲奥奈", "time": 0, @@ -9274,7 +9276,7 @@ core.plugin.animate = { * @param {number} y 纵坐标 * @param {string} text 显示的文字 */ - this.drawWarning = function (x, y, text, text2, warning) { + this.drawWarning = function (x, y, size, text, text2, warning) { if (timeout) return; x = x ?? 6; @@ -9288,7 +9290,7 @@ core.plugin.animate = { var t = document.createElement('p'); t.innerHTML = text; t.style.position = 'absolute'; - t.style.fontSize = '4em'; + t.style.fontSize = size * core.domStyle.scale + 'px'; t.style.left = -(300 * core.domStyle.scale) + 'px'; t.style.top = (parseInt(elements[0].style.height) / 2 - 100) + 'px'; t.style.zIndex = '300'; @@ -9581,6 +9583,7 @@ core.plugin.animate = { this.name = "" this.text = '' this.time = 0; + this.WindowSkin = false; } click(px, py) { @@ -9599,7 +9602,7 @@ core.plugin.animate = { const pos = [px, py]; const savebox = makeBox([1700, 1100], [192, 96]); const saveboxVertical = makeBox([52, 1700], [96, 192]) - if ((core.domStyle.isVertical && inRect(pos, saveboxVertical)) || (!core.domStyle.isVertical && inRect(pos, savebox))) { + if ((core.domStyle.isVertical && inRect(pos, saveboxVertical) && !this.WindowSkin) || (!core.domStyle.isVertical && !this.WindowSkin && inRect(pos, savebox))) { if (core.status.event.animateUI) return; if (core.status.event.interval != null) return; const current = core.clone(core.status.event.data.current) @@ -9766,13 +9769,15 @@ core.plugin.animate = { } ctx.filter = 'none' }) - if (core.isPlaying()) core.drawWindowSkin("winskin.png", ctx, 30, 802, 1968, 416) + if (core.isPlaying() && !this.WindowSkin) core.drawWindowSkin("winskin.png", ctx, 30, 802, 1968, 416) 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, head.width * 2, head.height * 2) } - if (core.isPlaying()) core.drawWindowSkin("winskin.png", ctx, 1700, 1100, 192, 96) - core.fillText(ctx, '存 档', 1736, 1166, '#FFFFFF', "bold 48px Verdana") + if (core.isPlaying() && !this.WindowSkin) { + core.drawWindowSkin("winskin.png", ctx, 1700, 1100, 192, 96) + core.fillText(ctx, '存 档', 1736, 1166, '#FFFFFF', "bold 48px Verdana") + } if (this.name) core.fillText(ctx, `【${this.name}】`, 500, 880, '#FFFFFF', "bold 48px Verdana") if (this.text) { this.drawTextContent(ctx, this.text, {