mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-04-23 14:12:32 +08:00
Fix: UI haven't fully loaded after get_current_zone_from_globe()
This commit is contained in:
@@ -87,6 +87,7 @@ class OSMap(OSFleet, Map, GlobeCamera):
|
|||||||
self.zone = self.get_globe_pinned_zone()
|
self.zone = self.get_globe_pinned_zone()
|
||||||
self.zone_config_set()
|
self.zone_config_set()
|
||||||
self.os_globe_goto_map()
|
self.os_globe_goto_map()
|
||||||
|
self.zone_init(fallback_init=False)
|
||||||
return self.zone
|
return self.zone
|
||||||
|
|
||||||
def globe_goto(self, zone, types=('SAFE', 'DANGEROUS'), refresh=False, stop_if_safe=False):
|
def globe_goto(self, zone, types=('SAFE', 'DANGEROUS'), refresh=False, stop_if_safe=False):
|
||||||
|
|||||||
@@ -137,13 +137,14 @@ class OSMapOperation(MapOrderHandler, MissionHandler, PortHandler, StorageHandle
|
|||||||
self.config.HOMO_EDGE_COLOR_RANGE = (0, 33)
|
self.config.HOMO_EDGE_COLOR_RANGE = (0, 33)
|
||||||
self.config.MAP_ENSURE_EDGE_INSIGHT_CORNER = ''
|
self.config.MAP_ENSURE_EDGE_INSIGHT_CORNER = ''
|
||||||
|
|
||||||
def zone_init(self, skip_first_screenshot=True):
|
def zone_init(self, fallback_init=True, skip_first_screenshot=True):
|
||||||
"""
|
"""
|
||||||
Wrap get_current_zone(), set self.zone to the current zone.
|
Wrap get_current_zone(), set self.zone to the current zone.
|
||||||
This method must be called after entering a new zone.
|
This method must be called after entering a new zone.
|
||||||
Handle map events and the animation that zone names appear from the top.
|
Handle map events and the animation that zone names appear from the top.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
|
fallback_init (bool): Whether to get zone from globe map when unable to parse zone name.
|
||||||
skip_first_screenshot (bool):
|
skip_first_screenshot (bool):
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
@@ -184,14 +185,15 @@ class OSMapOperation(MapOrderHandler, MissionHandler, PortHandler, StorageHandle
|
|||||||
timeout.reset()
|
timeout.reset()
|
||||||
continue
|
continue
|
||||||
|
|
||||||
logger.warning('Unable to get zone name, get current zone from globe map instead')
|
if fallback_init:
|
||||||
if hasattr(self, 'get_current_zone_from_globe'):
|
logger.warning('Unable to get zone name, get current zone from globe map instead')
|
||||||
return self.get_current_zone_from_globe()
|
if hasattr(self, 'get_current_zone_from_globe'):
|
||||||
else:
|
return self.get_current_zone_from_globe()
|
||||||
logger.warning('OperationSiren.get_current_zone_from_globe() not exists')
|
else:
|
||||||
if not self.is_in_map():
|
logger.warning('OperationSiren.get_current_zone_from_globe() not exists')
|
||||||
logger.warning('Trying to get zone name, but not in OS map')
|
if not self.is_in_map():
|
||||||
return self.get_current_zone()
|
logger.warning('Trying to get zone name, but not in OS map')
|
||||||
|
return self.get_current_zone()
|
||||||
|
|
||||||
def is_in_special_zone(self):
|
def is_in_special_zone(self):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user