Auto fill new floor title
This commit is contained in:
parent
2b43aaf5cd
commit
b8c6a4fdf7
@ -131,10 +131,18 @@ editor_file = function (editor, callback) {
|
|||||||
};
|
};
|
||||||
var currData=editor.currentFloorData;
|
var currData=editor.currentFloorData;
|
||||||
var saveStatus = document.getElementById('newMapStatus').checked;
|
var saveStatus = document.getElementById('newMapStatus').checked;
|
||||||
|
|
||||||
|
var floorId = saveFilename;
|
||||||
|
var title = saveStatus?currData.title:"新建楼层";
|
||||||
|
var name = saveStatus?currData.name:"0";
|
||||||
|
if (/^mt\d+$/i.test(floorId)) {
|
||||||
|
name = floorId.substring(2);
|
||||||
|
title = "主塔 "+name+" 层";
|
||||||
|
}
|
||||||
editor.currentFloorData = {
|
editor.currentFloorData = {
|
||||||
floorId: saveFilename,
|
floorId: saveFilename,
|
||||||
title: saveStatus?currData.title:"新建楼层",
|
title: title,
|
||||||
name: saveStatus?currData.name:"0",
|
name: name,
|
||||||
width: parseInt(document.getElementById('newMapWidth').value),
|
width: parseInt(document.getElementById('newMapWidth').value),
|
||||||
height: parseInt(document.getElementById('newMapHeight').value),
|
height: parseInt(document.getElementById('newMapHeight').value),
|
||||||
canFlyTo: saveStatus?currData.canFlyTo:true,
|
canFlyTo: saveStatus?currData.canFlyTo:true,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user