修复重复注册问题

This commit is contained in:
ckcz123 2021-04-13 15:18:32 +08:00
parent f16f9b5855
commit 5bcf8a5f6d
4 changed files with 9 additions and 16 deletions

View File

@ -191,7 +191,7 @@ editor_datapanel_wrapper = function (editor) {
if (!floorIds) return; if (!floorIds) return;
var from = parseInt(document.getElementById('newMapsFrom').value), var from = parseInt(document.getElementById('newMapsFrom').value),
to = parseInt(document.getElementById('newMapsTo').value); to = parseInt(document.getElementById('newMapsTo').value);
if (!core.isset(from) || !core.isset(to) || from > to || from < 0 || to < 0) { if (!core.isset(from) || !core.isset(to) || from > to) {
printe("请输入有效的起始和终止楼层"); printe("请输入有效的起始和终止楼层");
return; return;
} }

View File

@ -311,13 +311,11 @@ editor_file = function (editor, callback) {
} }
var c=image.toUpperCase().charAt(0); var c=image.toUpperCase().charAt(0);
// terrains id
var terrainsId = [];
Object.keys(core.material.icons.terrains).forEach(function (id) {
terrainsId[core.material.icons.terrains[id]]=id;
})
var allIds = []; var allIds = [];
Object.keys(icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1[image] || {}).forEach(function (v) {
allIds[icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1[image][v]] = v;
});
editor.ids.forEach(function (v) { editor.ids.forEach(function (v) {
if (v.images==image) { if (v.images==image) {
allIds[v.y]=v; allIds[v.y]=v;
@ -339,12 +337,7 @@ editor_file = function (editor, callback) {
// get id num // get id num
var id = c+idnum; var id = c+idnum;
if (image=='terrains' && terrainsId[y] != null) { iconActions.push(["add", "['" + image + "']['" + id + "']", y])
id=terrainsId[y];
}
else {
iconActions.push(["add", "['" + image + "']['" + id + "']", y])
}
mapActions.push(["add", "['" + idnum + "']", {'cls': image, 'id': id}]); mapActions.push(["add", "['" + idnum + "']", {'cls': image, 'id': id}]);
faceIds.push({idnum: idnum, id: id}); faceIds.push({idnum: idnum, id: id});
if (image=='items') if (image=='items')

View File

@ -2387,8 +2387,8 @@ control.prototype.clearRouteFolding = function () {
////// 检查录像折叠 ////// ////// 检查录像折叠 //////
control.prototype.checkRouteFolding = function () { control.prototype.checkRouteFolding = function () {
// 未开启、未开始游戏、正在事件中:不执行 // 未开启、未开始游戏、录像播放中、正在事件中:不执行
if (!core.flags.enableRouteFolding || !core.isPlaying() || core.status.event.id) { if (!core.flags.enableRouteFolding || !core.isPlaying() || core.isReplaying() || core.status.event.id) {
return this.clearRouteFolding(); return this.clearRouteFolding();
} }
var hero = core.clone(core.status.hero, function (name, value) { var hero = core.clone(core.status.hero, function (name, value) {

View File

@ -50,7 +50,7 @@ maps.prototype.loadFloor = function (floorId, map) {
if (map instanceof Array) { if (map instanceof Array) {
map = {"map": map}; map = {"map": map};
} }
if (!map.map) map.map = floor.map; if (!map.map) map.map = core.clone(floor.map);
var content = {}; var content = {};
var notCopy = this._loadFloor_doNotCopy(); var notCopy = this._loadFloor_doNotCopy();
for (var name in floor) { for (var name in floor) {