Skip to content

Commit

Permalink
Fix the new hint stuff for 0.5.1 (#40)
Browse files Browse the repository at this point in the history
* oops the new hint status info isn't available until the hint status is available xd

* and fix a silly
  • Loading branch information
qwint authored Jan 7, 2025
1 parent 47314cb commit 465849d
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions worlds/tracker/TrackerClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class TrackerHintLabel(HintLabel):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
logic = TooltipLabel(
sort_key="status", # is lying to computer and player but fixing it will need core changes
sort_key="name", # is lying to computer and player but fixing it will need core changes
text="", halign='center', valign='center', pos_hint={"center_y": 0.5},
)
self.add_widget(logic)
Expand All @@ -406,14 +406,21 @@ def set_text(_, value):

def refresh_view_attrs(self, rv, index, data):
super().refresh_view_attrs(rv, index, data)
if data["status"]["hint"]["receiving_player"] == -1:
if data["item"]["text"] == rv.header["item"]["text"]:
self.logic_text = "[u]In Logic[/u]"
return
ctx = ui.get_running_app().ctx
if "status" in data:
loc = data["status"]["hint"]["location"]
from NetUtils import HintStatus
found = data["status"]["hint"]["status"] == HintStatus.HINT_FOUND
else:
prefix = len("[color=00FF7F]")
suffix = len("[/color]")
loc_name = data["location"]["text"][prefix:-1*suffix]
loc = AutoWorld.AutoWorldRegister.world_types[ctx.game].location_name_to_id.get(loc_name)
found = "Not Found" not in data["found"]["text"]

loc = data["status"]["hint"]["location"]
from NetUtils import HintStatus
found = data["status"]["hint"]["status"] == HintStatus.HINT_FOUND
in_logic = loc in ctx.locations_available
self.logic_text = rv.parser.handle_node({
"type": "color", "color": "green" if found else
Expand Down Expand Up @@ -868,6 +875,8 @@ def updateTracker(ctx: TrackerGameContext) -> CurrentTrackerState:
status = "completed"
elif location in ctx.locations_available:
status = "in_logic"
else:
status = "out_of_logic"
for coord in relevent_coords:
coord.update_status(loc_name,status)
if ctx.quit_after_update:
Expand Down

0 comments on commit 465849d

Please sign in to comment.