diff --git a/libs/control.js b/libs/control.js index a3386870..49948869 100644 --- a/libs/control.js +++ b/libs/control.js @@ -911,6 +911,7 @@ control.prototype.setHeroOpacity = function (opacity, moveMode, time, callback) } }, 10); + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = callback; } @@ -1031,6 +1032,7 @@ control.prototype.moveViewport = function (x, y, moveMode, time, callback) { } }, per_time); + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = callback; } @@ -2759,6 +2761,7 @@ control.prototype._setCurtain_animate = function (nowColor, color, time, moveMod } }, per_time); + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = cb; } diff --git a/libs/core.js b/libs/core.js index d0d0a039..adcf37ab 100644 --- a/libs/core.js +++ b/libs/core.js @@ -54,7 +54,8 @@ function core() { 'sun': null }, "tip": null, - "asyncId": {} + "asyncId": {}, + "lastAsyncId": null } this.musicStatus = { 'audioContext': null, // WebAudioContext diff --git a/libs/events.js b/libs/events.js index 7687f9e1..7db1508c 100644 --- a/libs/events.js +++ b/libs/events.js @@ -600,6 +600,8 @@ events.prototype._openDoor_animate = function (block, x, y, callback) { } core.maps._drawBlockInfo(blockInfo, x, y); }, core.status.replay.speed == 24 ? 1 : speed / Math.max(core.status.replay.speed, 1)); + + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = cb; } @@ -3184,6 +3186,8 @@ events.prototype._moveTextBox_moving = function (ctx, moveInfo, callback) { if (callback) callback(); } }, 10); + + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = callback; } @@ -3248,6 +3252,8 @@ events.prototype.closeDoor = function (x, y, id, callback) { } core.maps._drawBlockInfo(blockInfo, x, y); }, core.status.replay.speed == 24 ? 1 : speed / Math.max(core.status.replay.speed, 1)); + + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = cb; } @@ -3357,6 +3363,8 @@ events.prototype._moveImage_moving = function (name, moveInfo, callback) { if (callback) callback(); } }, per_time); + + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = callback; } @@ -3400,6 +3408,8 @@ events.prototype._rotateImage_rotating = function (name, rotateInfo, callback) { if (callback) callback(); } }, per_time); + + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = callback; } @@ -3459,6 +3469,8 @@ events.prototype._scaleImage_scale = function (ctx, scaleInfo, callback) { if (callback) callback(); } }, per_time); + + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = callback; } @@ -3506,6 +3518,8 @@ events.prototype.setVolume = function (value, time, callback) { if (callback) callback(); } }, per_time); + + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = callback; } @@ -3541,6 +3555,7 @@ events.prototype.vibrate = function (direction, time, speed, power, callback) { } }, 10); + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = cb; } @@ -3600,6 +3615,7 @@ events.prototype.eventMoveHero = function(steps, time, callback) { } }, core.status.replay.speed == 24 ? 1 : time / 8 / core.status.replay.speed); + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = cb; } _run(); @@ -3674,6 +3690,7 @@ events.prototype._jumpHero_doJump = function (jumpInfo, callback) { } }, jumpInfo.per_time); + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = cb; } diff --git a/libs/maps.js b/libs/maps.js index daf4537f..a4d36b68 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -2622,6 +2622,8 @@ maps.prototype._moveBlock_doMove = function (blockInfo, canvases, moveInfo, call else core.maps._moveJumpBlock_finished(blockInfo, canvases, moveInfo, animate, cb); }, moveInfo.per_time); + + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = cb; } _run(); @@ -2754,6 +2756,7 @@ maps.prototype._jumpBlock_doJump = function (blockInfo, canvases, jumpInfo, call core.maps._moveJumpBlock_finished(blockInfo, canvases, jumpInfo, animate, cb); }, jumpInfo.per_time); + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = cb; } @@ -2832,6 +2835,7 @@ maps.prototype._animateBlock_doAnimate = function (loc, list, type, time, callba } }, 10); + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = cb; } diff --git a/libs/ui.js b/libs/ui.js index e680e3f5..f608e292 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -1683,6 +1683,7 @@ ui.prototype._drawScrollText_animate = function (ctx, time, callback) { core.drawImage('ui', ctx.canvas, 0, currH); }, per_time); + core.animateFrame.lastAsyncId = animate; core.animateFrame.asyncId[animate] = callback; }