diff --git a/RszTool.App/App.xaml.cs b/RszTool.App/App.xaml.cs index 84c2ff3..e403eb4 100644 --- a/RszTool.App/App.xaml.cs +++ b/RszTool.App/App.xaml.cs @@ -31,7 +31,7 @@ protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); - ThemeManager.Init(SaveData.IsDarkTheme); + ThemeManager.Init(SaveData.CurTheme); // 添加全局异常处理程序 SetupUnhandledExceptionHandling(); } diff --git a/RszTool.App/MainWindow.xaml b/RszTool.App/MainWindow.xaml index fc40aba..649e528 100644 --- a/RszTool.App/MainWindow.xaml +++ b/RszTool.App/MainWindow.xaml @@ -12,7 +12,7 @@ xmlns:dockablz="clr-namespace:Dragablz.Dockablz;assembly=Dragablz" mc:Ignorable="d" d:DataContext="{d:DesignInstance Type=viewmodels:MainWindowModel}" - Title="RszTool" Height="960" Width="1280" + Title="RszTool" Height="960" Width="1280" MinWidth="500" MinHeight="250" AllowDrop="True" DragOver="OnDragOver" Drop="OnDrop"> @@ -115,41 +115,57 @@ - + + + - + + + - + + + - + + + - + + + - + + + - + + + - + - + + - - - - + + + + + - - - + + + + + - - - + + + + Style="{StaticResource UsageHint}" FontSize="18" VerticalAlignment="Center" Grid.Column="2" Grid.ColumnSpan="3" /> + diff --git a/RszTool.App/MainWindow.xaml.cs b/RszTool.App/MainWindow.xaml.cs index 82b9870..08890f5 100644 --- a/RszTool.App/MainWindow.xaml.cs +++ b/RszTool.App/MainWindow.xaml.cs @@ -24,8 +24,19 @@ public MainWindow() Title = $"{Title} v{version.Major}.{version.Minor}.{version.Build} - By chenstack"; Closing += OnClosing; + } + + ///隐藏/显示侧边栏 + private void SideColumn_Hide(object sender, RoutedEventArgs e) + { + if (col1.Width != new GridLength(0)) + { + col1.Width = new GridLength(0); + } + else { + col1.Width =new GridLength(200); + } } - public void OnDragOver(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) diff --git a/RszTool.App/Resources/Texts.Designer.cs b/RszTool.App/Resources/Texts.Designer.cs index 57c7e8d..52e9551 100644 --- a/RszTool.App/Resources/Texts.Designer.cs +++ b/RszTool.App/Resources/Texts.Designer.cs @@ -1,541 +1,613 @@ -//------------------------------------------------------------------------------ -// -// 此代码由工具生成。 -// 运行时版本:4.0.30319.42000 -// -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 -// -//------------------------------------------------------------------------------ - -namespace RszTool.App.Resources { - using System; - - - /// - /// 一个强类型的资源类,用于查找本地化的字符串等。 - /// - // 此类是由 StronglyTypedResourceBuilder - // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 - // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen - // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Texts { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Texts() { - } - - /// - /// 返回此类使用的缓存的 ResourceManager 实例。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RszTool.App.Resources.Texts", typeof(Texts).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// 重写当前线程的 CurrentUICulture 属性,对 - /// 使用此强类型资源类的所有资源查找执行重写。 - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// 查找类似 About 的本地化字符串。 - /// - internal static string About { - get { - return ResourceManager.GetString("About", resourceCulture); - } - } - - /// - /// 查找类似 RszTool is a tool that edit and create resource file for RE ENGINE game. Currently support .user, .pfb and .scn files. 的本地化字符串。 - /// - internal static string AboutProjectDetail { - get { - return ResourceManager.GetString("AboutProjectDetail", resourceCulture); - } - } - - /// - /// 查找类似 Add component 的本地化字符串。 - /// - internal static string AddComponent { - get { - return ResourceManager.GetString("AddComponent", resourceCulture); - } - } - - /// - /// 查找类似 Add folder 的本地化字符串。 - /// - internal static string AddFolder { - get { - return ResourceManager.GetString("AddFolder", resourceCulture); - } - } - - /// - /// 查找类似 Input folder name 的本地化字符串。 - /// - internal static string InputFolderName { - get { - return ResourceManager.GetString("InputFolderName", resourceCulture); - } - } - - /// - /// 查找类似 Clear recent files history 的本地化字符串。 - /// - internal static string ClearRecentFilesHistory { - get { - return ResourceManager.GetString("ClearRecentFilesHistory", resourceCulture); - } - } - - /// - /// 查找类似 Close 的本地化字符串。 - /// - internal static string Close { - get { - return ResourceManager.GetString("Close", resourceCulture); - } - } - - /// - /// 查找类似 Component 的本地化字符串。 - /// - internal static string Component { - get { - return ResourceManager.GetString("Component", resourceCulture); - } - } - - /// - /// 查找类似 Copy 的本地化字符串。 - /// - internal static string Copy { - get { - return ResourceManager.GetString("Copy", resourceCulture); - } - } - - /// - /// 查找类似 Duplicate 的本地化字符串。 - /// - internal static string Duplicate { - get { - return ResourceManager.GetString("Duplicate", resourceCulture); - } - } - - /// - /// 查找类似 Duplicate many times 的本地化字符串。 - /// - internal static string DuplicateMulti { - get { - return ResourceManager.GetString("DuplicateMulti", resourceCulture); - } - } - - /// - /// 查找类似 Field name 的本地化字符串。 - /// - internal static string FieldName { - get { - return ResourceManager.GetString("FieldName", resourceCulture); - } - } - - /// - /// 查找类似 Field value 的本地化字符串。 - /// - internal static string FieldValue { - get { - return ResourceManager.GetString("FieldValue", resourceCulture); - } - } - - /// - /// 查找类似 File 的本地化字符串。 - /// - internal static string File { - get { - return ResourceManager.GetString("File", resourceCulture); - } - } - - /// - /// 查找类似 File is changed, do you want to save it? 的本地化字符串。 - /// - internal static string FileChangedPrompt { - get { - return ResourceManager.GetString("FileChangedPrompt", resourceCulture); - } - } - - /// - /// 查找类似 Find GameObjects 的本地化字符串。 - /// - internal static string FindGameObjects { - get { - return ResourceManager.GetString("FindGameObjects", resourceCulture); - } - } - - /// - /// 查找类似 Find instances 的本地化字符串。 - /// - internal static string FindInstances { - get { - return ResourceManager.GetString("FindInstances", resourceCulture); - } - } - - /// - /// 查找类似 GameObject Name 的本地化字符串。 - /// - internal static string GameObjectName { - get { - return ResourceManager.GetString("GameObjectName", resourceCulture); - } - } - - /// - /// 查找类似 Help 的本地化字符串。 - /// - internal static string Help { - get { - return ResourceManager.GetString("Help", resourceCulture); - } - } - - /// - /// 查找类似 Include Children 的本地化字符串。 - /// - internal static string IncludeChildren { - get { - return ResourceManager.GetString("IncludeChildren", resourceCulture); - } - } - - /// - /// 查找类似 Please input class name 的本地化字符串。 - /// - internal static string InputClassName { - get { - return ResourceManager.GetString("InputClassName", resourceCulture); - } - } - - /// - /// 查找类似 Please input duplicate count 的本地化字符串。 - /// - internal static string InputDulicateCount { - get { - return ResourceManager.GetString("InputDulicateCount", resourceCulture); - } - } - - /// - /// 查找类似 Match Case 的本地化字符串。 - /// - internal static string MatchCase { - get { - return ResourceManager.GetString("MatchCase", resourceCulture); - } - } - - /// - /// 查找类似 Match Whole Word 的本地化字符串。 - /// - internal static string MatchWholeWord { - get { - return ResourceManager.GetString("MatchWholeWord", resourceCulture); - } - } - - /// - /// 查找类似 Message 的本地化字符串。 - /// - internal static string Message { - get { - return ResourceManager.GetString("Message", resourceCulture); - } - } - - /// - /// 查找类似 Name 的本地化字符串。 - /// - internal static string Name { - get { - return ResourceManager.GetString("Name", resourceCulture); - } - } - - /// - /// 查找类似 New item 的本地化字符串。 - /// - internal static string NewItem { - get { - return ResourceManager.GetString("NewItem", resourceCulture); - } - } - - /// - /// 查找类似 Not supported file format 的本地化字符串。 - /// - internal static string NotSupportedFormat { - get { - return ResourceManager.GetString("NotSupportedFormat", resourceCulture); - } - } - - /// - /// 查找类似 Open 的本地化字符串。 - /// - internal static string Open { - get { - return ResourceManager.GetString("Open", resourceCulture); - } - } - - /// - /// 查找类似 Open recent files 的本地化字符串。 - /// - internal static string OpenRecentFiles { - get { - return ResourceManager.GetString("OpenRecentFiles", resourceCulture); - } - } - - /// - /// 查找类似 Paste 的本地化字符串。 - /// - internal static string Paste { - get { - return ResourceManager.GetString("Paste", resourceCulture); - } - } - - /// - /// 查找类似 Paste after 的本地化字符串。 - /// - internal static string PasteAfter { - get { - return ResourceManager.GetString("PasteAfter", resourceCulture); - } - } - - /// - /// 查找类似 Paste Gameobject 的本地化字符串。 - /// - internal static string PasteGameobject { - get { - return ResourceManager.GetString("PasteGameobject", resourceCulture); - } - } - - /// - /// 查找类似 Paste Gameobject as child 的本地化字符串。 - /// - internal static string PasteGameobjectAsChild { - get { - return ResourceManager.GetString("PasteGameobjectAsChild", resourceCulture); - } - } - - /// - /// 查找类似 Paste instance as component 的本地化字符串。 - /// - internal static string PasteInstanceAsComponent { - get { - return ResourceManager.GetString("PasteInstanceAsComponent", resourceCulture); - } - } - - /// - /// 查找类似 Project repo 的本地化字符串。 - /// - internal static string ProjectRepo { - get { - return ResourceManager.GetString("ProjectRepo", resourceCulture); - } - } - - /// - /// 查找类似 Quit 的本地化字符串。 - /// - internal static string Quit { - get { - return ResourceManager.GetString("Quit", resourceCulture); - } - } - - /// - /// 查找类似 Read failed. 的本地化字符串。 - /// - internal static string ReadFailed { - get { - return ResourceManager.GetString("ReadFailed", resourceCulture); - } - } - - /// - /// 查找类似 Remove 的本地化字符串。 - /// - internal static string Remove { - get { - return ResourceManager.GetString("Remove", resourceCulture); - } - } - - /// - /// 查找类似 Reopen 的本地化字符串。 - /// - internal static string Reopen { - get { - return ResourceManager.GetString("Reopen", resourceCulture); - } - } - - /// - /// 查找类似 Class mismatch, copied type is {0}, target type is {1}. 的本地化字符串。 - /// - internal static string RszClassMismatch { - get { - return ResourceManager.GetString("RszClassMismatch", resourceCulture); - } - } - - /// - /// 查找类似 Class mismatch, copied type is {0}, target type is {1}. Continue? 的本地化字符串。 - /// - internal static string RszClassMismatchConfirm { - get { - return ResourceManager.GetString("RszClassMismatchConfirm", resourceCulture); - } - } - - /// - /// 查找类似 {0} not found, please copy it from RE_RSZ manually 的本地化字符串。 - /// - internal static string RszJsonNotFound { - get { - return ResourceManager.GetString("RszJsonNotFound", resourceCulture); - } - } - - /// - /// 查找类似 Save 的本地化字符串。 - /// - internal static string Save { - get { - return ResourceManager.GetString("Save", resourceCulture); - } - } - - /// - /// 查找类似 Save as 的本地化字符串。 - /// - internal static string SaveAs { - get { - return ResourceManager.GetString("SaveAs", resourceCulture); - } - } - - /// - /// 查找类似 Tag 的本地化字符串。 - /// - internal static string Tag { - get { - return ResourceManager.GetString("Tag", resourceCulture); - } - } - - /// - /// 查找类似 Will try reopen, because {0}, better reopen other opened file manually. 的本地化字符串。 - /// - internal static string TryReopen { - get { - return ResourceManager.GetString("TryReopen", resourceCulture); - } - } - - /// - /// 查找类似 Update ContextID 的本地化字符串。 - /// - internal static string UpdateContextID { - get { - return ResourceManager.GetString("UpdateContextID", resourceCulture); - } - } - - /// +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace RszTool.App.Resources { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Texts { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Texts() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RszTool.App.Resources.Texts", typeof(Texts).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// 查找类似 About 的本地化字符串。 + /// + internal static string About { + get { + return ResourceManager.GetString("About", resourceCulture); + } + } + + /// + /// 查找类似 RszTool is a tool that edit and create resource file for RE ENGINE game. Currently support .user, .pfb and .scn files. 的本地化字符串。 + /// + internal static string AboutProjectDetail { + get { + return ResourceManager.GetString("AboutProjectDetail", resourceCulture); + } + } + + /// + /// 查找类似 Add component 的本地化字符串。 + /// + internal static string AddComponent { + get { + return ResourceManager.GetString("AddComponent", resourceCulture); + } + } + + /// + /// 查找类似 Add folder 的本地化字符串。 + /// + internal static string AddFolder { + get { + return ResourceManager.GetString("AddFolder", resourceCulture); + } + } + + /// + /// 查找类似 Auto Set ContextID 的本地化字符串。 + /// + internal static string AutoContextID { + get { + return ResourceManager.GetString("AutoContextID", resourceCulture); + } + } + + /// + /// 查找类似 Clear recent files history 的本地化字符串。 + /// + internal static string ClearRecentFilesHistory { + get { + return ResourceManager.GetString("ClearRecentFilesHistory", resourceCulture); + } + } + + /// + /// 查找类似 Close 的本地化字符串。 + /// + internal static string Close { + get { + return ResourceManager.GetString("Close", resourceCulture); + } + } + + /// + /// 查找类似 Component 的本地化字符串。 + /// + internal static string Component { + get { + return ResourceManager.GetString("Component", resourceCulture); + } + } + + /// + /// 查找类似 Copy 的本地化字符串。 + /// + internal static string Copy { + get { + return ResourceManager.GetString("Copy", resourceCulture); + } + } + + /// + /// 查找类似 Dark 的本地化字符串。 + /// + internal static string Dark { + get { + return ResourceManager.GetString("Dark", resourceCulture); + } + } + + /// + /// 查找类似 Duplicate 的本地化字符串。 + /// + internal static string Duplicate { + get { + return ResourceManager.GetString("Duplicate", resourceCulture); + } + } + + /// + /// 查找类似 Duplicate many times 的本地化字符串。 + /// + internal static string DuplicateMulti { + get { + return ResourceManager.GetString("DuplicateMulti", resourceCulture); + } + } + + /// + /// 查找类似 Duplicate Object many times 的本地化字符串。 + /// + internal static string DuplicateMultiObj { + get { + return ResourceManager.GetString("DuplicateMultiObj", resourceCulture); + } + } + + /// + /// 查找类似 Field name 的本地化字符串。 + /// + internal static string FieldName { + get { + return ResourceManager.GetString("FieldName", resourceCulture); + } + } + + /// + /// 查找类似 Field value 的本地化字符串。 + /// + internal static string FieldValue { + get { + return ResourceManager.GetString("FieldValue", resourceCulture); + } + } + + /// + /// 查找类似 File 的本地化字符串。 + /// + internal static string File { + get { + return ResourceManager.GetString("File", resourceCulture); + } + } + + /// + /// 查找类似 File is changed, do you want to save it? 的本地化字符串。 + /// + internal static string FileChangedPrompt { + get { + return ResourceManager.GetString("FileChangedPrompt", resourceCulture); + } + } + + /// + /// 查找类似 Find GameObjects 的本地化字符串。 + /// + internal static string FindGameObjects { + get { + return ResourceManager.GetString("FindGameObjects", resourceCulture); + } + } + + /// + /// 查找类似 Find instances 的本地化字符串。 + /// + internal static string FindInstances { + get { + return ResourceManager.GetString("FindInstances", resourceCulture); + } + } + + /// + /// 查找类似 GameObject Name 的本地化字符串。 + /// + internal static string GameObjectName { + get { + return ResourceManager.GetString("GameObjectName", resourceCulture); + } + } + + /// + /// 查找类似 Help 的本地化字符串。 + /// + internal static string Help { + get { + return ResourceManager.GetString("Help", resourceCulture); + } + } + + /// + /// 查找类似 Hide/Show SideBar 的本地化字符串。 + /// + internal static string HSideBar { + get { + return ResourceManager.GetString("HSideBar", resourceCulture); + } + } + + /// + /// 查找类似 Include Children 的本地化字符串。 + /// + internal static string IncludeChildren { + get { + return ResourceManager.GetString("IncludeChildren", resourceCulture); + } + } + + /// + /// 查找类似 Please input class name 的本地化字符串。 + /// + internal static string InputClassName { + get { + return ResourceManager.GetString("InputClassName", resourceCulture); + } + } + + /// + /// 查找类似 Does the Object has ContextID(IMPORTANT) 的本地化字符串。 + /// + internal static string InputContextCheck { + get { + return ResourceManager.GetString("InputContextCheck", resourceCulture); + } + } + + /// + /// 查找类似 Please input duplicate count 的本地化字符串。 + /// + internal static string InputDulicateCount { + get { + return ResourceManager.GetString("InputDulicateCount", resourceCulture); + } + } + + /// + /// 查找类似 Input folder name 的本地化字符串。 + /// + internal static string InputFolderName { + get { + return ResourceManager.GetString("InputFolderName", resourceCulture); + } + } + + /// + /// 查找类似 Input Group ID 的本地化字符串。 + /// + internal static string InputGroupDefault { + get { + return ResourceManager.GetString("InputGroupDefault", resourceCulture); + } + } + + /// + /// 查找类似 Input Start Index ID 的本地化字符串。 + /// + internal static string InputIndexDefault { + get { + return ResourceManager.GetString("InputIndexDefault", resourceCulture); + } + } + + /// + /// 查找类似 Please input duplicate count(MAX-20) 的本地化字符串。 + /// + internal static string InputObjectCount { + get { + return ResourceManager.GetString("InputObjectCount", resourceCulture); + } + } + + /// + /// 查找类似 Input Increase Num for Index ID(Per Obj) 的本地化字符串。 + /// + internal static string InputStepDefault { + get { + return ResourceManager.GetString("InputStepDefault", resourceCulture); + } + } + + /// + /// 查找类似 Match Case 的本地化字符串。 + /// + internal static string MatchCase { + get { + return ResourceManager.GetString("MatchCase", resourceCulture); + } + } + + /// + /// 查找类似 Match Whole Word 的本地化字符串。 + /// + internal static string MatchWholeWord { + get { + return ResourceManager.GetString("MatchWholeWord", resourceCulture); + } + } + + /// + /// 查找类似 Message 的本地化字符串。 + /// + internal static string Message { + get { + return ResourceManager.GetString("Message", resourceCulture); + } + } + + /// + /// 查找类似 Name 的本地化字符串。 + /// + internal static string Name { + get { + return ResourceManager.GetString("Name", resourceCulture); + } + } + + /// + /// 查找类似 New item 的本地化字符串。 + /// + internal static string NewItem { + get { + return ResourceManager.GetString("NewItem", resourceCulture); + } + } + + /// + /// 查找类似 Not supported file format 的本地化字符串。 + /// + internal static string NotSupportedFormat { + get { + return ResourceManager.GetString("NotSupportedFormat", resourceCulture); + } + } + + /// + /// 查找类似 Open 的本地化字符串。 + /// + internal static string Open { + get { + return ResourceManager.GetString("Open", resourceCulture); + } + } + + /// + /// 查找类似 Open in explorer 的本地化字符串。 + /// + internal static string OpenInExplorer { + get { + return ResourceManager.GetString("OpenInExplorer", resourceCulture); + } + } + + /// + /// 查找类似 Open recent files 的本地化字符串。 + /// + internal static string OpenRecentFiles { + get { + return ResourceManager.GetString("OpenRecentFiles", resourceCulture); + } + } + + /// + /// 查找类似 Paste 的本地化字符串。 + /// + internal static string Paste { + get { + return ResourceManager.GetString("Paste", resourceCulture); + } + } + + /// + /// 查找类似 Paste after 的本地化字符串。 + /// + internal static string PasteAfter { + get { + return ResourceManager.GetString("PasteAfter", resourceCulture); + } + } + + /// + /// 查找类似 Paste Gameobject 的本地化字符串。 + /// + internal static string PasteGameobject { + get { + return ResourceManager.GetString("PasteGameobject", resourceCulture); + } + } + + /// + /// 查找类似 Paste Gameobject as child 的本地化字符串。 + /// + internal static string PasteGameobjectAsChild { + get { + return ResourceManager.GetString("PasteGameobjectAsChild", resourceCulture); + } + } + + /// + /// 查找类似 Paste instance as component 的本地化字符串。 + /// + internal static string PasteInstanceAsComponent { + get { + return ResourceManager.GetString("PasteInstanceAsComponent", resourceCulture); + } + } + + /// + /// 查找类似 Project repo 的本地化字符串。 + /// + internal static string ProjectRepo { + get { + return ResourceManager.GetString("ProjectRepo", resourceCulture); + } + } + + /// + /// 查找类似 Quit 的本地化字符串。 + /// + internal static string Quit { + get { + return ResourceManager.GetString("Quit", resourceCulture); + } + } + + /// + /// 查找类似 Read failed. 的本地化字符串。 + /// + internal static string ReadFailed { + get { + return ResourceManager.GetString("ReadFailed", resourceCulture); + } + } + + /// + /// 查找类似 Refresh file explorer 的本地化字符串。 + /// + internal static string RefreshFileExplorer { + get { + return ResourceManager.GetString("RefreshFileExplorer", resourceCulture); + } + } + + /// + /// 查找类似 Remove 的本地化字符串。 + /// + internal static string Remove { + get { + return ResourceManager.GetString("Remove", resourceCulture); + } + } + + /// + /// 查找类似 Reopen 的本地化字符串。 + /// + internal static string Reopen { + get { + return ResourceManager.GetString("Reopen", resourceCulture); + } + } + + /// + /// 查找类似 Class mismatch, copied type is {0}, target type is {1}. 的本地化字符串。 + /// + internal static string RszClassMismatch { + get { + return ResourceManager.GetString("RszClassMismatch", resourceCulture); + } + } + + /// + /// 查找类似 Class mismatch, copied type is {0}, target type is {1}. Continue? 的本地化字符串。 + /// + internal static string RszClassMismatchConfirm { + get { + return ResourceManager.GetString("RszClassMismatchConfirm", resourceCulture); + } + } + + /// + /// 查找类似 {0} not found, please copy it from RE_RSZ manually 的本地化字符串。 + /// + internal static string RszJsonNotFound { + get { + return ResourceManager.GetString("RszJsonNotFound", resourceCulture); + } + } + + /// + /// 查找类似 Save 的本地化字符串。 + /// + internal static string Save { + get { + return ResourceManager.GetString("Save", resourceCulture); + } + } + + /// + /// 查找类似 Save as 的本地化字符串。 + /// + internal static string SaveAs { + get { + return ResourceManager.GetString("SaveAs", resourceCulture); + } + } + + /// + /// 查找类似 Tag 的本地化字符串。 + /// + internal static string Tag { + get { + return ResourceManager.GetString("Tag", resourceCulture); + } + } + + /// + /// 查找类似 Will try reopen, because {0}, better reopen other opened file manually. 的本地化字符串。 + /// + internal static string TryReopen { + get { + return ResourceManager.GetString("TryReopen", resourceCulture); + } + } + + /// + /// 查找类似 Update ContextID 的本地化字符串。 + /// + internal static string UpdateContextID { + get { + return ResourceManager.GetString("UpdateContextID", resourceCulture); + } + } + + /// /// 查找类似 Open a file from the file menu or drag it in . - ///Currently, user, scn, pfb files are supported 的本地化字符串。 - /// - internal static string UsageHint { - get { - return ResourceManager.GetString("UsageHint", resourceCulture); - } - } - - /// - /// 查找类似 Use Regular Expression 的本地化字符串。 - /// - internal static string UseRegex { - get { - return ResourceManager.GetString("UseRegex", resourceCulture); - } - } - - /// - /// 查找类似 Dark 的本地化字符串。 - /// - internal static string Dark { - get { - return ResourceManager.GetString("Dark", resourceCulture); - } - } - - /// - /// 查找类似 Refresh file explorer 的本地化字符串。 - /// - internal static string RefreshFileExplorer { - get { - return ResourceManager.GetString("RefreshFileExplorer", resourceCulture); - } - } - - /// - /// 查找类似 Open in explorer 的本地化字符串。 - /// - internal static string OpenInExplorer { - get { - return ResourceManager.GetString("OpenInExplorer", resourceCulture); - } - } - } -} + ///Currently, user, scn, pfb files are supported 的本地化字符串。 + /// + internal static string UsageHint { + get { + return ResourceManager.GetString("UsageHint", resourceCulture); + } + } + + /// + /// 查找类似 Use Regular Expression 的本地化字符串。 + /// + internal static string UseRegex { + get { + return ResourceManager.GetString("UseRegex", resourceCulture); + } + } + } +} diff --git a/RszTool.App/Resources/Texts.resx b/RszTool.App/Resources/Texts.resx index 83756c7..ddd0198 100644 --- a/RszTool.App/Resources/Texts.resx +++ b/RszTool.App/Resources/Texts.resx @@ -1,280 +1,304 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - Open - - - Save - - - Save as - - - Reopen - - - Close - - - Quit - - - File - - - New item - - - Copy - - - Remove - - - Duplicate - - - Duplicate many times - - - Paste after - - - Paste Gameobject - - - Paste Gameobject as child - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Open + + + Save + + + Save as + + + Reopen + + + Close + + + Quit + + + File + + + New item + + + Copy + + + Remove + + + Duplicate + + + Duplicate many times + + + Duplicate Object many times + + + Paste after + + + Paste Gameobject + + + Paste Gameobject as child + + Open a file from the file menu or drag it in . -Currently, user, scn, pfb files are supported - - - Message - - - Please input duplicate count - - - Please input class name - - - {0} not found, please copy it from RE_RSZ manually - - - Not supported file format - - - Find instances - - - Name - - - Field name - - - Field value - - - Match Case - - - Match Whole Word - - - Use Regular Expression - - - Find GameObjects - - - Include Children - - - GameObject Name - - - Component - - - Tag - - - File is changed, do you want to save it? - - - Open recent files - - - Clear recent files history - - - Help - - - About - - - RszTool is a tool that edit and create resource file for RE ENGINE game. Currently support .user, .pfb and .scn files. - - - Project repo - - - Paste - - - Class mismatch, copied type is {0}, target type is {1}. - - - Class mismatch, copied type is {0}, target type is {1}. Continue? - - - Add component - - - Add folder - - - Input folder name - - - Paste instance as component - - - Read failed. - - - Will try reopen, because {0}, better reopen other opened file manually. - - - Update ContextID - - - Dark - - - Refresh file explorer - - - Open in explorer - +Currently, user, scn, pfb files are supported + + + Message + + + Please input duplicate count + + + Please input class name + + + {0} not found, please copy it from RE_RSZ manually + + + Not supported file format + + + Find instances + + + Name + + + Field name + + + Field value + + + Match Case + + + Match Whole Word + + + Use Regular Expression + + + Find GameObjects + + + Include Children + + + GameObject Name + + + Component + + + Tag + + + File is changed, do you want to save it? + + + Open recent files + + + Clear recent files history + + + Help + + + About + + + RszTool is a tool that edit and create resource file for RE ENGINE game. Currently support .user, .pfb and .scn files. + + + Project repo + + + Paste + + + Class mismatch, copied type is {0}, target type is {1}. + + + Class mismatch, copied type is {0}, target type is {1}. Continue? + + + Add component + + + Add folder + + + Input folder name + + + Paste instance as component + + + Read failed. + + + Will try reopen, because {0}, better reopen other opened file manually. + + + Update ContextID + + + Dark + + + Refresh file explorer + + + Open in explorer + + + Hide/Show SideBar + + + Auto Set ContextID + + + Please input duplicate count(MAX-20) + + + Input Group ID + + + Input Start Index ID + + + Input Increase Num for Index ID(Per Obj) + + + Does the Object has ContextID(IMPORTANT) + \ No newline at end of file diff --git a/RszTool.App/Resources/Texts.zh-CN.resx b/RszTool.App/Resources/Texts.zh-CN.resx index b787683..388fd54 100644 --- a/RszTool.App/Resources/Texts.zh-CN.resx +++ b/RszTool.App/Resources/Texts.zh-CN.resx @@ -1,280 +1,304 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 打开 - - - 保存 - - - 另存为 - - - 重新打开 - - - 关闭 - - - 退出 - - - 文件 - - - 新建项 - - - 复制 - - - 移除 - - - 重复 - - - 重复多次 - - - 在后面粘贴 - - - 粘贴游戏对象 - - - 粘贴成子对象 - - - 从文件菜单打开文件或者从文件浏览器中拖文件进来 -目前支持user, scn, pfb文件 - - - 提示 - - - 请输入重复次数 - - - 请输入类名 - - - 未找到{0},请手动从RE_RSZ模板中复制到当前目录 - - - 不支持的文件类型 - - - 查找Instance - - - 名称 - - - 字段名称 - - - 字段值 - - - 区分大小写 - - - 全字匹配 - - - 使用正则表达式 - - - 查找游戏对象 - - - 包括子对象 - - - 游戏对象名称 - - - 组件 - - - 标签 - - - 文件已修改,是否保存? - - - 打开最近的文件 - - - 清除最近打开记录 - - - 帮助 - - - 关于 - - - RszTool是一个编辑RE引擎游戏资源文件的工具,目前支持.user, .pfb和.scn文件。 - - - 项目仓库 - - - 粘贴 - - - 类型不匹配,复制的类型是{0},目标类型是{1}。 - - - 类型可能不匹配,复制的类型是{0},目标类型是{1}。确认继续? - - - 添加组件 - - - 添加文件夹 - - - 输入文件夹名称 - - - 粘贴实例作为组件 - - - 读取失败。 - - - 正在尝试重新打开,因为 {0},最好重新打开其他已经打开的文件. - - - 更新ContextID - - - 深色 - - - 刷新资源管理器 - - - 在文件管理器中显示 - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 打开 + + + 保存 + + + 另存为 + + + 重新打开 + + + 关闭 + + + 退出 + + + 文件 + + + 新建项 + + + 复制 + + + 移除 + + + 重复 + + + 重复多次 + + + 重复对象多次 + + + 在后面粘贴 + + + 粘贴游戏对象 + + + 粘贴成子对象 + + + 从文件菜单打开文件或者从文件浏览器中拖文件进来 +目前支持user, scn, pfb文件 + + + 提示 + + + 请输入重复次数 + + + 请输入类名 + + + 未找到{0},请手动从RE_RSZ模板中复制到当前目录 + + + 不支持的文件类型 + + + 查找Instance + + + 名称 + + + 字段名称 + + + 字段值 + + + 区分大小写 + + + 全字匹配 + + + 使用正则表达式 + + + 查找游戏对象 + + + 包括子对象 + + + 游戏对象名称 + + + 组件 + + + 标签 + + + 文件已修改,是否保存? + + + 打开最近的文件 + + + 清除最近打开记录 + + + 帮助 + + + 关于 + + + RszTool是一个编辑RE引擎游戏资源文件的工具,目前支持.user, .pfb和.scn文件。 + + + 项目仓库 + + + 粘贴 + + + 类型不匹配,复制的类型是{0},目标类型是{1}。 + + + 类型可能不匹配,复制的类型是{0},目标类型是{1}。确认继续? + + + 添加组件 + + + 添加文件夹 + + + 输入文件夹名称 + + + 粘贴实例作为组件 + + + 正在尝试重新打开,因为 {0},最好重新打开其他已经打开的文件. + + + 更新ContextID + + + 深色 + + + 刷新资源管理器 + + + 在文件管理器中显示 + + + 读取失败。 + + + 隐藏/显示侧边栏 + + + 自动设置ContextID(单增) + + + 输入要重复的次数(MAX-20) + + + 输入Group ID + + + 输入起始Index ID + + + 输入IndexID增加值(每个对象) + + + 对象有ContextID吗? + \ No newline at end of file diff --git a/RszTool.App/RszTool.App.csproj b/RszTool.App/RszTool.App.csproj index 7d362a9..3626951 100644 --- a/RszTool.App/RszTool.App.csproj +++ b/RszTool.App/RszTool.App.csproj @@ -15,7 +15,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/RszTool.App/SaveData.cs b/RszTool.App/SaveData.cs index 24b60ff..e5877ab 100644 --- a/RszTool.App/SaveData.cs +++ b/RszTool.App/SaveData.cs @@ -11,10 +11,11 @@ public class SaveData [JsonConverter(typeof(EnumJsonConverter))] public GameName GameName { get; set; } = GameName.re4; + + public ThemeE CurTheme { get; set; }=ThemeE.light; public ObservableCollection RecentFiles { get; set; } = new(); public List OpenedFolders { get; set; } = new(); public ContextIDData LastContextID { get; set; } = new(); - public bool IsDarkTheme { get; set; } public void AddRecentFile(string path) { diff --git a/RszTool.App/Themes/CommonTheme.xaml b/RszTool.App/Themes/CommonTheme.xaml index b9b1825..65352fd 100644 --- a/RszTool.App/Themes/CommonTheme.xaml +++ b/RszTool.App/Themes/CommonTheme.xaml @@ -1,8 +1,8 @@ + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + > - + @@ -17,6 +17,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + #B8D8E7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RszTool.App/Themes/WinUITheme.xaml b/RszTool.App/Themes/WinUITheme.xaml new file mode 100644 index 0000000..144f417 --- /dev/null +++ b/RszTool.App/Themes/WinUITheme.xaml @@ -0,0 +1,440 @@ + + + + + + + + #2D2A3F + #F5F5F5 + #F5F5F5 + #4A4566 + #6B6499 + #9D8DF1 + #8A82C2 + #444059 + #5A557A + #9995A8 + + #2D2A3F + #3A3655 + #252233 + #5A557A + #8A82C2 + #F5F5F5 + #9995A8 + #6B6499 + #FFFFFF + #F5F5F5 + #2D2A3F + #252233 + #252233 + #F5F5F5 + #2D2A3F + #F5F5F5 + #3A3655 + #9D8DF1 + #F5F5F5 + #3A3655 + #8A82C2 + #9995A8 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #8A82C2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/RszTool.App/ViewModels/FileExplorerViewModel.cs b/RszTool.App/ViewModels/FileExplorerViewModel.cs index 020f5c7..3cccc1a 100644 --- a/RszTool.App/ViewModels/FileExplorerViewModel.cs +++ b/RszTool.App/ViewModels/FileExplorerViewModel.cs @@ -14,6 +14,9 @@ public class FileExplorerViewModel public RelayCommand RemoveRootDirectory => new(OnRemoveRootDirectory); public RelayCommand OpenInExplorer => new(OnOpenInExplorer); + public void Hide() { + + } public void Refresh() { foreach (var folder in Folders) diff --git a/RszTool.App/ViewModels/GameObjectCopyHelper.cs b/RszTool.App/ViewModels/GameObjectCopyHelper.cs index 5484468..b031ea7 100644 --- a/RszTool.App/ViewModels/GameObjectCopyHelper.cs +++ b/RszTool.App/ViewModels/GameObjectCopyHelper.cs @@ -1,4 +1,5 @@ using RszTool.App.Views; +using System.Windows; namespace RszTool.App.ViewModels { @@ -56,6 +57,20 @@ public static void UpdateContextID(RszFileOption fileOption, IGameObjectData gam } } + public static void UpdateContextIDBatch(RszFileOption fileOption, IGameObjectData gameObjectData,int Index,int Group) + { + if (fileOption.GameName == GameName.re4) + { + var contextIDs = IterGameObjectContextID(gameObjectData).ToArray(); + if (contextIDs.Length > 0) + { + contextIDs[0].Items[0].Value = Group; + contextIDs[0].Items[1].Value = Index; + } + + } + } + /// /// Update re4 chainsaw.ContextID /// diff --git a/RszTool.App/ViewModels/MainWindowModel.cs b/RszTool.App/ViewModels/MainWindowModel.cs index 9d890f5..9d05344 100644 --- a/RszTool.App/ViewModels/MainWindowModel.cs +++ b/RszTool.App/ViewModels/MainWindowModel.cs @@ -22,19 +22,12 @@ public class MainWindowModel : INotifyPropertyChanged public HeaderedItemViewModel? SelectedTabItem { get; set; } public FileExplorerViewModel FileExplorerViewModel { get; } = new(); + private BaseRszFileViewModel? CurrentFile => SelectedTabItem is FileTabItemViewModel fileTabItemViewModel ? fileTabItemViewModel.FileViewModel : null; - public bool IsDarkTheme - { - get => ThemeManager.Instance.IsDarkTheme; - set - { - SaveData.IsDarkTheme = value; - ThemeManager.Instance.IsDarkTheme = value; - } - } + public CustomInterTabClient InterTabClient { get; } = new(); public static SaveData SaveData => App.Instance.SaveData; @@ -63,7 +56,9 @@ public MainWindowModel() FileExplorerViewModel.Folders.Add(new(Directory.GetCurrentDirectory())); } FileExplorerViewModel.OnFileSelected += f => OpenFile(f.Path); - } + } + + /// /// 打开文件 diff --git a/RszTool.App/ViewModels/ScnFileViewModel.cs b/RszTool.App/ViewModels/ScnFileViewModel.cs index 057a8bf..0a23b79 100644 --- a/RszTool.App/ViewModels/ScnFileViewModel.cs +++ b/RszTool.App/ViewModels/ScnFileViewModel.cs @@ -1,7 +1,8 @@ -using System.Collections.ObjectModel; -using System.Windows; using RszTool.App.Common; using RszTool.App.Resources; +using System.Collections.ObjectModel; +using System.Text.RegularExpressions; +using System.Windows; namespace RszTool.App.ViewModels { @@ -39,7 +40,8 @@ public override IEnumerable TreeViewItems public RelayCommand CopyGameObject => new(OnCopyGameObject); public RelayCommand RemoveFolder => new(OnRemoveFolder); public RelayCommand RemoveGameObject => new(OnRemoveGameObject); - public RelayCommand DuplicateGameObject => new(OnDuplicateGameObject); + public RelayCommand DuplicateGameObject => new(OnDuplicateGameObject); + public RelayCommand DuplicateMultiGameObject => new(OnDuplicateMultiGameObject); public RelayCommand PasteGameObject => new(OnPasteGameObject); public RelayCommand PasteGameObjectToFolder => new(OnPasteGameObjectToFolder); public RelayCommand AddFolder => new(OnAddFolder); @@ -56,6 +58,10 @@ public override IEnumerable TreeViewItems private void UpdateContextID(IGameObjectData gameObject) { GameObjectCopyHelper.UpdateContextID(ScnFile.Option, gameObject); + } + private void UpdateContextIDBatch(IGameObjectData gameObject,int Index,int Group) + { + GameObjectCopyHelper.UpdateContextIDBatch(ScnFile.Option, gameObject,Index,Group); } /// @@ -96,8 +102,115 @@ private void OnDuplicateGameObject(object arg) var newGameObject = ScnFile.DuplicateGameObject((ScnFile.GameObjectData)arg); UpdateContextID(newGameObject); Changed = true; - } - + } + + /// + ///New MultiObject + /// + private void OnDuplicateMultiGameObject(object arg) + { + + Views.InputDialog dialog = new() + { + Title = "Tip", + Message = Texts.InputObjectCount, + InputText = "5", + Owner = Application.Current.MainWindow, + }; + bool? result = dialog.ShowDialog(); + + if (result == true) + { + string userInput = dialog.InputText; + MessageBoxResult Judge = MessageBox.Show( + messageBoxText:Texts.InputContextCheck, + caption: "Attention!", + button: MessageBoxButton.YesNo, + icon: MessageBoxImage.Question + ); + + // 判断用户点击的按钮 + if (Judge == MessageBoxResult.Yes) + { + Views.InputDialog Group = new() + { + Title = "Group", + Message = Texts.InputGroupDefault, + InputText = "5", + Owner = Application.Current.MainWindow, + }; + bool? GroupRes = Group.ShowDialog(); + if(GroupRes == true) { + Views.InputDialog Index = new() + { + Title = "Index", + Message = Texts.InputIndexDefault, + InputText = "5", + Owner = Application.Current.MainWindow, + }; + bool? IndexRes = Index.ShowDialog(); + if (IndexRes == true) + { + Views.InputDialog Step = new() + { + Title = "Step", + Message = Texts.InputStepDefault, + InputText = "1", + Owner = Application.Current.MainWindow, + }; + bool? StepRes = Step.ShowDialog(); + if(StepRes == true){ + + string GroupI = Group.InputText; + string IndexI = Index.InputText; + string StepI = Step.InputText; + if (int.TryParse(userInput, out int count)) + { + if (count <= 0) + { + MessageBoxUtils.Error("Count must be greater than 0"); + return; + } + if (count >= 20) { count = 20; } + if (int.TryParse(GroupI, out int GroupR)) + { + if (int.TryParse(IndexI, out int IndexR)) + { + if (int.TryParse(StepI, out int StepR)) + { + for (int i = 0; i < count; i++) + { + var newGameObject = ScnFile.DuplicateGameObject((ScnFile.GameObjectData)arg); + UpdateContextIDBatch(newGameObject, IndexR + StepR * i, GroupR); + } + Changed = true; + } + } + } + } + } + } + } + + } + else if (Judge == MessageBoxResult.No) + { + + if (int.TryParse(userInput, out int count)) + { + for (int i = 0; i < count; i++) + { + var newGameObject = ScnFile.DuplicateGameObject((ScnFile.GameObjectData)arg); + UpdateContextID(newGameObject); + } + } + Changed = true; + } + } + + } + + /// /// 粘贴游戏对象 /// diff --git a/RszTool.App/ViewModels/ThemeManager.cs b/RszTool.App/ViewModels/ThemeManager.cs index 578fd42..b4c17f4 100644 --- a/RszTool.App/ViewModels/ThemeManager.cs +++ b/RszTool.App/ViewModels/ThemeManager.cs @@ -1,57 +1,79 @@ using PropertyChanged; using System.ComponentModel; using System.Windows; +using System.Windows.Controls.Primitives; using System.Windows.Media; namespace RszTool.App.ViewModels { public class ThemeManager : INotifyPropertyChanged { - private bool isDarkTheme; + private ThemeE ThemeN; private static ThemeManager? instance; public readonly SolidColorBrush LightForeground = Application.Current.Resources["LightForeground"] as SolidColorBrush ?? Brushes.Black; public readonly SolidColorBrush DarkForeground = Application.Current.Resources["DarkForeground"] as SolidColorBrush ?? Brushes.White; + public readonly SolidColorBrush WinUIForeground = + Application.Current.Resources["DarkForeground"] as SolidColorBrush ?? Brushes.White; + public readonly SolidColorBrush MakaroForeground = + Application.Current.Resources["MakaroForeground"] as SolidColorBrush ?? Brushes.Black; public static ThemeManager Instance { - get => instance ??= new(false); + get => instance ??= new(ThemeE.light); private set => instance = value; - } - - [DoNotCheckEquality] - public bool IsDarkTheme - { - get => isDarkTheme; - set - { - isDarkTheme = value; - var mergedDictionaries = Application.Current.Resources.MergedDictionaries; - mergedDictionaries.Clear(); - mergedDictionaries.Add(new ResourceDictionary() - { - Source = new Uri(isDarkTheme ? "Themes/DarkTheme.xaml" : "Themes/LightTheme.xaml", UriKind.Relative) - }); - PropertyChanged?.Invoke(this, new(nameof(IsDarkTheme))); - } - } - - public SolidColorBrush Foreground => IsDarkTheme ? DarkForeground : LightForeground; - + } + + // ָԴֵ + private ThemeE LoadThemeResources + { + get => ThemeN; + set + { + ThemeN = value; + var mergedDicts = Application.Current.Resources.MergedDictionaries; + mergedDicts.Clear(); + + // öټضӦԴļ + string themePath = ThemeN switch + { + ThemeE.dark => "Themes/DarkTheme.xaml", + ThemeE.Winui => "Themes/WinUITheme.xaml", + ThemeE.Makaro => "Themes/MakaroTheme.xaml", + _ => "Themes/LightTheme.xaml" + }; + + + mergedDicts.Add(new ResourceDictionary + { + Source = new Uri(themePath, UriKind.Relative) + }); + + PropertyChanged?.Invoke(this, new(nameof(ThemeN))); + } + } + + + public event PropertyChangedEventHandler? PropertyChanged; - private ThemeManager(bool isDarkTheme) - { - IsDarkTheme = isDarkTheme; - var resources = Application.Current.Resources; - LightForeground = resources["LightForeground"] as SolidColorBrush ?? Brushes.Black; - DarkForeground = resources["DarkForeground"] as SolidColorBrush ?? Brushes.White; + private ThemeManager(ThemeE UserTheme) + { + LoadThemeResources = UserTheme; + + var resources = Application.Current.Resources; + LightForeground = resources["LightForeground"] as SolidColorBrush ?? Brushes.Black; + DarkForeground = resources["DarkForeground"] as SolidColorBrush ?? Brushes.White; + WinUIForeground = resources["WinUIForeground"] as SolidColorBrush ?? Brushes.Gray; + MakaroForeground = resources["MakaroForeground"] as SolidColorBrush ?? Brushes.Black; } - public static void Init(bool isDarkTheme = false) + + public static void Init(ThemeE UserTheme) { - Instance = new(isDarkTheme); + + Instance = new(UserTheme); } } } diff --git a/RszTool.App/Views/RszScnFileView.xaml b/RszTool.App/Views/RszScnFileView.xaml index 2c67e29..4bc5149 100644 --- a/RszTool.App/Views/RszScnFileView.xaml +++ b/RszTool.App/Views/RszScnFileView.xaml @@ -67,6 +67,7 @@ + diff --git a/RszTool.App/Views/UpdateContextIDWindow.xaml b/RszTool.App/Views/UpdateContextIDWindow.xaml index 1ff71c1..dafa85b 100644 --- a/RszTool.App/Views/UpdateContextIDWindow.xaml +++ b/RszTool.App/Views/UpdateContextIDWindow.xaml @@ -22,12 +22,17 @@ - + + + + + + - - + + diff --git a/RszTool.App/Views/UpdateContextIDWindow.xaml.cs b/RszTool.App/Views/UpdateContextIDWindow.xaml.cs index 66b014d..36e30e6 100644 --- a/RszTool.App/Views/UpdateContextIDWindow.xaml.cs +++ b/RszTool.App/Views/UpdateContextIDWindow.xaml.cs @@ -13,6 +13,10 @@ public UpdateContextIDWindow() InitializeComponent(); } - public IEnumerable TreeViewItems { get; set; } = Array.Empty(); + public IEnumerable TreeViewItems { get; set; } = Array.Empty(); + + + + } } diff --git a/RszTool/Enums.cs b/RszTool/Enums.cs index f397893..41a7be0 100644 --- a/RszTool/Enums.cs +++ b/RszTool/Enums.cs @@ -135,6 +135,12 @@ public enum GameName dd2, } + public enum ThemeE { + light, + dark, + Winui, + Makaro, + } public enum GameVersion { @@ -157,5 +163,7 @@ public enum GameVersion public static class RszDefines { public static GameName[] GameNames { get; } = (GameName[])Enum.GetValues(typeof(GameName)); + public static ThemeE[] Themes { get; } = (ThemeE[])Enum.GetValues(typeof(ThemeE)); } + } diff --git a/RszTool/RszFile/ScnFile.cs b/RszTool/RszFile/ScnFile.cs index 8a01dd9..8f7f94c 100644 --- a/RszTool/RszFile/ScnFile.cs +++ b/RszTool/RszFile/ScnFile.cs @@ -3,8 +3,8 @@ namespace RszTool { - using GameObjectInfoModel = StructModel; using FolderInfoModel = StructModel; + using GameObjectInfoModel = StructModel; public class ScnFile : BaseRszFile { @@ -1013,6 +1013,7 @@ public GameObjectData ImportGameObject(GameObjectData gameObject, FolderData? fo RszInstance.CleanCloneCache(); return newGameObject; } + /// /// 导入外部的游戏对象 @@ -1039,6 +1040,7 @@ public GameObjectData DuplicateGameObject(GameObjectData gameObject) return ImportGameObject(gameObject, gameObject.Folder, gameObject.Parent, true); } + public void AddFolder(string name, FolderData? parent = null) { var folder = new FolderData diff --git a/RszTool/RszTool.csproj b/RszTool/RszTool.csproj index 3339f60..c4e7fbf 100644 --- a/RszTool/RszTool.csproj +++ b/RszTool/RszTool.csproj @@ -9,8 +9,8 @@ - - + +