Skip to content

Commit

Permalink
only underline clickable statuses
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyV99 committed Sep 12, 2024
1 parent 0eb6256 commit 2eda2f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kvui.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,12 +784,15 @@ def refresh_hints(self, hints):
if not hints: # Fix the scrolling looking visually wrong in some edge cases
self.scroll_y = 1.0
data = []
ctx = App.get_running_app().ctx
for hint in hints:
if not hint.get("status"): # Allows connecting to old servers
hint["status"] = HintStatus.HINT_FOUND if hint["found"] else HintStatus.HINT_UNSPECIFIED
hint_status_node = self.parser.handle_node({"type": "color",
"color": status_colors.get(hint["status"], "red"),
"text": status_names.get(hint["status"], "Unknown")})
if hint["status"] != HintStatus.HINT_FOUND and hint["receiving_player"] == ctx.slot:
hint_status_node = f"[u]{hint_status_node}[/u]"
data.append({
"receiving": {"text": self.parser.handle_node({"type": "player_id", "text": hint["receiving_player"]})},
"item": {"text": self.parser.handle_node({
Expand All @@ -808,7 +811,7 @@ def refresh_hints(self, hints):
"color": "blue", "text": hint["entrance"]
if hint["entrance"] else "Vanilla"})},
"status": {
"text": f"[u]{hint_status_node}[/u]",
"text": hint_status_node,
"hint": hint,
},
})
Expand Down

0 comments on commit 2eda2f5

Please sign in to comment.