mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Fix: Inventory.set() finishes before clicked
This commit is contained in:
parent
96cfe4f8d4
commit
8d3a700f2e
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user