Fix bugs
This commit is contained in:
parent
51fd30c14c
commit
f16f9b5855
@ -452,8 +452,9 @@ actions.prototype._sys_keyUp = function (keyCode, altKey) {
|
|||||||
|
|
||||||
////// 点击(触摸)事件按下时 //////
|
////// 点击(触摸)事件按下时 //////
|
||||||
actions.prototype.ondown = function (loc) {
|
actions.prototype.ondown = function (loc) {
|
||||||
var x = parseInt(loc.x / loc.size), y = parseInt(loc.y / loc.size);
|
var lx = Math.max(loc.x, 0), ly = Math.max(loc.y, 0);
|
||||||
var px = parseInt(loc.x / core.domStyle.scale), py = parseInt(loc.y / core.domStyle.scale);
|
var x = parseInt(lx / loc.size), y = parseInt(ly / loc.size);
|
||||||
|
var px = parseInt(lx / core.domStyle.scale), py = parseInt(ly / core.domStyle.scale);
|
||||||
this.doRegisteredAction('ondown', x, y, px, py);
|
this.doRegisteredAction('ondown', x, y, px, py);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -518,8 +518,9 @@ control.prototype._setAutomaticRoute_isMoving = function (destX, destY) {
|
|||||||
control.prototype._setAutomaticRoute_isTurning = function (destX, destY, stepPostfix) {
|
control.prototype._setAutomaticRoute_isTurning = function (destX, destY, stepPostfix) {
|
||||||
if (destX == core.status.hero.loc.x && destY == core.status.hero.loc.y && stepPostfix.length==0) {
|
if (destX == core.status.hero.loc.x && destY == core.status.hero.loc.y && stepPostfix.length==0) {
|
||||||
if (core.timeout.turnHeroTimeout==null) {
|
if (core.timeout.turnHeroTimeout==null) {
|
||||||
|
var routeLength = core.status.route.length;
|
||||||
core.timeout.turnHeroTimeout = setTimeout(function() {
|
core.timeout.turnHeroTimeout = setTimeout(function() {
|
||||||
core.turnHero();
|
if (core.status.route.length == routeLength) core.turnHero();
|
||||||
clearTimeout(core.timeout.turnHeroTimeout);
|
clearTimeout(core.timeout.turnHeroTimeout);
|
||||||
core.timeout.turnHeroTimeout = null;
|
core.timeout.turnHeroTimeout = null;
|
||||||
}, 250);
|
}, 250);
|
||||||
@ -974,7 +975,7 @@ control.prototype.moveViewport = function (x, y, time, callback) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var px = core.clamp(32 * x, 0, 32 * core.bigmap.width - core.__PIXELS__);
|
var px = core.clamp(32 * x, 0, 32 * core.bigmap.width - core.__PIXELS__);
|
||||||
var py = core.clamp(32 * y, 0, 32 * core.bigmap.width - core.__PIXELS__);
|
var py = core.clamp(32 * y, 0, 32 * core.bigmap.height - core.__PIXELS__);
|
||||||
var dx = (px - core.bigmap.offsetX) / step, dy = (py - core.bigmap.offsetY) / step;
|
var dx = (px - core.bigmap.offsetX) / step, dy = (py - core.bigmap.offsetY) / step;
|
||||||
|
|
||||||
var animate=window.setInterval(function() {
|
var animate=window.setInterval(function() {
|
||||||
@ -1389,7 +1390,7 @@ control.prototype.rewindReplay = function () {
|
|||||||
"animate": false,
|
"animate": false,
|
||||||
"toReplay": data.replay.toReplay,
|
"toReplay": data.replay.toReplay,
|
||||||
"totalList": data.replay.totalList,
|
"totalList": data.replay.totalList,
|
||||||
"speed": data.replay.speed,
|
"speed": core.status.replay.speed,
|
||||||
"steps": data.replay.steps,
|
"steps": data.replay.steps,
|
||||||
"save": save
|
"save": save
|
||||||
}
|
}
|
||||||
@ -1548,7 +1549,6 @@ control.prototype._replay_save = function () {
|
|||||||
core.status.replay.save.push({"data": core.saveData(), "replay": {
|
core.status.replay.save.push({"data": core.saveData(), "replay": {
|
||||||
"totalList": core.cloneArray(core.status.replay.totalList),
|
"totalList": core.cloneArray(core.status.replay.totalList),
|
||||||
"toReplay": core.cloneArray(core.status.replay.toReplay),
|
"toReplay": core.cloneArray(core.status.replay.toReplay),
|
||||||
"speed": core.status.replay.speed,
|
|
||||||
"steps": core.status.replay.steps
|
"steps": core.status.replay.steps
|
||||||
}});
|
}});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1724,6 +1724,7 @@ maps.prototype.showBlock = function (x, y, floorId) {
|
|||||||
if (block.disable) {
|
if (block.disable) {
|
||||||
block.disable = false;
|
block.disable = false;
|
||||||
core.setMapBlockDisabled(floorId, x, y, false);
|
core.setMapBlockDisabled(floorId, x, y, false);
|
||||||
|
this._updateMapArray(floorId, block.x, block.y);
|
||||||
// 在本层,添加动画
|
// 在本层,添加动画
|
||||||
if (floorId == core.status.floorId) {
|
if (floorId == core.status.floorId) {
|
||||||
if (block.event.cls == 'autotile') {
|
if (block.event.cls == 'autotile') {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user