From e3033b4e48fb496ada18880e798e956e946f6bc8 Mon Sep 17 00:00:00 2001 From: jobithu <95491220+jobithu@users.noreply.github.com> Date: Thu, 16 Jun 2022 20:03:00 +0200 Subject: [PATCH] added param to bind a key for "clear_screen" --- config/params.ini | 2 ++ src/config.py | 2 ++ src/inventory/common.py | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/config/params.ini b/config/params.ini index 1da04c7fb..6aa80f957 100644 --- a/config/params.ini +++ b/config/params.ini @@ -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 diff --git a/src/config.py b/src/config.py index 81f57b9a2..9c552f86d 100644 --- a/src/config.py +++ b/src/config.py @@ -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"), + } # Sorc base config sorc_base_cfg = dict(self.configs["config"]["parser"]["sorceress"]) diff --git a/src/inventory/common.py b/src/inventory/common.py index 0bedc1d04..97eb1f611 100644 --- a/src/inventory/common.py +++ b/src/inventory/common.py @@ -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"]) # check to ensure it closed wait(0.04, 0.08) timer = True