Skip to content

Commit 1f4ce2e

Browse files
committed
avoid doing string comparisons when removing location buttons
1 parent f412da1 commit 1f4ce2e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ManualClient.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ class LocationsLayoutScrollable(ScrollView):
190190

191191
class TreeViewButton(Button, TreeViewNode):
192192
victory: bool = False
193+
id: int = None
193194

194195
class TreeViewScrollView(ScrollView, TreeViewNode):
195196
pass
@@ -391,6 +392,7 @@ def build_tracker_and_locations_table(self):
391392
for location_id in self.listed_locations[location_category]:
392393
location_button = TreeViewButton(text=self.ctx.location_names[location_id], size_hint=(None, None), height=30, width=400)
393394
location_button.bind(on_press=lambda *args, loc_id=location_id: self.location_button_callback(loc_id, *args))
395+
location_button.id = location_id
394396
category_layout.add_widget(location_button)
395397

396398
# if this is the category that Victory is in, display the Victory button
@@ -531,9 +533,7 @@ def update_tracker_and_locations_table(self, update_highlights=False):
531533
reachable_count += 1
532534
continue
533535

534-
location = self.ctx.get_location_by_name(location_button.text)
535-
536-
if ("victory" not in location or not location["victory"]) and location["id"] not in self.ctx.missing_locations:
536+
if location_button.id and location_button.id not in self.ctx.missing_locations:
537537
import logging
538538

539539
logging.info("location button being removed: " + location_button.text)

src/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ def __init__(self, display_name: str, script_name: Optional[str] = None, func: O
405405
self.version = version
406406

407407
def add_client_to_launcher() -> None:
408-
version = 2024_04_10 # YYYYMMDD
408+
version = 2024_05_05 # YYYYMMDD
409409
found = False
410410
for c in components:
411411
if c.display_name == "Manual Client":

0 commit comments

Comments
 (0)