diff --git a/libs/events.js b/libs/events.js index 2befed36..546e3bb3 100644 --- a/libs/events.js +++ b/libs/events.js @@ -1149,7 +1149,7 @@ events.prototype._action_openDoor = function (data, x, y, prefix) { events.prototype._action_closeDoor = function (data, x, y, prefix) { var loc = this.__action_getLoc(data.loc, x, y, prefix); - core.closeDoor(loc[0], loc[1], data.id, core.doAction); + this.__action_doAsyncFunc(data.async, core.closeDoor, loc[0], loc[1], data.id); } events.prototype._action_useItem = function (data, x, y, prefix) { diff --git a/libs/maps.js b/libs/maps.js index bdac2f51..fe9fd6bf 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -91,6 +91,9 @@ maps.prototype.initBlock = function (x, y, id, addInfo, eventFloor) { else if (core.icons.getTilesetOffset(id)) block.event = {"cls": "tileset", "id": "X" + id, "noPass": true}; else block.event = {'cls': 'terrains', 'id': 'none', 'noPass': false}; + if (typeof block.event.noPass === 'string') + block.event.noPass = JSON.parse(block.event.noPass); + if (addInfo) this._addInfo(block); if (eventFloor) { this._addEvent(block, x, y, (eventFloor.events || {})[x + "," + y]); @@ -1447,8 +1450,13 @@ maps.prototype.setBlock = function (number, x, y, floorId) { else number = core.getNumberById(number); } - var originBlock = core.getBlock(x, y, floorId, true); var block = this.initBlock(x, y, number, true, core.floors[floorId]); + if (block.id == 0 && !block.event.trigger) { + // 转变图块为0且该点无事件,视为隐藏 + core.removeBlock(x, y, floorId); + return; + } + var originBlock = core.getBlock(x, y, floorId, true); if (floorId == core.status.floorId) { core.removeGlobalAnimate(x, y); core.clearMap('event', x * 32, y * 32, 32, 32); diff --git a/libs/ui.js b/libs/ui.js index aca20dd8..6f990152 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -467,6 +467,11 @@ ui.prototype.drawWindowSelector = function(background, x, y, w, h) { ////// 绘制 WindowSkin ui.prototype.drawWindowSkin = function(background, ctx, x, y, w, h, direction, px, py) { + background = background || core.status.textAttribute.background; + if (typeof background == 'string') { + background = core.getMappedName(background); + background = core.material.images.images[background]; + } // 仿RM窗口皮肤 ↓ var dstImage = core.getContextByName(ctx); if (!dstImage) return;