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);
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];

View File

@ -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": {}
}
}
}