From e7d40c286e98a744a833c8bced15849b108bc33d Mon Sep 17 00:00:00 2001 From: Francesco Date: Mon, 3 Jan 2022 18:59:56 +0000 Subject: [PATCH] 1 liner bug fix for game_recovery: name 'config' is not defined (#385) * My pick up and sorc parameters * Moved the game logic away from the main within the new GameController class. Refactored the main to use built-in keyboard add_hotkey and wait functions instead of self-written main loop. * Revert "My pick up and sorc parameters" This reverts commit 0920a406 * Changed number of loot columns * Changes as per the comments: Handle non-existing backup file. Removed newline at the beginning of GameController class. Changed line splitted into multiple lines back to a single line. * Refactored graphic debugger with similar logic to botty to now have a controller. * Added a small comment on the graphic debugger class and fixed a now-typo on the presented menu * Bug Fix: if pressing F11 repeatedly the main loop may crash due to self.bot not yet initialized in the game_controller. A safe solution would be to try and catch all but that would also be an overkill as it would most likely mask exceptions that we might want to make the program crash. Checking that self.bot is initialized should work for the time being. * No need to re-assign the resume key within the game controlelr anymore * Urgent 1 liner bug fix for always_on_top: name 'config' is not defined --- src/game_recovery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game_recovery.py b/src/game_recovery.py index 00d694a..5cc9768 100644 --- a/src/game_recovery.py +++ b/src/game_recovery.py @@ -17,7 +17,7 @@ class GameRecovery: self._ui_manager = UiManager(self._screen, self._template_finder) def go_to_hero_selection(self): - if config.advanced_options['d2r_windows_always_on_top']: + if self._config.advanced_options['d2r_windows_always_on_top']: set_d2r_always_on_top() time.sleep(1) # clean up key presses that might be pressed in the run_thread