diff --git a/libs/actions.js b/libs/actions.js index a43b19ce..d43972f8 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -308,7 +308,7 @@ actions.prototype.ondown = function (loc) { // 画板 if (core.status.played && (core.status.event||{}).id=='paint') { - this.ondownPaint(loc.x, loc.y); + this.ondownPaint(loc.x/core.domStyle.scale, loc.y/core.domStyle.scale); return; } @@ -346,7 +346,7 @@ actions.prototype.onmove = function (loc) { // 画板 if (core.status.played && (core.status.event||{}).id=='paint') { - this.onmovePaint(loc.x, loc.y) + this.onmovePaint(loc.x/core.domStyle.scale, loc.y/core.domStyle.scale) return; } @@ -376,6 +376,12 @@ actions.prototype.onup = function () { if (core.isset(core.status.replay)&&core.status.replay.replaying &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return; + // 画板 + if (core.status.played && (core.status.event||{}).id=='paint') { + this.onupPaint() + return; + } + clearTimeout(core.timeout.onDownTimeout); core.timeout.onDownTimeout = null; clearInterval(core.interval.onDownInterval); @@ -2412,7 +2418,7 @@ actions.prototype.clickAbout = function () { if (core.isPlaying()) core.ui.closePanel(); else - core.restart(); + core.restart(true); } diff --git a/libs/control.js b/libs/control.js index f7a8f576..541c503a 100644 --- a/libs/control.js +++ b/libs/control.js @@ -335,8 +335,8 @@ control.prototype.resetStatus = function(hero, hard, floorId, route, maps, value } ////// 重新开始游戏;此函数将回到标题页面 ////// -control.prototype.restart = function() { - this.showStartAnimate(true); +control.prototype.restart = function(noAnimate) { + this.showStartAnimate(noAnimate); if (core.bgms.length>0) core.playBgm(core.bgms[0]); } @@ -1669,7 +1669,7 @@ control.prototype.chooseReplayFile = function () { return; } - core.startGame(obj.hard, obj.seed, core.decode(obj.route)); + core.startGame(obj.hard, obj.seed, core.decodeRoute(obj.route)); }, function () { }) diff --git a/libs/core.js b/libs/core.js index bda156dc..35186832 100644 --- a/libs/core.js +++ b/libs/core.js @@ -362,8 +362,8 @@ core.prototype.startGame = function (hard, seed, route, callback) { } ////// 重新开始游戏;此函数将回到标题页面 ////// -core.prototype.restart = function() { - core.control.restart(); +core.prototype.restart = function(noAnimate) { + core.control.restart(noAnimate); } /////////// 系统事件相关 END /////////// diff --git a/libs/ui.js b/libs/ui.js index 1d02d218..80292eef 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -2468,7 +2468,7 @@ ui.prototype.drawPaint = function () { core.statusBar.image.book.src = core.statusBar.icons.paint.src; core.statusBar.image.fly.src = core.statusBar.icons.erase.src; - core.statusBar.image.toolbox.src = core.statusBar.icons.delete.src; + core.statusBar.image.toolbox.src = core.statusBar.icons.empty.src; core.statusBar.image.settings.src = core.statusBar.icons.exit.src; core.statusBar.image.book.style.opacity = 1; core.statusBar.image.fly.style.opacity = 1; diff --git a/main.js b/main.js index f82481fd..45ccd438 100644 --- a/main.js +++ b/main.js @@ -130,7 +130,7 @@ function main() { 'skill': 25, 'paint': 26, 'erase': 27, - 'delete': 28, + 'empty': 28, 'exit': 29, }, 'floor': document.getElementById('floor'), @@ -381,8 +381,9 @@ main.dom.data.ontouchmove = function (e) { } ////// 手指离开触摸屏时 ////// -main.dom.data.ontouchend = function () { +main.dom.data.ontouchend = function (e) { try { + e.preventDefault(); main.core.onup(); } catch (e) { }