mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-09 18:39:04 +08:00
Fix: Loop when starting a E2 research but no gear boxes in storage
This commit is contained in:
parent
53ea819e72
commit
78b1444736
@ -29,7 +29,10 @@ FILTER = Filter(FILTER_REGEX, FILTER_ATTR, FILTER_PRESET)
|
||||
|
||||
|
||||
class ResearchSelector(ResearchUI):
|
||||
# List of current research projects
|
||||
projects: list
|
||||
# From StorageHandler
|
||||
storage_has_boxes = True
|
||||
|
||||
def research_goto_detail(self, index, skip_first_screenshot=True):
|
||||
logger.info(f'Research goto detail (project {index})')
|
||||
@ -198,12 +201,15 @@ class ResearchSelector(ResearchUI):
|
||||
return False
|
||||
# 2021.08.19 Allow E-2 to disassemble tech boxes, but JP still remains the same.
|
||||
# 2022.08.23 Allow all E-2, disassemble equipment is now supported
|
||||
# if self.config.SERVER == 'jp':
|
||||
# if project.genre.upper() == 'E' and str(project.duration) != '6':
|
||||
# return False
|
||||
# else:
|
||||
# if project.genre.upper() == 'E' and project.task != '':
|
||||
# return False
|
||||
# Ignore E-2 if don't have any boxes in storage to disassemble,
|
||||
# Or will enter a loop of starting research, trying to disassemble, cancel research
|
||||
if not self.storage_has_boxes:
|
||||
if self.config.SERVER == 'jp':
|
||||
if project.genre.upper() == 'E' and str(project.duration) != '6':
|
||||
return False
|
||||
else:
|
||||
if project.genre.upper() == 'E' and project.task != '':
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@ -24,6 +24,8 @@ class StorageFull(Exception):
|
||||
|
||||
|
||||
class StorageHandler(StorageUI):
|
||||
storage_has_boxes = True
|
||||
|
||||
@staticmethod
|
||||
def _storage_box_template(rarity):
|
||||
if rarity == 1:
|
||||
@ -326,6 +328,7 @@ class StorageHandler(StorageUI):
|
||||
boxes = self._storage_use_box_execute(rarity=rarity, amount=amount - disassembled)
|
||||
if boxes <= 0:
|
||||
logger.warning('No more boxes to use, disassemble equipment end')
|
||||
self.storage_has_boxes = False
|
||||
break
|
||||
except StorageFull:
|
||||
pass
|
||||
@ -370,6 +373,7 @@ class StorageHandler(StorageUI):
|
||||
used += boxes
|
||||
if boxes <= 0:
|
||||
logger.warning('No more boxes to use, disassemble equipment end')
|
||||
self.storage_has_boxes = False
|
||||
break
|
||||
except StorageFull:
|
||||
continue
|
||||
|
||||
Loading…
Reference in New Issue
Block a user