From 2f0d96ae5ccb6728bb2699b032f8de29936203e5 Mon Sep 17 00:00:00 2001 From: Supheria <77865986+Supheria@users.noreply.github.com> Date: Wed, 25 Dec 2024 07:55:22 +0800 Subject: [PATCH] =?UTF-8?q?Feat:=20=E6=B7=BB=E5=8A=A0=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=20(#47)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Moder.Core/App.axaml | 11 +- Moder.Core/App.axaml.cs | 2 + ...eroMinimumPrefixLengthDropdownBehaviour.cs | 2 +- Moder.Core/Controls/Controls.axaml | 3 + Moder.Core/Controls/DirectorySelector.axaml | 15 +- .../Controls/DirectorySelector.axaml.cs | 18 +- .../EnumTypeToStringListConverter.cs | 34 --- Moder.Core/Extensions/EnumExtensions.cs | 30 +-- .../Messages/CompleteAppInitializeMessage.cs | 4 +- Moder.Core/Models/AppThemeInfo.cs | 7 + .../Models/Game/Modifiers/LeafModifier.cs | 2 +- Moder.Core/Models/ThemeMode.cs | 4 +- Moder.Core/Models/ThemeVariants.cs | 13 -- Moder.Core/Models/Vo/TraitVo.cs | 2 +- Moder.Core/Moder.Core.csproj | 1 + Moder.Core/Resources/AppThemeResource.axaml | 13 +- .../Services/Config/AppSettingService.cs | 2 +- .../Modifiers/ModifierService.cs | 5 - .../Services/GameResources/TerrainService.cs | 5 +- Moder.Core/Services/MessageBoxService.cs | 11 + .../Game/CharacterEditorControlView.axaml.cs | 2 +- Moder.Core/Views/MainWindow.axaml | 18 +- .../Menus/AppInitializeControlView.axaml | 38 ++-- .../Menus/AppInitializeControlView.axaml.cs | 43 +--- Moder.Core/Views/Menus/AppSettingsView.axaml | 118 +++++++++++ .../Views/Menus/AppSettingsView.axaml.cs | 60 ++++++ Moder.Core/ViewsModel/MainWindowViewModel.cs | 8 + .../ViewsModel/Menus/AppSettingsViewModel.cs | 193 ++++++++++++++++++ .../Menus/SideBarControlViewModel.cs | 25 ++- Moder.Language/Strings/Resource.Designer.cs | 18 +- Moder.Language/Strings/Resource.en-US.resx | 6 +- Moder.Language/Strings/Resource.resx | 6 +- 32 files changed, 505 insertions(+), 214 deletions(-) create mode 100644 Moder.Core/Controls/Controls.axaml delete mode 100644 Moder.Core/Converters/EnumTypeToStringListConverter.cs create mode 100644 Moder.Core/Models/AppThemeInfo.cs delete mode 100644 Moder.Core/Models/ThemeVariants.cs create mode 100644 Moder.Core/Views/Menus/AppSettingsView.axaml create mode 100644 Moder.Core/Views/Menus/AppSettingsView.axaml.cs create mode 100644 Moder.Core/ViewsModel/Menus/AppSettingsViewModel.cs diff --git a/Moder.Core/App.axaml b/Moder.Core/App.axaml index dbad804..8af1637 100644 --- a/Moder.Core/App.axaml +++ b/Moder.Core/App.axaml @@ -1,10 +1,9 @@ + RequestedThemeVariant="Default"> @@ -12,14 +11,14 @@ - + - + Segoe Fluent Icons - + diff --git a/Moder.Core/App.axaml.cs b/Moder.Core/App.axaml.cs index d71a1bf..3f706cd 100644 --- a/Moder.Core/App.axaml.cs +++ b/Moder.Core/App.axaml.cs @@ -32,6 +32,7 @@ namespace Moder.Core; public class App : Application { public const string AppVersion = "0.1.0-alpha"; + public const string CodeRepositoryUrl = "https://github.com/ModerCore/Moder"; public static new App Current => (App)Application.Current!; public static IServiceProvider Services => Current._serviceProvider; public static string AppConfigFolder { get; } = @@ -131,6 +132,7 @@ private static HostApplicationBuilder CreateHostBuilder() builder.Services.AddViewSingleton(); builder.Services.AddViewSingleton(); builder.Services.AddViewTransient(); + builder.Services.AddViewTransient(); builder.Services.AddViewSingleton(); builder.Services.AddTransient(); diff --git a/Moder.Core/Behaviors/AutoCompleteZeroMinimumPrefixLengthDropdownBehaviour.cs b/Moder.Core/Behaviors/AutoCompleteZeroMinimumPrefixLengthDropdownBehaviour.cs index 71ed4f1..d83d82d 100644 --- a/Moder.Core/Behaviors/AutoCompleteZeroMinimumPrefixLengthDropdownBehaviour.cs +++ b/Moder.Core/Behaviors/AutoCompleteZeroMinimumPrefixLengthDropdownBehaviour.cs @@ -93,7 +93,7 @@ private void ShowDropdown() ipc.SetValue(AssociatedObject, true); } - AssociatedObject.SetCurrentValue(AutoCompleteBox.IsDropDownOpenProperty, true); + AssociatedObject.SetCurrentValue(AutoCompleteBox.IsDropDownOpenProperty, true); } } } diff --git a/Moder.Core/Controls/Controls.axaml b/Moder.Core/Controls/Controls.axaml new file mode 100644 index 0000000..3647941 --- /dev/null +++ b/Moder.Core/Controls/Controls.axaml @@ -0,0 +1,3 @@ + + + diff --git a/Moder.Core/Controls/DirectorySelector.axaml b/Moder.Core/Controls/DirectorySelector.axaml index 02311eb..604eb84 100644 --- a/Moder.Core/Controls/DirectorySelector.axaml +++ b/Moder.Core/Controls/DirectorySelector.axaml @@ -1,7 +1,7 @@ + xmlns:controls="clr-namespace:Moder.Core.Controls" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> @@ -11,19 +11,20 @@ + VerticalAlignment="Center"> + MaxHeight="55" + Text="{TemplateBinding DirectoryPath, + Mode=TwoWay}" + Width="280" />