From fe6256729f4e3963388fcba082b393b8431c7d10 Mon Sep 17 00:00:00 2001 From: Hakoyu Date: Sat, 23 Mar 2024 21:57:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E8=87=B3.NET8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 2 + VPet.ModMaker.sln | 4 +- VPet.ModMaker/App.xaml | 3 +- VPet.ModMaker/Models/ModLoader.cs | 12 +- VPet.ModMaker/Models/ModMakeHistory.cs | 6 +- VPet.ModMaker/Models/ModMaker.cs | 14 +- VPet.ModMaker/Models/ModModel/AnimeModel.cs | 9 +- .../Models/ModModel/AnimeTypeModel.cs | 78 ++- .../Models/ModModel/FoodAnimeModel.cs | 11 +- .../Models/ModModel/FoodAnimeTypeModel.cs | 85 ++-- VPet.ModMaker/Models/ModModel/FoodModel.cs | 11 +- VPet.ModMaker/Models/ModModel/ModInfoModel.cs | 54 +-- VPet.ModMaker/Models/ModModel/PetModel.cs | 43 +- VPet.ModMaker/Models/ModModel/WorkModel.cs | 35 +- VPet.ModMaker/NativeStyles.xaml | 5 +- VPet.ModMaker/Properties/AssemblyInfo.cs | 54 --- .../ObservableValue/ObservableValueGroup.cs | 4 +- VPet.ModMaker/Utils/Expansions.cs | 2 +- VPet.ModMaker/Utils/HashCode.cs | 72 --- .../Utils/{Utils.cs => NativeUtils.cs} | 2 +- VPet.ModMaker/VPet.ModMaker.csproj | 443 ++---------------- .../ModEdit/AnimeEdit/AnimeEditWindowVM.cs | 34 +- .../AnimeEdit/FoodAnimeEditWindowVM.cs | 40 +- .../ModEdit/FoodEdit/FoodEditWindowVM.cs | 13 +- .../ViewModels/ModEdit/ModEditWindowVM.cs | 28 +- .../ModEdit/MoveEdit/MoveEditWindowVM.cs | 13 +- .../ModEdit/PetEdit/PetEditWindowVM.cs | 13 +- .../ModEdit/WorkEdit/WorkEditWindowVM.cs | 35 +- .../ViewModels/ModEdit/WorkEdit/WorkPageVM.cs | 13 +- .../ModEdit/AnimeEdit/AnimeEditWindow.xaml.cs | 7 +- .../AnimeEdit/FoodAnimeEditWindow.xaml.cs | 7 +- .../ModEdit/WorkEdit/WorkEditWindow.xaml | 19 +- .../Views/ModEdit/WorkEdit/WorkPage.xaml | 4 +- VPet.ModMaker/packages.config | 10 - 34 files changed, 319 insertions(+), 866 deletions(-) delete mode 100644 VPet.ModMaker/Properties/AssemblyInfo.cs delete mode 100644 VPet.ModMaker/Utils/HashCode.cs rename VPet.ModMaker/Utils/{Utils.cs => NativeUtils.cs} (98%) delete mode 100644 VPet.ModMaker/packages.config diff --git a/.editorconfig b/.editorconfig index 98c177e..a007e79 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,3 +2,5 @@ # RCS1049: Simplify boolean comparison. dotnet_diagnostic.RCS1049.severity = none + +dotnet_diagnostic.CA1416.severity = none \ No newline at end of file diff --git a/VPet.ModMaker.sln b/VPet.ModMaker.sln index 6dcabf3..1f76097 100644 --- a/VPet.ModMaker.sln +++ b/VPet.ModMaker.sln @@ -1,9 +1,9 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.4.33213.308 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VPet.ModMaker", "VPet.ModMaker\VPet.ModMaker.csproj", "{8F804A27-A57E-4799-801C-4DE96BA153BC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VPet.ModMaker", "VPet.ModMaker\VPet.ModMaker.csproj", "{8F804A27-A57E-4799-801C-4DE96BA153BC}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/VPet.ModMaker/App.xaml b/VPet.ModMaker/App.xaml index db655e0..1950018 100644 --- a/VPet.ModMaker/App.xaml +++ b/VPet.ModMaker/App.xaml @@ -2,11 +2,12 @@ x:Class="VPet.ModMaker.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:pu="https://opensource.panuon.com/wpf-ui" StartupUri="Views/ModMakerWindow.xaml"> - + diff --git a/VPet.ModMaker/Models/ModLoader.cs b/VPet.ModMaker/Models/ModLoader.cs index 92a1a34..e76b232 100644 --- a/VPet.ModMaker/Models/ModLoader.cs +++ b/VPet.ModMaker/Models/ModLoader.cs @@ -1,13 +1,13 @@ -using LinePutScript; -using LinePutScript.Converter; -using LinePutScript.Dictionary; -using LinePutScript.Localization.WPF; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using LinePutScript; +using LinePutScript.Converter; +using LinePutScript.Dictionary; +using LinePutScript.Localization.WPF; using VPet_Simulator.Core; using VPet_Simulator.Windows.Interface; @@ -106,7 +106,7 @@ public class ModLoader public ModLoader(DirectoryInfo path) { ModPath = path; - LpsDocument modlps = new LpsDocument(File.ReadAllText(path.FullName + @"\info.lps")); + var modlps = new LPS(File.ReadAllText(path.FullName + @"\info.lps")); Name = modlps.FindLine("vupmod").Info; Intro = modlps.FindLine("intro").Info; GameVer = modlps.FindSub("gamever").InfoToInt; diff --git a/VPet.ModMaker/Models/ModMakeHistory.cs b/VPet.ModMaker/Models/ModMakeHistory.cs index 1e06102..583a219 100644 --- a/VPet.ModMaker/Models/ModMakeHistory.cs +++ b/VPet.ModMaker/Models/ModMakeHistory.cs @@ -1,11 +1,11 @@ -using LinePutScript.Converter; -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media.Imaging; +using LinePutScript.Converter; namespace VPet.ModMaker.Models; @@ -42,7 +42,7 @@ public class ModMakeHistory _path = value; var imagePath = Path.Combine(_path, "icon.png"); if (File.Exists(imagePath)) - Image = Utils.LoadImageToMemoryStream(imagePath); + Image = NativeUtils.LoadImageToMemoryStream(imagePath); } } diff --git a/VPet.ModMaker/Models/ModMaker.cs b/VPet.ModMaker/Models/ModMaker.cs index d56fe87..14f14ea 100644 --- a/VPet.ModMaker/Models/ModMaker.cs +++ b/VPet.ModMaker/Models/ModMaker.cs @@ -1,20 +1,20 @@ -using LinePutScript; -using LinePutScript.Localization.WPF; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Windows.Controls; using System.Windows; -using VPet_Simulator.Windows.Interface; +using System.Windows.Controls; +using LinePutScript; +using LinePutScript.Localization.WPF; using VPet.ModMaker.Views; +using VPet_Simulator.Windows.Interface; namespace VPet.ModMaker.Models; public class ModMaker : MainPlugin { - public ILine Set; + //public ILine Set; public override string PluginName => "ModMaker"; public ModMakerWindow Maker; @@ -24,7 +24,7 @@ public class ModMaker : MainPlugin public override void LoadPlugin() { - Set = MW.Set.FindLine("ModMaker"); + //Set = MW.Set.FindLine("ModMaker"); MenuItem modset = MW.Main.ToolBar.MenuMODConfig; modset.Visibility = Visibility.Visible; var menuset = new MenuItem() diff --git a/VPet.ModMaker/Models/ModModel/AnimeModel.cs b/VPet.ModMaker/Models/ModModel/AnimeModel.cs index b40082d..cd5af9d 100644 --- a/VPet.ModMaker/Models/ModModel/AnimeModel.cs +++ b/VPet.ModMaker/Models/ModModel/AnimeModel.cs @@ -1,8 +1,7 @@ -using HKW.HKWUtils.Observable; - -using System.Collections.ObjectModel; +using System.Collections.ObjectModel; using System.IO; using System.Linq; +using HKW.HKWUtils.Observable; using VPet_Simulator.Core; namespace VPet.ModMaker.Models.ModModel; @@ -34,11 +33,11 @@ public class AnimeModel { foreach (var file in Directory.EnumerateFiles(imagesPath)) { - var info = Path.GetFileNameWithoutExtension(file).Split(Utils.Separator); + var info = Path.GetFileNameWithoutExtension(file).Split(NativeUtils.Separator); Id.Value = info[0]; var duration = info.Last(); var imageModel = new ImageModel( - Utils.LoadImageToMemoryStream(file), + NativeUtils.LoadImageToMemoryStream(file), int.Parse(duration) ); Images.Add(imageModel); diff --git a/VPet.ModMaker/Models/ModModel/AnimeTypeModel.cs b/VPet.ModMaker/Models/ModModel/AnimeTypeModel.cs index c26d86e..e0c15c7 100644 --- a/VPet.ModMaker/Models/ModModel/AnimeTypeModel.cs +++ b/VPet.ModMaker/Models/ModModel/AnimeTypeModel.cs @@ -1,6 +1,4 @@ -using HKW.HKWUtils.Observable; - -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; @@ -8,8 +6,10 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media.Imaging; +using HKW.HKWUtils.Observable; using VPet_Simulator.Core; using static VPet_Simulator.Core.GraphInfo; +using static VPet_Simulator.Core.IGameSave; namespace VPet.ModMaker.Models.ModModel; @@ -19,7 +19,7 @@ public class AnimeTypeModel /// 动作类型 /// public static ObservableCollection GraphTypes { get; } = - new(Enum.GetValues(typeof(GraphInfo.GraphType)).Cast()); + new(Enum.GetValues()); /// /// 动画类型 @@ -30,8 +30,8 @@ public class AnimeTypeModel /// /// 模式类型 /// - public static ObservableCollection ModeTypes { get; } = - new(Enum.GetValues(typeof(GameSave.ModeType)).Cast()); + public static ObservableCollection ModeTypes { get; } = + new(Enum.GetValues(typeof(ModeType)).Cast()); /// /// 含有名称的动作列表 @@ -212,7 +212,7 @@ public class AnimeTypeModel var dirName = Path.GetFileName(dir); if ( dirName.Contains( - nameof(GameSave.ModeType.Happy), + nameof(ModeType.Happy), StringComparison.InvariantCultureIgnoreCase ) ) @@ -221,7 +221,7 @@ public class AnimeTypeModel } else if ( dirName.Contains( - nameof(GameSave.ModeType.Nomal), + nameof(ModeType.Nomal), StringComparison.InvariantCultureIgnoreCase ) ) @@ -230,7 +230,7 @@ public class AnimeTypeModel } else if ( dirName.Contains( - nameof(GameSave.ModeType.PoorCondition), + nameof(ModeType.PoorCondition), StringComparison.InvariantCultureIgnoreCase ) ) @@ -238,10 +238,7 @@ public class AnimeTypeModel AddAnime(PoorConditionAnimes, dir); } else if ( - dirName.Contains( - nameof(GameSave.ModeType.Ill), - StringComparison.InvariantCultureIgnoreCase - ) + dirName.Contains(nameof(ModeType.Ill), StringComparison.InvariantCultureIgnoreCase) ) { AddAnime(IllAnimes, dir); @@ -262,15 +259,17 @@ public class AnimeTypeModel foreach (var dir in Directory.EnumerateDirectories(path)) { var dirName = Path.GetFileName(dir); - var dirInfo = dirName.Split(Utils.Separator, StringSplitOptions.RemoveEmptyEntries); + var dirInfo = dirName.Split( + NativeUtils.Separator, + StringSplitOptions.RemoveEmptyEntries + ); if (dirInfo.Length == 3) { // 判断 A_1_Happy 类型文件夹 var typeName = dirInfo[0]; var modeName = dirInfo[2]; var type = GetAnimatType(typeName[0]); - var mode = (GameSave.ModeType) - Enum.Parse(typeof(GameSave.ModeType), Path.GetFileName(modeName), true); + var mode = (ModeType)Enum.Parse(typeof(ModeType), Path.GetFileName(modeName), true); AddAnimeForModeType(dir, mode, type); } else if (dirInfo.Length == 2) @@ -279,17 +278,16 @@ public class AnimeTypeModel var typeName = dirInfo[0]; var modeName = dirInfo[1]; var type = GetAnimatType(typeName[0]); - var mode = (GameSave.ModeType) - Enum.Parse(typeof(GameSave.ModeType), Path.GetFileName(modeName), true); + var mode = (ModeType)Enum.Parse(typeof(ModeType), Path.GetFileName(modeName), true); AddAnimeForModeType(dir, mode, type); } - else if (Enum.TryParse(dirName, true, out var mode)) + else if (Enum.TryParse(dirName, true, out var mode)) { // 判断 Happy/A 型文件夹 foreach (var typePath in Directory.EnumerateDirectories(dir)) { var type = GetAnimatType( - Path.GetFileName(typePath).Split(Utils.Separator).First()[0] + Path.GetFileName(typePath).Split(NativeUtils.Separator).First()[0] ); AddAnimeForModeType(typePath, mode, type); } @@ -302,10 +300,10 @@ public class AnimeTypeModel { foreach (var modePath in Directory.EnumerateDirectories(dir)) { - mode = (GameSave.ModeType) + mode = (ModeType) Enum.Parse( - typeof(GameSave.ModeType), - Path.GetFileName(modePath).Split(Utils.Separator).First(), + typeof(ModeType), + Path.GetFileName(modePath).Split(NativeUtils.Separator).First(), true ); AddAnimeForModeType(modePath, mode, type); @@ -313,7 +311,7 @@ public class AnimeTypeModel } else { - AddAnimeForModeType(dir, GameSave.ModeType.Nomal, type); + AddAnimeForModeType(dir, ModeType.Nomal, type); } } } @@ -325,25 +323,21 @@ public class AnimeTypeModel /// 路径 /// 模式类型 /// 动画类型 - private void AddAnimeForModeType( - string path, - GameSave.ModeType modeType, - GraphInfo.AnimatType animeType - ) + private void AddAnimeForModeType(string path, ModeType modeType, GraphInfo.AnimatType animeType) { - if (modeType is GameSave.ModeType.Happy) + if (modeType is ModeType.Happy) { AddAnime(HappyAnimes, path, animeType); } - else if (modeType is GameSave.ModeType.Nomal) + else if (modeType is ModeType.Nomal) { AddAnime(NomalAnimes, path, animeType); } - else if (modeType is GameSave.ModeType.PoorCondition) + else if (modeType is ModeType.PoorCondition) { AddAnime(PoorConditionAnimes, path, animeType); } - else if (modeType is GameSave.ModeType.Ill) + else if (modeType is ModeType.Ill) { AddAnime(IllAnimes, path, animeType); } @@ -496,7 +490,7 @@ public class AnimeTypeModel { var animePath = Path.Combine(path, "Switch"); Directory.CreateDirectory(animePath); - var switchName = animeTypeModel.GraphType.ToString().Split(Utils.Separator).Last(); + var switchName = animeTypeModel.GraphType.ToString().Split(NativeUtils.Separator).Last(); SaveWithAnimeType(Path.Combine(animePath, switchName), animeTypeModel); } @@ -533,22 +527,22 @@ public class AnimeTypeModel { if (animeTypeModel.HappyAnimes.Count > 0) { - var modePath = Path.Combine(path, nameof(GameSave.ModeType.Happy)); + var modePath = Path.Combine(path, nameof(ModeType.Happy)); SaveAnimes(modePath, animeTypeModel.HappyAnimes); } if (animeTypeModel.NomalAnimes.Count > 0) { - var modePath = Path.Combine(path, nameof(GameSave.ModeType.Nomal)); + var modePath = Path.Combine(path, nameof(ModeType.Nomal)); SaveAnimes(modePath, animeTypeModel.NomalAnimes); } if (animeTypeModel.PoorConditionAnimes.Count > 0) { - var modePath = Path.Combine(path, nameof(GameSave.ModeType.PoorCondition)); + var modePath = Path.Combine(path, nameof(ModeType.PoorCondition)); SaveAnimes(modePath, animeTypeModel.PoorConditionAnimes); } if (animeTypeModel.IllAnimes.Count > 0) { - var modePath = Path.Combine(path, nameof(GameSave.ModeType.Ill)); + var modePath = Path.Combine(path, nameof(ModeType.Ill)); SaveAnimes(modePath, animeTypeModel.IllAnimes); } @@ -594,22 +588,22 @@ public class AnimeTypeModel { if (animeType.HappyAnimes.Count > 0) { - var modePath = Path.Combine(animePath, nameof(GameSave.ModeType.Happy)); + var modePath = Path.Combine(animePath, nameof(ModeType.Happy)); SaveAnimes(modePath, animeType.HappyAnimes); } if (animeType.NomalAnimes.Count > 0) { - var modePath = Path.Combine(animePath, nameof(GameSave.ModeType.Nomal)); + var modePath = Path.Combine(animePath, nameof(ModeType.Nomal)); SaveAnimes(modePath, animeType.NomalAnimes); } if (animeType.PoorConditionAnimes.Count > 0) { - var modePath = Path.Combine(animePath, nameof(GameSave.ModeType.PoorCondition)); + var modePath = Path.Combine(animePath, nameof(ModeType.PoorCondition)); SaveAnimes(modePath, animeType.PoorConditionAnimes); } if (animeType.IllAnimes.Count > 0) { - var modePath = Path.Combine(animePath, nameof(GameSave.ModeType.Ill)); + var modePath = Path.Combine(animePath, nameof(ModeType.Ill)); SaveAnimes(modePath, animeType.IllAnimes); } static void SaveAnimes(string animePath, ObservableCollection animes) diff --git a/VPet.ModMaker/Models/ModModel/FoodAnimeModel.cs b/VPet.ModMaker/Models/ModModel/FoodAnimeModel.cs index 859891c..44221ee 100644 --- a/VPet.ModMaker/Models/ModModel/FoodAnimeModel.cs +++ b/VPet.ModMaker/Models/ModModel/FoodAnimeModel.cs @@ -1,13 +1,14 @@ -using HKW.HKWUtils.Observable; -using LinePutScript; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Text.RegularExpressions; using System.Threading.Tasks; +using HKW.HKWUtils.Observable; +using LinePutScript; using VPet_Simulator.Core; +using static VPet_Simulator.Core.IGameSave; namespace VPet.ModMaker.Models.ModModel; @@ -18,7 +19,7 @@ public class FoodAnimeModel /// public ObservableValue Id { get; } = new(); - public ObservableValue Mode { get; } + public ObservableValue Mode { get; } /// /// 后图像列表 @@ -94,7 +95,7 @@ public class FoodAnimeModel public class FoodImagesPath { - public ObservableValue Mode { get; } = new(); + public ObservableValue Mode { get; } = new(); public ObservableValue Index { get; } = new(); } diff --git a/VPet.ModMaker/Models/ModModel/FoodAnimeTypeModel.cs b/VPet.ModMaker/Models/ModModel/FoodAnimeTypeModel.cs index 4bebb47..aa4b2a0 100644 --- a/VPet.ModMaker/Models/ModModel/FoodAnimeTypeModel.cs +++ b/VPet.ModMaker/Models/ModModel/FoodAnimeTypeModel.cs @@ -1,8 +1,4 @@ -using HKW.HKWUtils.Observable; - -using LinePutScript; -using LinePutScript.Localization.WPF; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; @@ -10,7 +6,11 @@ using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using HKW.HKWUtils.Observable; +using LinePutScript; +using LinePutScript.Localization.WPF; using VPet_Simulator.Core; +using static VPet_Simulator.Core.IGameSave; namespace VPet.ModMaker.Models.ModModel; @@ -159,15 +159,11 @@ public class FoodAnimeTypeModel if (foodAnimeInfos.Any() is false) throw new Exception("信息文件\n{0}\n未包含食物动画信息".Translate(infoPath)); var pngAnimeInfos = lps.FindAllLine(nameof(PNGAnimation)) - .Select( - i => - new PNGAnimeInfo( - i.Info, - i.Find("path").Info, - (GameSave.ModeType) - Enum.Parse(typeof(GameSave.ModeType), i.Find("mode").Info, true) - ) - ) + .Select(i => new PNGAnimeInfo( + i.Info, + i.Find("path").Info, + (ModeType)Enum.Parse(typeof(ModeType), i.Find("mode").Info, true) + )) .ToList(); foreach (var foodAnimation in foodAnimeInfos) { @@ -183,22 +179,15 @@ public class FoodAnimeTypeModel /// PNG动画信息 public void ParseFoodAnimeInfo(string path, ILine line, List pngAnimeInfos) { - var mode = (GameSave.ModeType) - Enum.Parse(typeof(GameSave.ModeType), line.Find("mode").Info, true); - if (mode is GameSave.ModeType.Happy) - AddModeAnime(path, GameSave.ModeType.Happy, HappyAnimes, line, pngAnimeInfos); - else if (mode is GameSave.ModeType.Nomal) - AddModeAnime(path, GameSave.ModeType.Nomal, NomalAnimes, line, pngAnimeInfos); - else if (mode is GameSave.ModeType.PoorCondition) - AddModeAnime( - path, - GameSave.ModeType.PoorCondition, - PoorConditionAnimes, - line, - pngAnimeInfos - ); - else if (mode is GameSave.ModeType.Ill) - AddModeAnime(path, GameSave.ModeType.Ill, IllAnimes, line, pngAnimeInfos); + var mode = (ModeType)Enum.Parse(typeof(ModeType), line.Find("mode").Info, true); + if (mode is ModeType.Happy) + AddModeAnime(path, ModeType.Happy, HappyAnimes, line, pngAnimeInfos); + else if (mode is ModeType.Nomal) + AddModeAnime(path, ModeType.Nomal, NomalAnimes, line, pngAnimeInfos); + else if (mode is ModeType.PoorCondition) + AddModeAnime(path, ModeType.PoorCondition, PoorConditionAnimes, line, pngAnimeInfos); + else if (mode is ModeType.Ill) + AddModeAnime(path, ModeType.Ill, IllAnimes, line, pngAnimeInfos); } /// @@ -211,7 +200,7 @@ public class FoodAnimeTypeModel /// PNG动画信息 public void AddModeAnime( string path, - GameSave.ModeType mode, + ModeType mode, ObservableCollection foodAnimes, ILine line, List pngAnimeInfos @@ -232,7 +221,7 @@ public class FoodAnimeTypeModel // 若没有则获取通用动画 anime.FrontImages = GetImages( path, - frontLayAnimes.First(i => i.Mode == GameSave.ModeType.Nomal) + frontLayAnimes.First(i => i.Mode == ModeType.Nomal) ); } if (backLayAnimes.FirstOrDefault(i => i.Mode == mode) is PNGAnimeInfo backAnimeInfo) @@ -241,10 +230,7 @@ public class FoodAnimeTypeModel } else { - anime.BackImages = GetImages( - path, - backLayAnimes.First(i => i.Mode == GameSave.ModeType.Nomal) - ); + anime.BackImages = GetImages(path, backLayAnimes.First(i => i.Mode == ModeType.Nomal)); } foodAnimes.Add(anime); @@ -253,13 +239,10 @@ public class FoodAnimeTypeModel return new( Directory .EnumerateFiles(Path.Combine(path, pngAnimeInfo.Path)) - .Select( - i => - new ImageModel( - Utils.LoadImageToMemoryStream(i), - int.Parse(Path.GetFileNameWithoutExtension(i).Split('_')[2]) - ) - ) + .Select(i => new ImageModel( + NativeUtils.LoadImageToMemoryStream(i), + int.Parse(Path.GetFileNameWithoutExtension(i).Split('_')[2]) + )) ); } } @@ -283,13 +266,13 @@ public class FoodAnimeTypeModel return; } if (HappyAnimes.Count > 0) - SaveAnimeInfo(animePath, HappyAnimes, GameSave.ModeType.Happy); + SaveAnimeInfo(animePath, HappyAnimes, ModeType.Happy); if (NomalAnimes.Count > 0) - SaveAnimeInfo(animePath, NomalAnimes, GameSave.ModeType.Nomal); + SaveAnimeInfo(animePath, NomalAnimes, ModeType.Nomal); if (PoorConditionAnimes.Count > 0) - SaveAnimeInfo(animePath, PoorConditionAnimes, GameSave.ModeType.PoorCondition); + SaveAnimeInfo(animePath, PoorConditionAnimes, ModeType.PoorCondition); if (IllAnimes.Count > 0) - SaveAnimeInfo(animePath, IllAnimes, GameSave.ModeType.Ill); + SaveAnimeInfo(animePath, IllAnimes, ModeType.Ill); } /// @@ -301,7 +284,7 @@ public class FoodAnimeTypeModel private void SaveAnimeInfo( string animePath, ObservableCollection animes, - GameSave.ModeType mode + ModeType mode ) { var modeAnimePath = Path.Combine(animePath, mode.ToString()); @@ -355,7 +338,7 @@ public class FoodAnimeTypeModel string frontLayName, string backLayName, FoodAnimeModel anime, - GameSave.ModeType mode + ModeType mode ) { var lps = new LPS() @@ -395,9 +378,9 @@ public class PNGAnimeInfo { public string Name { get; } public string Path { get; } - public GameSave.ModeType Mode { get; } + public ModeType Mode { get; } - public PNGAnimeInfo(string name, string path, GameSave.ModeType mode) + public PNGAnimeInfo(string name, string path, ModeType mode) { Name = name; Path = path; diff --git a/VPet.ModMaker/Models/ModModel/FoodModel.cs b/VPet.ModMaker/Models/ModModel/FoodModel.cs index 4a91f81..f44ed2b 100644 --- a/VPet.ModMaker/Models/ModModel/FoodModel.cs +++ b/VPet.ModMaker/Models/ModModel/FoodModel.cs @@ -1,8 +1,4 @@ -using HKW.HKWUtils.Observable; - -using LinePutScript; -using LinePutScript.Converter; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; @@ -10,6 +6,9 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media.Imaging; +using HKW.HKWUtils.Observable; +using LinePutScript; +using LinePutScript.Converter; using VPet_Simulator.Windows.Interface; namespace VPet.ModMaker.Models; @@ -153,7 +152,7 @@ public class FoodModel : I18nModel Price.Value = food.Price; Exp.Value = food.Exp; if (File.Exists(food.Image)) - Image.Value = Utils.LoadImageToMemoryStream(food.Image); + Image.Value = NativeUtils.LoadImageToMemoryStream(food.Image); } public Food ToFood() diff --git a/VPet.ModMaker/Models/ModModel/ModInfoModel.cs b/VPet.ModMaker/Models/ModModel/ModInfoModel.cs index 984ba32..b52d337 100644 --- a/VPet.ModMaker/Models/ModModel/ModInfoModel.cs +++ b/VPet.ModMaker/Models/ModModel/ModInfoModel.cs @@ -1,10 +1,4 @@ -using HKW.HKWUtils; -using HKW.HKWUtils.Observable; - -using LinePutScript; -using LinePutScript.Converter; -using LinePutScript.Localization.WPF; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; @@ -14,6 +8,11 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using System.Windows.Media.Imaging; +using HKW.HKWUtils; +using HKW.HKWUtils.Observable; +using LinePutScript; +using LinePutScript.Converter; +using LinePutScript.Localization.WPF; using VPet.ModMaker.Models.ModModel; using VPet.ModMaker.Views.ModEdit.I18nEdit; using VPet_Simulator.Core; @@ -170,7 +169,7 @@ public class ModInfoModel : I18nModel AuthorID = loader.AuthorID; var imagePath = Path.Combine(loader.ModPath.FullName, "icon.png"); if (File.Exists(imagePath)) - Image.Value = Utils.LoadImageToMemoryStream(imagePath); + Image.Value = NativeUtils.LoadImageToMemoryStream(imagePath); foreach (var food in loader.Foods) Foods.Add(new(food)); foreach (var clickText in loader.ClickTexts) @@ -544,14 +543,13 @@ public class ModInfoModel : I18nModel lps.Add(LPSConvert.SerializeObjectToLine(food.ToFood(), "food")); foreach (var cultureName in I18nHelper.Current.CultureNames) { - SaveI18nDatas[cultureName].TryAdd( - food.Id.Value, - food.I18nDatas[cultureName].Name.Value - ); - SaveI18nDatas[cultureName].TryAdd( - food.DescriptionId.Value, - food.I18nDatas[cultureName].Description.Value - ); + SaveI18nDatas[cultureName] + .TryAdd(food.Id.Value, food.I18nDatas[cultureName].Name.Value); + SaveI18nDatas[cultureName] + .TryAdd( + food.DescriptionId.Value, + food.I18nDatas[cultureName].Description.Value + ); } } File.WriteAllText(foodFile, lps.ToString()); @@ -593,14 +591,10 @@ public class ModInfoModel : I18nModel lps.Add(LPSConvert.SerializeObjectToLine(text.ToSelectText(), "SelectText")); foreach (var cultureName in I18nHelper.Current.CultureNames) { - SaveI18nDatas[cultureName].TryAdd( - text.Id.Value, - text.I18nDatas[cultureName].Text.Value - ); - SaveI18nDatas[cultureName].TryAdd( - text.ChooseId.Value, - text.I18nDatas[cultureName].Choose.Value - ); + SaveI18nDatas[cultureName] + .TryAdd(text.Id.Value, text.I18nDatas[cultureName].Text.Value); + SaveI18nDatas[cultureName] + .TryAdd(text.ChooseId.Value, text.I18nDatas[cultureName].Choose.Value); } } File.WriteAllText(textFile, lps.ToString()); @@ -622,10 +616,8 @@ public class ModInfoModel : I18nModel lps.Add(LPSConvert.SerializeObjectToLine(text.ToLowText(), "lowfoodtext")); foreach (var cultureName in I18nHelper.Current.CultureNames) { - SaveI18nDatas[cultureName].TryAdd( - text.Id.Value, - text.I18nDatas[cultureName].Text.Value - ); + SaveI18nDatas[cultureName] + .TryAdd(text.Id.Value, text.I18nDatas[cultureName].Text.Value); } } File.WriteAllText(textFile, lps.ToString()); @@ -647,10 +639,8 @@ public class ModInfoModel : I18nModel lps.Add(LPSConvert.SerializeObjectToLine(text.ToClickText(), "clicktext")); foreach (var cultureName in I18nHelper.Current.CultureNames) { - SaveI18nDatas[cultureName].TryAdd( - text.Id.Value, - text.I18nDatas[cultureName].Text.Value - ); + SaveI18nDatas[cultureName] + .TryAdd(text.Id.Value, text.I18nDatas[cultureName].Text.Value); } } File.WriteAllText(textFile, lps.ToString()); diff --git a/VPet.ModMaker/Models/ModModel/PetModel.cs b/VPet.ModMaker/Models/ModModel/PetModel.cs index 53ae584..ad9938f 100644 --- a/VPet.ModMaker/Models/ModModel/PetModel.cs +++ b/VPet.ModMaker/Models/ModModel/PetModel.cs @@ -1,9 +1,4 @@ -using HKW.HKWUtils; -using HKW.HKWUtils.Observable; -using LinePutScript; -using LinePutScript.Converter; -using LinePutScript.Localization.WPF; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; @@ -12,6 +7,11 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Media.Imaging; +using HKW.HKWUtils; +using HKW.HKWUtils.Observable; +using LinePutScript; +using LinePutScript.Converter; +using LinePutScript.Localization.WPF; using VPet.ModMaker.Models.ModModel; using VPet_Simulator.Core; @@ -235,18 +235,15 @@ public class PetModel : I18nModel { foreach (var cultureName in I18nHelper.Current.CultureNames) { - ModInfoModel.SaveI18nDatas[cultureName].TryAdd( - Id.Value, - I18nDatas[cultureName].Name.Value - ); - ModInfoModel.SaveI18nDatas[cultureName].TryAdd( - PetNameId.Value, - I18nDatas[cultureName].PetName.Value - ); - ModInfoModel.SaveI18nDatas[cultureName].TryAdd( - DescriptionId.Value, - I18nDatas[cultureName].Description.Value - ); + ModInfoModel + .SaveI18nDatas[cultureName] + .TryAdd(Id.Value, I18nDatas[cultureName].Name.Value); + ModInfoModel + .SaveI18nDatas[cultureName] + .TryAdd(PetNameId.Value, I18nDatas[cultureName].PetName.Value); + ModInfoModel + .SaveI18nDatas[cultureName] + .TryAdd(DescriptionId.Value, I18nDatas[cultureName].Description.Value); } var petFile = Path.Combine(path, $"{Id.Value}.lps"); if (File.Exists(petFile) is false) @@ -299,10 +296,9 @@ public class PetModel : I18nModel lps.Add(LPSConvert.SerializeObjectToLine(work.ToWork(), "work")); foreach (var cultureName in I18nHelper.Current.CultureNames) { - ModInfoModel.SaveI18nDatas[cultureName].TryAdd( - work.Id.Value, - work.I18nDatas[cultureName].Name.Value - ); + ModInfoModel + .SaveI18nDatas[cultureName] + .TryAdd(work.Id.Value, work.I18nDatas[cultureName].Name.Value); } } } @@ -338,7 +334,8 @@ public class PetModel : I18nModel if (TouchBodyRect != Default.TouchBodyRect && TouchBodyRect != mainPet.TouchBodyRect) SavePetTouchBodyInfo(lps); if ( - TouchRaisedRect != Default.TouchRaisedRect && TouchRaisedRect != mainPet.TouchRaisedRect + TouchRaisedRect != Default.TouchRaisedRect + && TouchRaisedRect != mainPet.TouchRaisedRect ) SavePetTouchRaisedInfo(lps); if (RaisePoint != Default.RaisePoint && RaisePoint != mainPet.RaisePoint) diff --git a/VPet.ModMaker/Models/ModModel/WorkModel.cs b/VPet.ModMaker/Models/ModModel/WorkModel.cs index 0f23495..26676f2 100644 --- a/VPet.ModMaker/Models/ModModel/WorkModel.cs +++ b/VPet.ModMaker/Models/ModModel/WorkModel.cs @@ -1,11 +1,12 @@ -using HKW.HKWUtils.Observable; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media; +using System.Windows.Media.Imaging; +using HKW.HKWUtils.Observable; namespace VPet.ModMaker.Models; @@ -36,7 +37,7 @@ public class WorkModel : I18nModel /// /// 收获倍率 /// - public ObservableValue MoneyLevel { get; } = new(); + //public ObservableValue MoneyLevel { get; } = new(); /// /// 收获基础 @@ -78,6 +79,11 @@ public class WorkModel : I18nModel /// public ObservableValue IsOverLoad { get; } = new(); + /// + /// 图片 + /// + public ObservableValue Image { get; } = new(); + /// /// 类型 /// @@ -134,7 +140,7 @@ public class WorkModel : I18nModel IsOverLoad.AddNotifySender( WorkType, MoneyBase, - MoneyLevel, + //MoneyLevel, StrengthFood, StrengthDrink, Feeling, @@ -153,7 +159,7 @@ public class WorkModel : I18nModel WorkType.Value = model.WorkType.Value; Id.Value = model.Id.Value; Graph.Value = model.Graph.Value; - MoneyLevel.Value = model.MoneyLevel.Value; + //MoneyLevel.Value = model.MoneyLevel.Value; MoneyBase.Value = model.MoneyBase.Value; StrengthFood.Value = model.StrengthFood.Value; StrengthDrink.Value = model.StrengthDrink.Value; @@ -183,7 +189,7 @@ public class WorkModel : I18nModel WorkType.Value = work.Type; Id.Value = work.Name; Graph.Value = work.Graph; - MoneyLevel.Value = work.MoneyLevel; + //MoneyLevel.Value = work.MoneyLevel; MoneyBase.Value = work.MoneyBase; StrengthFood.Value = work.StrengthFood; StrengthDrink.Value = work.StrengthDrink; @@ -214,7 +220,7 @@ public class WorkModel : I18nModel Type = WorkType.Value, Name = Id.Value, Graph = Graph.Value, - MoneyLevel = MoneyLevel.Value, + //MoneyLevel = MoneyLevel.Value, MoneyBase = MoneyBase.Value, StrengthFood = StrengthFood.Value, StrengthDrink = StrengthDrink.Value, @@ -223,17 +229,22 @@ public class WorkModel : I18nModel Time = Time.Value, FinishBonus = FinishBonus.Value, // - BorderBrush = BorderBrush.Value.ToString().Substring(3), - Background = Background.Value.ToString().Substring(3), - ButtonBackground = ButtonBackground.Value.ToString().Substring(3), - ButtonForeground = ButtonForeground.Value.ToString().Substring(3), - Foreground = Foreground.Value.ToString().Substring(3), + BorderBrush = BorderBrush.Value.ToString()[3..], + Background = Background.Value.ToString()[3..], + ButtonBackground = ButtonBackground.Value.ToString()[3..], + ButtonForeground = ButtonForeground.Value.ToString()[3..], + Foreground = Foreground.Value.ToString()[3..], // Left = Left.Value, Top = Top.Value, Width = Width.Value, }; } + + public void Close() + { + Image.Value.CloseStream(); + } } public class I18nWorkModel diff --git a/VPet.ModMaker/NativeStyles.xaml b/VPet.ModMaker/NativeStyles.xaml index 10e2db8..0cc8c13 100644 --- a/VPet.ModMaker/NativeStyles.xaml +++ b/VPet.ModMaker/NativeStyles.xaml @@ -1,9 +1,10 @@  + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:pu="https://opensource.panuon.com/wpf-ui"> - + diff --git a/VPet.ModMaker/Properties/AssemblyInfo.cs b/VPet.ModMaker/Properties/AssemblyInfo.cs deleted file mode 100644 index e9b143e..0000000 --- a/VPet.ModMaker/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// 有关程序集的一般信息由以下 -// 控制。更改这些特性值可修改 -// 与程序集关联的信息。 -[assembly: AssemblyTitle("VPet.ModMaker")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("VPet.ModMaker")] -[assembly: AssemblyCopyright("Copyright © 2023")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -//将 ComVisible 设置为 false 将使此程序集中的类型 -//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, -//请将此类型的 ComVisible 特性设置为 true。 -[assembly: ComVisible(false)] - -//若要开始生成可本地化的应用程序,请设置 -//.csproj 文件中的 CultureYouAreCodingWith -//例如,如果您在源文件中使用的是美国英语, -//使用的是美国英语,请将 设置为 en-US。 然后取消 -//对以下 NeutralResourceLanguage 特性的注释。 更新 -//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。 - -//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] - - -[assembly: ThemeInfo( - ResourceDictionaryLocation.None, //主题特定资源词典所处位置 - //(未在页面中找到资源时使用, - //或应用程序资源字典中找到时使用) - ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置 -//(未在页面中找到资源时使用, -//、应用程序或任何主题专用资源字典中找到时使用) -)] - -// 程序集的版本信息由下列四个值组成: -// -// 主版本 -// 次版本 -// 生成号 -// 修订号 -// -//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 -//通过使用 "*",如下所示: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/VPet.ModMaker/SimpleObservable/ObservableValue/ObservableValueGroup.cs b/VPet.ModMaker/SimpleObservable/ObservableValue/ObservableValueGroup.cs index 3a06b53..3f2ac80 100644 --- a/VPet.ModMaker/SimpleObservable/ObservableValue/ObservableValueGroup.cs +++ b/VPet.ModMaker/SimpleObservable/ObservableValue/ObservableValueGroup.cs @@ -117,8 +117,8 @@ public class ObservableValueGroup : IEnumerable?> /// public IEnumerator?> GetEnumerator() { - return _bindingValues.Values - .Select(v => v.TryGetTarget(out var t) ? t : null) + return _bindingValues + .Values.Select(v => v.TryGetTarget(out var t) ? t : null) .GetEnumerator(); } diff --git a/VPet.ModMaker/Utils/Expansions.cs b/VPet.ModMaker/Utils/Expansions.cs index 8519668..8db8ece 100644 --- a/VPet.ModMaker/Utils/Expansions.cs +++ b/VPet.ModMaker/Utils/Expansions.cs @@ -19,7 +19,7 @@ namespace HKW.HKWUtils; /// /// 拓展 /// -public static class Extensions +public static class NativeExtensions { /// /// diff --git a/VPet.ModMaker/Utils/HashCode.cs b/VPet.ModMaker/Utils/HashCode.cs deleted file mode 100644 index 2af45ae..0000000 --- a/VPet.ModMaker/Utils/HashCode.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HKW.HKWUtils; - -/// -/// 哈希值 -/// -public class HashCode -{ - /// - /// 默认种子 - /// - public const int DefaultSeed = 114514; - - /// - /// 默认系数 - /// - public const int DefaultFactor = 1919810; - - /// - /// 组合哈希值 - /// - /// 值 - /// 组合的哈希值 - public static int Combine(params object[] values) - { - return CustomHash(DefaultSeed, DefaultFactor, values.Select(v => v.GetHashCode())); - } - - /// - /// 组合哈希值 - /// - /// 种子 - /// 系数 - /// 值 - /// 组合的哈希值 - public static int Combine(int seed, int factor, params object[] values) - { - return CustomHash(seed, factor, values.Select(v => v.GetHashCode())); - } - - /// - /// 自定义组合哈希 - /// - /// 种子 - /// 系数 - /// 哈希集合 - /// 组合的哈希 - public static int CustomHash(int seed, int factor, IEnumerable collection) - { - int hash = seed; - foreach (int i in collection) - hash = unchecked((hash * factor) + i); - return hash; - } - - /// - /// 自定义组合哈希 - /// - /// 种子 - /// 系数 - /// 哈希集合 - /// 组合的哈希 - public static int CustomHash(int seed, int factor, params int[] values) - { - return CustomHash(seed, factor, collection: values); - } -} diff --git a/VPet.ModMaker/Utils/Utils.cs b/VPet.ModMaker/Utils/NativeUtils.cs similarity index 98% rename from VPet.ModMaker/Utils/Utils.cs rename to VPet.ModMaker/Utils/NativeUtils.cs index d8763ec..1439883 100644 --- a/VPet.ModMaker/Utils/Utils.cs +++ b/VPet.ModMaker/Utils/NativeUtils.cs @@ -11,7 +11,7 @@ namespace HKW.HKWUtils; /// /// 工具 /// -public static class Utils +public static class NativeUtils { /// /// 解码像素宽度 diff --git a/VPet.ModMaker/VPet.ModMaker.csproj b/VPet.ModMaker/VPet.ModMaker.csproj index d175783..8862f56 100644 --- a/VPet.ModMaker/VPet.ModMaker.csproj +++ b/VPet.ModMaker/VPet.ModMaker.csproj @@ -1,417 +1,28 @@ - - - - - Debug - AnyCPU - {8F804A27-A57E-4799-801C-4DE96BA153BC} - WinExe - VPet.ModMaker - VPet.ModMaker - v4.6.2 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - latest - true - false - enable - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - preview - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - preview - - - - - - - - ..\packages\LinePutScript.1.9.2\lib\net462\LinePutScript.dll - - - ..\packages\LinePutScript.Localization.WPF.1.0.6\lib\net462\LinePutScript.Localization.WPF.dll - - - ..\packages\Ookii.Dialogs.Wpf.5.0.1\lib\net462\Ookii.Dialogs.Wpf.dll - - - ..\packages\Panuon.WPF.1.0.3\lib\net462\Panuon.WPF.dll - - - ..\packages\Panuon.WPF.UI.1.1.16.3\lib\net462\Panuon.WPF.UI.dll - - - - - - - - - - - - - - 4.0 - - - ..\packages\VPet-Simulator.Core.1.0.9\lib\net462\VPet-Simulator.Core.dll - - - ..\packages\VPet-Simulator.Windows.Interface.1.0.9\lib\net462\VPet-Simulator.Windows.Interface.dll - - - - - - - - App.xaml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FoodAnimeEditWindow.xaml - - - AnimeEditWindow.xaml - - - AnimePage.xaml - - - SelectGraphTypeWindow.xaml - - - ClickTextPage.xaml - - - ClickTextEditWindow.xaml - - - FoodPage.xaml - - - I18nEditWindow.xaml - - - LowTextPage.xaml - - - LowTextEditWindow.xaml - - - AddCultureWindow.xaml - - - - - Code - - - True - True - Resources.resx - - - True - Settings.settings - True - - - FoodEditWindow.xaml - - - ModEditWindow.xaml - - - - MoveEditWindow.xaml - - - MovePage.xaml - - - PetEditWindow.xaml - - - PetPage.xaml - - - SaveTranslationModWindow.xaml - - - SelectTextPage.xaml - - - SelectTextEditWindow.xaml - - - WorkEditWindow.xaml - - - WorkPage.xaml - - - ModMakerWindow.xaml - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - true - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - MSBuild:Compile - Designer - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - False - Microsoft .NET Framework 4.6.2 %28x86 和 x64%29 - true - - - False - .NET Framework 3.5 SP1 - false - - - - - - - + + + net8.0-windows + WinExe + latest + false + enable + false + true + false + true + preview + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimeEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimeEditWindowVM.cs index 8ed0d6e..425429c 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimeEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/AnimeEditWindowVM.cs @@ -1,8 +1,4 @@ -using HKW.HKWUtils.Observable; - -using LinePutScript.Localization.WPF; -using Microsoft.Win32; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; @@ -12,9 +8,13 @@ using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Media.Imaging; +using HKW.HKWUtils.Observable; +using LinePutScript.Localization.WPF; +using Microsoft.Win32; using VPet.ModMaker.Models; using VPet.ModMaker.Models.ModModel; using VPet_Simulator.Core; +using static VPet_Simulator.Core.IGameSave; namespace VPet.ModMaker.ViewModels.ModEdit.AnimeEdit; @@ -48,7 +48,7 @@ public class AnimeEditWindowVM /// /// 当前模式 /// - public GameSave.ModeType CurrentMode { get; set; } + public ModeType CurrentMode { get; set; } /// /// 循环 @@ -161,13 +161,13 @@ public class AnimeEditWindowVM /// 动画模型 private void AddAnimeCommand_ExecuteEvent() { - if (CurrentMode is GameSave.ModeType.Happy) + if (CurrentMode is ModeType.Happy) Anime.Value.HappyAnimes.Add(new()); - else if (CurrentMode is GameSave.ModeType.Nomal) + else if (CurrentMode is ModeType.Nomal) Anime.Value.NomalAnimes.Add(new()); - else if (CurrentMode is GameSave.ModeType.PoorCondition) + else if (CurrentMode is ModeType.PoorCondition) Anime.Value.PoorConditionAnimes.Add(new()); - else if (CurrentMode is GameSave.ModeType.Ill) + else if (CurrentMode is ModeType.Ill) Anime.Value.IllAnimes.Add(new()); } @@ -182,13 +182,13 @@ public class AnimeEditWindowVM MessageBox.Show("确定删除吗".Translate(), "", MessageBoxButton.YesNo) is MessageBoxResult.Yes ) { - if (CurrentMode is GameSave.ModeType.Happy) + if (CurrentMode is ModeType.Happy) Anime.Value.HappyAnimes.Remove(value); - else if (CurrentMode is GameSave.ModeType.Nomal) + else if (CurrentMode is ModeType.Nomal) Anime.Value.NomalAnimes.Remove(value); - else if (CurrentMode is GameSave.ModeType.PoorCondition) + else if (CurrentMode is ModeType.PoorCondition) Anime.Value.PoorConditionAnimes.Remove(value); - else if (CurrentMode is GameSave.ModeType.Ill) + else if (CurrentMode is ModeType.Ill) Anime.Value.IllAnimes.Remove(value); value.Close(); } @@ -239,7 +239,7 @@ public class AnimeEditWindowVM BitmapImage newImage; try { - newImage = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + newImage = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } catch (Exception ex) { @@ -281,13 +281,13 @@ public class AnimeEditWindowVM { if (File.Exists(path)) { - newImages.Add(new(Utils.LoadImageToMemoryStream(path))); + newImages.Add(new(NativeUtils.LoadImageToMemoryStream(path))); } else if (Directory.Exists(path)) { foreach (var file in Directory.EnumerateFiles(path, "*.png")) { - newImages.Add(new(Utils.LoadImageToMemoryStream(path))); + newImages.Add(new(NativeUtils.LoadImageToMemoryStream(path))); } } } diff --git a/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/FoodAnimeEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/FoodAnimeEditWindowVM.cs index b51a355..6852ffc 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/FoodAnimeEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/AnimeEdit/FoodAnimeEditWindowVM.cs @@ -1,8 +1,4 @@ -using HKW.HKWUtils.Observable; - -using LinePutScript.Localization.WPF; -using Microsoft.Win32; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; @@ -10,10 +6,14 @@ using System.IO; using System.Threading.Tasks; using System.Windows; using System.Windows.Media.Imaging; +using HKW.HKWUtils.Observable; +using LinePutScript.Localization.WPF; +using Microsoft.Win32; using VPet.ModMaker.Models; using VPet.ModMaker.Models.ModModel; using VPet.ModMaker.Resources; using VPet_Simulator.Core; +using static VPet_Simulator.Core.IGameSave; namespace VPet.ModMaker.ViewModels.ModEdit.AnimeEdit; @@ -28,7 +28,7 @@ public class FoodAnimeEditWindowVM /// 默认食物图片 /// public static BitmapImage DefaultFoodImage { get; } = - Utils.LoadImageToMemoryStream(NativeResources.GetStream(NativeResources.FoodImage)); + NativeUtils.LoadImageToMemoryStream(NativeResources.GetStream(NativeResources.FoodImage)); /// /// 食物图片 @@ -73,7 +73,7 @@ public class FoodAnimeEditWindowVM /// /// 当前模式 /// - public GameSave.ModeType CurrentMode { get; set; } + public ModeType CurrentMode { get; set; } /// /// 循环 @@ -248,7 +248,7 @@ public class FoodAnimeEditWindowVM { if (FoodImage.Value != DefaultFoodImage) FoodImage.Value.CloseStream(); - FoodImage.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + FoodImage.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } } @@ -270,13 +270,13 @@ public class FoodAnimeEditWindowVM #region AnimeCommand private void AddAnimeCommand_ExecuteEvent() { - if (CurrentMode is GameSave.ModeType.Happy) + if (CurrentMode is ModeType.Happy) Anime.Value.HappyAnimes.Add(new()); - else if (CurrentMode is GameSave.ModeType.Nomal) + else if (CurrentMode is ModeType.Nomal) Anime.Value.NomalAnimes.Add(new()); - else if (CurrentMode is GameSave.ModeType.PoorCondition) + else if (CurrentMode is ModeType.PoorCondition) Anime.Value.PoorConditionAnimes.Add(new()); - else if (CurrentMode is GameSave.ModeType.Ill) + else if (CurrentMode is ModeType.Ill) Anime.Value.IllAnimes.Add(new()); } @@ -291,13 +291,13 @@ public class FoodAnimeEditWindowVM MessageBox.Show("确定删除吗".Translate(), "", MessageBoxButton.YesNo) is MessageBoxResult.Yes ) { - if (CurrentMode is GameSave.ModeType.Happy) + if (CurrentMode is ModeType.Happy) Anime.Value.HappyAnimes.Remove(value); - else if (CurrentMode is GameSave.ModeType.Nomal) + else if (CurrentMode is ModeType.Nomal) Anime.Value.NomalAnimes.Remove(value); - else if (CurrentMode is GameSave.ModeType.PoorCondition) + else if (CurrentMode is ModeType.PoorCondition) Anime.Value.PoorConditionAnimes.Remove(value); - else if (CurrentMode is GameSave.ModeType.Ill) + else if (CurrentMode is ModeType.Ill) Anime.Value.IllAnimes.Remove(value); value.Close(); } @@ -365,7 +365,7 @@ public class FoodAnimeEditWindowVM BitmapImage newImage; try { - newImage = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + newImage = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } catch (Exception ex) { @@ -439,7 +439,7 @@ public class FoodAnimeEditWindowVM BitmapImage newImage; try { - newImage = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + newImage = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } catch (Exception ex) { @@ -467,13 +467,13 @@ public class FoodAnimeEditWindowVM { if (File.Exists(path)) { - newImages.Add(new(Utils.LoadImageToMemoryStream(path))); + newImages.Add(new(NativeUtils.LoadImageToMemoryStream(path))); } else if (Directory.Exists(path)) { foreach (var file in Directory.EnumerateFiles(path, "*.png")) { - newImages.Add(new(Utils.LoadImageToMemoryStream(path))); + newImages.Add(new(NativeUtils.LoadImageToMemoryStream(path))); } } } diff --git a/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodEditWindowVM.cs index 15d60a8..9c6baa3 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/FoodEdit/FoodEditWindowVM.cs @@ -1,8 +1,4 @@ -using HKW.HKWUtils.Observable; - -using LinePutScript.Localization.WPF; -using Microsoft.Win32; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; @@ -10,6 +6,9 @@ using System.Reflection; using System.Text; using System.Threading.Tasks; using System.Windows.Media.Imaging; +using HKW.HKWUtils.Observable; +using LinePutScript.Localization.WPF; +using Microsoft.Win32; using VPet.ModMaker.Models; using VPet_Simulator.Windows.Interface; @@ -69,7 +68,7 @@ public class FoodEditWindowVM }; if (openFileDialog.ShowDialog() is true) { - Food.Value.Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + Food.Value.Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } } @@ -84,7 +83,7 @@ public class FoodEditWindowVM if (openFileDialog.ShowDialog() is true) { Food.Value.Image.Value?.StreamSource?.Close(); - Food.Value.Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + Food.Value.Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } } } diff --git a/VPet.ModMaker/ViewModels/ModEdit/ModEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/ModEditWindowVM.cs index 1547225..7e740b4 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/ModEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/ModEditWindowVM.cs @@ -1,23 +1,23 @@ -using HKW.HKWUtils.Observable; -using Microsoft.Win32; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Collections.Specialized; +using System.ComponentModel; +using System.Globalization; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; -using System.Windows.Media.Imaging; -using VPet.ModMaker.Models; -using System.Collections.Specialized; -using System.ComponentModel; -using VPet.ModMaker.Views.ModEdit; using System.Windows; -using System.IO; +using System.Windows.Media.Imaging; +using HKW.HKWUtils.Observable; using LinePutScript.Localization.WPF; -using Panuon.WPF.UI; -using VPet.ModMaker.Views.ModEdit.I18nEdit; -using System.Globalization; +using Microsoft.Win32; using Ookii.Dialogs.Wpf; +using Panuon.WPF.UI; +using VPet.ModMaker.Models; +using VPet.ModMaker.Views.ModEdit; +using VPet.ModMaker.Views.ModEdit.I18nEdit; namespace VPet.ModMaker.ViewModels.ModEdit; @@ -138,7 +138,9 @@ public class ModEditWindowVM if (openFileDialog.ShowDialog() is true) { ModInfo.Value.Image.Value?.StreamSource?.Close(); - ModInfo.Value.Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + ModInfo.Value.Image.Value = NativeUtils.LoadImageToMemoryStream( + openFileDialog.FileName + ); } } diff --git a/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MoveEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MoveEditWindowVM.cs index 556d46b..5f02365 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MoveEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/MoveEdit/MoveEditWindowVM.cs @@ -1,13 +1,12 @@ -using HKW.HKWUtils.Observable; - -using LinePutScript.Localization.WPF; -using Microsoft.Win32; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media.Imaging; +using HKW.HKWUtils.Observable; +using LinePutScript.Localization.WPF; +using Microsoft.Win32; using VPet.ModMaker.Models; namespace VPet.ModMaker.ViewModels.ModEdit.MoveEdit; @@ -56,7 +55,7 @@ public class MoveEditWindowVM }; if (openFileDialog.ShowDialog() is true) { - Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } } @@ -71,7 +70,7 @@ public class MoveEditWindowVM if (openFileDialog.ShowDialog() is true) { Image.Value?.StreamSource?.Close(); - Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } } } diff --git a/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs index 7ec660f..7e2a5ef 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs @@ -1,14 +1,13 @@ -using HKW.HKWUtils.Observable; - -using LinePutScript.Localization.WPF; -using Microsoft.Win32; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Media.Imaging; +using HKW.HKWUtils.Observable; +using LinePutScript.Localization.WPF; +using Microsoft.Win32; using VPet.ModMaker.Models; namespace VPet.ModMaker.ViewModels.ModEdit.PetEdit; @@ -56,7 +55,7 @@ public class PetEditWindowVM }; if (openFileDialog.ShowDialog() is true) { - Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } } @@ -71,7 +70,7 @@ public class PetEditWindowVM if (openFileDialog.ShowDialog() is true) { Image.Value?.StreamSource?.Close(); - Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } } } diff --git a/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkEditWindowVM.cs b/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkEditWindowVM.cs index e26aa3c..f515914 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkEditWindowVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkEditWindowVM.cs @@ -1,14 +1,14 @@ -using HKW.HKWUtils.Observable; - -using LinePutScript.Localization.WPF; -using Microsoft.Win32; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Media.Imaging; +using HKW.HKWUtils.Observable; +using LinePutScript.Localization.WPF; +using Microsoft.Win32; using VPet.ModMaker.Models; +using VPet_Simulator.Windows.Interface; namespace VPet.ModMaker.ViewModels.ModEdit.WorkEdit; @@ -23,29 +23,24 @@ public class WorkEditWindowVM #endregion public ObservableValue BorderLength { get; } = new(250); public ObservableValue LengthRatio { get; } = new(250.0 / 500.0); - public ObservableValue Image { get; } = new(); #region Command public ObservableCommand AddImageCommand { get; } = new(); public ObservableCommand ChangeImageCommand { get; } = new(); + + public ObservableCommand FixOverLoadCommand { get; } = new(); #endregion public WorkEditWindowVM() { AddImageCommand.ExecuteCommand += AddImage; ChangeImageCommand.ExecuteCommand += ChangeImage; - Image.ValueChanged += Image_ValueChanged; + FixOverLoadCommand.ExecuteCommand += FixOverLoadCommand_ExecuteCommand; } - private void Image_ValueChanged( - ObservableValue sender, - ValueChangedEventArgs e - ) + private void FixOverLoadCommand_ExecuteCommand() { - //LengthRatio.EnumValue = BorderLength.EnumValue / value.PixelWidth; - } - - public void Close() - { - Image.Value?.CloseStream(); + var work = Work.Value.ToWork(); + work.FixOverLoad(); + Work.Value = new(work); } private void AddImage() @@ -58,7 +53,7 @@ public class WorkEditWindowVM }; if (openFileDialog.ShowDialog() is true) { - Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + Work.Value.Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } } @@ -72,8 +67,8 @@ public class WorkEditWindowVM }; if (openFileDialog.ShowDialog() is true) { - Image.Value?.StreamSource?.Close(); - Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName); + Work.Value.Image.Value?.CloseStream(); + Work.Value.Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName); } } } diff --git a/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkPageVM.cs b/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkPageVM.cs index 9e44cda..e230949 100644 --- a/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkPageVM.cs +++ b/VPet.ModMaker/ViewModels/ModEdit/WorkEdit/WorkPageVM.cs @@ -1,13 +1,12 @@ -using HKW.HKWUtils.Observable; - -using LinePutScript.Localization.WPF; -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; +using HKW.HKWUtils.Observable; +using LinePutScript.Localization.WPF; using VPet.ModMaker.Models; using VPet.ModMaker.Views.ModEdit.WorkEdit; @@ -60,15 +59,13 @@ public class WorkPageVM else { ShowWorks.Value = new( - Works.Where( - m => m.Id.Value.Contains(e.NewValue, StringComparison.OrdinalIgnoreCase) + Works.Where(m => + m.Id.Value.Contains(e.NewValue, StringComparison.OrdinalIgnoreCase) ) ); } } - public void Close() { } - private void Add() { var window = new WorkEditWindow(); diff --git a/VPet.ModMaker/Views/ModEdit/AnimeEdit/AnimeEditWindow.xaml.cs b/VPet.ModMaker/Views/ModEdit/AnimeEdit/AnimeEditWindow.xaml.cs index 3202721..1405c38 100644 --- a/VPet.ModMaker/Views/ModEdit/AnimeEdit/AnimeEditWindow.xaml.cs +++ b/VPet.ModMaker/Views/ModEdit/AnimeEdit/AnimeEditWindow.xaml.cs @@ -1,5 +1,4 @@ -using LinePutScript.Localization.WPF; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -12,10 +11,12 @@ using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; +using LinePutScript.Localization.WPF; using VPet.ModMaker.Models; using VPet.ModMaker.Models.ModModel; using VPet.ModMaker.ViewModels.ModEdit.AnimeEdit; using VPet_Simulator.Core; +using static VPet_Simulator.Core.IGameSave; namespace VPet.ModMaker.Views.ModEdit.AnimeEdit; @@ -61,7 +62,7 @@ public partial class AnimeEditWindow : Window || item.Tag is not string str ) return; - if (Enum.TryParse(str, true, out var mode)) + if (Enum.TryParse(str, true, out var mode)) { ViewModel.CurrentMode = mode; ViewModel.CurrentImageModel.Value = null; diff --git a/VPet.ModMaker/Views/ModEdit/AnimeEdit/FoodAnimeEditWindow.xaml.cs b/VPet.ModMaker/Views/ModEdit/AnimeEdit/FoodAnimeEditWindow.xaml.cs index e17b3c7..42e9297 100644 --- a/VPet.ModMaker/Views/ModEdit/AnimeEdit/FoodAnimeEditWindow.xaml.cs +++ b/VPet.ModMaker/Views/ModEdit/AnimeEdit/FoodAnimeEditWindow.xaml.cs @@ -1,5 +1,4 @@ -using LinePutScript.Localization.WPF; -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Linq; @@ -13,10 +12,12 @@ using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; +using LinePutScript.Localization.WPF; using VPet.ModMaker.Models; using VPet.ModMaker.Models.ModModel; using VPet.ModMaker.ViewModels.ModEdit.AnimeEdit; using VPet_Simulator.Core; +using static VPet_Simulator.Core.IGameSave; namespace VPet.ModMaker.Views.ModEdit.AnimeEdit; @@ -64,7 +65,7 @@ public partial class FoodAnimeEditWindow : Window || item.Tag is not string str ) return; - if (Enum.TryParse(str, true, out var mode)) + if (Enum.TryParse(str, true, out var mode)) { ViewModel.CurrentMode = mode; ViewModel.CurrentFrontImageModel.Value = null; diff --git a/VPet.ModMaker/Views/ModEdit/WorkEdit/WorkEditWindow.xaml b/VPet.ModMaker/Views/ModEdit/WorkEdit/WorkEditWindow.xaml index 2b3e42a..29e859a 100644 --- a/VPet.ModMaker/Views/ModEdit/WorkEdit/WorkEditWindow.xaml +++ b/VPet.ModMaker/Views/ModEdit/WorkEdit/WorkEditWindow.xaml @@ -145,10 +145,17 @@ Grid.Column="1" Text="{Binding Work.Value.Graph.Value}" />