Skip to content

Commit

Permalink
Rememver settings window position
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Nov 28, 2023
1 parent 1aff0b4 commit 33044a6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion srcjs/stendhal/action/SettingsAction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion srcjs/stendhal/util/ConfigManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 33044a6

Please sign in to comment.