From fb7df9404d031d5d477d8456427ef232b7ce6f11 Mon Sep 17 00:00:00 2001 From: Pear-231 <61670316+Pear-231@users.noreply.github.com> Date: Fri, 13 Mar 2026 20:30:52 +0000 Subject: [PATCH 1/2] Fixed window buttons misalignment and modernised CustomWindowStyle --- AssetEditor/Themes/Controls.xaml | 174 ++++++++++++------ AssetEditor/Views/MainWindow.xaml | 43 +++-- .../WindowStateToPathConverter.cs | 4 +- 3 files changed, 142 insertions(+), 79 deletions(-) diff --git a/AssetEditor/Themes/Controls.xaml b/AssetEditor/Themes/Controls.xaml index fc35e6cda..9ed80e97e 100644 --- a/AssetEditor/Themes/Controls.xaml +++ b/AssetEditor/Themes/Controls.xaml @@ -5446,7 +5446,9 @@ + - diff --git a/AssetEditor/WindowsTitleMenu/WindowStateToPathConverter.cs b/AssetEditor/WindowsTitleMenu/WindowStateToPathConverter.cs index ddc0b27fc..2cffa826e 100644 --- a/AssetEditor/WindowsTitleMenu/WindowStateToPathConverter.cs +++ b/AssetEditor/WindowsTitleMenu/WindowStateToPathConverter.cs @@ -13,11 +13,11 @@ public object Convert(object value, Type targetType, object parameter, CultureIn var ws = (WindowState)value; if (ws == WindowState.Normal) { - return Geometry.Parse("M 13.5,10.5 H 22.5 V 19.5 H 13.5 Z"); + return Geometry.Parse("M 18.5,10.5 H 27.5 V 19.5 H 18.5 Z"); } else { - return Geometry.Parse("M 13.5,12.5 H 20.5 V 19.5 H 13.5 Z M 15.5,12.5 V 10.5 H 22.5 V 17.5 H 20.5"); + return Geometry.Parse("M 18.5,12.5 H 25.5 V 19.5 H 18.5 Z M 20.5,12.5 V 10.5 H 27.5 V 17.5 H 25.5"); } } From 3fff3c8bb21ff95a30b4b2a33420d5d6dc44d296 Mon Sep 17 00:00:00 2001 From: Pear-231 <61670316+Pear-231@users.noreply.github.com> Date: Fri, 13 Mar 2026 20:31:08 +0000 Subject: [PATCH 2/2] Added updater UI localisation and theme colours --- AssetEditor/Language_En.json | 8 +- AssetEditor/Themes/ControlColours.xaml | 9 ++ AssetEditor/Themes/Controls.xaml | 107 ++++++++++++++--- AssetEditor/ViewModels/UpdaterViewModel.cs | 25 ++-- AssetEditor/Views/Updater/UpdaterWindow.xaml | 111 ++++++++---------- .../Views/Updater/UpdaterWindow.xaml.cs | 42 +++++++ 6 files changed, 210 insertions(+), 92 deletions(-) diff --git a/AssetEditor/Language_En.json b/AssetEditor/Language_En.json index 4f3d61061..22bbe25d9 100644 --- a/AssetEditor/Language_En.json +++ b/AssetEditor/Language_En.json @@ -11,5 +11,11 @@ "SettingsWindow.OnlyLoadLod0": "Only load Lod0 for reference meshes", "SettingsWindow.GridSize": "Grid Size", "SettingsWindow.AudioModding": "Audio Modding", - "SettingsWindow.SaveButton": "Save" + "SettingsWindow.SaveButton": "Save", + + "UpdaterWindow.Title": "Updater", + "UpdaterWindow.UpdateInfo": "A new version of AssetEditor is available!\n\nYour current version is {0}. Update to version {1} to get the latest changes detailed below.", + "UpdaterWindow.ReleaseNotes": "Release Notes", + "UpdaterWindow.UpdateButton": "Update", + "UpdaterWindow.CancelButton": "Cancel" } \ No newline at end of file diff --git a/AssetEditor/Themes/ControlColours.xaml b/AssetEditor/Themes/ControlColours.xaml index c52f49d34..70470f7e7 100644 --- a/AssetEditor/Themes/ControlColours.xaml +++ b/AssetEditor/Themes/ControlColours.xaml @@ -264,6 +264,15 @@ + + + + + + + + + diff --git a/AssetEditor/Themes/Controls.xaml b/AssetEditor/Themes/Controls.xaml index 9ed80e97e..58a4c3170 100644 --- a/AssetEditor/Themes/Controls.xaml +++ b/AssetEditor/Themes/Controls.xaml @@ -1,14 +1,16 @@ - + @@ -16,7 +18,7 @@ - + + + + + + + - + + - + + diff --git a/AssetEditor/ViewModels/UpdaterViewModel.cs b/AssetEditor/ViewModels/UpdaterViewModel.cs index 6d5a0aad9..f4595d4c0 100644 --- a/AssetEditor/ViewModels/UpdaterViewModel.cs +++ b/AssetEditor/ViewModels/UpdaterViewModel.cs @@ -3,7 +3,6 @@ using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; -using System.Text; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; using Octokit; @@ -17,39 +16,33 @@ namespace AssetEditor.ViewModels { public class ReleaseNoteItem(Release release) { - public string ReleaseName { get; } = release.Name; - public string PublishedAt { get; } = $"Published {release.PublishedAt.Value:dd MMM yyyy}"; + public string ReleaseName { get; } = $"## [{release.Name}]({release.HtmlUrl})"; + public string PublishedAt { get; } = $"{release.PublishedAt!.Value:dd MMM yyyy}"; public string ReleaseNotes { get; } = release.Body; } - partial class UpdaterViewModel : ObservableObject + public partial class UpdaterViewModel(LocalizationManager localisationManager) : ObservableObject { + private readonly LocalizationManager _localisationManager = localisationManager; + private readonly ILogger _logger = Logging.Create(); - private Action _closeAction; + private Action? _closeAction; private const string AssetEditorUpdaterExe = "AssetEditorUpdater.exe"; private List _newerReleases = []; [ObservableProperty] private ObservableCollection _releaseNotesItems = []; - - [ObservableProperty] private string _latestVersionInfo; + [ObservableProperty] private string _updateInfo = string.Empty; public void SetReleaseInfo(List newerReleases) { _newerReleases = newerReleases; - var currentVersion = VersionChecker.GetCurrentVersion(); var latestRelease = _newerReleases[0]; var latestVersion = VersionChecker.ParseReleaseVersion(latestRelease.TagName); - - var stringBuilder = new StringBuilder(); - stringBuilder.AppendLine($"A new version of AssetEditor is available! The AssetEditor donkeys have been busy..."); - stringBuilder.AppendLine(); - stringBuilder.AppendLine($"Your current version is {currentVersion}. The latest verison is {latestVersion}."); - stringBuilder.AppendLine(); - stringBuilder.AppendLine("Update to get the changes detailed in the release notes below."); - LatestVersionInfo = stringBuilder.ToString(); + var currentVersion = VersionChecker.GetCurrentVersion(); + UpdateInfo = string.Format(_localisationManager.Get("UpdaterWindow.UpdateInfo"), currentVersion, latestVersion); ReleaseNotesItems.Clear(); foreach (var release in _newerReleases) diff --git a/AssetEditor/Views/Updater/UpdaterWindow.xaml b/AssetEditor/Views/Updater/UpdaterWindow.xaml index e1781fb56..3081e655f 100644 --- a/AssetEditor/Views/Updater/UpdaterWindow.xaml +++ b/AssetEditor/Views/Updater/UpdaterWindow.xaml @@ -4,6 +4,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:Localisation="clr-namespace:Shared.Ui.Common;assembly=Shared.Ui" xmlns:Updater="clr-namespace:AssetEditor.Views.Updater" xmlns:MdXaml="clr-namespace:MdXaml;assembly=MdXaml" xmlns:ViewModels="clr-namespace:AssetEditor.ViewModels" @@ -13,9 +14,9 @@ Closed="OnClosed" ResizeMode="NoResize" WindowStartupLocation="CenterScreen" - Height="545" - Width="800" - Title="Asset Editor Updater"> + SizeToContent="Height" + Width="1000" + Title="{Localisation:Loc UpdaterWindow.Title}"> @@ -29,90 +30,82 @@ Height="Auto"/> - - - - - - - - - - + VerticalScrollBarVisibility="Auto" + MaxHeight="400" + Padding="0"> - + + + + - + + + - - + - - - - - - - - - - - + + + + + + + + Margin="10, 10, 0, 0">