Skip to content

Commit

Permalink
Remember chest window position
Browse files Browse the repository at this point in the history
  • Loading branch information
AntumDeluge committed Nov 28, 2023
1 parent bc70aae commit 1aff0b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion srcjs/stendhal/entity/Chest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,15 @@ export class Chest extends PopupInventory {

openInventoryWindow() {
if (!this.inventory || !this.inventory.isOpen()) {
const dstate = stendhal.config.windowstates["chest"];
const invComponent = new ItemInventoryComponent(this,
"content", 5, 6, stendhal.config.getBoolean("action.chest.quickpickup"), undefined);
// TODO: remove, deprecated
invComponent.setConfigId("chest");

const dstate = stendhal.config.getWindowState("chest");
this.inventory = new FloatingWindow("Chest", invComponent,
dstate.x, dstate.y);
this.inventory.setId("chest");
}
}

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 @@ -34,6 +34,7 @@ export class ConfigManager {
"ui.joystick": "none",
"ui.joystick.center.x": "224",
"ui.joystick.center.y": "384",
"ui.window.chest": "160,370",
"ui.window.corpse": "160,370",
// FIXME: these should have been "gamewindow" to prevent confusion
"gamescreen.blood": "true",
Expand Down Expand Up @@ -123,7 +124,6 @@ export class ConfigManager {

// store window information for this session
// TODO: move this into "session" file
this.windowstates["chest"] = {x: 160, y: 370};
this.windowstates["menu"] = {x: 150, y: 20};
this.windowstates["outfit"] = {x: 300, y: 50};
this.windowstates["settings"] = {x: 20, y: 20};
Expand Down

0 comments on commit 1aff0b4

Please sign in to comment.