editor strict check range
This commit is contained in:
parent
4372981cb3
commit
bd0e8e2f10
@ -16,26 +16,31 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"images": {
|
"images": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "editor.mode.checkUnique(thiseval)",
|
||||||
"_data": "在此存放所有可能使用的图片(tilesets除外) \n图片可以被作为背景图(的一部分),也可以直接用自定义事件进行显示。 \n 图片名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好 \n 建议对于较大的图片,在网上使用在线的“图片压缩工具(http://compresspng.com/zh/)”来进行压缩,以节省流量 \n 依次向后添加"
|
"_data": "在此存放所有可能使用的图片(tilesets除外) \n图片可以被作为背景图(的一部分),也可以直接用自定义事件进行显示。 \n 图片名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好 \n 建议对于较大的图片,在网上使用在线的“图片压缩工具(http://compresspng.com/zh/)”来进行压缩,以节省流量 \n 依次向后添加"
|
||||||
},
|
},
|
||||||
"tilesets": {
|
"tilesets": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "editor.mode.checkUnique(thiseval)",
|
||||||
"_data": "在此存放额外素材的图片名, \n可以自定导入任意张素材图片,无需PS,无需注册,即可直接在游戏中使用 \n 形式如[\"1.png\", \"2.png\"] ,将需要的素材图片放在images目录下 \n 素材的宽高必须都是32的倍数,且图片上的总图块数不超过1000(即最多有1000个32*32的图块在该图片上)"
|
"_data": "在此存放额外素材的图片名, \n可以自定导入任意张素材图片,无需PS,无需注册,即可直接在游戏中使用 \n 形式如[\"1.png\", \"2.png\"] ,将需要的素材图片放在images目录下 \n 素材的宽高必须都是32的倍数,且图片上的总图块数不超过1000(即最多有1000个32*32的图块在该图片上)"
|
||||||
},
|
},
|
||||||
"animates": {
|
"animates": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "editor.mode.checkUnique(thiseval)",
|
||||||
"_data": "在此存放所有可能使用的动画,必须是animate格式,在这里不写后缀名 \n动画必须放在animates目录下;文件名不能使用中文,不能带空格或特殊字符 \n \"jianji\", \"thunder\" \n 根据需求自行添加"
|
"_data": "在此存放所有可能使用的动画,必须是animate格式,在这里不写后缀名 \n动画必须放在animates目录下;文件名不能使用中文,不能带空格或特殊字符 \n \"jianji\", \"thunder\" \n 根据需求自行添加"
|
||||||
},
|
},
|
||||||
"bgms": {
|
"bgms": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "editor.mode.checkUnique(thiseval)",
|
||||||
"_data": "在此存放所有的bgm,和文件名一致。 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
|
"_data": "在此存放所有的bgm,和文件名一致。 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
|
||||||
},
|
},
|
||||||
"sounds": {
|
"sounds": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "editor.mode.checkUnique(thiseval)",
|
||||||
"_data": "在此存放所有的SE,和文件名一致 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
|
"_data": "在此存放所有的SE,和文件名一致 \n音频名不能使用中文,不能带空格或特殊字符;可以直接改名拼音就好"
|
||||||
},
|
},
|
||||||
"startBackground": {
|
"startBackground": {
|
||||||
@ -131,17 +136,20 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"title": {
|
"title": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_string": true,
|
||||||
"_data": "游戏名,将显示在标题页面以及切换楼层的界面中"
|
"_data": "游戏名,将显示在标题页面以及切换楼层的界面中"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_string": true,
|
||||||
"_range": "/^[a-zA-Z0-9_]{1,30}$/.test(thiseval)",
|
"_range": "/^[a-zA-Z0-9_]{1,30}$/.test(thiseval)",
|
||||||
"_data": "游戏的唯一英文标识符。由英文、数字、下划线组成,不能超过30个字符。\n此项必须修改,其将直接影响到存档的定位!"
|
"_data": "游戏的唯一英文标识符。由英文、数字、下划线组成,不能超过30个字符。\n此项必须修改,其将直接影响到存档的定位!"
|
||||||
},
|
},
|
||||||
"version": {
|
"version": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_string": true,
|
||||||
"_data": "当前游戏版本;版本不一致的存档不能通用。"
|
"_data": "当前游戏版本;版本不一致的存档不能通用。"
|
||||||
},
|
},
|
||||||
"floorId": {
|
"floorId": {
|
||||||
@ -160,6 +168,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"name": {
|
"name": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_string": true,
|
||||||
"_data": "勇士名;可以改成喜欢的"
|
"_data": "勇士名;可以改成喜欢的"
|
||||||
},
|
},
|
||||||
"lv": {
|
"lv": {
|
||||||
@ -211,6 +220,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"equipment": {
|
"equipment": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "thiseval instanceof Array",
|
||||||
"_data": "初始装上的装备,此处建议请直接留空数组"
|
"_data": "初始装上的装备,此处建议请直接留空数组"
|
||||||
},
|
},
|
||||||
"items": {
|
"items": {
|
||||||
@ -220,21 +230,25 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"keys": {
|
"keys": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
|
||||||
"_data": "初始三种钥匙个数"
|
"_data": "初始三种钥匙个数"
|
||||||
},
|
},
|
||||||
"constants": {
|
"constants": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
|
||||||
"_data": "初始永久道具个数,例如初始送手册可以写 {\"book\": 1}"
|
"_data": "初始永久道具个数,例如初始送手册可以写 {\"book\": 1}"
|
||||||
},
|
},
|
||||||
"tools": {
|
"tools": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
|
||||||
"_data": "初始消耗道具个数,例如初始有两破可以写 {\"pickaxe\": 2}"
|
"_data": "初始消耗道具个数,例如初始有两破可以写 {\"pickaxe\": 2}"
|
||||||
},
|
},
|
||||||
"equips": {
|
"equips": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
|
||||||
"_data": "初始装备个数,例如初始送铁剑可以写 {\"sword1\": 1}"
|
"_data": "初始装备个数,例如初始送铁剑可以写 {\"sword1\": 1}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -242,6 +256,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"flyRange": {
|
"flyRange": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "thiseval instanceof Array",
|
||||||
"_data": "初始可飞的楼层;一般留空数组即可"
|
"_data": "初始可飞的楼层;一般留空数组即可"
|
||||||
},
|
},
|
||||||
"loc": {
|
"loc": {
|
||||||
@ -276,6 +291,7 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
|
|||||||
"flags": {
|
"flags": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "textarea",
|
"_type": "textarea",
|
||||||
|
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
|
||||||
"_data": "游戏过程中的变量或flags"
|
"_data": "游戏过程中的变量或flags"
|
||||||
},
|
},
|
||||||
"steps": {
|
"steps": {
|
||||||
|
|||||||
@ -1166,7 +1166,21 @@ editor_mode = function (editor) {
|
|||||||
if(editor.isMobile)editor.showdataarea(false);
|
if(editor.isMobile)editor.showdataarea(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
editor_mode.checkUnique = function (thiseval) {
|
||||||
|
if (!(thiseval instanceof Array)) return false;
|
||||||
|
var map = {};
|
||||||
|
for (var i = 0; i<thiseval.length; ++i) {
|
||||||
|
if (map[thiseval[i]]) {
|
||||||
|
alert("警告:存在重复定义!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
map[thiseval[i]] = true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
editor_mode.checkFloorIds = function(thiseval){
|
editor_mode.checkFloorIds = function(thiseval){
|
||||||
|
if (!editor_mode.checkUnique(thiseval)) return false;
|
||||||
var oldvalue = data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main.floorIds;
|
var oldvalue = data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.main.floorIds;
|
||||||
fs.readdir('project/floors',function(err, data){
|
fs.readdir('project/floors',function(err, data){
|
||||||
if(err){
|
if(err){
|
||||||
@ -1186,7 +1200,7 @@ editor_mode = function (editor) {
|
|||||||
printe(objs_.slice(-1)[0]);
|
printe(objs_.slice(-1)[0]);
|
||||||
throw(objs_.slice(-1)[0])
|
throw(objs_.slice(-1)[0])
|
||||||
}
|
}
|
||||||
;printe('已放弃floorIds的修改');
|
;printe('已放弃floorIds的修改,请F5进行刷新');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user