mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-16 06:25:24 +00:00
Opt: Show failed route at last
This commit is contained in:
parent
ff48ba74dd
commit
5efb2a8cb4
@ -71,7 +71,11 @@ class RouteLoader(UI):
|
|||||||
before_func_obj = self.route_obj.__getattribute__('before_route')
|
before_func_obj = self.route_obj.__getattribute__('before_route')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
before_func_obj = empty_function
|
before_func_obj = empty_function
|
||||||
before_func_obj()
|
try:
|
||||||
|
before_func_obj()
|
||||||
|
except (GameStuckError, GameTooManyClickError):
|
||||||
|
logger.error(f'Route failed: {route}')
|
||||||
|
raise
|
||||||
|
|
||||||
# Run route
|
# Run route
|
||||||
try:
|
try:
|
||||||
@ -80,16 +84,21 @@ class RouteLoader(UI):
|
|||||||
logger.critical(e)
|
logger.critical(e)
|
||||||
logger.critical(f'Route class in {route} ({path}) does not have method {func}')
|
logger.critical(f'Route class in {route} ({path}) does not have method {func}')
|
||||||
raise ScriptError
|
raise ScriptError
|
||||||
|
self.route_func = func
|
||||||
|
self.route_obj.route_func = func
|
||||||
|
try:
|
||||||
|
func_obj()
|
||||||
except (GameStuckError, GameTooManyClickError):
|
except (GameStuckError, GameTooManyClickError):
|
||||||
logger.error(f'Route failed: {route}')
|
logger.error(f'Route failed: {route}')
|
||||||
raise
|
raise
|
||||||
self.route_func = func
|
|
||||||
self.route_obj.route_func = func
|
|
||||||
func_obj()
|
|
||||||
|
|
||||||
# after_route()
|
# after_route()
|
||||||
try:
|
try:
|
||||||
after_route_obj = self.route_obj.__getattribute__('after_route')
|
after_route_obj = self.route_obj.__getattribute__('after_route')
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
after_route_obj = empty_function
|
after_route_obj = empty_function
|
||||||
after_route_obj()
|
try:
|
||||||
|
after_route_obj()
|
||||||
|
except (GameStuckError, GameTooManyClickError):
|
||||||
|
logger.error(f'Route failed: {route}')
|
||||||
|
raise
|
||||||
|
Loading…
Reference in New Issue
Block a user