sidebar info tweaks

This commit is contained in:
Alex
2025-08-19 21:24:01 -07:00
parent 12a13b4194
commit 3997e24321
4 changed files with 27 additions and 16 deletions
+12 -8
View File
@@ -5,15 +5,19 @@
xmlns:local="clr-namespace:MercuryConverter.UI.Views"
x:Class="MercuryConverter.UI.Views.ChartInfo">
<StackPanel Margin="0 0 0 12">
<Canvas Width="150" Height="32">
<Rectangle Name="ShapeBase" Width="118" Height="32" Canvas.Left="16"/>
<Ellipse Name="ShapeLeftRound" Width="32" Height="32" Canvas.Left="0" Canvas.Top="0"/>
<Ellipse Name="ShapeRightRound" Width="32" Height="32" Canvas.Right="0" Canvas.Top="0"/>
<Polygon Name="ShapeDiagonal" Points="0,32 16,0 45,0 50,32" Canvas.Top="0" Canvas.Right="16"/>
<TextBlock Name="LevelNoTxt" Text="14+" Canvas.Right="8" Canvas.Top="4" Foreground="White" FontSize="20" FontWeight="Bold"/>
<TextBlock Name="LevelNameTxt" Text="INFERNO" Canvas.Left="12" Canvas.Top="6" Foreground="White" FontSize="16" FontWeight="Bold"/>
<Canvas Width="120" Height="24">
<Rectangle Name="ShapeBase" Width="96" Height="24" Canvas.Left="12"/>
<Ellipse Name="ShapeLeftRound" Width="24" Height="24" Canvas.Left="0" Canvas.Top="0"/>
<Ellipse Name="ShapeRightRound" Width="24" Height="24" Canvas.Right="0" Canvas.Top="0"/>
<Polygon Name="ShapeDiagonal" Points="0,24 12,0 40,0 40,24" Canvas.Top="0" Canvas.Right="12"/>
<TextBlock Name="LevelNoTxt" Text="14+" Canvas.Right="8" Canvas.Top="3" Foreground="White" FontSize="16" FontWeight="Bold"/>
<TextBlock Name="LevelNameTxt" Text="INFERNO" Canvas.Left="12" Canvas.Top="5" Foreground="White" FontSize="12" FontWeight="Bold"/>
<ToolTip.Tip>
<TextBlock Text="{Binding Level}"/>
</ToolTip.Tip>
</Canvas>
<TextBlock Name="DesignerTxt" Text="muskit" HorizontalAlignment="Center"/>
<TextBlock Name="DesignerTxt" Text="muskit" HorizontalAlignment="Center" ToolTip.Tip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
</StackPanel>
</UserControl>
+8 -3
View File
@@ -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<Difficulty, (Color, Color)> COLORS = new Dictionary<Difficulty, (Color, Color)>(){
{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;
}
+2 -2
View File
@@ -21,8 +21,8 @@
<StackPanel Name="SelectionInfo">
<TextBlock Name="InfoId" FontFamily="monospace" Text="S00-000" HorizontalAlignment="Center"/>
<Image Name="InfoImageJacket" Margin="24 0 24 0" Source="/Assets/imgs/jacket-placeholder.png"/>
<TextBlock Name="InfoNameText" Text="Name" FontWeight="Bold" HorizontalAlignment="Center" Margin="0 10 0 0"/>
<TextBlock Name="InfoArtistText" Text="Artist" HorizontalAlignment="Center"/>
<TextBlock Name="InfoNameText" Text="Name" FontWeight="Bold" HorizontalAlignment="Center" Margin="0 10 0 0" ToolTip.Tip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
<TextBlock Name="InfoArtistText" Text="Artist" HorizontalAlignment="Center" ToolTip.Tip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"/>
<TextBlock Name="InfoSourceText" Text="Source" HorizontalAlignment="Center" Margin="0 6 0 0"/>
<StackPanel Name="ChartInfoGroup" Margin="0 20 0 0">
</StackPanel>
+5 -3
View File
@@ -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<Song> 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)
{