Fix: Inventory.set() finishes before clicked

This commit is contained in:
LmeSzinc 2024-07-05 21:27:12 +08:00
parent 96cfe4f8d4
commit 8d3a700f2e

View File

@ -303,6 +303,7 @@ class InventoryManager:
loca = item
interval = Timer(2, count=6)
clicked = False
while 1:
if skip_first_screenshot:
skip_first_screenshot = False
@ -319,13 +320,14 @@ class InventoryManager:
continue
# End
if item.is_selected:
if clicked and item.is_selected:
logger.info('Inventory item selected')
break
# Click
if interval.reached():
self.main.device.click(item)
interval.reset()
clicked = True
continue
def wait_selected(self, skip_first_screenshot=True):