Skip to content

Commit

Permalink
Merge pull request #1 from gjgfuj/tracker
Browse files Browse the repository at this point in the history
Added option to hide excluded locations.
  • Loading branch information
FarisTheAncient authored Mar 10, 2024
2 parents ccce781 + ae85cf3 commit 8f4f3f3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions worlds/tracker/TrackerClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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']:
Expand All @@ -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()
Expand Down Expand Up @@ -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 + ")")
Expand Down

0 comments on commit 8f4f3f3

Please sign in to comment.