floors_template

This commit is contained in:
YouWei Zhao 2019-04-23 14:58:15 -04:00
parent 4e102eba6c
commit 057861d826
2 changed files with 39 additions and 32 deletions

View File

@ -70,7 +70,8 @@ editor_file = function (editor, callback) {
name = saveFilename.substring(2); name = saveFilename.substring(2);
title = "主塔 "+name+" 层"; 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, floorId: saveFilename,
title: title, title: title,
name: name, name: name,
@ -80,24 +81,13 @@ editor_file = function (editor, callback) {
canUseQuickShop: saveStatus?currData.canUseQuickShop:true, canUseQuickShop: saveStatus?currData.canUseQuickShop:true,
cannotViewMap: saveStatus?currData.cannotViewMap:false, cannotViewMap: saveStatus?currData.cannotViewMap:false,
cannotMoveDirectly: saveStatus?currData.cannotMoveDirectly:false, cannotMoveDirectly: saveStatus?currData.cannotMoveDirectly:false,
images: [],
item_ratio: saveStatus?currData.item_ratio:1, item_ratio: saveStatus?currData.item_ratio:1,
defaultGround: saveStatus?currData.defaultGround:"ground", defaultGround: saveStatus?currData.defaultGround:"ground",
bgm: saveStatus?currData.bgm:null, bgm: saveStatus?currData.bgm:null,
upFloor: null,
downFloor: null,
color: saveStatus?currData.color:null, color: saveStatus?currData.color:null,
weather: saveStatus?currData.weather:null, weather: saveStatus?currData.weather:null,
firstArrive: [], });
eachArrive: [],
parallelDo: "",
events: {},
changeFloor: {},
afterBattle: {},
afterGetItem: {},
afterOpenDoor: {},
cannotMove: {}
};
Object.keys(editor.currentFloorData).forEach(function (t) { Object.keys(editor.currentFloorData).forEach(function (t) {
if (editor.currentFloorData[t] == null) if (editor.currentFloorData[t] == null)
delete editor.currentFloorData[t]; delete editor.currentFloorData[t];
@ -128,7 +118,7 @@ editor_file = function (editor, callback) {
var datas = []; var datas = [];
for (var i=from;i<=to;i++) { for (var i=from;i<=to;i++) {
var datastr = ['main.floors.', floorIdList[i-from], '=\n{']; 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], floorId: floorIdList[i-from],
title: calValue(document.getElementById('newFloorTitles').value, i), title: calValue(document.getElementById('newFloorTitles').value, i),
name: calValue(document.getElementById('newFloorNames').value, i), name: calValue(document.getElementById('newFloorNames').value, i),
@ -139,24 +129,12 @@ editor_file = function (editor, callback) {
canUseQuickShop: saveStatus?currData.canUseQuickShop:true, canUseQuickShop: saveStatus?currData.canUseQuickShop:true,
cannotViewMap: saveStatus?currData.cannotViewMap:false, cannotViewMap: saveStatus?currData.cannotViewMap:false,
cannotMoveDirectly: saveStatus?currData.cannotMoveDirectly:false, cannotMoveDirectly: saveStatus?currData.cannotMoveDirectly:false,
images: [],
item_ratio: saveStatus?currData.item_ratio:1, item_ratio: saveStatus?currData.item_ratio:1,
defaultGround: saveStatus?currData.defaultGround:"ground", defaultGround: saveStatus?currData.defaultGround:"ground",
bgm: saveStatus?currData.bgm:null, bgm: saveStatus?currData.bgm:null,
upFloor: null,
downFloor: null,
color: saveStatus?currData.color:null, color: saveStatus?currData.color:null,
weather: saveStatus?currData.weather:null, weather: saveStatus?currData.weather:null,
firstArrive: [], });
eachArrive: [],
parallelDo: "",
events: {},
changeFloor: {},
afterBattle: {},
afterGetItem: {},
afterOpenDoor: {},
cannotMove: {}
};
Object.keys(data).forEach(function (t) { Object.keys(data).forEach(function (t) {
if (data[t] == null) if (data[t] == null)
delete data[t]; delete data[t];

View File

@ -230,7 +230,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "select", "_type": "select",
"_select": { "_select": {
"values": [ "values": [
null, "null",
"openDoor", "openDoor",
"passNet", "passNet",
"changeLight", "changeLight",
@ -245,9 +245,9 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "select", "_type": "select",
"_select": { "_select": {
"values": [ "values": [
null, "null",
true, "true",
false "false"
] ]
}, },
"_data": "该图块是否不可通行true代表不可通行false代表可通行null代表使用系统缺省值" "_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": {}
} }
} }
} }