From 09892bfcb9dee92d4caa8677c8f89e85682b4a7c Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 3 Jun 2026 00:01:08 +0200 Subject: [PATCH 1/6] initial steps --- WheelWizard/Views/Layout.axaml | 219 +++++++++++------- WheelWizard/Views/Layout.axaml.cs | 21 +- WheelWizard/Views/Pages/FriendsPage.axaml | 4 - WheelWizard/Views/Pages/HomePage.axaml | 3 - WheelWizard/Views/Pages/MiiListPage.axaml | 3 - .../Views/Patterns/CurrentUserProfile.axaml | 38 +-- .../Views/Patterns/SidebarRadioButton.axaml | 20 +- .../Patterns/SidebarRadioButton.axaml.cs | 20 ++ 8 files changed, 199 insertions(+), 129 deletions(-) diff --git a/WheelWizard/Views/Layout.axaml b/WheelWizard/Views/Layout.axaml index 82aa4958..83f444a1 100644 --- a/WheelWizard/Views/Layout.axaml +++ b/WheelWizard/Views/Layout.axaml @@ -13,7 +13,7 @@ ExtendClientAreaToDecorationsHint="True" ExtendClientAreaChromeHints="NoChrome" CanResize='False' Background="Transparent"> - - - - - - - - - @@ -64,57 +56,20 @@ Margin="{StaticResource EdgeGap}" /> - - - - - - - - - - - - - - - - + + + - - @@ -135,7 +90,11 @@ + Text="{loc:T page_title.rooms}" x:Name="RoomsButton" + BoxText="0" + BoxIconData="{StaticResource UserCouple}" + BoxIconSize="14" + BoxTip="{loc:T hover.players_online.0}" /> @@ -157,34 +116,120 @@ Text="Kitchen Sink" x:Name="KitchenSinkButton" /> - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (SettingsService.TESTING_MODE_ENABLED); } + private void SidebarInfoButton_OnPointerPressed(object? sender, PointerPressedEventArgs e) + { + SidebarInfoContextMenu.Open(); + e.Handled = true; + } + private void CloseButton_Click(object? sender, RoutedEventArgs e) => Close(); private void MinimizeButton_Click(object? sender, RoutedEventArgs e) => WindowState = WindowState.Minimized; - private void Discord_Click(object sender, EventArgs e) => ViewUtils.OpenLink(BrandingService.Branding.DiscordUrl.ToString()); + private void Discord_Click(object? sender, RoutedEventArgs e) => ViewUtils.OpenLink(BrandingService.Branding.DiscordUrl.ToString()); - private void Github_Click(object sender, EventArgs e) => ViewUtils.OpenLink(BrandingService.Branding.RepositoryUrl.ToString()); + private void Github_Click(object? sender, RoutedEventArgs e) => ViewUtils.OpenLink(BrandingService.Branding.RepositoryUrl.ToString()); - private void Support_Click(object sender, EventArgs e) => ViewUtils.OpenLink(BrandingService.Branding.SupportUrl.ToString()); + private void Support_Click(object? sender, RoutedEventArgs e) => ViewUtils.OpenLink(BrandingService.Branding.SupportUrl.ToString()); private void CloseSnackbar_OnClick(object? sender, EventArgs e) { diff --git a/WheelWizard/Views/Pages/FriendsPage.axaml b/WheelWizard/Views/Pages/FriendsPage.axaml index eacddb7a..02b39f45 100644 --- a/WheelWizard/Views/Pages/FriendsPage.axaml +++ b/WheelWizard/Views/Pages/FriendsPage.axaml @@ -44,10 +44,6 @@ - - - - - diff --git a/WheelWizard/Views/Pages/MiiListPage.axaml b/WheelWizard/Views/Pages/MiiListPage.axaml index beaf8a37..67ad16b9 100644 --- a/WheelWizard/Views/Pages/MiiListPage.axaml +++ b/WheelWizard/Views/Pages/MiiListPage.axaml @@ -22,9 +22,6 @@ - - - - - - - - - + - - - - - \ No newline at end of file + + + diff --git a/WheelWizard/Views/Patterns/SidebarRadioButton.axaml b/WheelWizard/Views/Patterns/SidebarRadioButton.axaml index 9b5bc454..d34f3c78 100644 --- a/WheelWizard/Views/Patterns/SidebarRadioButton.axaml +++ b/WheelWizard/Views/Patterns/SidebarRadioButton.axaml @@ -34,7 +34,7 @@ + diff --git a/WheelWizard/Views/Patterns/SidebarRadioButton.axaml.cs b/WheelWizard/Views/Patterns/SidebarRadioButton.axaml.cs index 5e052614..5518fa8f 100644 --- a/WheelWizard/Views/Patterns/SidebarRadioButton.axaml.cs +++ b/WheelWizard/Views/Patterns/SidebarRadioButton.axaml.cs @@ -53,6 +53,26 @@ public string BoxTip set => SetValue(BoxTipProperty, value); } + public static readonly StyledProperty BoxIconDataProperty = AvaloniaProperty.Register( + nameof(BoxIconData) + ); + + public Geometry BoxIconData + { + get => GetValue(BoxIconDataProperty); + set => SetValue(BoxIconDataProperty, value); + } + + public static readonly StyledProperty BoxIconSizeProperty = AvaloniaProperty.Register( + nameof(BoxIconSize) + ); + + public double BoxIconSize + { + get => GetValue(BoxIconSizeProperty); + set => SetValue(BoxIconSizeProperty, value); + } + //todo: after patches is more stable, uncomment this // public static readonly StyledProperty WarningVisibleProperty = AvaloniaProperty.Register( From 626de43a6557567a3e5a60761ae9164079e1a67b Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 3 Jun 2026 21:37:33 +0200 Subject: [PATCH 2/6] absolute cinema --- WheelWizard/Views/Layout.axaml | 56 ++++++++++++++----- WheelWizard/Views/Layout.axaml.cs | 28 ++++++++++ .../Views/Patterns/CurrentUserProfile.axaml | 23 ++------ 3 files changed, 74 insertions(+), 33 deletions(-) diff --git a/WheelWizard/Views/Layout.axaml b/WheelWizard/Views/Layout.axaml index 83f444a1..a1ba71ca 100644 --- a/WheelWizard/Views/Layout.axaml +++ b/WheelWizard/Views/Layout.axaml @@ -8,6 +8,7 @@ xmlns:pages="clr-namespace:WheelWizard.Views.Pages" xmlns:components="clr-namespace:WheelWizard.Views.Components" xmlns:patterns="clr-namespace:WheelWizard.Views.Patterns" + xmlns:miiVars="using:WheelWizard.MiiImages.Domain" Height="876" Width="656" WindowStartupLocation="CenterScreen" SystemDecorations="None" ExtendClientAreaToDecorationsHint="True" @@ -57,18 +58,43 @@ - - - + + + + + + + + + + + @@ -116,13 +142,13 @@ Text="Kitchen Sink" x:Name="KitchenSinkButton" /> - + new SolidColorBrush((Color)Application.Current!.FindResource(resourceName)!); + private void CloseButton_Click(object? sender, RoutedEventArgs e) => Close(); private void MinimizeButton_Click(object? sender, RoutedEventArgs e) => WindowState = WindowState.Minimized; diff --git a/WheelWizard/Views/Patterns/CurrentUserProfile.axaml b/WheelWizard/Views/Patterns/CurrentUserProfile.axaml index f8b07a11..f8991064 100644 --- a/WheelWizard/Views/Patterns/CurrentUserProfile.axaml +++ b/WheelWizard/Views/Patterns/CurrentUserProfile.axaml @@ -1,25 +1,16 @@  - - - - - + - - From f3a971fa47db774838dbee4ce77e17c9a25eb0c3 Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 3 Jun 2026 21:45:55 +0200 Subject: [PATCH 3/6] profiles ins the sidebars now update perfectly --- WheelWizard/Views/Layout.axaml.cs | 2 ++ .../Views/Pages/UserProfilePage.axaml.cs | 18 ++++++++++++++++-- .../Views/Patterns/CurrentUserProfile.axaml.cs | 5 +++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/WheelWizard/Views/Layout.axaml.cs b/WheelWizard/Views/Layout.axaml.cs index 7da4106a..71d1b9f7 100644 --- a/WheelWizard/Views/Layout.axaml.cs +++ b/WheelWizard/Views/Layout.axaml.cs @@ -250,6 +250,8 @@ public void UpdateFriendCount() FriendsButton.BoxTip = t("hover.friends_online.n", friends.Count(friend => friend.IsOnline)); } + public void UpdateSidebarProfile() => SidebarCurrentUserProfile.Refresh(); + public void UpdatePlayerAndRoomCount(RRLiveRooms sender) { var playerCount = sender.PlayerCount; diff --git a/WheelWizard/Views/Pages/UserProfilePage.axaml.cs b/WheelWizard/Views/Pages/UserProfilePage.axaml.cs index ea87d8ef..dbc201cc 100644 --- a/WheelWizard/Views/Pages/UserProfilePage.axaml.cs +++ b/WheelWizard/Views/Pages/UserProfilePage.axaml.cs @@ -250,7 +250,9 @@ private void SetUserAsPrimary() // since Avalonia has some weird ass cashing, It might just be that that is because this method is actually deprecated //now we refresh the sidebar friend amount - ViewUtils.GetLayout().UpdateFriendCount(); + var layout = ViewUtils.GetLayout(); + layout.UpdateFriendCount(); + layout.UpdateSidebarProfile(); ViewUtils.ShowSnackbar(t("snackbar_success.profile_set_primary")); } @@ -275,7 +277,9 @@ private void RegionDropdown_SelectionChanged(object? sender, SelectionChangedEve ViewMii(0); // Just in case you have current user set as 4. and you change to a region where there are only 3 users. SetUserAsPrimary(); UpdatePage(); - ViewUtils.GetLayout().UpdateFriendCount(); + var layout = ViewUtils.GetLayout(); + layout.UpdateFriendCount(); + layout.UpdateSidebarProfile(); } private void TopBarRadio_OnClick(object? sender, RoutedEventArgs e) @@ -325,6 +329,7 @@ private async void OpenMiiSelector_Click(object? sender, RoutedEventArgs e) CurrentMii = selectedMii; GameLicenseService.LoadLicense(); UpdatePage(); + UpdateSidebarProfileIfCurrentUser(); ViewUtils.ShowSnackbar(t("message_success.mii_changed")); } @@ -390,6 +395,15 @@ private async void RenameMii_OnClick(object? sender, EventArgs e) //reload game data, since multiple licenses can use the same mii GameLicenseService.LoadLicense(); UpdatePage(); + UpdateSidebarProfileIfCurrentUser(); + } + + private void UpdateSidebarProfileIfCurrentUser() + { + if (FocusedUser != _currentUserIndex) + return; + + ViewUtils.GetLayout().UpdateSidebarProfile(); } private void MoveCarouselPage(int offset) diff --git a/WheelWizard/Views/Patterns/CurrentUserProfile.axaml.cs b/WheelWizard/Views/Patterns/CurrentUserProfile.axaml.cs index 9012d4a6..13cec9f4 100644 --- a/WheelWizard/Views/Patterns/CurrentUserProfile.axaml.cs +++ b/WheelWizard/Views/Patterns/CurrentUserProfile.axaml.cs @@ -51,6 +51,11 @@ public CurrentUserProfile() InitializeComponent(); DataContext = this; + Refresh(); + } + + public void Refresh() + { GameLicenseService.RefreshOnlineStatus(); GameLicenseService.LoadLicense(); From f0fee66e3f8e761388ebc915c7063c254f23cdb9 Mon Sep 17 00:00:00 2001 From: Dirk Date: Wed, 3 Jun 2026 23:36:47 +0200 Subject: [PATCH 4/6] improved buttons in the my profiels page --- WheelWizard/Views/Pages/LeaderboardPage.axaml | 24 +--- .../Views/Pages/LeaderboardPage.axaml.cs | 9 -- WheelWizard/Views/Pages/MiiListPage.axaml | 119 ++++++++-------- WheelWizard/Views/Pages/UserProfilePage.axaml | 134 +++++++++++++----- .../Views/Pages/UserProfilePage.axaml.cs | 12 +- .../Views/Patterns/CurrentUserProfile.axaml | 1 + 6 files changed, 179 insertions(+), 120 deletions(-) diff --git a/WheelWizard/Views/Pages/LeaderboardPage.axaml b/WheelWizard/Views/Pages/LeaderboardPage.axaml index 369373e4..25b0be4a 100644 --- a/WheelWizard/Views/Pages/LeaderboardPage.axaml +++ b/WheelWizard/Views/Pages/LeaderboardPage.axaml @@ -77,26 +77,10 @@ HorizontalAlignment="Stretch" VerticalAlignment="Bottom" /> - - - - - - - + _loadedPlayerCount.ToString(); - public string RemainingCountText => $"{RemainingPlayers.Count} players"; public LeaderboardPlayerItem? PodiumFirst @@ -268,9 +265,6 @@ private async Task ReloadLeaderboardAsync() if (cancellationToken.IsCancellationRequested) return; - _loadedPlayerCount = mappedPlayers.Count; - OnPropertyChanged(nameof(TotalPlayerCountText)); - PodiumFirst = mappedPlayers.ElementAtOrDefault(0); PodiumSecond = mappedPlayers.ElementAtOrDefault(1); PodiumThird = mappedPlayers.ElementAtOrDefault(2); @@ -409,9 +403,6 @@ private void ClearLeaderboardData() PodiumSecond = null; PodiumThird = null; RemainingPlayers.Clear(); - _loadedPlayerCount = 0; - - OnPropertyChanged(nameof(TotalPlayerCountText)); OnPropertyChanged(nameof(RemainingCountText)); } diff --git a/WheelWizard/Views/Pages/MiiListPage.axaml b/WheelWizard/Views/Pages/MiiListPage.axaml index 67ad16b9..f49261ee 100644 --- a/WheelWizard/Views/Pages/MiiListPage.axaml +++ b/WheelWizard/Views/Pages/MiiListPage.axaml @@ -16,9 +16,67 @@ - + + + + + + + + + + + + + + + + + + + + @@ -27,59 +85,8 @@ Title="{loc:T empty_content.no_miis_title}" BodyText="{loc:T empty_content.no_miis}" /> - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/WheelWizard/Views/Pages/UserProfilePage.axaml b/WheelWizard/Views/Pages/UserProfilePage.axaml index caea2562..71b7345c 100644 --- a/WheelWizard/Views/Pages/UserProfilePage.axaml +++ b/WheelWizard/Views/Pages/UserProfilePage.axaml @@ -35,6 +35,67 @@ + + + + + + + + + + + + @@ -47,42 +108,18 @@ - - - - - - - - - - - - - + - + @@ -90,9 +127,38 @@ Background="{StaticResource Neutral900}" BorderThickness="1" CornerRadius="{StaticResource GlobalCornerRadius}" BorderBrush="{StaticResource Neutral900}" x:Name="CurrentUserProfile" ClipToBounds="true"> - + + + + + + + + + + + + - @@ -112,7 +178,7 @@ - @@ -170,7 +236,7 @@ - + x:Name="CurrentUserCarousel" Height="250" /> diff --git a/WheelWizard/Views/Pages/UserProfilePage.axaml.cs b/WheelWizard/Views/Pages/UserProfilePage.axaml.cs index dbc201cc..ca60bbf2 100644 --- a/WheelWizard/Views/Pages/UserProfilePage.axaml.cs +++ b/WheelWizard/Views/Pages/UserProfilePage.axaml.cs @@ -25,6 +25,7 @@ namespace WheelWizard.Views.Pages; public partial class UserProfilePage : UserControlBase, INotifyPropertyChanged { private const int ProfileCarouselPageCount = 2; + private const int ProfileSelectorMaxCharacters = 12; private LicenseProfile? currentPlayer; private Mii? _currentMii; @@ -187,17 +188,26 @@ private void ResetMiiTopBar() var noLicense = miiName == SettingValues.NoLicense; radioButton.IsEnabled = !noLicense; - radioButton.Content = miiName switch + var displayName = miiName switch { SettingValues.NoName => t("state.no_name"), SettingValues.NoLicense => t("state.no_license"), _ => miiName, }; + radioButton.Content = TrimProfileSelectorText(displayName); } UpdateCarouselIndicators(); } + private static string TrimProfileSelectorText(string? text) + { + if (string.IsNullOrEmpty(text) || text.Length < ProfileSelectorMaxCharacters) + return text ?? string.Empty; + + return $"{text[..(ProfileSelectorMaxCharacters - 1)]}..."; + } + private void UpdatePage() { PrimaryCheckBox.IsChecked = FocusedUser == _currentUserIndex; diff --git a/WheelWizard/Views/Patterns/CurrentUserProfile.axaml b/WheelWizard/Views/Patterns/CurrentUserProfile.axaml index f8991064..1517ad46 100644 --- a/WheelWizard/Views/Patterns/CurrentUserProfile.axaml +++ b/WheelWizard/Views/Patterns/CurrentUserProfile.axaml @@ -15,6 +15,7 @@ From bb46a9e563f254d0a59373277b08386e5f916223 Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 4 Jun 2026 00:01:42 +0200 Subject: [PATCH 5/6] beterecontext menu --- WheelWizard/Views/Layout.axaml | 41 +++++++++++++++---- WheelWizard/Views/Layout.axaml.cs | 6 +++ WheelWizard/Views/Pages/SettingsPage.axaml.cs | 12 ++++++ WheelWizard/Views/ViewUtils.cs | 1 + 4 files changed, 52 insertions(+), 8 deletions(-) diff --git a/WheelWizard/Views/Layout.axaml b/WheelWizard/Views/Layout.axaml index a1ba71ca..1a7391e7 100644 --- a/WheelWizard/Views/Layout.axaml +++ b/WheelWizard/Views/Layout.axaml @@ -196,27 +196,52 @@ HorizontalAlignment="Center" VerticalAlignment="Center" /> - - + + + + + - - - + + + - + + + + + + - + - + diff --git a/WheelWizard/Views/Layout.axaml.cs b/WheelWizard/Views/Layout.axaml.cs index 71d1b9f7..679ed5b2 100644 --- a/WheelWizard/Views/Layout.axaml.cs +++ b/WheelWizard/Views/Layout.axaml.cs @@ -19,6 +19,7 @@ using WheelWizard.Utilities.RepeatedTasks; using WheelWizard.Views.Components; using WheelWizard.Views.Pages; +using WheelWizard.Views.Pages.Settings; using WheelWizard.Views.Patterns; using WheelWizard.Views.Popups.Generic; using WheelWizard.WheelWizardData.Domain; @@ -129,6 +130,7 @@ private void OnLanguageChanged(object? sender, EventArgs e) { UpdateModsButtonText(); UpdateMadeByText(); + UpdateLiveAlert(); } private void UpdateMadeByText() @@ -260,6 +262,8 @@ public void UpdatePlayerAndRoomCount(RRLiveRooms sender) UpdateFriendCount(); } + public void UpdateLiveAlert() => UpdateLiveAlert(WhWzStatusManager.Instance); + private void UpdateLiveAlert(WhWzStatusManager sender) { var hasVariant = sender.Status?.Variant != null && sender.Status.Variant != WhWzStatusVariant.None; @@ -407,6 +411,8 @@ private static IBrush GetResourceBrush(string resourceName) => private void Support_Click(object? sender, RoutedEventArgs e) => ViewUtils.OpenLink(BrandingService.Branding.SupportUrl.ToString()); + private void About_Click(object? sender, RoutedEventArgs e) => NavigationManager.NavigateTo(new AppInfo()); + private void CloseSnackbar_OnClick(object? sender, EventArgs e) { Snackbar.Classes.Remove("show"); diff --git a/WheelWizard/Views/Pages/SettingsPage.axaml.cs b/WheelWizard/Views/Pages/SettingsPage.axaml.cs index 0e9ba539..085bd867 100644 --- a/WheelWizard/Views/Pages/SettingsPage.axaml.cs +++ b/WheelWizard/Views/Pages/SettingsPage.axaml.cs @@ -19,6 +19,7 @@ public SettingsPage(UserControl initialSettingsPage) #endif SettingsContent.Content = initialSettingsPage; + SetCheckedTopBarButton(initialSettingsPage); } private void TopBarRadio_OnClick(object? sender, RoutedEventArgs e) @@ -39,5 +40,16 @@ private void TopBarRadio_OnClick(object? sender, RoutedEventArgs e) SettingsContent.Content = instance; } + private void SetCheckedTopBarButton(UserControl settingsPage) + { + foreach (var child in SettingPages.Children) + { + if (child is not RadioButton radioButton) + continue; + + radioButton.IsChecked = radioButton.Tag?.ToString() == settingsPage.GetType().Name; + } + } + private void DevButton_OnClick(object? sender, RoutedEventArgs e) => new DevToolWindow().Show(); } diff --git a/WheelWizard/Views/ViewUtils.cs b/WheelWizard/Views/ViewUtils.cs index 43b88d44..720c8514 100644 --- a/WheelWizard/Views/ViewUtils.cs +++ b/WheelWizard/Views/ViewUtils.cs @@ -80,6 +80,7 @@ public static void RefreshWindow() } newWindow.UpdatePlayerAndRoomCount(RRLiveRooms.Instance); + newWindow.UpdateLiveAlert(); } public static T? FindParent(object? child, int maxSearchDepth = 10) From 830f67aa3c65d098d1fe2cbdf4c014522c63e9cc Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 4 Jun 2026 00:04:19 +0200 Subject: [PATCH 6/6] small fix --- WheelWizard/Views/Layout.axaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/WheelWizard/Views/Layout.axaml b/WheelWizard/Views/Layout.axaml index 1a7391e7..3ee845c5 100644 --- a/WheelWizard/Views/Layout.axaml +++ b/WheelWizard/Views/Layout.axaml @@ -191,6 +191,7 @@ Classes="BottomSidebarIcon" PointerPressed="SidebarInfoButton_OnPointerPressed"> - - +