Skip to content

Commit

Permalink
fix naming on doors in tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
gymnast86 committed Sep 2, 2024
1 parent 93f3f10 commit 8f2e366
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions gui/components/tracker_entrance_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ def entrance_is_accessible(self) -> bool:
def update_text(self, recent_search_: Search | None = None) -> None:
if recent_search_ is not None:
self.recent_search = recent_search_
connected_area = self.entrance.connected_area

# Take the name of the connected area to start (or just "?" if it isn't connected)
connected_area_name = self.entrance.connected_area.name if self.entrance.connected_area else "?"
# If this entrance has a replacement, then use the second part of the replacement's
# original name (this takes into account undecoupled double door names)
if self.entrance.replaces:
connected_area_name = self.entrance.replaces.original_name.split(" -> ")[1]

original_parent, original_connected = self.entrance.original_name.split(" -> ")
first_part = (
f"{original_parent} to "
Expand All @@ -69,7 +76,7 @@ def update_text(self, recent_search_: Search | None = None) -> None:
else ""
)
self.setText(
f"{first_part}{original_connected} -> {connected_area.name if connected_area else '?'}"
f"{first_part}{original_connected} -> {connected_area_name}"
)

self.update_color(recent_search_)
Expand Down

0 comments on commit 8f2e366

Please sign in to comment.