diff --git a/_server/data.comment.js b/_server/data.comment.js index acfae9fc..3cd98103 100644 --- a/_server/data.comment.js +++ b/_server/data.comment.js @@ -589,6 +589,12 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "_type": "checkbox", "_bool": "bool", "_data": "是否允许瞬间移动" + }, + "clickMoveDirectly": { + "_leaf": true, + "_type": "checkbox", + "_bool": "bool", + "_data": "是否默认开启单击瞬移,用户可在菜单栏手动开关" } } } diff --git a/libs/actions.js b/libs/actions.js index e09bf17a..01619092 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -1591,8 +1591,8 @@ actions.prototype.clickSwitchs = function (x,y) { core.ui.drawSwitchs(); break; case 6: - core.status.automaticRoute.clickMoveDirectly=!core.status.automaticRoute.clickMoveDirectly; - core.setLocalStorage('clickMoveDirectly', core.status.automaticRoute.clickMoveDirectly); + core.flags.clickMoveDirectly=!core.flags.clickMoveDirectly; + core.setLocalStorage('clickMoveDirectly', core.flags.clickMoveDirectly); core.ui.drawSwitchs(); break; case 7: diff --git a/libs/control.js b/libs/control.js index ec9d6928..6eed9e72 100644 --- a/libs/control.js +++ b/libs/control.js @@ -295,8 +295,6 @@ control.prototype.resetStatus = function(hero, hard, floorId, route, maps, value // 保存的Index core.status.saveIndex = core.getLocalStorage('saveIndex2', 1); - core.status.automaticRoute.clickMoveDirectly = core.getLocalStorage('clickMoveDirectly', true); - if (core.isset(values)) core.values = core.clone(values); else core.values = core.clone(core.data.values); @@ -457,7 +455,7 @@ control.prototype.setAutomaticRoute = function (destX, destY, stepPostfix) { if (core.timeout.turnHeroTimeout!=null) return; // 单击瞬间移动 - if (core.status.automaticRoute.clickMoveDirectly && core.status.heroStop) { + if (core.flags.clickMoveDirectly && core.status.heroStop) { if (core.control.tryMoveDirectly(destX, destY)) return; } diff --git a/libs/core.js b/libs/core.js index 1b3a28cd..24adfd2a 100644 --- a/libs/core.js +++ b/libs/core.js @@ -113,7 +113,6 @@ function core() { 'cursorX': null, 'cursorY': null, "moveDirectly": false, - 'clickMoveDirectly': true, }, // 按下键的时间:为了判定双击 @@ -288,6 +287,8 @@ core.prototype.init = function (coreData, callback) { 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.flags.clickMoveDirectly = core.getLocalStorage('clickMoveDirectly', + !(core.isset(core.flags.clickMoveDirectly) && !core.flags.clickMoveDirectly)); core.material.ground = new Image(); core.material.ground.src = "project/images/ground.png"; diff --git a/libs/ui.js b/libs/ui.js index b160d9ed..a365323f 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -799,7 +799,7 @@ ui.prototype.drawSwitchs = function() { "怪物显伤: "+(core.flags.displayEnemyDamage ? "[ON]" : "[OFF]"), "临界显伤: "+(core.flags.displayCritical ? "[ON]" : "[OFF]"), "领域显伤: "+(core.flags.displayExtraDamage ? "[ON]" : "[OFF]"), - "单击瞬移: "+(core.status.automaticRoute.clickMoveDirectly ? "[ON]" : "[OFF]"), + "单击瞬移: "+(core.flags.clickMoveDirectly ? "[ON]" : "[OFF]"), "新版存档: "+(core.platform.useLocalForage ? "[ON]":"[OFF]"), "查看工程", "下载离线版本", diff --git a/project/data.js b/project/data.js index 230dcdae..5bbb87a6 100644 --- a/project/data.js +++ b/project/data.js @@ -168,5 +168,6 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "portalWithoutTrigger": true, "canGoDeadZone": false, "enableMoveDirectly": true, + "clickMoveDirectly": true, } } \ No newline at end of file