From c50ad6572577f46b2dc20e475b74aec30159f659 Mon Sep 17 00:00:00 2001 From: Stanley Albayeros Duarte Date: Fri, 29 Nov 2024 17:11:01 +0100 Subject: [PATCH] Add queue exit on timeout subroutine to the queue loop. (#90) * Add queue exit on timeout subroutine to the queue loop. Timeout is configurable through the YAML. 150 secs seems a good base value. * Implement code review changes * Refactor queue timeout documentation and update function argument description * fix wording from game to queue * fix whitespace --------- Co-authored-by: Deko --- alune/config.py | 9 +++++++++ alune/images.py | 1 + alune/images/exit_lobby.png | Bin 0 -> 7369 bytes alune/resources/config.yaml | 4 ++++ main.py | 12 +++++++----- 5 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 alune/images/exit_lobby.png diff --git a/alune/config.py b/alune/config.py index 0a48c00..a60e2e7 100644 --- a/alune/config.py +++ b/alune/config.py @@ -203,3 +203,12 @@ def get_chance_to_buy_xp(self) -> int: The chance in percent from 0 to 100. """ return self._config["chances"]["buy_xp"] + + def get_queue_timeout(self) -> int: + """ + Get the queue timeout in seconds. + + Returns: + The queue timeout in seconds. + """ + return self._config["queue_timeout"] diff --git a/alune/images.py b/alune/images.py index 5c2b2f0..916bb40 100644 --- a/alune/images.py +++ b/alune/images.py @@ -284,6 +284,7 @@ class Button: # Buttons with an image, the variable name must be the same as the image name. play = ImageButton(BoundingBox(950, 600, 1200, 650)) accept = ImageButton(BoundingBox(525, 520, 755, 545)) + exit_lobby = ImageButton(BoundingBox(50, 600, 130, 680)) exit_now = ImageButton( click_box=BoundingBox(550, 425, 740, 440), capture_area=BoundingBox(520, 400, 775, 425), diff --git a/alune/images/exit_lobby.png b/alune/images/exit_lobby.png new file mode 100644 index 0000000000000000000000000000000000000000..484b66eb27adb9b6d8bf9e50c9399749481e3e19 GIT binary patch literal 7369 zcmV;)95&;LP)Px#19L)2R0s$N+u={(00004XF*Lt006O%3;baP00009a7bBm000&x000&x0ZCFM z@BjcDPf0{URCr$PTxpCP$94X?d+ynDW=|fwBqfm)FOifi%Zg-CmSkN9V<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