更新自制事件

This commit is contained in:
草莓 2024-12-11 18:08:07 +08:00
parent 98c1de1b7d
commit 12280625e0
3 changed files with 22 additions and 17 deletions

View File

@ -1061,18 +1061,18 @@ return code+',\n';
*/; */;
cgtext_s cgtext_s
: '背景' EvalString? '头像' EvalString?'名字' EvalString?'坐标PX' Number'打字间隔' Int? BGNL? Newline : '背景' EvalString? '移除对话框' Bool? '头像' EvalString?'名字' EvalString?'坐标PX' Number'打字间隔' Int? BGNL? Newline
EvalString BGNL? Newline textcgDrawingList* Newline EvalString? BGNL? Newline textcgDrawingList*? Newline
/* cgtext_s /* cgtext_s
tooltip : cgtext显示一段包含cg的文字剧情 tooltip : cgtext显示一段包含cg的文字剧情
helpUrl : /_docs/#/instruction helpUrl : /_docs/#/instruction
allImages : ['EvalString_0','EvalString_1'] 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 head ='{ "name": "'+EvalString_1+'", "px": '+Number_0+' }'
var list=',"bodyList": [\n'+textcgDrawingList_0+'\n]' 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; return code;
*/; */;
textcgDrawingList textcgDrawingList
@ -1080,7 +1080,7 @@ textcgDrawingList
| textcgDrawingEmpty; | textcgDrawingEmpty;
textcgDrawing textcgDrawing
: '立绘' EvalString '绘制坐标' 'x' Number '变暗'Bool? Newline : '立绘' EvalString? '绘制坐标' 'x' Number '变暗'Bool? Newline
/* textcgDrawing /* textcgDrawing
tooltip : 立绘 tooltip : 立绘
@ -1872,16 +1872,16 @@ return code;
*/; */;
drawWarning_s drawWarning_s
: '警告坐标x' PosString 'y' PosString '警告内容' EvalString? '副标题' EvalString? '不播放音效' Bool? Newline : '警告坐标x' PosString 'y' PosString '文字大小'Int '警告内容' EvalString? '副标题' EvalString? '不播放音效' Bool? Newline
/* drawWarning_s /* drawWarning_s
tooltip : drawWarning: 绘制warning警告并拉进镜头,本事件为异步事件,下一事件将在3100ms后执行 tooltip : drawWarning: 绘制warning警告并拉进镜头,本事件为异步事件,下一事件将在3100ms后执行
helpUrl : /_docs/#/instruction helpUrl : /_docs/#/instruction
default : [0, 0,"这里是提示内容","绿色史莱姆",false] default : [0, 0,24,"这里是提示内容","绿色史莱姆",false]
colour : this.soundColor colour : this.soundColor
selectPoint : ["PosString_0", "PosString_1"] 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; return code;
*/; */;

View File

@ -315,7 +315,7 @@ ActionParser.prototype.parseAction = function() {
return res; return res;
} }
this.next = MotaActionBlocks['cgtext_s'].xmlText([ 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; break;
case "moveTextBox": // 移动对话框 case "moveTextBox": // 移动对话框
@ -1005,7 +1005,7 @@ ActionParser.prototype.parseAction = function() {
case "drawWarning": case "drawWarning":
this.next = MotaActionBlocks['drawWarning_s'].xmlText([ 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; break;
case "changeMouse": case "changeMouse":

View File

@ -23,7 +23,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (!main.replayChecking && !core.isReplaying()) { if (!main.replayChecking && !core.isReplaying()) {
data.text = core.replaceText(data.text) data.text = core.replaceText(data.text)
data.text2 = core.replaceText(data.text2) 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) setTimeout(() => core.doAction(), 3100)
} else { } else {
core.doAction(); core.doAction();
@ -47,6 +47,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.ui.cgText.name = data.name; core.ui.cgText.name = data.name;
core.ui.cgText.text = data.text; core.ui.cgText.text = data.text;
core.ui.cgText.time = data.time; core.ui.cgText.time = data.time;
core.ui.cgText.WindowSkin = data.WindowSkin
core.ui.cgText.bodyList = core.clone(data.bodyList); core.ui.cgText.bodyList = core.clone(data.bodyList);
main.dom.cgText.style.display = 'block'; main.dom.cgText.style.display = 'block';
core.ui.cgText.update() core.ui.cgText.update()
@ -7160,6 +7161,7 @@ core.plugin.animate = {
MotaActionFunctions.actionParser.parseList([{ MotaActionFunctions.actionParser.parseList([{
"type": "cgtext", "type": "cgtext",
"bg": "bg_5043.png", "bg": "bg_5043.png",
"WindowSkin": false,
"head": { "name": "face_050445.png", "px": -300 }, "head": { "name": "face_050445.png", "px": -300 },
"name": "菲奥奈", "name": "菲奥奈",
"time": 0, "time": 0,
@ -9274,7 +9276,7 @@ core.plugin.animate = {
* @param {number} y 纵坐标 * @param {number} y 纵坐标
* @param {string} text 显示的文字 * @param {string} text 显示的文字
*/ */
this.drawWarning = function (x, y, text, text2, warning) { this.drawWarning = function (x, y, size, text, text2, warning) {
if (timeout) return; if (timeout) return;
x = x ?? 6; x = x ?? 6;
@ -9288,7 +9290,7 @@ core.plugin.animate = {
var t = document.createElement('p'); var t = document.createElement('p');
t.innerHTML = text; t.innerHTML = text;
t.style.position = 'absolute'; 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.left = -(300 * core.domStyle.scale) + 'px';
t.style.top = (parseInt(elements[0].style.height) / 2 - 100) + 'px'; t.style.top = (parseInt(elements[0].style.height) / 2 - 100) + 'px';
t.style.zIndex = '300'; t.style.zIndex = '300';
@ -9581,6 +9583,7 @@ core.plugin.animate = {
this.name = "" this.name = ""
this.text = '' this.text = ''
this.time = 0; this.time = 0;
this.WindowSkin = false;
} }
click(px, py) { click(px, py) {
@ -9599,7 +9602,7 @@ core.plugin.animate = {
const pos = [px, py]; const pos = [px, py];
const savebox = makeBox([1700, 1100], [192, 96]); const savebox = makeBox([1700, 1100], [192, 96]);
const saveboxVertical = makeBox([52, 1700], [96, 192]) 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.animateUI) return;
if (core.status.event.interval != null) return; if (core.status.event.interval != null) return;
const current = core.clone(core.status.event.data.current) const current = core.clone(core.status.event.data.current)
@ -9766,13 +9769,15 @@ core.plugin.animate = {
} }
ctx.filter = 'none' 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] const head = core.material.images.images?.[this.head.name]
if (head) { if (head) {
ctx.drawImage(head, 0, 0, head.width, head.height, this.head.px, 1248 - head.height * 2, head.width * 2, head.height * 2) 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) if (core.isPlaying() && !this.WindowSkin) {
core.drawWindowSkin("winskin.png", ctx, 1700, 1100, 192, 96)
core.fillText(ctx, '存 档', 1736, 1166, '#FFFFFF', "bold 48px Verdana") 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.name) core.fillText(ctx, `${this.name}`, 500, 880, '#FFFFFF', "bold 48px Verdana")
if (this.text) { if (this.text) {
this.drawTextContent(ctx, this.text, { this.drawTextContent(ctx, this.text, {