一些细节的修复

This commit is contained in:
ckcz123 2020-06-04 12:05:49 +08:00
parent 60d5e2cc08
commit f865914139
6 changed files with 28 additions and 15 deletions

View File

@ -1258,7 +1258,6 @@ tooltip : showFloorImg: 显示一个贴图xy为左上角坐标可用逗号
helpUrl : https://h5mota.com/games/template/_docs/#/event?id=showFloorImg%ef%bc%9a%e6%98%be%e7%a4%ba%e8%b4%b4%e5%9b%be
default : ["","",""]
allFloorIds : ['IdString_0']
selectPoint : ["EvalString_0", "EvalString_1", "IdString_0"]
colour : this.mapColor
var floorstr = '';
if (EvalString_0 && EvalString_1) {
@ -1292,7 +1291,6 @@ helpUrl : https://h5mota.com/games/template/_docs/#/event?id=hideFloorImg%ef%bc%
default : ["","",""]
allFloorIds : ['IdString_0']
colour : this.mapColor
selectPoint : ["EvalString_0", "EvalString_1", "IdString_0"]
var floorstr = '';
if (EvalString_0 && EvalString_1) {
var pattern1 = MotaActionFunctions.pattern.id;
@ -2445,7 +2443,7 @@ break_s
: '跳出当前循环或公共事件' Newline
/* break_s
tooltip : break跳出循环, 如果break事件不在任何循环中被执行则和exit等价即会立刻结束当前事件!
tooltip : break跳出循环或公共事件!
helpUrl : https://h5mota.com/games/template/_docs/#/event?id=break%EF%BC%9A%E8%B7%B3%E5%87%BA%E5%BE%AA%E7%8E%AF
colour : this.eventColor
var code = '{"type": "break"},\n';
@ -2453,10 +2451,10 @@ return code;
*/;
continue_s
: '继续当前循环' Newline
: '提前结束本轮循环或跳出公共事件' Newline
/* continue_s
tooltip : continue继续执行当前循环的下一轮, 如果continue事件不在任何循环中被执行则和exit等价即会立刻结束当前事件!
tooltip : continue继续执行当前循环的下一轮,或跳出公共事件!
helpUrl : https://h5mota.com/games/template/_docs/#/event?id=continue%EF%BC%9A%E7%BB%A7%E7%BB%AD%E6%89%A7%E8%A1%8C%E5%BD%93%E5%89%8D%E5%BE%AA%E7%8E%AF
colour : this.eventColor
var code = '{"type": "continue"},\n';

View File

@ -1201,6 +1201,8 @@ MotaActionFunctions.IdString_pre = function(IdString){
MotaActionFunctions.PosString_pre = function(PosString){
if (!PosString || /^-?\d+$/.test(PosString)) return PosString;
//if (!(MotaActionFunctions.pattern.id.test(PosString)))throw new Error(PosString+'中包含了0-9 a-z A-Z _ 和中文之外的字符,或者是没有以flag: 开头');
var comma = PosString.indexOf(',');
if (comma >= 0 && PosString.substring(0, comma).indexOf('(') < 0) throw '此处不可写多点坐标';
return '"'+MotaActionFunctions.replaceFromName(PosString)+'"';
}

View File

@ -509,7 +509,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"ratio": {
"_leaf": true,
"_type": "textarea",
"_range": "(thiseval==~~thiseval && thiseval>=0)||thiseval==null",
"_range": "thiseval==~~thiseval && thiseval>=0",
"_docs": "宝石血瓶效果",
"_data": "每一层的宝石/血瓶效果,即获得宝石和血瓶时框内\"ratio\"的值。"
}

View File

@ -7,6 +7,7 @@
<link href="_server/CodeMirror/codemirror.css" rel="stylesheet">
<link href="_server/thirdparty/awesomplete.css" rel="stylesheet">
<link href="_server/css/editor_mode_mobile.css" rel="stylesheet">
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
</head>
<body>
<script>

View File

@ -6,6 +6,7 @@
<link href="_server/CodeMirror/codemirror.css" rel="stylesheet">
<link href="_server/thirdparty/awesomplete.css" rel="stylesheet">
<link href="_server/css/editor_mode.css" rel="stylesheet">
<link rel="icon" href="data:;base64,iVBORw0KGgo=">
</head>
<body>
<script>

View File

@ -1815,7 +1815,7 @@ events.prototype._action_switch = function (data, x, y, prefix) {
var list = [];
for (var i = 0; i < data.caseList.length; i++) {
var condition = data.caseList[i]["case"];
if (condition == "default" || core.calValue(condition, prefix) == key) {
if (condition == "default" || core.calValue(condition, prefix) === key) {
core.push(list, data.caseList[i].action);
if (!data.caseList[i].nobreak)
break;
@ -1927,10 +1927,18 @@ events.prototype._action_for = function (data, x, y, prefix) {
return core.doAction();
}
var from = core.calValue(data.from);
if (typeof from != 'number') {
core.insertAction('循环遍历事件要求【起始点】仅能是数字!');
var to = core.calValue(data.to);
var step = core.calValue(data.step);
if (typeof from != 'number' || typeof to !='number' || typeof step != 'number') {
core.insertAction('循环遍历事件要求【起始点】【终止点】【每步】仅能是数字!');
return core.doAction();
}
// 首次判定
if ((step > 0 && from > to) || (step < 0 && from < to)) {
core.doAction();
return;
}
var letter = data.name.substring(5);
core.setFlag('@temp@' + letter, from);
var toName = '@temp@for-to@' + letter;
@ -2016,16 +2024,19 @@ events.prototype._precompile_dowhile = function (data) {
}
events.prototype._action_break = function (data, x, y, prefix) {
core.status.event.data.list.shift();
if (core.status.event.data.list.length > 1)
core.status.event.data.list.shift();
core.doAction();
}
events.prototype._action_continue = function (data, x, y, prefix) {
if (core.calValue(core.status.event.data.list[0].condition, prefix)) {
core.status.event.data.list[0].todo = core.clone(core.status.event.data.list[0].total);
}
else {
core.status.event.data.list.shift();
if (core.status.event.data.list.length > 1) {
if (core.calValue(core.status.event.data.list[0].condition, prefix)) {
core.status.event.data.list[0].todo = core.clone(core.status.event.data.list[0].total);
}
else {
core.status.event.data.list.shift();
}
}
core.doAction();
}