1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 16:47:03 +08:00

Add: Goto to port of current map

- Fix: Detect zone name if not in OS map
This commit is contained in:
LmeSzinc
2021-04-04 21:23:46 +08:00
parent 51f51bb006
commit 74bbc59f94
2 changed files with 32 additions and 1 deletions

View File

@@ -5,7 +5,7 @@ from module.map.map_operation import MapOperation
from module.ocr.ocr import Ocr
from module.os.assets import *
from module.os.globe_zone import Zone, ZoneManager
from module.exception import ScriptError
class OSMapOperation(MapOperation, ZoneManager):
zone: Zone
@@ -73,6 +73,10 @@ class OSMapOperation(MapOperation, ZoneManager):
Returns:
Zone:
"""
if not self.is_in_map():
logger.warning('Trying to get zone name, but not in OS map')
raise ScriptError('Trying to get zone name, but not in OS map')
name = self.get_zone_name()
logger.info(f'Map name processed: {name}')
self.zone = self.name_to_zone(name)