From 3997e243211ea797bd12bf1963f49e2fd7a307db Mon Sep 17 00:00:00 2001 From: Alex <15199219+muskit@users.noreply.github.com> Date: Tue, 19 Aug 2025 21:24:01 -0700 Subject: [PATCH] sidebar info tweaks --- src/UI/Views/Selection/ChartInfo.axaml | 20 ++++++++++++-------- src/UI/Views/Selection/ChartInfo.axaml.cs | 11 ++++++++--- src/UI/Views/Selection/Selection.axaml | 4 ++-- src/UI/Views/Selection/Selection.axaml.cs | 8 +++++--- 4 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/UI/Views/Selection/ChartInfo.axaml b/src/UI/Views/Selection/ChartInfo.axaml index 5a1d67c..79e3b3b 100644 --- a/src/UI/Views/Selection/ChartInfo.axaml +++ b/src/UI/Views/Selection/ChartInfo.axaml @@ -5,15 +5,19 @@ xmlns:local="clr-namespace:MercuryConverter.UI.Views" x:Class="MercuryConverter.UI.Views.ChartInfo"> - - - - - - - + + + + + + + + + + + - + \ No newline at end of file diff --git a/src/UI/Views/Selection/ChartInfo.axaml.cs b/src/UI/Views/Selection/ChartInfo.axaml.cs index cf379c7..45ed2cc 100644 --- a/src/UI/Views/Selection/ChartInfo.axaml.cs +++ b/src/UI/Views/Selection/ChartInfo.axaml.cs @@ -8,9 +8,13 @@ namespace MercuryConverter.UI.Views; public partial class ChartInfo : UserControl { + private float _level; + private string Level => _level.ToString(); + private string LevelStr => $"{(int)_level}{(_level - (int)_level >= 0.7f ? "+" : "")}"; + private static readonly IReadOnlyDictionary COLORS = new Dictionary(){ {Difficulty.Normal, (new Color(0xff, 0x1b, 0x7c, 0xff), new Color(0xff, 0x3f, 0x66, 0xfa))}, - {Difficulty.Hard, (new Color(0xff, 0xF2, 0xB5, 0x00), new Color(0xff, 0xFF, 0xA0, 0x00))}, + {Difficulty.Hard, (new Color(0xff, 0xF2, 0xB5, 0x00), new Color(0xff, 0xEE, 0x99, 0x00))}, {Difficulty.Expert, (new Color(0xff, 0xFF, 0x00, 0x84), new Color(0xff, 0xCF, 0x00, 0x5B))}, {Difficulty.Inferno, (new Color(0xff, 0x40, 0x00, 0x43), new Color(0xff, 0x1F, 0x00, 0x20))} }; @@ -18,6 +22,7 @@ public partial class ChartInfo : UserControl public ChartInfo(Song song, Difficulty diff = Difficulty.Inferno) { InitializeComponent(); + DataContext = this; var colLight = COLORS[diff].Item1; var colDark = COLORS[diff].Item2; @@ -27,9 +32,9 @@ public partial class ChartInfo : UserControl ShapeDiagonal.Fill = new SolidColorBrush(colDark); var l = song.Levels[(int)diff]!; - var level = l.Value.Item1; var designer = l.Value.Item2; - LevelNoTxt.Text = $"{(int)level}{(level - (int)level >= 0.7f ? "+" : "")}"; + _level = l.Value.Item1; + LevelNoTxt.Text = LevelStr; LevelNameTxt.Text = diff.ToString().ToUpper(); DesignerTxt.Text = designer; } diff --git a/src/UI/Views/Selection/Selection.axaml b/src/UI/Views/Selection/Selection.axaml index 151a53d..67686cd 100644 --- a/src/UI/Views/Selection/Selection.axaml +++ b/src/UI/Views/Selection/Selection.axaml @@ -21,8 +21,8 @@ - - + + diff --git a/src/UI/Views/Selection/Selection.axaml.cs b/src/UI/Views/Selection/Selection.axaml.cs index daf5b15..bae2e43 100644 --- a/src/UI/Views/Selection/Selection.axaml.cs +++ b/src/UI/Views/Selection/Selection.axaml.cs @@ -1,5 +1,4 @@ using System; -using System.Linq; using Avalonia.Controls; using MercuryConverter.Data; using Avalonia.Threading; @@ -7,15 +6,18 @@ using System.IO; using Avalonia.Media.Imaging; using SaturnData.Notation.Core; using System.Collections.Generic; -using UAssetAPI.UnrealTypes.EngineEnums; namespace MercuryConverter.UI.Views; public partial class Selection : Panel { + private List selections; + public Selection() { InitializeComponent(); + DataContext = this; + ListingTable.CellPointerPressed += OnCellClicked; ListingTable.SelectionChanged += OnSelectionChange; ListingTable.SelectionMode = DataGridSelectionMode.Extended; @@ -58,7 +60,7 @@ public partial class Selection : Panel Console.WriteLine($"{e.PointerPressedEventArgs.Properties.IsRightButtonPressed} - {e.Cell.Content}"); } - private void OnSelectionChange(object sender, SelectionChangedEventArgs e) + private void OnSelectionChange(object? sender, SelectionChangedEventArgs e) { if (e.AddedItems.Count > 0) {