修改id后移除最近使用素材

This commit is contained in:
ckcz123 2021-07-20 18:03:11 +08:00
parent bb0b2e8f51
commit 839c6e502b
2 changed files with 12 additions and 1 deletions

View File

@ -627,7 +627,10 @@ editor.prototype.drawInitData = function (icons) {
editor.uivalues.foldPerCol = editor.config.get('foldPerCol', 50);
// var imgNames = Object.keys(images); //还是固定顺序吧;
editor.setLastUsedType(editor.config.get('lastUsedType', 'recent'));
editor.uivalues.lastUsed = editor.config.get("lastUsed", []);
var ids = editor.ids.map(function (x) {return x.id || "";});
editor.uivalues.lastUsed = editor.config.get("lastUsed", []).filter(function (one) {
return ids.indexOf(one.id) >= 0;
});
var imgNames = ["terrains", "animates", "enemys", "enemy48", "items", "npcs", "npc48", "autotile"];
for (var ii = 0; ii < imgNames.length; ii++) {

View File

@ -334,6 +334,14 @@ editor_datapanel_wrapper = function (editor) {
printe('不得使用保留关键字作为id');
return;
}
if (editor_mode.info.images == 'autotile') {
printe('自动元件不可修改id');
return;
}
if (editor_mode.info.idnum >= 10000) {
printe('额外素材不可修改id');
return;
}
editor.file.changeIdAndIdnum(id, null, editor_mode.info, function (err) {
if (err) {
printe(err);