From d4b307839b48f4d64efe258c362a02d4e75aa05e Mon Sep 17 00:00:00 2001 From: 0O0o0oOoO00 <11174151+0o0o0oooo00@users.noreply.github.com> Date: Fri, 23 Jan 2026 12:34:08 +0800 Subject: [PATCH] tmp(need revert after upstream fixed): do not use skip_first_screenshot in StorageHandler.storage_checkout_item --- module/os_handler/storage.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/module/os_handler/storage.py b/module/os_handler/storage.py index 8e2c4be09..4a0533c8e 100644 --- a/module/os_handler/storage.py +++ b/module/os_handler/storage.py @@ -252,3 +252,36 @@ class StorageHandler(GlobeOperation, ZoneManager): result = self.storage_checkout_item(item) return result + + +class StorageHandler(StorageHandler): + def storage_checkout_item(self, item): + """ + Args: + item (str): 'OBSCURE' or 'ABYSSAL'. + + Returns: + bool: If checkout + + Pages: + in: STORAGE_CHECK + out: is_in_map, in an obscure/abyssal zone if checkout. + is_in_map, in previous zone if no more obscure/abyssal coordinates. + """ + logger.hr(f'Storage checkout item {item}') + if SCROLL_STORAGE.appear(main=self): + SCROLL_STORAGE.set_top(main=self) + + confirm_timer = Timer(0.6, count=2).start() + for _ in self.loop(): + image = rgb2gray(self.device.image) + items = self._storage_item_to_template(item).match_multi(image, similarity=0.75) + logger.attr(f'Storage_{item}', len(items)) + + if len(items): + self._storage_coordinate_checkout(items[0], types=(item,)) + return True + if confirm_timer.reached(): + logger.info(f'No more {item} items in storage') + self.storage_quit() + return False