editor help & plugin new function
This commit is contained in:
parent
ddac388dd0
commit
10fc179934
@ -94,6 +94,8 @@ editor_multi = function () {
|
|||||||
editor_multi.lintAutocomplete = false;
|
editor_multi.lintAutocomplete = false;
|
||||||
if (args.lint === true) editor_multi.lintAutocomplete = true;
|
if (args.lint === true) editor_multi.lintAutocomplete = true;
|
||||||
if (field.indexOf('Effect') !== -1) editor_multi.lintAutocomplete = true;
|
if (field.indexOf('Effect') !== -1) editor_multi.lintAutocomplete = true;
|
||||||
|
if ((!input.value || input.value == 'null') && editor_mode.mode == 'plugins')
|
||||||
|
input.value = '"function () {\\n\\t// 在此增加新插件\\n\\t\\n}"';
|
||||||
if (input.value.slice(0, 1) === '"' || args.string) {
|
if (input.value.slice(0, 1) === '"' || args.string) {
|
||||||
editor_multi.isString = true;
|
editor_multi.isString = true;
|
||||||
codeEditor.setValue(JSON.parse(input.value) || '');
|
codeEditor.setValue(JSON.parse(input.value) || '');
|
||||||
|
|||||||
@ -379,17 +379,44 @@ editor.constructor.prototype.listen=function () {
|
|||||||
}
|
}
|
||||||
var focusElement = document.activeElement;
|
var focusElement = document.activeElement;
|
||||||
if (!focusElement || focusElement.tagName.toLowerCase()=='body') {
|
if (!focusElement || focusElement.tagName.toLowerCase()=='body') {
|
||||||
// wasd平移大地图
|
switch (e.keyCode) {
|
||||||
if (e.keyCode==87)
|
// WASD
|
||||||
editor.moveViewport(0,-1)
|
case 87: editor.moveViewport(0,-1); break;
|
||||||
else if (e.keyCode==65)
|
case 65: editor.moveViewport(-1,0); break;
|
||||||
editor.moveViewport(-1,0)
|
case 83: editor.moveViewport(0,1); break;
|
||||||
else if (e.keyCode==83)
|
case 68: editor.moveViewport(1,0); break;
|
||||||
editor.moveViewport(0,1);
|
// Z~.
|
||||||
else if (e.keyCode==68)
|
case 90: editor_mode.change('map'); break; // Z
|
||||||
editor.moveViewport(1,0);
|
case 88: editor_mode.change('loc'); break; // X
|
||||||
|
case 67: editor_mode.change('enemyitem'); break; // C
|
||||||
|
case 86: editor_mode.change('floor'); break; // V
|
||||||
|
case 66: editor_mode.change('tower'); break; // B
|
||||||
|
case 78: editor_mode.change('functions'); break; // N
|
||||||
|
case 77: editor_mode.change('appendpic'); break; // M
|
||||||
|
case 188: editor_mode.change('commonevent'); break; // ,
|
||||||
|
case 190: editor_mode.change('plugins'); break; // .
|
||||||
|
// H
|
||||||
|
case 72: editor.showHelp(); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
editor.showHelp = function () {
|
||||||
|
alert(
|
||||||
|
"快捷操作帮助:\n" +
|
||||||
|
"点击空白处:自动保存当前修改" +
|
||||||
|
"WASD / 长按箭头:平移大地图\n" +
|
||||||
|
"PgUp, PgDn / 鼠标滚轮:上下切换楼层\n" +
|
||||||
|
"Z~.(键盘的第三排):快捷切换标签\n" +
|
||||||
|
"双击地图:选中对应点的素材\n" +
|
||||||
|
"右键地图:弹出菜单栏\n" +
|
||||||
|
"Alt+0~9:保存当前使用的图块\n" +
|
||||||
|
"Ctrl+0~9:选中保存的图块\n" +
|
||||||
|
"Ctrl+Z / Ctrl+Y:撤销/重做上次绘制\n" +
|
||||||
|
"Ctrl+S:事件与脚本编辑器的保存并退出\n" +
|
||||||
|
"双击事件编辑器:长文本编辑/脚本编辑/地图选点/UI绘制预览"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
var getScrollBarHeight = function () {
|
var getScrollBarHeight = function () {
|
||||||
var outer = document.createElement("div");
|
var outer = document.createElement("div");
|
||||||
@ -780,7 +807,7 @@ editor.constructor.prototype.listen=function () {
|
|||||||
}, 500);
|
}, 500);
|
||||||
};
|
};
|
||||||
node.onmouseup = function () {
|
node.onmouseup = function () {
|
||||||
if (pressTimer >= 0) {
|
if (pressTimer > 0) {
|
||||||
clearTimeout(pressTimer);
|
clearTimeout(pressTimer);
|
||||||
move();
|
move();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -568,11 +568,14 @@ editor_unsorted_2_wrapper=function(editor_mode){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
editor_mode.change = function (value) {
|
||||||
|
editor_mode.onmode('nextChange');
|
||||||
|
editor_mode.onmode(value);
|
||||||
|
if(editor.isMobile)editor.showdataarea(false);
|
||||||
|
}
|
||||||
var editModeSelect = document.getElementById('editModeSelect');
|
var editModeSelect = document.getElementById('editModeSelect');
|
||||||
editModeSelect.onchange = function () {
|
editModeSelect.onchange = function () {
|
||||||
editor_mode.onmode('nextChange');
|
editor_mode.change(editModeSelect.value);
|
||||||
editor_mode.onmode(editModeSelect.value);
|
|
||||||
if(editor.isMobile)editor.showdataarea(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
editor_mode.checkUnique = function (thiseval) {
|
editor_mode.checkUnique = function (thiseval) {
|
||||||
|
|||||||
@ -207,10 +207,11 @@ printe = function (str_) {
|
|||||||
printf(str_, 'error')
|
printf(str_, 'error')
|
||||||
}
|
}
|
||||||
tip_in_showMode = [
|
tip_in_showMode = [
|
||||||
'涉及图片的更改需要F5刷新浏览器来生效',
|
'表格的文本域可以双击进行编辑',
|
||||||
'文本域可以通过双击,在文本编辑器或事件编辑器中编辑',
|
'双击地图可以选中素材,右键可以弹出菜单',
|
||||||
'事件编辑器中的显示文本和自定义脚本的方块也可以双击',
|
'双击事件编辑器的图块可以进行长文本编辑/脚本编辑/地图选点/UI绘制预览等操作',
|
||||||
"画出的地图要点击\"保存地图\"才会写入到文件中",
|
'点击空白处可以自动保存当前修改',
|
||||||
|
'H键可以打开操作帮助哦',
|
||||||
];
|
];
|
||||||
tip=document.getElementById('tip')
|
tip=document.getElementById('tip')
|
||||||
tip._infos= {}
|
tip._infos= {}
|
||||||
@ -536,7 +537,7 @@ uievent.move = function (dx, dy) {
|
|||||||
}, 500);
|
}, 500);
|
||||||
};
|
};
|
||||||
node.onmouseup = function () {
|
node.onmouseup = function () {
|
||||||
if (pressTimer >= 0) {
|
if (pressTimer > 0) {
|
||||||
clearTimeout(pressTimer);
|
clearTimeout(pressTimer);
|
||||||
move();
|
move();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user