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
This commit is contained in:
Francesco
2022-01-03 19:59:56 +01:00
committed by GitHub
parent 992bfa91e8
commit e7d40c286e
+1 -1
View File
@@ -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