From 33044a6500a930719584317b2ca29dad1526c196 Mon Sep 17 00:00:00 2001 From: Jordan Irwin Date: Mon, 27 Nov 2023 17:33:00 -0800 Subject: [PATCH] Rememver settings window position https://github.com/arianne/stendhal/issues/254 --- srcjs/stendhal/action/SettingsAction.ts | 3 ++- srcjs/stendhal/util/ConfigManager.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/srcjs/stendhal/action/SettingsAction.ts b/srcjs/stendhal/action/SettingsAction.ts index 6db39b26b99..a5e2bb05186 100644 --- a/srcjs/stendhal/action/SettingsAction.ts +++ b/srcjs/stendhal/action/SettingsAction.ts @@ -23,13 +23,14 @@ export class SettingsAction extends SlashAction { readonly maxParams = 0; execute(_type: string, _params: string[], _remainder: string): boolean { - const wstate = stendhal.config.windowstates["settings"]; + const wstate = stendhal.config.getWindowState("settings"); const offset = stendhal.ui.getPageOffset(); const content = new SettingsDialog(); const dialog = ui.createSingletonFloatingWindow( "Settings", content, wstate.x - offset.x, wstate.y - offset.y); + dialog.setId("settings"); content.setFrame(dialog); return true; } diff --git a/srcjs/stendhal/util/ConfigManager.ts b/srcjs/stendhal/util/ConfigManager.ts index 3b5237bc68e..40ac7beb266 100644 --- a/srcjs/stendhal/util/ConfigManager.ts +++ b/srcjs/stendhal/util/ConfigManager.ts @@ -36,6 +36,7 @@ export class ConfigManager { "ui.joystick.center.y": "384", "ui.window.chest": "160,370", "ui.window.corpse": "160,370", + "ui.window.settings": "20,20", // FIXME: these should have been "gamewindow" to prevent confusion "gamescreen.blood": "true", "gamescreen.lighting": "true", @@ -126,7 +127,6 @@ export class ConfigManager { // TODO: move this into "session" file this.windowstates["menu"] = {x: 150, y: 20}; this.windowstates["outfit"] = {x: 300, y: 50}; - this.windowstates["settings"] = {x: 20, y: 20}; this.windowstates["trade"] = {x: 200, y: 100}; this.windowstates["travellog"] = {x: 160, y: 50}; this.initialized = true;