Opt: wait until navbar active is not None (#3832)

This commit is contained in:
Air111 2024-06-03 00:05:23 +08:00 committed by GitHub
parent 1e793295e8
commit bb3f4964ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 10 deletions

View File

@ -103,17 +103,15 @@ class GachaUI(UI):
def _construct_bottom_navbar(self):
"""
limited 4 options
build.
limited_build.
orders.
shop.
retire.
event.
light.
heavy.
special.
regular 3 options
build.
orders.
shop.
retire.
light.
heavy.
special.
"""
construct_bottom_navbar = ButtonGrid(
origin=(262, 615), delta=(209, 0),

View File

@ -188,7 +188,8 @@ class Navbar:
active, minimum, maximum = self.get_info(main=main)
logger.info(f'Nav item active: {active} from range ({minimum}, {maximum})')
# Get None when receiving a pure black screenshot.
if minimum is None or maximum is None:
# Active is None could be because of slow animation
if active is None or minimum is None or maximum is None:
continue
index = minimum + left - 1 if left is not None else maximum - right + 1