Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

added param to bind a key for "clear_screen" #878

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/params.ini
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ stand_still=capslock
; teleport: leave empty if you can't use
teleport=
town_portal=f9
;close all windows without hitting escape and ending up in the game menu - used to close vendor tabs and inventories.
clear_screen=space
; call to arms settings:
weapon_switch=x
battle_orders=f7
Expand Down
2 changes: 2 additions & 0 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ def load_data(self):
"sell_junk": bool(int(self._select_val("char", "sell_junk"))),
"enable_no_pickup": bool(int(self._select_val("char", "enable_no_pickup"))),
"safer_routines": bool(int(self._select_val("char", "safer_routines"))),
"clear_screen": self._select_val("char", "clear_screen"),

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty line

}
# Sorc base config
sorc_base_cfg = dict(self.configs["config"]["parser"]["sorceress"])
Expand Down
3 changes: 2 additions & 1 deletion src/inventory/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def close(img: np.ndarray = None) -> np.ndarray | None:
img = grab() if img is None else img
if inventory_is_open(img):
# close open inventory
keyboard.send("esc")
if Config().char["clear_screen"]:
keyboard.send(Config().char["clear_screen"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add else: keyboard.send("esc")

# check to ensure it closed
wait(0.04, 0.08)
timer = True
Expand Down