滚动剧情&多人立绘

This commit is contained in:
草莓 2024-12-28 23:53:21 +08:00
parent 576a5e0a3b
commit e35c59ebf5
5 changed files with 2896 additions and 2514 deletions

View File

@ -954,6 +954,7 @@ action
| drawWarning_s | drawWarning_s
| addPop_s | addPop_s
| over_s | over_s
| overlist_s
| playStereo_s | playStereo_s
| moveStereo_s | moveStereo_s
| pass_s | pass_s
@ -1076,10 +1077,49 @@ var code = '{"type": "over", "text": "'+EvalString_0+'","image":"'+EvalString_1+
return code; return code;
*/; */;
overlist_s
: '背景' EvalString? '每句持续帧数' Int? '每句渐入渐出帧数' Int? BGNL? Newline
overtextList+? Newline
/*overlist_s
tooltip : overlist多行滚动旁白
helpUrl : /_docs/#/instruction
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}]]
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';
return code;
*/;
overtextList
: overtext
| overtextEmpty;
overtext
: '文字' EvalString? BGNL? Newline
'音频文件(需注册)' EvalString? '文字颜色' ColorString? Colour '描边颜色' ColorString? Colour '字体信息' EvalString? Newline
/* overtext
tooltip : 多行滚动字幕
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']
colour : this.subColor
allSounds : ['EvalString_1']
return '{ "text":"'+EvalString_0+'","sound": "'+EvalString_1+'","textColor": ['+ColorString_0+'],"boldColor": ['+ColorString_1+'],"font": "'+EvalString_2+'","frame":0},'
*/;
overtextEmpty
: Newline
/* overtextEmpty
var code = [];
return code;
*/;
cgtext_s cgtext_s
: '背景' EvalString? '移除对话框' Bool? '头像' EvalString?'名字' EvalString?'坐标PX' Number'打字间隔' Int? BGNL? Newline : '背景' EvalString? '移除对话框' Bool? '头像' EvalString?'名字' EvalString?'坐标PX' Number'打字间隔' Int? BGNL? Newline
'自动等待时长' Int '音频文件(需在全塔属性——使用音效注册)'EvalString? BGNL? Newline '自动等待时长' Int '音频文件(需在全塔属性——使用音效注册)'EvalString? BGNL? Newline
EvalString? BGNL? Newline textcgDrawingList*? Newline EvalString? BGNL? Newline textcgDrawingList+? Newline
/* cgtext_s /* cgtext_s
@ -1089,7 +1129,7 @@ allImages : ['EvalString_0','EvalString_1']
allSounds : ['EvalString_3'] allSounds : ['EvalString_3']
default : ["bg_5043.png","face_050445.png",false,"菲奥奈",-300,0,2000,"","这句话显示在对话框内",[{ "name":"tati_050145a.png" , "px": 100,"filter":false }]] default : ["bg_5043.png","face_050445.png",false,"菲奥奈",-300,0,2000,"","这句话显示在对话框内",[{ "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.slice(0,-1)+'\n]'
var code = '{"type": "cgtext", "bg":"'+EvalString_0+'","WindowSkin":'+Bool_0+',"head":'+head+' ,"name":"'+EvalString_2+'","time":'+Int_0+',"wait":'+Int_1+',"sound":"'+EvalString_3+'","text": "'+EvalString_4+'"'+list+' },\n'; var code = '{"type": "cgtext", "bg":"'+EvalString_0+'","WindowSkin":'+Bool_0+',"head":'+head+' ,"name":"'+EvalString_2+'","time":'+Int_0+',"wait":'+Int_1+',"sound":"'+EvalString_3+'","text": "'+EvalString_4+'"'+list+' },\n';
return code; return code;
*/; */;
@ -1107,7 +1147,7 @@ default : ["tati_050145a.png",100,false]
colour : this.subColor colour : this.subColor
allImages : ['EvalString_0'] allImages : ['EvalString_0']
return '{ "name": "'+EvalString_0+'", "px": '+Number_0+',"filter":'+Bool_0+' }' return '{ "name": "'+EvalString_0+'", "px": '+Number_0+',"filter":'+Bool_0+' },'
*/; */;
textcgDrawingEmpty textcgDrawingEmpty

View File

@ -674,6 +674,32 @@ MotaActionParser = function () {
this.next, this.next,
]); ]);
break; break;
case "overlist":
var buildovertext = function (obj) {
obj = MotaActionFunctions.processovertext(obj || []);
var res = null;
for (var ii = obj.length - 1, one; (one = obj[ii]); ii--) {
res = MotaActionBlocks["overtext"].xmlText([
one[0],
one[1],
one[2],
"rgba(" + one[2] + ")",
one[3],
"rgba(" + one[3] + ")",
one[4],
res,
]);
}
return res;
};
this.next = MotaActionBlocks["overlist_s"].xmlText([
data.image,
data.time,
data.hidetime,
buildovertext(data.list),
this.next,
]);
break;
case "tip": case "tip":
this.next = MotaActionBlocks["tip_s"].xmlText([ this.next = MotaActionBlocks["tip_s"].xmlText([
data.text, data.text,
@ -2737,6 +2763,13 @@ MotaActionParser = function () {
}); });
return list; return list;
}; };
MotaActionFunctions.processovertext = function (overList) {
var list = [];
overList.forEach(function (one) {
list.push([one.text, one.sound, one.textColor, one.boldColor, one.font]);
});
return list;
};
MotaActionFunctions.processMultiLoc = function (EvalString_0, EvalString_1) { MotaActionFunctions.processMultiLoc = function (EvalString_0, EvalString_1) {
var floorstr = ""; var floorstr = "";

View File

@ -1 +1 @@
{"viewportLoc":[0,0],"editorLastFloorId":"street02"} {"viewportLoc":[0,0],"editorLastFloorId":"street01"}

View File

@ -31,6 +31,112 @@ main.floors.street01=
"type": "insert", "type": "insert",
"name": "chapter01" "name": "chapter01"
} }
],
"6,11": [
{
"type": "insert",
"name": "chapter01"
}
],
"4,11": [
{
"type": "overlist",
"image": "bg_5043.png",
"time": 100,
"hidetime": 60,
"list": [
{
"text": "这",
"sound": "",
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana",
"frame": 0
},
{
"text": "是",
"sound": "",
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana",
"frame": 0
},
{
"text": "脏翅膀",
"sound": "",
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana",
"frame": 0
},
{
"text": "的",
"sound": "",
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana",
"frame": 0
},
{
"text": "文案",
"sound": "",
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana",
"frame": 0
}
]
}
] ]
}, },
"changeFloor": { "changeFloor": {

View File

@ -108,6 +108,21 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.doAction(); core.doAction();
} }
}); });
core.registerEvent("overlist", function (data) {
core.overlist(
data.image,
data.time || 50,
data.hidetime || 30,
data.list || [{
text: "",
sound: "",
textColor: "#FFFFFF",
boldColor: "#000000",
font: "bold 48px Verdana",
frame: 0,
}]
)
})
core.registerEvent("cgtext", function (data) { core.registerEvent("cgtext", function (data) {
if (!main.replayChecking && !core.isReplaying()) { if (!main.replayChecking && !core.isReplaying()) {
@ -2512,9 +2527,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
(obj.clientWidth - obj.totalWidth) / 2 + "px"; (obj.clientWidth - obj.totalWidth) / 2 + "px";
core.dom.musicBtn.style.bottom = core.dom.musicBtn.style.bottom =
(obj.clientHeight - obj.totalHeight) / 2 - 27 + "px"; (obj.clientHeight - obj.totalHeight) / 2 - 27 + "px";
let startBackground = core.domStyle.isVertical ? let startBackground = core.domStyle.isVertical
main.styles.startVerticalBackground || main.styles.startBackground : ? main.styles.startVerticalBackground || main.styles.startBackground
main.styles.startBackground; : main.styles.startBackground;
if (main.dom.startBackground.getAttribute("__src__") != startBackground) { if (main.dom.startBackground.getAttribute("__src__") != startBackground) {
main.dom.startBackground.setAttribute("__src__", startBackground); main.dom.startBackground.setAttribute("__src__", startBackground);
main.dom.startBackground.src = startBackground; main.dom.startBackground.src = startBackground;
@ -2538,12 +2553,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
main.dom.outerBackground.style.height = obj.totalHeight + "px"; main.dom.outerBackground.style.height = obj.totalHeight + "px";
main.dom.outerUI.style.width = obj.totalWidth + "px"; main.dom.outerUI.style.width = obj.totalWidth + "px";
main.dom.outerUI.style.height = obj.totalHeight + "px"; main.dom.outerUI.style.height = obj.totalHeight + "px";
main.dom.CGUI.style.width = (obj.totalWidth + 3) + "px"; main.dom.CGUI.style.width = obj.totalWidth + 3 + "px";
main.dom.CGUI.style.height = (obj.totalHeight + 3) + "px"; main.dom.CGUI.style.height = obj.totalHeight + 3 + "px";
main.dom.cgText.style.width = (obj.totalWidth + 3) + "px"; main.dom.cgText.style.width = obj.totalWidth + 3 + "px";
main.dom.cgText.style.height = (obj.totalHeight + 3) + "px"; main.dom.cgText.style.height = obj.totalHeight + 3 + "px";
main.dom.over.style.width = (obj.totalWidth + 3) + "px"; main.dom.over.style.width = obj.totalWidth + 3 + "px";
main.dom.over.style.height = (obj.totalHeight + 3) + "px"; main.dom.over.style.height = obj.totalHeight + 3 + "px";
const innerSize = obj.canvasWidth * core.domStyle.scale + "px"; const innerSize = obj.canvasWidth * core.domStyle.scale + "px";
for (let i = 0; i < core.dom.gameCanvas.length; ++i) for (let i = 0; i < core.dom.gameCanvas.length; ++i)
@ -2560,9 +2575,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
obj.gameDrawBox.left * core.domStyle.scale + "px"; obj.gameDrawBox.left * core.domStyle.scale + "px";
// resize bigmap // resize bigmap
core.bigmap.canvas.forEach(function (cn) { core.bigmap.canvas.forEach(function (cn) {
const ratio = core.canvas[cn].canvas.hasAttribute("isHD") ? const ratio = core.canvas[cn].canvas.hasAttribute("isHD")
core.domStyle.ratio : ? core.domStyle.ratio
1; : 1;
core.canvas[cn].canvas.style.width = core.canvas[cn].canvas.style.width =
(innerSize / ratio) * core.domStyle.scale + "px"; (innerSize / ratio) * core.domStyle.scale + "px";
core.canvas[cn].canvas.style.height = core.canvas[cn].canvas.style.height =
@ -2649,12 +2664,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
const isVertical = clientHeight > clientWidth; const isVertical = clientHeight > clientWidth;
core.domStyle.isVertical = isVertical; core.domStyle.isVertical = isVertical;
const totalWidth = isVertical ? const totalWidth = isVertical
GAMEVIEW_WIDTH_VERTICAL / 3 : ? GAMEVIEW_WIDTH_VERTICAL / 3
GAMEVIEW_WIDTH / 3, : GAMEVIEW_WIDTH / 3,
totalHeight = isVertical ? totalHeight = isVertical
GAMEVIEW_HEIGHT_VERTICAL / 3 : ? GAMEVIEW_HEIGHT_VERTICAL / 3
GAMEVIEW_HEIGHT / 3; : GAMEVIEW_HEIGHT / 3;
const maxRatio = Math.min( const maxRatio = Math.min(
clientWidth / totalWidth, clientWidth / totalWidth,
@ -2682,10 +2697,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
const totalWidthScaled = totalWidth * core.domStyle.scale, const totalWidthScaled = totalWidth * core.domStyle.scale,
totalHeightScaled = totalHeight * core.domStyle.scale; totalHeightScaled = totalHeight * core.domStyle.scale;
const gameDrawBox = isVertical ? { const gameDrawBox = isVertical
? {
left: BORDER_WIDTH / 3, left: BORDER_WIDTH / 3,
top: BAR_HEIGHT_VERTICAL / 3 + BORDER_HEIGHT / 3, top: BAR_HEIGHT_VERTICAL / 3 + BORDER_HEIGHT / 3,
} : { left: BAR_WIDTH / 3 + BORDER_WIDTH / 3, top: BORDER_HEIGHT / 3 }; }
: { left: BAR_WIDTH / 3 + BORDER_WIDTH / 3, top: BORDER_HEIGHT / 3 };
const obj = { const obj = {
clientWidth: clientWidth, clientWidth: clientWidth,
@ -2694,7 +2711,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
totalWidth: totalWidthScaled, totalWidth: totalWidthScaled,
totalHeight: totalHeightScaled, totalHeight: totalHeightScaled,
gameDrawBox: gameDrawBox, gameDrawBox: gameDrawBox,
globalAttribute: core.status.globalAttribute || core.initStatus.globalAttribute, globalAttribute:
core.status.globalAttribute || core.initStatus.globalAttribute,
}; };
_resize_gameGroup(obj); _resize_gameGroup(obj);
@ -2852,7 +2870,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
// 四舍五入 // 四舍五入
core.status.hero[item] = Math.round(core.status.hero[item]); core.status.hero[item] = Math.round(core.status.hero[item]);
// 大数据格式化 // 大数据格式化
core.fillBoldText( core.fillBoldText1(
"outerUI", "outerUI",
core.getRealStatus(item), core.getRealStatus(item),
baseX, baseX,
@ -2873,7 +2891,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.clearMap("outerUI", 10 * 3, 0, 210 * 3, 120 * 3); core.clearMap("outerUI", 10 * 3, 0, 210 * 3, 120 * 3);
core.setFont("outerUI", "bold 42px Verdana"); core.setFont("outerUI", "bold 42px Verdana");
if (updatedFloorTitle) { if (updatedFloorTitle) {
core.fillBoldText( core.fillBoldText1(
"outerUI", "outerUI",
updatedFloorTitle, updatedFloorTitle,
60 * 3, 60 * 3,
@ -2890,7 +2908,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.clearMap("outerUI", 10 * 3, 40 * 3, 105 * 3, 250 * 3); core.clearMap("outerUI", 10 * 3, 40 * 3, 105 * 3, 250 * 3);
core.setFont("outerUI", "bold 48px Verdana"); core.setFont("outerUI", "bold 48px Verdana");
if (updatedFloorTitle) { if (updatedFloorTitle) {
core.fillBoldText( core.fillBoldText1(
"outerUI", "outerUI",
updatedFloorTitle, updatedFloorTitle,
62 * 3, 62 * 3,
@ -2981,12 +2999,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
_update_map(floorId = core.status.floorId) { _update_map(floorId = core.status.floorId) {
const x = core.domStyle.isVertical ? const x = core.domStyle.isVertical
MAP_BLOCK_LEFT_VERTICAL : ? MAP_BLOCK_LEFT_VERTICAL
MAP_BLOCK_LEFT; : MAP_BLOCK_LEFT;
const y = core.domStyle.isVertical ? const y = core.domStyle.isVertical
MAP_BLOCK_TOP_VERTICAL : ? MAP_BLOCK_TOP_VERTICAL
MAP_BLOCK_TOP; : MAP_BLOCK_TOP;
const w = core.domStyle.isVertical ? 300 : 300; const w = core.domStyle.isVertical ? 300 : 300;
const h = core.domStyle.isVertical ? 300 : 300; const h = core.domStyle.isVertical ? 300 : 300;
let sx, sy; let sx, sy;
@ -3340,10 +3358,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this._update_infoWindow(); this._update_infoWindow();
} }
_update_toolBox() { _update_toolBox() {
const tools = core.isReplaying() ? [ const tools = core.isReplaying()
? [
[core.status.replay.pausing ? "play" : "pause", "stop", "rewind"], [core.status.replay.pausing ? "play" : "pause", "stop", "rewind"],
["speedDown", "speedUp", "save"], ["speedDown", "speedUp", "save"],
] : [ ]
: [
["keyboard", "shop", "pack", "T332"], ["keyboard", "shop", "pack", "T332"],
["settings", "save", "load", "T331"], ["settings", "save", "load", "T331"],
]; ];
@ -3428,10 +3448,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
} }
}; };
const inRect = ([x, y], [ const inRect = ([x, y], [[sx, sy], [dx, dy]]) => {
[sx, sy],
[dx, dy]
]) => {
return sx <= x && x <= dx && sy <= y && y <= dy; return sx <= x && x <= dx && sy <= y && y <= dy;
}; };
const relativeTo = ([x, y], [ax, ay]) => { const relativeTo = ([x, y], [ax, ay]) => {
@ -3903,7 +3920,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}; };
////// 在某个canvas上绘制粗体 ////// ////// 在某个canvas上绘制粗体 //////
ui.prototype.fillBoldText = function ( core.fillBoldText1 = function (
name, name,
text, text,
x, x,
@ -4897,9 +4914,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var itembar_right = rightArrow_right; var itembar_right = rightArrow_right;
var boxName = var boxName =
core.status.event.id == "toolbox" ? core.status.event.id == "toolbox"
"\r[yellow]道具栏\r | 装备栏" : ? "\r[yellow]道具栏\r | 装备栏"
"道具栏 | \r[yellow]装备栏\r"; : "道具栏 | \r[yellow]装备栏\r";
core.drawArrow( core.drawArrow(
ctx, ctx,
arrow_x + arrow_width, arrow_x + arrow_width,
@ -5246,7 +5263,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
color: "white", color: "white",
align: "left", align: "left",
fontSize: itemTextFontSize, fontSize: itemTextFontSize,
maxWidth: rightbar_width - (itemText_x - rightbar_x) * 2 + itemTextFontSize / 2, maxWidth:
rightbar_width - (itemText_x - rightbar_x) * 2 + itemTextFontSize / 2,
}); });
///// *** 退出按钮设置 ///// *** 退出按钮设置
@ -5354,9 +5372,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (i === 1) name = "副手"; if (i === 1) name = "副手";
var selectBorder = false; var selectBorder = false;
if (core.status.thisUIEventInfo.select.type == i) selectBorder = true; if (core.status.thisUIEventInfo.select.type == i) selectBorder = true;
var borderStyle = selectBorder ? var borderStyle = selectBorder
box_selectBorderStyle : ? box_selectBorderStyle
box_borderStyle; : box_borderStyle;
core.drawEquipbox_drawOne( core.drawEquipbox_drawOne(
ctx, ctx,
name, name,
@ -9170,6 +9188,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"\t[小妖精,fairy]\f[fairy.png,0,0]欢迎使用事件编辑器(双击方块可直接预览)" "\t[小妖精,fairy]\f[fairy.png,0,0]欢迎使用事件编辑器(双击方块可直接预览)"
), ),
MotaActionBlocks["over_s"].xmlText(), MotaActionBlocks["over_s"].xmlText(),
MotaActionFunctions.actionParser.parseList([{
type: "overlist",
image: "bg_5043.png",
time: 50,
hidetime: 30,
list: [
{ text: "", sound: "", textColor: "255,255,255,1", boldColor: "0,0,0,1", font: "bold 48px Verdana", frame: 0 }
],
}, ]),
MotaActionFunctions.actionParser.parseList([{ MotaActionFunctions.actionParser.parseList([{
type: "cgtext", type: "cgtext",
bg: "bg_5043.png", bg: "bg_5043.png",
@ -9181,7 +9208,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
sound: "", sound: "",
text: "这句话显示在对话框内", text: "这句话显示在对话框内",
bodyList: [ bodyList: [
{ name: "tati_050145a.png", px: 100, filter: false }, { name: "tati_050145a.png", px: 100, filter: false }
], ],
}, ]), }, ]),
MotaActionBlocks["moveTextBox_s"].xmlText(), MotaActionBlocks["moveTextBox_s"].xmlText(),
@ -10497,7 +10524,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.fillRect(ctx, sx, sy, sw, sh, "#000"); core.fillRect(ctx, sx, sy, sw, sh, "#000");
core.strokeRect(ctx, sx, sy, sw, sh, "#fff", 5); core.strokeRect(ctx, sx, sy, sw, sh, "#fff", 5);
core.setTextAlign("outerUI", "center"); core.setTextAlign("outerUI", "center");
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
core.status.maps[center].areas, core.status.maps[center].areas,
sx + (sw * 3) / 8, sx + (sw * 3) / 8,
@ -10626,7 +10653,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"#444444", "#444444",
1 1
); );
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"当前", "当前",
13 + 20, 13 + 20,
@ -10660,7 +10687,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
!core.status.maps[core.floorIds[page]].canFlyTo || !core.status.maps[core.floorIds[page]].canFlyTo ||
!core.hasVisitedFloor(core.floorIds[page]) !core.hasVisitedFloor(core.floorIds[page])
) { ) {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"预览", "预览",
13 + 20, 13 + 20,
@ -10671,7 +10698,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this._buildFont(18, true) this._buildFont(18, true)
); );
} else { } else {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"传送", "传送",
13 + 20, 13 + 20,
@ -10701,7 +10728,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"#444444", "#444444",
1 1
); );
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"离开", "离开",
15 - 4 + size - 4 + 45 + 22, 15 - 4 + size - 4 + 45 + 22,
@ -10732,7 +10759,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
1 1
); );
if (mapdir.includes("up")) { if (mapdir.includes("up")) {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"北▲", "北▲",
30 + 145 + 10, 30 + 145 + 10,
@ -10743,7 +10770,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this._buildFont(18, true) this._buildFont(18, true)
); );
} else { } else {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"北▲", "北▲",
30 + 145 + 10, 30 + 145 + 10,
@ -10775,7 +10802,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
1 1
); );
if (mapdir.includes("left")) { if (mapdir.includes("left")) {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"西", "西",
15 + 17, 15 + 17,
@ -10785,17 +10812,18 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
2, 2,
this._buildFont(18, true) this._buildFont(18, true)
); );
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"◀", "◀",
15 + 17, 15 + 17,
45 + 150, 45 + 150,
"#FFFFFF", "#FFFFFF",
"#000000", "#000000",
2,
this._buildFont(18, true) this._buildFont(18, true)
); );
} else { } else {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"西", "西",
15 + 17, 15 + 17,
@ -10805,7 +10833,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
2, 2,
this._buildFont(18, true) this._buildFont(18, true)
); );
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"◀", "◀",
15 + 17, 15 + 17,
@ -10836,7 +10864,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
1 1
); );
if (mapdir.includes("down")) { if (mapdir.includes("down")) {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"南▼", "南▼",
30 + 145 + 10, 30 + 145 + 10,
@ -10847,7 +10875,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this._buildFont(18, true) this._buildFont(18, true)
); );
} else { } else {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"南▼", "南▼",
30 + 145 + 10, 30 + 145 + 10,
@ -10879,7 +10907,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
1 1
); );
if (mapdir.includes("right")) { if (mapdir.includes("right")) {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"东", "东",
15 + 17 + size - 4, 15 + 17 + size - 4,
@ -10889,7 +10917,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
2, 2,
this._buildFont(18, true) this._buildFont(18, true)
); );
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"▶", "▶",
15 + 17 + size - 4, 15 + 17 + size - 4,
@ -10900,7 +10928,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this._buildFont(18, true) this._buildFont(18, true)
); );
} else { } else {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"东", "东",
15 + 17 + size - 4, 15 + 17 + size - 4,
@ -10910,7 +10938,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
2, 2,
this._buildFont(18, true) this._buildFont(18, true)
); );
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"▶", "▶",
15 + 17 + size - 4, 15 + 17 + size - 4,
@ -10984,7 +11012,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"#444444", "#444444",
1 1
); );
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
core.status.maps[floorId].areas, core.status.maps[floorId].areas,
30 + 145 + 10, 30 + 145 + 10,
@ -11014,7 +11042,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
1 1
); );
if (i === 0) { if (i === 0) {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"◀", "◀",
30, 30,
@ -11025,7 +11053,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this._buildFont(18, true) this._buildFont(18, true)
); );
} else { } else {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"◀", "◀",
30, 30,
@ -11056,7 +11084,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
1 1
); );
if (i === areas.length - 1) { if (i === areas.length - 1) {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"▶", "▶",
30 + 300 + 10, 30 + 300 + 10,
@ -11067,7 +11095,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this._buildFont(18, true) this._buildFont(18, true)
); );
} else { } else {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"▶", "▶",
30 + 300 + 10, 30 + 300 + 10,
@ -11099,7 +11127,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
1 1
); );
if (mapdir.includes("upFloor")) { if (mapdir.includes("upFloor")) {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"上楼", "上楼",
30 + 320 + 10, 30 + 320 + 10,
@ -11110,7 +11138,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this._buildFont(18, true) this._buildFont(18, true)
); );
} else { } else {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"上楼", "上楼",
30 + 320 + 10, 30 + 320 + 10,
@ -11141,7 +11169,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
1 1
); );
if (mapdir.includes("downFloor")) { if (mapdir.includes("downFloor")) {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"下楼", "下楼",
30 + 320 + 10, 30 + 320 + 10,
@ -11152,7 +11180,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this._buildFont(18, true) this._buildFont(18, true)
); );
} else { } else {
core.fillBoldText( core.fillBoldText1(
"ui", "ui",
"下楼", "下楼",
30 + 320 + 10, 30 + 320 + 10,
@ -12163,7 +12191,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"#444444", "#444444",
3 3
); );
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
"离开", "离开",
100, 100,
@ -12212,7 +12240,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"#444444", "#444444",
3 3
); );
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
"向上翻页", "向上翻页",
100, 100,
@ -12222,7 +12250,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
6, 6,
core.ui._buildFont(24, true) core.ui._buildFont(24, true)
); );
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
"向下翻页", "向下翻页",
100, 100,
@ -12293,7 +12321,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"#444444", "#444444",
3 3
); );
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
"离开", "离开",
100, 100,
@ -12324,7 +12352,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"#444444", "#444444",
3 3
); );
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
"向上翻页", "向上翻页",
100, 100,
@ -12353,7 +12381,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"#444444", "#444444",
3 3
); );
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
"向下翻页", "向下翻页",
100, 100,
@ -12497,7 +12525,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (one.frame >= one.time) if (one.frame >= one.time)
core.setAlpha(ctx, 1 - (one.frame - one.time) / one.show); core.setAlpha(ctx, 1 - (one.frame - one.time) / one.show);
else core.setAlpha(ctx, 1); else core.setAlpha(ctx, 1);
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
one.value, one.value,
one.px, one.px,
@ -12997,7 +13025,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this.WindowSkin = false; this.WindowSkin = false;
this.sound = ""; this.sound = "";
this.beforeSound = 0; this.beforeSound = 0;
this.wait = 200 this.wait = 200;
} }
click(px, py) { click(px, py) {
//点击效果 //点击效果
@ -13137,7 +13165,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
config.lineHeight = config.lineHeight || config.fontSize * 1.3; config.lineHeight = config.lineHeight || config.fontSize * 1.3;
config.defaultFont = config.font = config.font || globalAttribute.font; config.defaultFont = config.font = config.font || globalAttribute.font;
config.time = config.time || 0; config.time = config.time || 0;
config.letterSpacing = (config.letterSpacing == null) ? (textAttribute.letterSpacing || 0) : config.letterSpacing; config.letterSpacing =
config.letterSpacing == null ?
textAttribute.letterSpacing || 0 :
config.letterSpacing;
config.index = 0; config.index = 0;
config.currcolor = config.color; config.currcolor = config.color;
@ -13317,7 +13348,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
if (core.isPlaying() && !this.WindowSkin) { if (core.isPlaying() && !this.WindowSkin) {
core.drawWindowSkin("winskin.png", ctx, 1700, 1100, 192, 96); core.drawWindowSkin("winskin.png", ctx, 1700, 1100, 192, 96);
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
"存 档", "存 档",
1736, 1736,
@ -13328,7 +13359,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"bold 48px Verdana" "bold 48px Verdana"
); );
core.drawWindowSkin("winskin.png", ctx, 1400, 1100, 192, 96); core.drawWindowSkin("winskin.png", ctx, 1400, 1100, 192, 96);
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
"▶▶", "▶▶",
1456, 1456,
@ -13341,7 +13372,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.drawWindowSkin("winskin.png", ctx, 1700, 900, 192, 96); core.drawWindowSkin("winskin.png", ctx, 1700, 900, 192, 96);
let autoText = "AUTO"; let autoText = "AUTO";
if (auto) autoText = "STOP"; if (auto) autoText = "STOP";
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
autoText, autoText,
1722, 1722,
@ -13353,7 +13384,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
); );
} }
if (this.name) if (this.name)
core.fillBoldText( core.fillBoldText1(
ctx, ctx,
`${this.name}`, `${this.name}`,
500, 500,
@ -13436,10 +13467,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
const img = core.material.images.images?.[image]; const img = core.material.images.images?.[image];
over.style.display = "block"; over.style.display = "block";
let frame = 0 let frame = 0;
let sod = 0; let sod = 0;
core.registerAnimationFrame("over", true, () => { core.registerAnimationFrame("over", true, () => {
core.clearMap(ctx); core.clearMap(ctx);
if (core.domStyle.isVertical) { if (core.domStyle.isVertical) {
ctx.canvas.width = 416 * 3; ctx.canvas.width = 416 * 3;
@ -13460,37 +13490,44 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
frame++; frame++;
// 绘制 // 绘制
if (frame <= hidetime) core.setAlpha(ctx, 1 - (hidetime - frame) / hidetime); if (frame <= hidetime)
core.setAlpha(ctx, 1 - (hidetime - frame) / hidetime);
if (frame > hidetime && frame <= hidetime + time) ctx.globalAlpha = 1; if (frame > hidetime && frame <= hidetime + time) ctx.globalAlpha = 1;
if (frame > hidetime + time && frame <= hidetime * 2 + time) core.setAlpha(ctx, 1 - (frame - hidetime - time) / hidetime); if (frame > hidetime + time && frame <= hidetime * 2 + time)
const lisen = sound && core.material.sounds[sound] && core.musicStatus.soundStatus; core.setAlpha(ctx, 1 - (frame - hidetime - time) / hidetime);
const lisen =
sound && core.material.sounds[sound] && core.musicStatus.soundStatus;
if (frame == hidetime && lisen) { if (frame == hidetime && lisen) {
sod = core.playSound(sound) sod = core.playSound(sound);
} }
if (frame > hidetime * 2 + time) { if (frame > hidetime * 2 + time) {
core.unregisterAnimationFrame("over") core.unregisterAnimationFrame("over");
ctx.restore(); ctx.restore();
over.style.display = "none"; over.style.display = "none";
core.stopSound(sod) core.stopSound(sod);
core.doAction() core.doAction();
return return;
} }
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText(ctx, text, 1014, 624, textColor, boldColor, 6, font); core.fillBoldText1(ctx, text, 1014, 624, textColor, boldColor, 6, font);
ctx.restore(); ctx.restore();
}) });
} };
this.overlist = function ( this.overlist = function (
image, image,
time = 100, time = 50,
hidetime = 30, hidetime = 30,
font = "bold 48px Verdana", list = [{
list = [{ text: "", sound: "", textColor: "#FFFFFF", boldColor: "#000000", font: "bold 48px Verdana", frame: 0 }] text: "",
sound: "",
textColor: "#FFFFFF",
boldColor: "#000000",
font: "bold 48px Verdana",
frame: 0,
}]
) { ) {
if (!core.isPlaying()) { if (!core.isPlaying()) {
return core.doAction(); return core.doAction();
@ -13498,8 +13535,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
const img = core.material.images.images?.[image]; const img = core.material.images.images?.[image];
over.style.display = "block"; over.style.display = "block";
let sod = 0; let sod = 0;
let i = 0;
core.registerAnimationFrame("overlist", true, () => { core.registerAnimationFrame("overlist", true, () => {
core.clearMap(ctx); core.clearMap(ctx);
if (core.domStyle.isVertical) { if (core.domStyle.isVertical) {
ctx.canvas.width = 416 * 3; ctx.canvas.width = 416 * 3;
@ -13518,32 +13555,198 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} else { } else {
core.fillRect(ctx, 0, 0, 676 * 3, 416 * 3); core.fillRect(ctx, 0, 0, 676 * 3, 416 * 3);
} }
const a = list[i];
const b = list[i - 1];
const c = list[i - 2];
const d = list[i - 3];
let ay = 624,
by = 624,
cy = 624,
dy = 624;
if (i === 0 && !list[1]) {
core.over(image,
time,
hidetime,
a.sound,
a.textColor,
a.boldColor,
a.font,
a.text)
} else {
const numa = parseInt(a?.font?.replace(/[^\d]/g, " ").replace(" ", "")) || 48;
const numb = parseInt(b?.font?.replace(/[^\d]/g, " ").replace(" ", "")) || 48;
const numc = parseInt(c?.font?.replace(/[^\d]/g, " ").replace(" ", "")) || 48;
const numd = parseInt(d?.font?.replace(/[^\d]/g, " ").replace(" ", "")) || 48;
frame++;
// 绘制 // 绘制
if (frame <= hidetime) core.setAlpha(ctx, 1 - (hidetime - frame) / hidetime); if (a) {
if (frame > hidetime && frame <= hidetime + time) ctx.globalAlpha = 1; if (a.frame < hidetime / 2) {
if (frame > hidetime + time && frame <= hidetime * 2 + time) core.setAlpha(ctx, 1 - (frame - hidetime - time) / hidetime); a.frame++;
const lisen = sound && core.material.sounds[sound] && core.musicStatus.soundStatus; core.setAlpha(ctx, 1 - (hidetime - a.frame) / hidetime);
if (frame == hidetime && lisen) { ay += (numa * (hidetime - a.frame)) / hidetime * 3;
sod = core.playSound(sound) core.setTextAlign(ctx, "center");
core.fillBoldText1(
ctx,
a.text,
1014,
ay,
a.textColor,
a.boldColor,
6,
a.font
);
} }
if (frame > hidetime * 2 + time) { if (a.frame === hidetime / 2) {
core.unregisterAnimationFrame("over")
core.setAlpha(ctx, 1 - (hidetime - a.frame) / hidetime);
ay = 624 + (numa * (hidetime - a.frame)) / hidetime * 3;
core.setTextAlign(ctx, "center");
core.fillBoldText1(
ctx,
a.text,
1014,
ay,
a.textColor,
a.boldColor,
6,
a.font
);
if (!b) {
a.frame++;
i++
}
}
}
if (b) {
if (b.frame > hidetime / 2 && b.frame <= hidetime) {
b.frame++;
core.setAlpha(ctx, 1 - (hidetime - b.frame) / hidetime);
by += (numb * (hidetime - b.frame)) / hidetime * 3;
core.setTextAlign(ctx, "center");
core.fillBoldText1(
ctx,
b.text,
1014,
by,
b.textColor,
b.boldColor,
6,
b.font
);
core.stopSound(sod)
}
const lisenb = b.sound && core.material.sounds[b.sound] && core.musicStatus.soundStatus;
if (b.frame && lisenb) { sod = core.playSound(sound); }
if (b.frame > hidetime && b.frame < hidetime + time) {
b.frame++
ctx.globalAlpha = 1;
core.setTextAlign(ctx, "center");
core.fillBoldText1(
ctx,
b.text,
1014,
by,
b.textColor,
b.boldColor,
6,
b.font
);
}
if (b.frame == hidetime + time) {
ctx.globalAlpha = 1;
core.setTextAlign(ctx, "center");
core.fillBoldText1(
ctx,
b.text,
1014,
by,
b.textColor,
b.boldColor,
6,
b.font
);
if (a) a.frame++;
if (b) b.frame++;
if (c) c.frame++;
i++
}
}
if (c) {
if (c.frame > hidetime + time && c.frame < hidetime * 3 / 2 + time) {
c.frame++;
core.setAlpha(ctx, 1 - (c.frame - hidetime - time) / hidetime)
cy -= (numc * (c.frame - hidetime - time)) / hidetime * 3;
core.setTextAlign(ctx, "center");
core.fillBoldText1(
ctx,
c.text,
1014,
cy,
c.textColor,
c.boldColor,
6,
c.font
);
}
if (c.frame === hidetime * 3 / 2 + time) {
core.setAlpha(ctx, 1 - (c.frame - hidetime - time) / hidetime)
cy = 624 - (numc * (c.frame - hidetime - time)) / hidetime * 3;
core.setTextAlign(ctx, "center");
core.fillBoldText1(
ctx,
c.text,
1014,
cy,
c.textColor,
c.boldColor,
6,
c.font
);
if (!b) {
c.frame++
i++
}
}
}
if (d) {
if (d.frame > hidetime * 3 / 2 + time && d.frame < hidetime * 2 + time) {
d.frame++;
core.setAlpha(ctx, 1 - (d.frame - hidetime - time) / hidetime)
dy -= (numd * (d.frame - hidetime - time)) / hidetime * 3;
core.setTextAlign(ctx, "center");
core.fillBoldText1(
ctx,
d.text,
1014,
dy,
d.textColor,
d.boldColor,
6,
d.font
);
}
if (d.frame == hidetime * 2 + time && !c) {
core.unregisterAnimationFrame("overlist");
ctx.restore(); ctx.restore();
over.style.display = "none"; over.style.display = "none";
core.stopSound(sod) core.stopSound(sod);
core.doAction() core.doAction();
return return;
} }
core.setTextAlign(ctx, "center"); }
core.fillBoldText(ctx, text, 1014, 624, textColor, boldColor, 6, font); }
ctx.restore(); ctx.restore();
}) });
} };
this.changebg = function (img1, img2, time, style) { this.changebg = function (img1, img2, time, style) {
let globalAlpha1 = 0; let globalAlpha1 = 0;