Deploying to gh-pages from @ ae3d62211e 🚀

This commit is contained in:
unanmed committed 2023-01-04 08:25:31 +00:00
1 parent 13f055451d
commit 9fe9888e13
18 files changed
+650 -965

No files matched your search

+10 -2
View File
@@ -19,6 +19,7 @@ control.prototype._init = function () {
this.weathers = {};
this.resizes = [];
this.noAutoEvents = true;
this.updateNextFrame = false;
// --- 注册系统的animationFrame
this.registerAnimationFrame(
'totalTime',
@@ -3862,16 +3863,23 @@ control.prototype.clearStatusBar = function () {
////// 更新状态栏 //////
control.prototype.updateStatusBar = function (doNotCheckAutoEvents, immediate) {
if (!core.isPlaying()) return;
if (immediate) {
return this.updateStatusBar_update();
}
if (!doNotCheckAutoEvents) this.noAutoEvents = false;
if (core.isReplaying()) return this.updateStatusBar_update();
requestAnimationFrame(this.updateStatusBar_update);
if (!core.control.updateNextFrame) {
core.control.updateNextFrame = true;
requestAnimationFrame(this.updateStatusBar_update);
}
};
control.prototype.updateStatusBar_update = function () {
if (!core.isPlaying() || core.hasFlag('__statistics__')) return;
core.control.updateNextFrame = false;
if (!core.isPlaying() || core.hasFlag('__statistics__')) {
return;
}
core.control.controldata.updateStatusBar();
if (!core.control.noAutoEvents) core.checkAutoEvents();
core.control._updateStatusBar_setToolboxIcon();
+13 -11
View File
@@ -3186,13 +3186,13 @@ maps.prototype.removeBlock = function (x, y, floorId) {
if (!floorId) return false;
core.extractBlocks(floorId);
for (var i in core.status.maps[floorId].blocks) {
var block = core.status.maps[floorId].blocks[i];
if (block.x == x && block.y == y) {
this.removeBlockByIndex(i, floorId);
this._removeBlockFromMap(floorId, block);
return true;
}
const blocks = core.status.maps[floorId].blocks;
const i = blocks.findIndex(v => v.x === x && v.y === y);
if (i !== -1) {
const block = blocks[i];
this.removeBlockByIndex(i, floorId);
this._removeBlockFromMap(floorId, block);
return true;
}
return false;
};
@@ -3295,7 +3295,7 @@ maps.prototype._triggerFloorImage = function (type, loc, floorId, callback) {
};
////// 改变图块 //////
maps.prototype.setBlock = function (number, x, y, floorId) {
maps.prototype.setBlock = function (number, x, y, floorId, noredraw) {
floorId = floorId || core.status.floorId;
if (!floorId || number == null || x == null || y == null) return;
if (
@@ -3334,7 +3334,7 @@ maps.prototype.setBlock = function (number, x, y, floorId) {
// 有任何一个是autotile直接重绘地图
if (
(originEvent != null && originEvent.cls == 'autotile') ||
block.event.cls == 'autotile'
(block.event.cls == 'autotile' && !noredraw)
) {
core.redrawMap();
} else {
@@ -3346,8 +3346,10 @@ maps.prototype.setBlock = function (number, x, y, floorId) {
});
}
if (!block.disable) {
core.drawBlock(block);
core.addGlobalAnimate(block);
if (!noredraw) {
core.drawBlock(block);
core.addGlobalAnimate(block);
}
core.updateStatusBar();
}
}