From 07e76a75e8d8f717e29d4840cc675c4db004bd14 Mon Sep 17 00:00:00 2001 From: Packsolite Date: Sun, 15 Mar 2026 19:22:09 +0100 Subject: [PATCH] Fix Player and RoomCountBox tooltip not updating --- WheelWizard/Views/Layout.axaml | 4 ++-- WheelWizard/Views/Layout.axaml.cs | 34 +++++++++++++++++-------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/WheelWizard/Views/Layout.axaml b/WheelWizard/Views/Layout.axaml index d2886b41..1dd698b1 100644 --- a/WheelWizard/Views/Layout.axaml +++ b/WheelWizard/Views/Layout.axaml @@ -68,11 +68,11 @@ Margin="0,0,0,25"> diff --git a/WheelWizard/Views/Layout.axaml.cs b/WheelWizard/Views/Layout.axaml.cs index 9c41e809..8f5c7ba7 100644 --- a/WheelWizard/Views/Layout.axaml.cs +++ b/WheelWizard/Views/Layout.axaml.cs @@ -14,12 +14,10 @@ using WheelWizard.Settings.Types; using WheelWizard.Shared.DependencyInjection; using WheelWizard.Utilities.RepeatedTasks; -using WheelWizard.Views.Components; using WheelWizard.Views.Pages; using WheelWizard.Views.Patterns; using WheelWizard.Views.Popups.Generic; using WheelWizard.WheelWizardData.Domain; -using WheelWizard.WiiManagement; using WheelWizard.WiiManagement.GameLicense; namespace WheelWizard.Views; @@ -198,20 +196,26 @@ public void UpdatePlayerAndRoomCount(RRLiveRooms sender) var playerCount = sender.PlayerCount; var roomCount = sender.RoomCount; PlayerCountBox.Text = playerCount.ToString(); - PlayerCountBox.TipText = playerCount switch - { - 1 => Phrases.Hover_PlayersOnline_1, - 0 => Phrases.Hover_PlayersOnline_0, - _ => Humanizer.ReplaceDynamic(Phrases.Hover_PlayersOnline_x, playerCount) - ?? $"There are currently {playerCount} players online", - }; + ToolTip.SetTip( + PlayerCountBox, + playerCount switch + { + 1 => Phrases.Hover_PlayersOnline_1, + 0 => Phrases.Hover_PlayersOnline_0, + _ => Humanizer.ReplaceDynamic(Phrases.Hover_PlayersOnline_x, playerCount) + ?? $"There are currently {playerCount} players online", + } + ); RoomCountBox.Text = roomCount.ToString(); - RoomCountBox.TipText = roomCount switch - { - 1 => Phrases.Hover_RoomsOnline_1, - 0 => Phrases.Hover_RoomsOnline_0, - _ => Humanizer.ReplaceDynamic(Phrases.Hover_RoomsOnline_x, roomCount) ?? $"There are currently {roomCount} rooms active", - }; + ToolTip.SetTip( + RoomCountBox, + roomCount switch + { + 1 => Phrases.Hover_RoomsOnline_1, + 0 => Phrases.Hover_RoomsOnline_0, + _ => Humanizer.ReplaceDynamic(Phrases.Hover_RoomsOnline_x, roomCount) ?? $"There are currently {roomCount} rooms active", + } + ); UpdateFriendCount(); }