common event-create

create js file&obj, load them in main and editor_file
This commit is contained in:
YouWei Zhao 2019-01-31 16:56:08 -05:00
parent a30cbf00ad
commit ed9550a773
5 changed files with 38 additions and 2 deletions

View File

@ -7,6 +7,7 @@ editor_file = function (editor, callback) {
'comment': 'comment',
'data.comment': 'dataComment',
'functions.comment': 'functionsComment',
'events.comment': 'eventsComment',
}
for (var key in commentjs) {
(function (key) {

30
_server/events.comment.js Normal file
View File

@ -0,0 +1,30 @@
var events_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
{
"_type": "object",
"_data": function (key) {
var obj = {
"addPoint": {
"_leaf": true,
"_type": "event",
"_range": "thiseval instanceof Array",
"_event": "commonEvent",
"_data": "加点事件,可以双击进入事件编辑器"
},
"test": {
"_leaf": true,
"_type": "event",
"_range": "thiseval instanceof Array",
"_event": "commonEvent",
"_data": "测试事件, events.comment.js中标记了_range不能为null, 所以应该无法删除"
},
}
if (obj[key]) return obj[key];
return {
"_leaf": true,
"_type": "event",
"_event": "commonEvent",
"_data": "自定义公共事件,可以双击进入事件编辑器"
}
}
}

View File

@ -1,4 +1,4 @@
var maps_comment_90f36752_8815_4be8_b32b_d7fad1d0542e =
var maps_comment_c456ea59_6018_45ef_8bcc_211a24c627dc =
{
////////////////////////// 地形部分 //////////////////////////

View File

@ -75,7 +75,7 @@ function main() {
'loader', 'control', 'utils', 'items', 'icons', 'maps', 'enemys', 'events', 'actions', 'data', 'ui', 'core'
];
this.pureData = [
'data', 'enemys', 'icons', 'maps', 'items', 'functions'
'data', 'enemys', 'icons', 'maps', 'items', 'functions', 'events'
];
this.materials = [
'animates', 'enemys', 'hero', 'items', 'npcs', 'terrains', 'enemy48', 'npc48'

5
project/events.js Normal file
View File

@ -0,0 +1,5 @@
var events_c12a15a8_c380_4b28_8144_256cba95f760 =
{
"test": ["应该无法删除"],
"test2": ["应该可以删除"]
}