mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 22:37:00 +08:00
Merge branch 'master' of https://github.com/LmeSzinc/AzurLaneAutoScript
This commit is contained in:
@@ -93,18 +93,13 @@ class FleetSelector:
|
||||
index = numbers - index
|
||||
return Button(area=(), color=(), button=area, name='%s_INDEX_%s' % (str(self._bar), str(index)))
|
||||
|
||||
def open(self, skip_first_screenshot=True):
|
||||
def open(self):
|
||||
"""
|
||||
Activate dropdown menu for fleet selection.
|
||||
"""
|
||||
main = self.main
|
||||
click_timer = Timer(3, count=6)
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
else:
|
||||
main.device.screenshot()
|
||||
|
||||
for _ in main.loop():
|
||||
if main.handle_map_event():
|
||||
click_timer.reset()
|
||||
continue
|
||||
@@ -118,18 +113,13 @@ class FleetSelector:
|
||||
main.device.click(self._choose)
|
||||
click_timer.reset()
|
||||
|
||||
def close(self, skip_first_screenshot=True):
|
||||
def close(self):
|
||||
"""
|
||||
Deactivate dropdown menu for fleet selection.
|
||||
"""
|
||||
main = self.main
|
||||
click_timer = Timer(3, count=6)
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
else:
|
||||
main.device.screenshot()
|
||||
|
||||
for _ in main.loop():
|
||||
# End
|
||||
if not self.bar_opened():
|
||||
break
|
||||
@@ -139,23 +129,17 @@ class FleetSelector:
|
||||
main.device.click(self._choose)
|
||||
click_timer.reset()
|
||||
|
||||
def click(self, index, skip_first_screenshot=True):
|
||||
def click(self, index):
|
||||
"""
|
||||
Choose a fleet on dropdown menu, and dropdown deactivated.
|
||||
|
||||
Args:
|
||||
index (int): Fleet index, 1-6.
|
||||
skip_first_screenshot (bool):
|
||||
"""
|
||||
main = self.main
|
||||
button = self.get_button(index)
|
||||
click_timer = Timer(3, count=6)
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
else:
|
||||
main.device.screenshot()
|
||||
|
||||
for _ in main.loop():
|
||||
if main.handle_map_event():
|
||||
click_timer.reset()
|
||||
continue
|
||||
@@ -173,25 +157,19 @@ class FleetSelector:
|
||||
main.device.click(button)
|
||||
click_timer.reset()
|
||||
|
||||
def ensure_to_be(self, index, skip_first_screenshot=True):
|
||||
def ensure_to_be(self, index):
|
||||
"""
|
||||
Set to a specific fleet.
|
||||
|
||||
Args:
|
||||
index (int): Fleet index, 1-4.
|
||||
skip_first_screenshot (bool):
|
||||
|
||||
Returns:
|
||||
bool: If fleet switched.
|
||||
"""
|
||||
confirm_timer = Timer(1.5, count=5).start()
|
||||
main = self.main
|
||||
while 1:
|
||||
if skip_first_screenshot:
|
||||
skip_first_screenshot = False
|
||||
else:
|
||||
main.device.screenshot()
|
||||
|
||||
for _ in main.loop():
|
||||
if confirm_timer.reached():
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user