diff --git a/GsaEditor.Core/bin/Debug/net8.0/GsaEditor.Core.dll b/GsaEditor.Core/bin/Debug/net8.0/GsaEditor.Core.dll index 4b60a8d..7e45f4a 100644 Binary files a/GsaEditor.Core/bin/Debug/net8.0/GsaEditor.Core.dll and b/GsaEditor.Core/bin/Debug/net8.0/GsaEditor.Core.dll differ diff --git a/GsaEditor.Core/bin/Debug/net8.0/GsaEditor.Core.pdb b/GsaEditor.Core/bin/Debug/net8.0/GsaEditor.Core.pdb index 5b9285b..3abb27e 100644 Binary files a/GsaEditor.Core/bin/Debug/net8.0/GsaEditor.Core.pdb and b/GsaEditor.Core/bin/Debug/net8.0/GsaEditor.Core.pdb differ diff --git a/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.AssemblyInfo.cs b/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.AssemblyInfo.cs index dfdd656..44a6762 100644 --- a/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.AssemblyInfo.cs +++ b/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("GsaEditor.Core")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d6d621dc92b3083d8e47827baa0ccf59d5b0a4c4")] [assembly: System.Reflection.AssemblyProductAttribute("GsaEditor.Core")] [assembly: System.Reflection.AssemblyTitleAttribute("GsaEditor.Core")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.AssemblyInfoInputs.cache b/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.AssemblyInfoInputs.cache index 222b3db..f61127c 100644 --- a/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.AssemblyInfoInputs.cache +++ b/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.AssemblyInfoInputs.cache @@ -1 +1 @@ -68387796343863a0e5c11cd0f612a1b364816551cf5816c6d556d410439a3710 +27416b735d6b5e6056e4f76966d345ebebb5a18e412e4170cdbcf381f9ab7092 diff --git a/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.dll b/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.dll index 4b60a8d..7e45f4a 100644 Binary files a/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.dll and b/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.dll differ diff --git a/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.pdb b/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.pdb index 5b9285b..3abb27e 100644 Binary files a/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.pdb and b/GsaEditor.Core/obj/Debug/net8.0/GsaEditor.Core.pdb differ diff --git a/GsaEditor.Core/obj/Debug/net8.0/ref/GsaEditor.Core.dll b/GsaEditor.Core/obj/Debug/net8.0/ref/GsaEditor.Core.dll index 4c7eb2e..3b897f7 100644 Binary files a/GsaEditor.Core/obj/Debug/net8.0/ref/GsaEditor.Core.dll and b/GsaEditor.Core/obj/Debug/net8.0/ref/GsaEditor.Core.dll differ diff --git a/GsaEditor.Core/obj/Debug/net8.0/refint/GsaEditor.Core.dll b/GsaEditor.Core/obj/Debug/net8.0/refint/GsaEditor.Core.dll index 4c7eb2e..3b897f7 100644 Binary files a/GsaEditor.Core/obj/Debug/net8.0/refint/GsaEditor.Core.dll and b/GsaEditor.Core/obj/Debug/net8.0/refint/GsaEditor.Core.dll differ diff --git a/GsaEditor/App.axaml b/GsaEditor/App.axaml index b28a7e1..16df790 100644 --- a/GsaEditor/App.axaml +++ b/GsaEditor/App.axaml @@ -5,5 +5,6 @@ + diff --git a/GsaEditor/GsaEditor.csproj b/GsaEditor/GsaEditor.csproj index fd5035f..4baa241 100644 --- a/GsaEditor/GsaEditor.csproj +++ b/GsaEditor/GsaEditor.csproj @@ -23,6 +23,8 @@ All + + diff --git a/GsaEditor/ViewModels/MainWindowViewModel.cs b/GsaEditor/ViewModels/MainWindowViewModel.cs index 0ba3ee6..fad9cbd 100644 --- a/GsaEditor/ViewModels/MainWindowViewModel.cs +++ b/GsaEditor/ViewModels/MainWindowViewModel.cs @@ -1,4 +1,5 @@ using System.Collections.ObjectModel; +using System.Reflection; using System.Text; using Avalonia.Controls; using Avalonia.Media.Imaging; @@ -627,14 +628,24 @@ public partial class MainWindowViewModel : ViewModelBase [RelayCommand] private void SaveEdit() { - if (SelectedNode?.Entry == null || PreviewText == null) return; + if (SelectedNode?.Entry == null) return; + + // Get the current text from the AvaloniaEdit editor via the window + string? editorText = null; + if (_window is GsaEditor.Views.MainWindow mainWindow) + { + editorText = mainWindow.GetEditorText(); + } + + if (editorText == null) editorText = PreviewText ?? string.Empty; var entry = SelectedNode.Entry; - var newData = Encoding.UTF8.GetBytes(PreviewText); + var newData = Encoding.UTF8.GetBytes(editorText); entry.SetData(newData, entry.IsCompressed); IsDirty = true; IsEditingText = false; + PreviewText = editorText; var entryVm = new EntryViewModel(entry); entryVm.OnModified = () => { IsDirty = true; NotifyStatusChanged(); }; @@ -660,8 +671,17 @@ public partial class MainWindowViewModel : ViewModelBase private async Task ShowAbout() { if (_window == null) return; + + var appVersion = Assembly.GetExecutingAssembly().GetName().Version; + var versionStr = appVersion != null ? $"{appVersion.Major}.{appVersion.Minor}.{appVersion.Build}" : "1.0.0"; + var avaloniaVersion = typeof(Avalonia.Application).Assembly.GetName().Version; + var avaloniaStr = avaloniaVersion != null ? $"{avaloniaVersion.Major}.{avaloniaVersion.Minor}.{avaloniaVersion.Build}" : "unknown"; + await Dialogs.ShowMessageAsync(_window, "About GsaEditor", - "GsaEditor v1.0\n\nGSA Archive Viewer & Editor\nBuilt with Avalonia UI"); + $"GsaEditor v{versionStr}\n\n" + + $"GSA Archive Viewer & Editor\n" + + $"By Develter Innovation (Nicolas RACOT)\n\n" + + $"Built with Avalonia UI v{avaloniaStr}"); } // ========================================================================= diff --git a/GsaEditor/Views/MainWindow.axaml b/GsaEditor/Views/MainWindow.axaml index 58d2f87..935ba7d 100644 --- a/GsaEditor/Views/MainWindow.axaml +++ b/GsaEditor/Views/MainWindow.axaml @@ -3,6 +3,7 @@ xmlns:vm="using:GsaEditor.ViewModels" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:aedit="https://github.com/avaloniaui/avaloniaedit" mc:Ignorable="d" d:DesignWidth="1100" d:DesignHeight="700" x:Class="GsaEditor.Views.MainWindow" x:CompileBindings="False" @@ -199,13 +200,12 @@