移除nowLoc,合并存档同步,竖屏标题页面,右键焦点

This commit is contained in:
ckcz123 2020-05-24 10:50:13 +08:00
parent f6e313126a
commit 07eb9fdbe6
11 changed files with 53 additions and 42 deletions

View File

@ -558,7 +558,8 @@ return '{' + [
mainStyle_m mainStyle_m
: '主要样式设置:' '标题界面背景图(全路径):' EvalString BGNL? Newline : '主要样式设置:' '标题界面背景图544x422' EvalString BGNL? Newline
'竖屏标题界面背景图422x580' EvalString BGNL? Newline
'标题样式;可写 display: none 隐藏标题' EvalString BGNL? Newline '标题样式;可写 display: none 隐藏标题' EvalString BGNL? Newline
'标题按钮样式:' EvalString BGNL? Newline '标题按钮样式:' EvalString BGNL? Newline
'横屏状态栏背景url(...) 0 0/100% 100% no-repeat 可将图片拉伸自适配' BGNL? Newline EvalString BGNL? Newline '横屏状态栏背景url(...) 0 0/100% 100% no-repeat 可将图片拉伸自适配' BGNL? Newline EvalString BGNL? Newline
@ -569,19 +570,20 @@ mainStyle_m
/* mainStyle_m /* mainStyle_m
tooltip : 主要样式设置 tooltip : 主要样式设置
default : ["project/images/bg.jpg", "color: black", "background-color: #32369F; opacity: 0.85; color: #FFFFFF; border: #FFFFFF 2px solid; caret-color: #FFD700;", "url(project/materials/ground.png) repeat", "url(project/materials/ground.png) repeat", "url(project/materials/ground.png) repeat", "background-color: black; color: white", "255,255,255,1", "rgba(255,255,255,1)", "204,204,204,1", "rgba(204,204,204,1)", "Verdana"] default : ["project/images/bg.jpg", "project/images/bg.jpg", "color: black", "background-color: #32369F; opacity: 0.85; color: #FFFFFF; border: #FFFFFF 2px solid; caret-color: #FFD700;", "url(project/materials/ground.png) repeat", "url(project/materials/ground.png) repeat", "url(project/materials/ground.png) repeat", "background-color: black; color: white", "255,255,255,1", "rgba(255,255,255,1)", "204,204,204,1", "rgba(204,204,204,1)", "Verdana"]
helpUrl : https://h5mota.com/games/template/_docs/#/event helpUrl : https://h5mota.com/games/template/_docs/#/event
var code = { var code = {
startBackground: EvalString_0, startBackground: EvalString_0,
startLogoStyle: EvalString_1, startVerticalBackground: EvalString_1,
startButtonsStyle: EvalString_2, startLogoStyle: EvalString_2,
statusLeftBackground: EvalString_3, startButtonsStyle: EvalString_3,
statusTopBackground: EvalString_4, statusLeftBackground: EvalString_4,
toolsBackground: EvalString_5, statusTopBackground: EvalString_5,
floorChangingStyle: EvalString_6, toolsBackground: EvalString_6,
floorChangingStyle: EvalString_7,
statusBarColor: JSON.parse('['+ColorString_0+']'), statusBarColor: JSON.parse('['+ColorString_0+']'),
borderColor: JSON.parse('['+ColorString_1+']'), borderColor: JSON.parse('['+ColorString_1+']'),
font: EvalString_7 font: EvalString_8
}; };
return JSON.stringify(code); return JSON.stringify(code);
*/; */;

View File

@ -107,8 +107,8 @@ ActionParser.prototype.parse = function (obj,type) {
case 'mainStyle': case 'mainStyle':
if(!obj) obj={}; if(!obj) obj={};
return MotaActionBlocks['mainStyle_m'].xmlText([ return MotaActionBlocks['mainStyle_m'].xmlText([
obj.startBackground, obj.startLogoStyle, obj.startButtonsStyle, obj.statusLeftBackground, obj.statusTopBackground, obj.startBackground, obj.startVerticalBackground || obj.startBackground, obj.startLogoStyle, obj.startButtonsStyle,
obj.toolsBackground, obj.floorChangingStyle, obj.statusLeftBackground, obj.statusTopBackground, obj.toolsBackground, obj.floorChangingStyle,
obj.statusBarColor, 'rgba('+obj.statusBarColor+')', obj.borderColor, 'rgba('+obj.borderColor+')', obj.font obj.statusBarColor, 'rgba('+obj.statusBarColor+')', obj.borderColor, 'rgba('+obj.borderColor+')', obj.font
]); ]);

View File

@ -28,7 +28,7 @@ editor_config.prototype.set = function(key, value, callback) {
editor_config.prototype.save = function(callback) { editor_config.prototype.save = function(callback) {
fs.writeFile(this.address, JSON.stringify(this.config) ,'utf-8', function(e) { fs.writeFile(this.address, JSON.stringify(this.config) ,'utf-8', function(e) {
if (e) alert("写入配置文件失败"); if (e) printe("写入配置文件失败");
if (callback instanceof Function) callback(); if (callback instanceof Function) callback();
}) })
} }

View File

@ -216,18 +216,18 @@ editor_mappanel_wrapper = function (editor) {
ee.preventDefault(); ee.preventDefault();
ee.stopPropagation(); ee.stopPropagation();
var e=editor.uivalues.lastMoveE; var e=editor.uivalues.lastMoveE;
if (e.buttons == 2 && (editor.uivalues.endPos==null || (editor.uivalues.startPos.x == editor.uivalues.endPos.x && editor.uivalues.startPos.y == editor.uivalues.endPos.y))) {
editor.uifunctions.showMidMenu(e.clientX, e.clientY);
editor.dom.euiCtx.clearRect(0, 0, core.__PIXELS__, core.__PIXELS__);
editor.uivalues.startPos = editor.uivalues.endPos = null;
return false;
}
if (!selectBox.isSelected()) { if (!selectBox.isSelected()) {
if (e.buttons == 2) { if (e.buttons == 2) {
if (editor.uivalues.endPos==null || (editor.uivalues.startPos.x == editor.uivalues.endPos.x && editor.uivalues.startPos.y == editor.uivalues.endPos.y)) { // 右键拖拽: 选中区域
// 右键点击: 弹菜单 printf('已经选中该区域')
editor.uifunctions.showMidMenu(e.clientX, e.clientY); editor.uivalues.selectedArea = Object.assign({}, editor.uivalues.startPos, {x1: editor.uivalues.endPos.x, y1: editor.uivalues.endPos.y});
editor.dom.euiCtx.clearRect(0, 0, core.__PIXELS__, core.__PIXELS__); // 后续的处理
} else {
// 右键拖拽: 选中区域
printf('已经选中该区域')
editor.uivalues.selectedArea = Object.assign({}, editor.uivalues.startPos, {x1: editor.uivalues.endPos.x, y1: editor.uivalues.endPos.y});
// 后续的处理
}
} else { } else {
// 左键拖拽: 交换 // 左键拖拽: 交换
//tip.whichShow(1); //tip.whichShow(1);

View File

@ -71,7 +71,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_range": "editor.mode.checkUnique(thiseval)", "_range": "editor.mode.checkUnique(thiseval)",
"_directory": "./project/bgms/", "_directory": "./project/bgms/",
"_transform": (function (one) { "_transform": (function (one) {
if (one.endsWith('.mp3') || one.endsWith('.wmv') || one.endsWith('.ogg') || one.endsWith('.wav')) if (one.endsWith('.mp3') || one.endsWith('.ogg') || one.endsWith('.wav'))
return one; return one;
return null; return null;
}).toString(), }).toString(),
@ -84,7 +84,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_range": "editor.mode.checkUnique(thiseval)", "_range": "editor.mode.checkUnique(thiseval)",
"_directory": "./project/sounds/", "_directory": "./project/sounds/",
"_transform": (function (one) { "_transform": (function (one) {
if (one.endsWith('.mp3') || one.endsWith('.wmv') || one.endsWith('.ogg') || one.endsWith('.wav')) if (one.endsWith('.mp3') || one.endsWith('.ogg') || one.endsWith('.wav'))
return one; return one;
return null; return null;
}).toString(), }).toString(),

View File

@ -1821,9 +1821,9 @@ control.prototype._syncSave_http = function (type, saves) {
core.drawText("出错啦!\n无法同步存档到服务器。\n错误原因"+response.msg); core.drawText("出错啦!\n无法同步存档到服务器。\n错误原因"+response.msg);
} }
else { else {
core.drawText((type=='all'?"所有存档":"存档"+core.saves.saveIndex)+"同步成功!\n\n您的存档编号 " core.drawText((type=='all'?"所有存档":"存档"+core.saves.saveIndex)+"同步成功!\n\n您的存档编号+密码 \r[yellow]"
+response.code+"\n您的存档密码 "+response.msg +response.code+response.msg
+"\n\n请牢记以上两个信息(如截图等),在从服务器\n同步存档时使用。\n\r[yellow]另外请注意,存档同步只会保存一个月的时间。\r") +"\r\n\n请牢记以上信息如截图等在从服务器\n同步存档时使用。\n\r[yellow]另外请注意,存档同步只会保存一个月的时间。\r")
} }
}, function (e) { }, function (e) {
core.drawText("出错啦!\n无法同步存档到服务器。\n错误原因"+e); core.drawText("出错啦!\n无法同步存档到服务器。\n错误原因"+e);
@ -1832,13 +1832,14 @@ control.prototype._syncSave_http = function (type, saves) {
////// 从服务器加载存档 ////// ////// 从服务器加载存档 //////
control.prototype.syncLoad = function () { control.prototype.syncLoad = function () {
core.myprompt("请输入存档编号", null, function (id) { core.myprompt("请输入存档编号+密码", null, function (idpassword) {
if (!id) return core.ui.drawSyncSave(); if (!idpassword) return core.ui.drawSyncSave();
core.myprompt("请输入存档密码:", null, function (password) { if (!/^\d{6}\w{4}$/.test(idpassword)) {
if (!password) return core.ui.drawSyncSave(); core.drawText("不合法的存档编号+密码应当为6位数字+4位数字字母的组合如\r[yellow]123456abcd\r。");
core.ui.drawWaiting("正在同步,请稍后..."); return;
core.control._syncLoad_http(id, password); }
}); core.ui.drawWaiting("正在同步,请稍后...");
core.control._syncLoad_http(idpassword.substring(0, 6), idpassword.substring(6));
}); });
} }
@ -2695,6 +2696,12 @@ control.prototype.resize = function() {
} }
control.prototype._resize_gameGroup = function (obj) { control.prototype._resize_gameGroup = function (obj) {
var startBackground = core.domStyle.isVertical ? (main.styles.startVerticalBackground || main.styles.startBackground) : main.styles.startBackground;
if (main.dom.startBackground.getAttribute('__src__') != startBackground) {
main.dom.startBackground.setAttribute('__src__', startBackground);
main.dom.startBackground.src = startBackground;
}
var gameGroup = core.dom.gameGroup; var gameGroup = core.dom.gameGroup;
var totalWidth, totalHeight; var totalWidth, totalHeight;
if (core.domStyle.isVertical) { if (core.domStyle.isVertical) {

View File

@ -44,7 +44,6 @@ events.prototype.startGame = function (hard, seed, route, callback) {
events.prototype._startGame_start = function (hard, seed, route, callback) { events.prototype._startGame_start = function (hard, seed, route, callback) {
console.log('开始游戏'); console.log('开始游戏');
core.resetGame(core.firstData.hero, hard, null, core.clone(core.initStatus.maps)); core.resetGame(core.firstData.hero, hard, null, core.clone(core.initStatus.maps));
var nowLoc = core.clone(core.getHeroLoc());
core.setHeroLoc('x', -1); core.setHeroLoc('x', -1);
core.setHeroLoc('y', -1); core.setHeroLoc('y', -1);
@ -64,7 +63,7 @@ events.prototype._startGame_start = function (hard, seed, route, callback) {
core.push(todo, {"type": "function", "function": "function() { core.events._startGame_setHard(); }"}) core.push(todo, {"type": "function", "function": "function() { core.events._startGame_setHard(); }"})
core.push(todo, core.firstData.startText); core.push(todo, core.firstData.startText);
this.insertAction(todo, null, null, function () { this.insertAction(todo, null, null, function () {
core.events._startGame_afterStart(nowLoc, callback); core.events._startGame_afterStart(callback);
}); });
if (route != null) core.startReplay(route); if (route != null) core.startReplay(route);
@ -86,11 +85,10 @@ events.prototype._startGame_setHard = function () {
core.setFlag('__hardColor__', hardColor); core.setFlag('__hardColor__', hardColor);
} }
events.prototype._startGame_afterStart = function (nowLoc, callback) { events.prototype._startGame_afterStart = function (callback) {
core.ui.closePanel(); core.ui.closePanel();
this._startGame_statusBar(); this._startGame_statusBar();
core.dom.musicBtn.style.display = 'none'; core.changeFloor(core.firstData.floorId, null, core.firstData.hero.loc, null, function () {
core.changeFloor(core.firstData.floorId, null, nowLoc, null, function () {
// 插入一个空事件避免直接回放录像出错 // 插入一个空事件避免直接回放录像出错
core.insertAction([]); core.insertAction([]);
if (callback) callback(); if (callback) callback();

View File

@ -207,7 +207,6 @@ main.prototype.init = function (mode, callback) {
var mainData = data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main; var mainData = data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main;
for(var ii in mainData)main[ii]=mainData[ii]; for(var ii in mainData)main[ii]=mainData[ii];
main.dom.startBackground.src = main.styles.startBackground;
main.dom.startLogo.style=main.styles.startLogoStyle; main.dom.startLogo.style=main.styles.startLogoStyle;
main.dom.startButtonGroup.style = main.styles.startButtonsStyle; main.dom.startButtonGroup.style = main.styles.startButtonsStyle;
main.levelChoose = main.levelChoose || []; main.levelChoose = main.levelChoose || [];

View File

@ -138,6 +138,7 @@ function action_data(callback) {
// Step 2: 合并main.styles // Step 2: 合并main.styles
if (!main.styles) main.styles = { if (!main.styles) main.styles = {
"startBackground": "project/images/bg.jpg", "startBackground": "project/images/bg.jpg",
"startVerticalBackground": "project/images/bg.jpg",
"startLogoStyle": "color: black", "startLogoStyle": "color: black",
"startButtonsStyle": "background-color: #32369F; opacity: 0.85; color: #FFFFFF; border: #FFFFFF 2px solid; caret-color: #FFD700;", "startButtonsStyle": "background-color: #32369F; opacity: 0.85; color: #FFFFFF; border: #FFFFFF 2px solid; caret-color: #FFD700;",
"statusLeftBackground": "url(project/materials/ground.png) repeat", "statusLeftBackground": "url(project/materials/ground.png) repeat",
@ -150,7 +151,8 @@ function action_data(callback) {
}; };
["startLogoStyle", "startButtonsStyle", "statusLeftBackground", "statusTopBackground", "toolsBackground", "font"].forEach(function (one) { ["startLogoStyle", "startButtonsStyle", "statusLeftBackground", "statusTopBackground", "toolsBackground", "font"].forEach(function (one) {
if (main[one]) main.styles[one] = main[one]; if (main[one]) main.styles[one] = main[one];
}) });
if (main.styles.startVerticalBackground == null) main.styles.startVerticalBackground = main.styles.startBackground;
for (var key in main.styles) delete main[key]; for (var key in main.styles) delete main[key];
delete main.floorChangingBackground; delete main.floorChangingTextColor; delete main.floorChangingBackground; delete main.floorChangingTextColor;

View File

@ -73,6 +73,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"startBgm": null, "startBgm": null,
"styles": { "styles": {
"startBackground": "project/images/bg.jpg", "startBackground": "project/images/bg.jpg",
"startVerticalBackground": "project/images/bg.jpg",
"startLogoStyle": "color: black", "startLogoStyle": "color: black",
"startButtonsStyle": "background-color: #32369F; opacity: 0.85; color: #FFFFFF; border: #FFFFFF 2px solid; caret-color: #FFD700;", "startButtonsStyle": "background-color: #32369F; opacity: 0.85; color: #FFFFFF; border: #FFFFFF 2px solid; caret-color: #FFD700;",
"statusLeftBackground": "url(project/materials/ground.png) repeat", "statusLeftBackground": "url(project/materials/ground.png) repeat",

View File

@ -68,7 +68,9 @@
(不处理;现在静止状态可以有帧动画了,所以不考虑行走过程动画) 行走动画 (不处理;现在静止状态可以有帧动画了,所以不考虑行走过程动画) 行走动画
(已完成!) 合并main中一些设置内容 (已完成!) 合并main中一些设置内容
(已完成!) \t[this], 勇士朝下flag:arg清理瞬移扣血 (已完成!) \t[this], 勇士朝下flag:arg清理瞬移扣血
nowLoc同步存档合并右键反复弹出失去焦点右键地图编辑框无效 (OK) 同步存档合并;(OK) 失去焦点右键;地图编辑框无效;(OK) 竖屏标题界面背景
右键反复弹出;
------------- -------------