mirror of
https://github.com/0O0o0oOoO00/Alas.git
synced 2026-05-14 17:09:26 +08:00
tmp(need revert after upstream fixed): do not use skip_first_screenshot in StorageHandler.storage_checkout_item
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user