From ae85cf373e3a9cf871cf625faca197f771c35228 Mon Sep 17 00:00:00 2001 From: Sandra Date: Sun, 10 Mar 2024 18:13:01 +1100 Subject: [PATCH] Added option to hide excluded locations. --- worlds/tracker/TrackerClient.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/worlds/tracker/TrackerClient.py b/worlds/tracker/TrackerClient.py index a75d195c7186..af1a04444967 100644 --- a/worlds/tracker/TrackerClient.py +++ b/worlds/tracker/TrackerClient.py @@ -68,6 +68,7 @@ class TrackerGameContext(CommonContext): region_callback: Callable[[list[str]], bool] = None gen_error = None output_format = "Both" + hide_excluded = False re_gen_passthrough = None def __init__(self, server_address, password): @@ -210,6 +211,8 @@ def _set_host_settings(self,host): host['universal_tracker']['include_region_name'] = False if 'include_location_name' not in host['universal_tracker']: host['universal_tracker']['include_location_name'] = True + if 'hide_excluded_locations' not in host['universal_tracker']: + host['universal_tracker']['hide_excluded_locations'] = False report_type = "Both" if host['universal_tracker']['include_location_name']: if host['universal_tracker']['include_region_name']: @@ -219,12 +222,12 @@ def _set_host_settings(self,host): else: report_type = "Region" host.save() - return host['universal_tracker']['player_files_path'],report_type + return host['universal_tracker']['player_files_path'],report_type, host['universal_tracker']['hide_excluded_locations'] def run_generator(self): try: host = get_settings() - yaml_path ,self.output_format = self._set_host_settings(host) + yaml_path ,self.output_format, self.hide_excluded = self._set_host_settings(host) #strip command line args, they won't be useful from the client anyway sys.argv = sys.argv[:1] args, _settings = mystery_argparse() @@ -428,6 +431,8 @@ def updateTracker(ctx: TrackerGameContext): for temp_loc in ctx.multiworld.get_reachable_locations(state,ctx.player_id): if temp_loc.address == None or isinstance(temp_loc.address,list): continue + elif ctx.hide_excluded and temp_loc.progress_type == LocationProgressType.EXCLUDED: + continue try: if (temp_loc.address in ctx.missing_locations): #logger.info("YES rechable (" + temp_loc.name + ")")