From b9ce792a6cfc3522d408b0ca015c5b44f2220b16 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Tue, 2 Apr 2024 01:24:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9D=83=E9=99=90=E4=BF=AE=E6=94=B9=E5=92=8C?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Windows/Function/CoreMOD.cs | 16 ++-- VPet-Simulator.Windows/Function/Setting.cs | 2 +- VPet-Simulator.Windows/MainWindow.cs | 71 +-------------- VPet-Simulator.Windows/MainWindow_Property.cs | 87 +++++++++++++++++++ .../MutiPlayer/MPFriends.xaml.cs | 2 +- VPet-Simulator.Windows/MutiPlayer/MPMOD.cs | 2 +- 6 files changed, 100 insertions(+), 80 deletions(-) create mode 100644 VPet-Simulator.Windows/MainWindow_Property.cs diff --git a/VPet-Simulator.Windows/Function/CoreMOD.cs b/VPet-Simulator.Windows/Function/CoreMOD.cs index b5d8688..ea8aed3 100644 --- a/VPet-Simulator.Windows/Function/CoreMOD.cs +++ b/VPet-Simulator.Windows/Function/CoreMOD.cs @@ -14,7 +14,7 @@ using VPet_Simulator.Windows.Interface; namespace VPet_Simulator.Windows { - public class CoreMOD + internal class CoreMOD { /// /// 自动启用MOD名称 @@ -422,7 +422,7 @@ namespace VPet_Simulator.Windows save.Health += food.Health * buff; save.Likability += food.Likability * buff; } - public static bool IsOnMod(this Setting t, string ModName) + internal static bool IsOnMod(this Setting t, string ModName) { if (CoreMOD.OnModDefList.Contains(ModName)) return true; @@ -431,14 +431,14 @@ namespace VPet_Simulator.Windows return false; return line.Find(ModName.ToLower()) != null; } - public static bool IsPassMOD(this Setting t, string ModName) + internal static bool IsPassMOD(this Setting t, string ModName) { var line = t.FindLine("passmod"); if (line == null) return false; return line.Find(ModName.ToLower()) != null; } - public static bool IsMSGMOD(this Setting t, string ModName) + internal static bool IsMSGMOD(this Setting t, string ModName) { var line = t.FindorAddLine("msgmod"); if (line.GetBool(ModName)) @@ -446,21 +446,21 @@ namespace VPet_Simulator.Windows line.SetBool(ModName, true); return true; } - public static void OnMod(this Setting t, string ModName) + internal static void OnMod(this Setting t, string ModName) { if (string.IsNullOrWhiteSpace(ModName)) return; t.FindorAddLine("onmod").AddorReplaceSub(new Sub(ModName.ToLower())); } - public static void OnModRemove(this Setting t, string ModName) + internal static void OnModRemove(this Setting t, string ModName) { t.FindorAddLine("onmod").Remove(ModName.ToLower()); } - public static void PassMod(this Setting t, string ModName) + internal static void PassMod(this Setting t, string ModName) { t.FindorAddLine("passmod").AddorReplaceSub(new Sub(ModName.ToLower())); } - public static void PassModRemove(this Setting t, string ModName) + internal static void PassModRemove(this Setting t, string ModName) { t.FindorAddLine("passmod").Remove(ModName.ToLower()); } diff --git a/VPet-Simulator.Windows/Function/Setting.cs b/VPet-Simulator.Windows/Function/Setting.cs index 3568467..c3816eb 100644 --- a/VPet-Simulator.Windows/Function/Setting.cs +++ b/VPet-Simulator.Windows/Function/Setting.cs @@ -12,7 +12,7 @@ namespace VPet_Simulator.Windows /// /// 游戏设置 /// - public class Setting : LPS_D, ISetting + internal class Setting : LPS_D, ISetting { MainWindow mw; /// diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index f918731..a50f3fa 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -40,56 +40,7 @@ namespace VPet_Simulator.Windows { public partial class MainWindow : IMainWindow { - public readonly string ModPath = ExtensionValue.BaseDirectory + @"\mod"; - public bool IsSteamUser { get; } - public LPS_D Args { get; } - public string PrefixSave { get; } = ""; - private string prefixsavetrans = null; - public string PrefixSaveTrans - { - get - { - if (prefixsavetrans == null) - { - if (PrefixSave == "") - prefixsavetrans = ""; - else - prefixsavetrans = '-' + PrefixSave.TrimStart('-').Translate(); - } - return prefixsavetrans; - } - } - public Setting Set { get; set; } - ISetting IMainWindow.Set => Set; - - public List Pets { get; set; } = new List(); - public List CoreMODs = new List(); - public GameCore Core { get; set; } = new GameCore(); - public List Windows { get; set; } = new List(); - public Main Main { get; set; } - public UIElement TalkBox; - public winGameSetting winSetting { get; set; } - public winBetterBuy winBetterBuy { get; set; } - - public winWorkMenu winWorkMenu { get; set; } - //public ChatGPTClient CGPTClient; - public ImageResources ImageSources { get; set; } = new ImageResources(); - /// - /// 所有三方插件 - /// - public List Plugins { get; } = new List(); - /// - /// 所有字体(位置) - /// - public List Fonts { get; } = new List(); - /// - /// 所有主题 - /// - public List Themes = new List(); - /// - /// 当前启用主题 - /// - public Theme Theme = null; + /// /// 加载主题 /// @@ -157,25 +108,7 @@ namespace VPet_Simulator.Windows Panuon.WPF.UI.GlobalSettings.Setting.FontFamily = font; } - public List Foods { get; } = new List(); - /// - /// 版本号 - /// - public int version { get; } = 11001; - /// - /// 版本号 - /// - public string Version => $"{version / 10000}.{version % 10000 / 100}.{version % 100:00}"; - - public List LowFoodText { get; set; } = new List(); - - public List LowDrinkText { get; set; } = new List(); - - public List SelectTexts { get; set; } = new List(); - - public List ClickTexts { get; set; } = new List(); - - public GameSave_v2 GameSavesData { get; set; } + /// /// 获得自动点击的文本 /// diff --git a/VPet-Simulator.Windows/MainWindow_Property.cs b/VPet-Simulator.Windows/MainWindow_Property.cs new file mode 100644 index 0000000..0143afe --- /dev/null +++ b/VPet-Simulator.Windows/MainWindow_Property.cs @@ -0,0 +1,87 @@ +using LinePutScript.Dictionary; +using LinePutScript.Localization.WPF; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using VPet_Simulator.Core; +using VPet_Simulator.Windows.Interface; + +namespace VPet_Simulator.Windows; + +public partial class MainWindow +{//主窗口部分数据 + + public List Foods { get; } = new List(); + /// + /// 版本号 + /// + public int version { get; } = 11002; + /// + /// 版本号 + /// + public string Version => $"{version / 10000}.{version % 10000 / 100}.{version % 100:00}"; + + public List LowFoodText { get; set; } = new List(); + + public List LowDrinkText { get; set; } = new List(); + + public List SelectTexts { get; set; } = new List(); + + public List ClickTexts { get; set; } = new List(); + + public GameSave_v2 GameSavesData { get; set; } + + public readonly string ModPath = ExtensionValue.BaseDirectory + @"\mod"; + public bool IsSteamUser { get; } + public LPS_D Args { get; } + public string PrefixSave { get; } = ""; + private string prefixsavetrans = null; + public string PrefixSaveTrans + { + get + { + if (prefixsavetrans == null) + { + if (PrefixSave == "") + prefixsavetrans = ""; + else + prefixsavetrans = '-' + PrefixSave.TrimStart('-').Translate(); + } + return prefixsavetrans; + } + } + internal Setting Set { get; set; } + ISetting IMainWindow.Set => Set; + + public List Pets { get; set; } = new List(); + internal List CoreMODs = new List(); + public GameCore Core { get; set; } = new GameCore(); + public List Windows { get; set; } = new List(); + public Main Main { get; set; } + public UIElement TalkBox; + public winGameSetting winSetting { get; set; } + public winBetterBuy winBetterBuy { get; set; } + + public winWorkMenu winWorkMenu { get; set; } + //public ChatGPTClient CGPTClient; + public ImageResources ImageSources { get; set; } = new ImageResources(); + /// + /// 所有三方插件 + /// + public List Plugins { get; } = new List(); + /// + /// 所有字体(位置) + /// + public List Fonts { get; } = new List(); + /// + /// 所有主题 + /// + public List Themes = new List(); + /// + /// 当前启用主题 + /// + public Theme Theme = null; +} diff --git a/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs b/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs index 7e0a555..faf77d4 100644 --- a/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs +++ b/VPet-Simulator.Windows/MutiPlayer/MPFriends.xaml.cs @@ -218,7 +218,7 @@ public partial class MPFriends : WindowX, IMPFriend wmp.SendMessageALL(msg); } - public List MPMODs = new List(); + internal List MPMODs = new List(); public Main Main { get; set; } public ulong LobbyID => lb.Id; diff --git a/VPet-Simulator.Windows/MutiPlayer/MPMOD.cs b/VPet-Simulator.Windows/MutiPlayer/MPMOD.cs index 519314d..e7c849d 100644 --- a/VPet-Simulator.Windows/MutiPlayer/MPMOD.cs +++ b/VPet-Simulator.Windows/MutiPlayer/MPMOD.cs @@ -9,7 +9,7 @@ using VPet_Simulator.Core; using VPet_Simulator.Windows.Interface; namespace VPet_Simulator.Windows; -public class MPMOD +internal class MPMOD { public static void LoadImage(MPFriends mw, DirectoryInfo di, string pre = "") {