diff --git a/srcjs/stendhal.html b/srcjs/stendhal.html index cfe22675d21..dd6a78355b6 100644 --- a/srcjs/stendhal.html +++ b/srcjs/stendhal.html @@ -253,6 +253,7 @@

+
diff --git a/srcjs/stendhal/entity/Ground.ts b/srcjs/stendhal/entity/Ground.ts index 30173e4e991..8bd73b3a659 100644 --- a/srcjs/stendhal/entity/Ground.ts +++ b/srcjs/stendhal/entity/Ground.ts @@ -59,6 +59,9 @@ export class Ground { } onclick(x: number, y: number, dblclick: boolean) { + if (!stendhal.config.getBoolean("client.pathfinding")) { + return; + } var gameX = x + stendhal.ui.gamewindow.offsetX; var gameY = y + stendhal.ui.gamewindow.offsetY; var action = { diff --git a/srcjs/stendhal/ui/component/MiniMapComponent.ts b/srcjs/stendhal/ui/component/MiniMapComponent.ts index 78cd4943370..1222465c47e 100644 --- a/srcjs/stendhal/ui/component/MiniMapComponent.ts +++ b/srcjs/stendhal/ui/component/MiniMapComponent.ts @@ -206,6 +206,9 @@ export class MiniMapComponent extends Component { } onClick(event: MouseEvent) { + if (!stendhal.config.getBoolean("client.pathfinding")) { + return; + } let pos = stendhal.ui.html.extractPosition(event); let x = Math.floor((pos.canvasRelativeX + this.xOffset) / this.scale); let y = Math.floor((pos.canvasRelativeY + this.yOffset) / this.scale); diff --git a/srcjs/stendhal/ui/dialog/SettingsDialog.ts b/srcjs/stendhal/ui/dialog/SettingsDialog.ts index 3e62587d0ee..499ff2beed7 100644 --- a/srcjs/stendhal/ui/dialog/SettingsDialog.ts +++ b/srcjs/stendhal/ui/dialog/SettingsDialog.ts @@ -129,6 +129,9 @@ export class SettingsDialog extends DialogContentComponent { this.createCheckBox("chk_clickindicator", "input.click.indicator", "Displaying clicks", "Not displaying clicks"); + this.createCheckBox("chk_pathfinding", "client.pathfinding", + "Pathfinding on ground enabled", "Pathfinding on ground disabled"); + /* *** right panel *** */ diff --git a/srcjs/stendhal/util/ConfigManager.ts b/srcjs/stendhal/util/ConfigManager.ts index ea4a9b85d72..5cf9a3b1828 100644 --- a/srcjs/stendhal/util/ConfigManager.ts +++ b/srcjs/stendhal/util/ConfigManager.ts @@ -20,6 +20,7 @@ declare var stendhal: any; export class ConfigManager { private readonly defaults = { + "client.pathfinding": "true", "ui.sound": "false", "ui.sound.master.volume": "100", "ui.sound.ambient.volume": "100",