From c72529443dd7db41b6652912ec35135fc4cd6ec0 Mon Sep 17 00:00:00 2001 From: Hakoyu Date: Sat, 6 May 2023 15:39:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=A4=96=E7=BD=AE=E6=A8=A1?= =?UTF-8?q?=E7=BB=84=E5=88=86=E7=B1=BB=E7=9A=84=E8=AE=BE=E7=BD=AE=E6=96=B9?= =?UTF-8?q?=E5=BC=8F=20=E6=A8=A1=E7=BB=84=E5=88=86=E7=B1=BB=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20#8=20=E5=86=85=E5=AE=B9=E6=A8=A1=E7=BB=84:=20AMerch?= =?UTF-8?q?antsLegend,=20niko=5FmorePlanetaryConditions,=20planet=5Fsearch?= =?UTF-8?q?,=20secretsofthefrontier,=20StopGapMeasures3,=20The=5FLengend?= =?UTF-8?q?=5FOf=5FTenshi=20=E6=B4=BE=E7=B3=BB=E6=A8=A1=E7=BB=84:=20jc=5Fa?= =?UTF-8?q?sm,=20star=5Ffederation,=20HMI,=20HMI=5Fbrighton,=20HMI=5FSV,?= =?UTF-8?q?=20mik,=20Templars,=20adversary,=20fairyempire,=20Mayasuran=20N?= =?UTF-8?q?avy,=20Prasrity=5FScrap=5FMaster=20=E7=BE=8E=E5=8C=96=E6=A8=A1?= =?UTF-8?q?=E7=BB=84:=20synDawnSkinPack,=20BlueArchive=20Portrait=20Packv?= =?UTF-8?q?=20=E5=8A=9F=E8=83=BD=E6=A8=A1=E7=BB=84:=20fast=5Fengine=5Frend?= =?UTF-8?q?ering,=20leadingPip,=20speedUp,=20dynamictariffs,=20sun=5Fflux?= =?UTF-8?q?=5Freticle,=20presmattdamon=5Ftakenoprisoners,=20whichmod,=20ca?= =?UTF-8?q?pturecrew=20=E9=97=B2=E6=9D=82=E6=A8=A1=E7=BB=84:=20stop=5Fremo?= =?UTF-8?q?ve=5Fdmod,=20ly=5Fthis=5Fis=5Ftrash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Resources/ModTypeGroup.toml | 31 ++++++++++++++++++- .../ModManager/ModManagerPageVMController.cs | 28 ++++++++++++----- 2 files changed, 51 insertions(+), 8 deletions(-) diff --git a/Resources/ModTypeGroup.toml b/Resources/ModTypeGroup.toml index 3e6f173..b6f2a3f 100644 --- a/Resources/ModTypeGroup.toml +++ b/Resources/ModTypeGroup.toml @@ -17,7 +17,13 @@ "luddenhance", "swp", "ApproLightPlus", - "SEEKER" + "SEEKER", + "AMerchantsLegend", + "niko_morePlanetaryConditions", + "planet_search", + "secretsofthefrontier", + "StopGapMeasures3", + "The_Lengend_Of_Tenshi", ] # 派系模组 "FactionMods" = [ @@ -54,6 +60,17 @@ "underworld", "diableavionics", "shadow_ships", + "jc_asm", + "star_federation", + "HMI", + "HMI_brighton", + "HMI_SV", + "mik", + "Templars", + "adversary", + "fairyempire", + "Mayasuran Navy", + "Prasrity_Scrap_Master", ] # 美化模组 "BeautifyMods" = [ @@ -63,6 +80,8 @@ "Touhou Portrait Mod", "intothebreachportraitpack", "Gia_Portrait_Pack", + "synDawnSkinPack", + "BlueArchive Portrait Packv", ] # 功能模组 "UtilityMods" = [ @@ -86,6 +105,14 @@ "advanced_gunnery_control_dbeaa06e", "TAR", "VariantAcknowledged", + "fast_engine_rendering", + "leadingPip", + "speedUp", + "dynamictariffs", + "sun_flux_reticle", + "presmattdamon_takenoprisoners", + "whichmod", + "capturecrew" ] # 闲杂模组 "MiscellaneousMods" = [ @@ -110,4 +137,6 @@ "more_hullmods", "US", "efficientPop", + "stop_remove_dmod", + "ly_this_is_trash", ] diff --git a/ViewModels/ModManager/ModManagerPageVMController.cs b/ViewModels/ModManager/ModManagerPageVMController.cs index 6486192..f95f072 100644 --- a/ViewModels/ModManager/ModManagerPageVMController.cs +++ b/ViewModels/ModManager/ModManagerPageVMController.cs @@ -775,21 +775,35 @@ private static void TryGetModTypeGroup(string file) private static void GetModTypeGroup(string file) { - CreateModTypeGroup(file); + CheckModTypeGroup(file); using var sr = new StreamReader(file); - TomlTable table = TOML.Parse(sr); + var table = TOML.Parse(sr); TomlDeserializer.DeserializeStatic(table, typeof(ModTypeGroup)); } - private static void CreateModTypeGroup(string file) + private static void CheckModTypeGroup(string file) { + using var resourceStream = ResourceDictionary + .GetResourceStream(ResourceDictionary.ModTypeGroup_toml) + .BaseStream; if (File.Exists(file) is false) { - using var sw = new StreamWriter(file); - ResourceDictionary - .GetResourceStream(ResourceDictionary.ModTypeGroup_toml) - .BaseStream.CopyTo(sw.BaseStream); + CreateModTypeGroup(file, resourceStream); } + else + { + var fileInfo = new FileInfo(file); + if (resourceStream.Length != fileInfo.Length) + { + CreateModTypeGroup(file, resourceStream); + } + } + } + + private static void CreateModTypeGroup(string file, Stream resourceStream) + { + using var sw = new StreamWriter(file); + resourceStream.CopyTo(sw.BaseStream); } #endregion TypeGroup