1
0
mirror of https://github.com/sui-feng-cb/AzurLaneAutoScript1.git synced 2026-08-19 20:55:05 +08:00

Opt: restructure OS strategic search flow to reduce redundant operations

This commit is contained in:
positnuec
2026-08-13 21:45:35 +08:00
parent 2d2db92c3c
commit 602a35a660
4 changed files with 44 additions and 19 deletions

View File

@@ -1009,8 +1009,11 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler):
self.hp_get()
self._solved_map_event = set()
self._solved_fleet_mechanism = False
self.clear_question()
self.map_rescan()
self.get_current_zone()
logger.attr('is_zone_name_hidden', self.is_zone_name_hidden)
if self.is_zone_name_hidden:
self.clear_question()
self.map_rescan()
def _swipe_camera_avoid_ui(self, grid, ref=None, _ui_avoid_count=0, name='Grid'):
"""
@@ -1026,12 +1029,12 @@ class OSMap(OSFleet, Map, GlobeCamera, StorageHandler, StrategicSearchHandler):
Returns:
bool: True if the camera swiped and the map should be rescanned; False if the grid is safe to click.
"""
if _ui_avoid_count < 3 and area_cross_area(grid.button, MAP_OPTIONS_AREA.area, threshold=0):
if _ui_avoid_count < 2 and area_cross_area(grid.button, MAP_OPTIONS_AREA.area, threshold=0):
if ref is None:
ref = self.view.center_loca
vector = np.array(grid.location) - np.array(ref)
vector = tuple((vector // 2).astype(int))
logger.info(f'{name} grid {grid} overlaps with map options area, swipe {vector}')
logger.info(f'{name} grid {grid} overlaps with map options area, swipe: {vector}')
self.map_swipe(vector)
return True
return False