From fd1349a6643899a2b3b55394701e71249e71e9c4 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Sat, 20 Apr 2019 20:46:27 +0800 Subject: [PATCH] set moveSpeed --- libs/actions.js | 24 ++++++++++++++++++------ libs/control.js | 2 +- libs/core.js | 2 ++ libs/ui.js | 1 + 4 files changed, 22 insertions(+), 7 deletions(-) diff --git a/libs/actions.js b/libs/actions.js index abdfb709..1596ba47 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -1860,18 +1860,20 @@ actions.prototype._clickSwitchs = function (x, y) { case 1: return this._clickSwitchs_sound(); case 2: - return this._clickSwitchs_displayEnemyDamage(); + return this._clickSwitchs_moveSpeed(); case 3: - return this._clickSwitchs_displayCritical(); + return this._clickSwitchs_displayEnemyDamage(); case 4: - return this._clickSwitchs_displayExtraDamage(); + return this._clickSwitchs_displayCritical(); case 5: - return this._clickSwitchs_localForage(); + return this._clickSwitchs_displayExtraDamage(); case 6: - return this._clickSwitchs_clickMove(); + return this._clickSwitchs_localForage(); case 7: - return this._clickSwitchs_ExtendKeyboard(); + return this._clickSwitchs_clickMove(); case 8: + return this._clickSwitchs_ExtendKeyboard(); + case 9: core.status.event.selection = 0; core.ui.drawSettings(); break; @@ -1890,6 +1892,16 @@ actions.prototype._clickSwitchs_sound = function () { core.ui.drawSwitchs(); } +actions.prototype._clickSwitchs_moveSpeed = function () { + core.myprompt("请输入行走速度(每走一步的时间,单位毫秒,默认100)", core.values.moveSpeed, function (value) { + value = parseInt(value) || core.values.moveSpeed; + value = core.clamp(value, 10, 500); + core.values.moveSpeed = value; + core.setLocalStorage("moveSpeed", value); + core.ui.drawSwitchs(); + }); +} + actions.prototype._clickSwitchs_displayEnemyDamage = function () { core.flags.displayEnemyDamage = !core.flags.displayEnemyDamage; core.updateDamage(); diff --git a/libs/control.js b/libs/control.js index e89cf64b..e8a7f75b 100644 --- a/libs/control.js +++ b/libs/control.js @@ -1100,7 +1100,7 @@ control.prototype.speedUpReplay = function () { else if (core.status.replay.speed==3) core.status.replay.speed=6; else if (core.status.replay.speed==2.5) core.status.replay.speed=3; else if (core.status.replay.speed==2) core.status.replay.speed=2.5; - else { + else if (core.status.replay.speed<2) { core.status.replay.speed = parseInt(10*core.status.replay.speed + 2)/10; } core.drawTip("x"+core.status.replay.speed+"倍"); diff --git a/libs/core.js b/libs/core.js index 3f1165b6..be98ccfe 100644 --- a/libs/core.js +++ b/libs/core.js @@ -252,6 +252,8 @@ core.prototype._init_sys_flags = function () { core.flags.displayEnemyDamage = core.getLocalStorage('enemyDamage', core.flags.displayEnemyDamage); core.flags.displayCritical = core.getLocalStorage('critical', core.flags.displayCritical); core.flags.displayExtraDamage = core.getLocalStorage('extraDamage', core.flags.displayExtraDamage); + // 行走速度 + core.values.moveSpeed = core.getLocalStorage('moveSpeed', core.values.moveSpeed); } core.prototype._init_platform = function () { diff --git a/libs/ui.js b/libs/ui.js index 34284a6e..1406be64 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -1190,6 +1190,7 @@ ui.prototype.drawSwitchs = function() { var choices = [ "背景音乐: "+(core.musicStatus.bgmStatus ? "[ON]" : "[OFF]"), "背景音效: "+(core.musicStatus.soundStatus ? "[ON]" : "[OFF]"), + "行走速度: "+parseInt(core.values.moveSpeed), "怪物显伤: "+(core.flags.displayEnemyDamage ? "[ON]" : "[OFF]"), "临界显伤: "+(core.flags.displayCritical ? "[ON]" : "[OFF]"), "领域显伤: "+(core.flags.displayExtraDamage ? "[ON]" : "[OFF]"),