可以控制时间的滚动剧情

This commit is contained in:
草莓 2024-12-29 13:11:43 +08:00
parent e35c59ebf5
commit 99b6550fe1
4 changed files with 1108 additions and 1118 deletions

View File

@ -1078,15 +1078,15 @@ return code;
*/; */;
overlist_s overlist_s
: '背景' EvalString? '每句持续帧数' Int? '每句渐入渐出帧数' Int? BGNL? Newline : '背景' EvalString? '每句渐入渐出帧数' Int? BGNL? Newline
overtextList+? Newline overtextList+? Newline
/*overlist_s /*overlist_s
tooltip : overlist多行滚动旁白 tooltip : overlist多行滚动旁白
helpUrl : /_docs/#/instruction helpUrl : /_docs/#/instruction
allImages : ['EvalString_0'] allImages : ['EvalString_0']
default : ["bg_5043.png",50,30,[{ "text":"" ,"sound":"","textColor":"255,255,255,1","boldColor":"0,0,0,1","font":"bold 48px Verdana","frame":0}]] default : ["bg_5043.png",30,[{ "text":"" ,"sound":"","time":50,"textColor":"255,255,255,1","boldColor":"0,0,0,1","font":"bold 48px Verdana","frame":0}]]
var list=',"list": [\n'+overtextList_0.slice(0,-1)+'\n]' var list=',"list": [\n'+overtextList_0.slice(0,-1)+'\n]'
var code = '{"type": "overlist", "image": "'+EvalString_0+'","time":'+Int_0+',"hidetime":'+Int_1+''+list+' },\n'; var code = '{"type": "overlist", "image": "'+EvalString_0+'","hidetime":'+Int_0+''+list+' },\n';
return code; return code;
*/; */;
@ -1096,16 +1096,16 @@ overtextList
overtext overtext
: '文字' EvalString? BGNL? Newline : '文字' EvalString? BGNL? Newline
'音频文件(需注册)' EvalString? '文字颜色' ColorString? Colour '描边颜色' ColorString? Colour '字体信息' EvalString? Newline '音频文件(需注册)' EvalString? '显示帧数' Int? '文字颜色' ColorString? Colour '描边颜色' ColorString? Colour '字体信息' EvalString? Newline
/* overtext /* overtext
tooltip : 多行滚动字幕 tooltip : 多行滚动字幕
helpUrl : /_docs/#/instruction helpUrl : /_docs/#/instruction
default : ["","","255,255,255,1",'rgba(255,255,255,1)',"0,0,0,1",'rgba(0,0,0,1)','bold 48px Verdana'] default : ["","",50,"255,255,255,1",'rgba(255,255,255,1)',"0,0,0,1",'rgba(0,0,0,1)','bold 48px Verdana']
colour : this.subColor colour : this.subColor
allSounds : ['EvalString_1'] allSounds : ['EvalString_1']
return '{ "text":"'+EvalString_0+'","sound": "'+EvalString_1+'","textColor": ['+ColorString_0+'],"boldColor": ['+ColorString_1+'],"font": "'+EvalString_2+'","frame":0},' return '{ "text":"'+EvalString_0+'","sound": "'+EvalString_1+'","time":'+Int_0+',"textColor": ['+ColorString_0+'],"boldColor": ['+ColorString_1+'],"font": "'+EvalString_2+'","frame":0},'
*/; */;
overtextEmpty overtextEmpty

View File

@ -683,10 +683,11 @@ MotaActionParser = function () {
one[0], one[0],
one[1], one[1],
one[2], one[2],
"rgba(" + one[2] + ")",
one[3], one[3],
"rgba(" + one[3] + ")", "rgba(" + one[3] + ")",
one[4], one[4],
"rgba(" + one[4] + ")",
one[5],
res, res,
]); ]);
} }
@ -694,7 +695,6 @@ MotaActionParser = function () {
}; };
this.next = MotaActionBlocks["overlist_s"].xmlText([ this.next = MotaActionBlocks["overlist_s"].xmlText([
data.image, data.image,
data.time,
data.hidetime, data.hidetime,
buildovertext(data.list), buildovertext(data.list),
this.next, this.next,
@ -2766,7 +2766,14 @@ MotaActionParser = function () {
MotaActionFunctions.processovertext = function (overList) { MotaActionFunctions.processovertext = function (overList) {
var list = []; var list = [];
overList.forEach(function (one) { overList.forEach(function (one) {
list.push([one.text, one.sound, one.textColor, one.boldColor, one.font]); list.push([
one.text,
one.sound,
one.time,
one.textColor,
one.boldColor,
one.font,
]);
}); });
return list; return list;
}; };

View File

@ -42,12 +42,12 @@ main.floors.street01=
{ {
"type": "overlist", "type": "overlist",
"image": "bg_5043.png", "image": "bg_5043.png",
"time": 100, "hidetime": 30,
"hidetime": 60,
"list": [ "list": [
{ {
"text": "", "text": "试试",
"sound": "", "sound": "",
"time": 30,
"textColor": [ "textColor": [
255, 255,
255, 255,
@ -64,8 +64,9 @@ main.floors.street01=
"frame": 0 "frame": 0
}, },
{ {
"text": "", "text": "这可以",
"sound": "", "sound": "",
"time": 50,
"textColor": [ "textColor": [
255, 255,
255, 255,
@ -82,8 +83,9 @@ main.floors.street01=
"frame": 0 "frame": 0
}, },
{ {
"text": "脏翅膀", "text": "变速的脏翅膀对话",
"sound": "", "sound": "",
"time": 80,
"textColor": [ "textColor": [
255, 255,
255, 255,
@ -100,26 +102,9 @@ main.floors.street01=
"frame": 0 "frame": 0
}, },
{ {
"text": "的", "text": "牛逼",
"sound": "",
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana",
"frame": 0
},
{
"text": "文案",
"sound": "", "sound": "",
"time": 20,
"textColor": [ "textColor": [
255, 255,
255, 255,

View File

@ -111,11 +111,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.registerEvent("overlist", function (data) { core.registerEvent("overlist", function (data) {
core.overlist( core.overlist(
data.image, data.image,
data.time || 50,
data.hidetime || 30, data.hidetime || 30,
data.list || [{ data.list || [{
text: "", text: "",
sound: "", sound: "",
time: 50,
textColor: "#FFFFFF", textColor: "#FFFFFF",
boldColor: "#000000", boldColor: "#000000",
font: "bold 48px Verdana", font: "bold 48px Verdana",
@ -9191,10 +9191,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionFunctions.actionParser.parseList([{ MotaActionFunctions.actionParser.parseList([{
type: "overlist", type: "overlist",
image: "bg_5043.png", image: "bg_5043.png",
time: 50,
hidetime: 30, hidetime: 30,
list: [ list: [
{ text: "", sound: "", textColor: "255,255,255,1", boldColor: "0,0,0,1", font: "bold 48px Verdana", frame: 0 } { text: "", sound: "", time: 50, textColor: "255,255,255,1", boldColor: "0,0,0,1", font: "bold 48px Verdana", frame: 0 }
], ],
}, ]), }, ]),
MotaActionFunctions.actionParser.parseList([{ MotaActionFunctions.actionParser.parseList([{
@ -11195,7 +11194,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.fillRoundRect( core.fillRoundRect(
"ui", "ui",
15 - 2 + size - 4 + 35 + 8, 15 - 2 + size - 4 + 35 + 8,
60 - 2, 59 - 2,
37 + 4, 37 + 4,
(size - 58) / 2 + 4, (size - 58) / 2 + 4,
4, 4,
@ -11204,7 +11203,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.strokeRoundRect( core.strokeRoundRect(
"ui", "ui",
15 - 4 + size - 4 + 35 + 8, 15 - 4 + size - 4 + 35 + 8,
60 - 4, 59 - 4,
37 + 8, 37 + 8,
(size - 58) / 2 + 8, (size - 58) / 2 + 8,
4, 4,
@ -11226,7 +11225,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.fillRoundRect( core.fillRoundRect(
"ui", "ui",
15 - 2 + size - 4 + 35 + 8, 15 - 2 + size - 4 + 35 + 8,
60 - 2 + (size - 58) / 2 + 8, 59 - 2 + (size - 58) / 2 + 8,
37 + 4, 37 + 4,
119 + 4, 119 + 4,
4, 4,
@ -11235,7 +11234,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.strokeRoundRect( core.strokeRoundRect(
"ui", "ui",
15 - 4 + size - 4 + 35 + 8, 15 - 4 + size - 4 + 35 + 8,
60 - 4 + (size - 58) / 2 + 8, 59 - 4 + (size - 58) / 2 + 8,
37 + 8, 37 + 8,
119 + 8, 119 + 8,
4, 4,
@ -13518,11 +13517,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this.overlist = function ( this.overlist = function (
image, image,
time = 50,
hidetime = 30, hidetime = 30,
list = [{ list = [{
text: "", text: "",
sound: "", sound: "",
time: 50,
textColor: "#FFFFFF", textColor: "#FFFFFF",
boldColor: "#000000", boldColor: "#000000",
font: "bold 48px Verdana", font: "bold 48px Verdana",
@ -13565,7 +13564,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
dy = 624; dy = 624;
if (i === 0 && !list[1]) { if (i === 0 && !list[1]) {
core.over(image, core.over(image,
time, a.time,
hidetime, hidetime,
a.sound, a.sound,
a.textColor, a.textColor,
@ -13573,11 +13572,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
a.font, a.font,
a.text) a.text)
} else { } else {
const numa = parseInt(a?.font?.replace(/[^\d]/g, " ").trim()) || 48;
const numa = parseInt(a?.font?.replace(/[^\d]/g, " ").replace(" ", "")) || 48; const numb = parseInt(b?.font?.replace(/[^\d]/g, " ").trim()) || 48;
const numb = parseInt(b?.font?.replace(/[^\d]/g, " ").replace(" ", "")) || 48; const numc = parseInt(c?.font?.replace(/[^\d]/g, " ").trim()) || 48;
const numc = parseInt(c?.font?.replace(/[^\d]/g, " ").replace(" ", "")) || 48; const numd = parseInt(d?.font?.replace(/[^\d]/g, " ").trim()) || 48;
const numd = parseInt(d?.font?.replace(/[^\d]/g, " ").replace(" ", "")) || 48;
// 绘制 // 绘制
if (a) { if (a) {
@ -13641,7 +13639,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
const lisenb = b.sound && core.material.sounds[b.sound] && core.musicStatus.soundStatus; const lisenb = b.sound && core.material.sounds[b.sound] && core.musicStatus.soundStatus;
if (b.frame && lisenb) { sod = core.playSound(sound); } if (b.frame && lisenb) { sod = core.playSound(sound); }
if (b.frame > hidetime && b.frame < hidetime + time) { if (b.frame > hidetime && b.frame < hidetime + b.time) {
b.frame++ b.frame++
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
@ -13659,7 +13657,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
if (b.frame == hidetime + time) { if (b.frame == hidetime + b.time) {
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
@ -13679,10 +13677,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
} }
if (c) { if (c) {
if (c.frame > hidetime + time && c.frame < hidetime * 3 / 2 + time) { if (c.frame > hidetime + c.time && c.frame < hidetime * 3 / 2 + c.time) {
c.frame++; c.frame++;
core.setAlpha(ctx, 1 - (c.frame - hidetime - time) / hidetime) core.setAlpha(ctx, 1 - (c.frame - hidetime - c.time) / hidetime)
cy -= (numc * (c.frame - hidetime - time)) / hidetime * 3; cy -= (numc * (c.frame - hidetime - c.time)) / hidetime * 3;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
ctx, ctx,
@ -13695,9 +13693,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
c.font c.font
); );
} }
if (c.frame === hidetime * 3 / 2 + time) { if (c.frame === hidetime * 3 / 2 + c.time) {
core.setAlpha(ctx, 1 - (c.frame - hidetime - time) / hidetime) core.setAlpha(ctx, 1 - (c.frame - hidetime - c.time) / hidetime)
cy = 624 - (numc * (c.frame - hidetime - time)) / hidetime * 3; cy = 624 - (numc * (c.frame - hidetime - c.time)) / hidetime * 3;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
ctx, ctx,
@ -13717,10 +13715,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
} }
if (d) { if (d) {
if (d.frame > hidetime * 3 / 2 + time && d.frame < hidetime * 2 + time) { if (d.frame > hidetime * 3 / 2 + d.time && d.frame < hidetime * 2 + d.time) {
d.frame++; d.frame++;
core.setAlpha(ctx, 1 - (d.frame - hidetime - time) / hidetime) core.setAlpha(ctx, 1 - (d.frame - hidetime - d.time) / hidetime)
dy -= (numd * (d.frame - hidetime - time)) / hidetime * 3; dy -= (numd * (d.frame - hidetime - d.time)) / hidetime * 3;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
ctx, ctx,
@ -13733,7 +13731,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
d.font d.font
); );
} }
if (d.frame == hidetime * 2 + time && !c) { if (d.frame == hidetime * 2 + d.time && !c) {
core.unregisterAnimationFrame("overlist"); core.unregisterAnimationFrame("overlist");
ctx.restore(); ctx.restore();
over.style.display = "none"; over.style.display = "none";