diff --git a/_server/editor_file_unsorted.js b/_server/editor_file_unsorted.js index 27d4e7aa..80c34c3a 100644 --- a/_server/editor_file_unsorted.js +++ b/_server/editor_file_unsorted.js @@ -70,7 +70,8 @@ editor_file = function (editor, callback) { name = saveFilename.substring(2); title = "主塔 "+name+" 层"; } - editor.currentFloorData = { + // editor.file.comment._data.floors_template + editor.currentFloorData = Object.assign(JSON.parse(JSON.stringify(editor.file.comment._data.floors_template)), { floorId: saveFilename, title: title, name: name, @@ -80,24 +81,13 @@ editor_file = function (editor, callback) { canUseQuickShop: saveStatus?currData.canUseQuickShop:true, cannotViewMap: saveStatus?currData.cannotViewMap:false, cannotMoveDirectly: saveStatus?currData.cannotMoveDirectly:false, - images: [], item_ratio: saveStatus?currData.item_ratio:1, defaultGround: saveStatus?currData.defaultGround:"ground", bgm: saveStatus?currData.bgm:null, - upFloor: null, - downFloor: null, color: saveStatus?currData.color:null, weather: saveStatus?currData.weather:null, - firstArrive: [], - eachArrive: [], - parallelDo: "", - events: {}, - changeFloor: {}, - afterBattle: {}, - afterGetItem: {}, - afterOpenDoor: {}, - cannotMove: {} - }; + }); + Object.keys(editor.currentFloorData).forEach(function (t) { if (editor.currentFloorData[t] == null) delete editor.currentFloorData[t]; @@ -128,7 +118,7 @@ editor_file = function (editor, callback) { var datas = []; for (var i=from;i<=to;i++) { var datastr = ['main.floors.', floorIdList[i-from], '=\n{']; - var data = { + var data = Object.assign(JSON.parse(JSON.stringify(editor.file.comment._data.floors_template)), { floorId: floorIdList[i-from], title: calValue(document.getElementById('newFloorTitles').value, i), name: calValue(document.getElementById('newFloorNames').value, i), @@ -139,24 +129,12 @@ editor_file = function (editor, callback) { canUseQuickShop: saveStatus?currData.canUseQuickShop:true, cannotViewMap: saveStatus?currData.cannotViewMap:false, cannotMoveDirectly: saveStatus?currData.cannotMoveDirectly:false, - images: [], item_ratio: saveStatus?currData.item_ratio:1, defaultGround: saveStatus?currData.defaultGround:"ground", bgm: saveStatus?currData.bgm:null, - upFloor: null, - downFloor: null, color: saveStatus?currData.color:null, weather: saveStatus?currData.weather:null, - firstArrive: [], - eachArrive: [], - parallelDo: "", - events: {}, - changeFloor: {}, - afterBattle: {}, - afterGetItem: {}, - afterOpenDoor: {}, - cannotMove: {} - }; + }); Object.keys(data).forEach(function (t) { if (data[t] == null) delete data[t]; diff --git a/_server/table/comment.js b/_server/table/comment.js index ff09aa48..d5d72cf8 100644 --- a/_server/table/comment.js +++ b/_server/table/comment.js @@ -230,7 +230,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_type": "select", "_select": { "values": [ - null, + "null", "openDoor", "passNet", "changeLight", @@ -245,9 +245,9 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { "_type": "select", "_select": { "values": [ - null, - true, - false + "null", + "true", + "false" ] }, "_data": "该图块是否不可通行;true代表不可通行,false代表可通行,null代表使用系统缺省值" @@ -462,6 +462,35 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = { } } } + }, + + "floors_template": { + "floorId": "to be covered", + "title": "new floor", + "name": "new floor", + "width": 13, + "height": 13, + "canFlyTo": true, + "canUseQuickShop": true, + "cannotViewMap": false, + "cannotMoveDirectly": false, + "images": [], + "item_ratio": 1, + "defaultGround": "ground", + "bgm": null, + "upFloor": null, + "downFloor": null, + "color": null, + "weather": null, + "firstArrive": [], + "eachArrive": [], + "parallelDo": "", + "events": {}, + "changeFloor": {}, + "afterBattle": {}, + "afterGetItem": {}, + "afterOpenDoor": {}, + "cannotMove": {} } } } \ No newline at end of file