Fix: Count research status from the end instead of all

Status 'waiting' may in the middle because mis-detection
This commit is contained in:
LmeSzinc 2022-08-15 00:05:07 +08:00
parent 1344cf9c92
commit bf6d391554

View File

@ -111,9 +111,14 @@ class ResearchQueue(ResearchUI):
"""
status = [self._queue_status_detect(button) for button in self.queue_status_grids.buttons]
logger.info(f'Research queue: {status}')
slot = sum([int(s == 'empty') for s in status])
logger.attr('Research queue slot', slot)
return slot
status = status[::-1]
for index, s in enumerate(status):
if s != 'empty':
logger.attr('Research queue slot', index)
return index
index = len(status)
logger.attr('Research queue slot', index)
return index
def get_research_ended(self):
"""