From b846affcbf766c8dba43fd7907fc68381ec71e65 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Tue, 8 Aug 2023 13:54:10 +1000 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=85=B3=E9=97=AD=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../VPet-Simulator.Core.csproj | 10 +- VPet-Simulator.Core/packages.config | 6 +- .../VPet-Simulator.Windows.Interface.csproj | 10 +- .../packages.config | 6 +- VPet-Simulator.Windows/MainWindow.cs | 7 +- VPet-Simulator.Windows/MainWindow.xaml.cs | 41 ++++-- .../VPet-Simulator.Windows.csproj | 10 +- .../WinDesign/winGameSetting.xaml | 18 ++- .../WinDesign/winGameSetting.xaml.cs | 128 +++++++++++++----- .../mod/0000_core/lang/en/Base2308.lps | 9 ++ .../mod/0000_core/lang/en/CGPT2308.lps | 23 ++++ .../mod/0000_core/lang/zh-Hans/Base2308.lps | 2 + .../mod/0000_core/lang/zh-Hant/Base2308.lps | 9 ++ .../mod/0000_core/lang/zh-Hant/CGPT2308.lps | 23 ++++ VPet-Simulator.Windows/packages.config | 6 +- 15 files changed, 230 insertions(+), 78 deletions(-) create mode 100644 VPet-Simulator.Windows/mod/0000_core/lang/en/Base2308.lps create mode 100644 VPet-Simulator.Windows/mod/0000_core/lang/en/CGPT2308.lps create mode 100644 VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/Base2308.lps create mode 100644 VPet-Simulator.Windows/mod/0000_core/lang/zh-Hant/CGPT2308.lps diff --git a/VPet-Simulator.Core/VPet-Simulator.Core.csproj b/VPet-Simulator.Core/VPet-Simulator.Core.csproj index a4512d5..731f2a8 100644 --- a/VPet-Simulator.Core/VPet-Simulator.Core.csproj +++ b/VPet-Simulator.Core/VPet-Simulator.Core.csproj @@ -72,16 +72,16 @@ - ..\packages\LinePutScript.1.8.3\lib\net462\LinePutScript.dll + ..\packages\LinePutScript.1.9.2\lib\net462\LinePutScript.dll ..\packages\LinePutScript.Localization.WPF.1.0.6\lib\net462\LinePutScript.Localization.WPF.dll - - ..\packages\Panuon.WPF.1.0.1\lib\net462\Panuon.WPF.dll + + ..\packages\Panuon.WPF.1.0.2\lib\net462\Panuon.WPF.dll - - ..\packages\Panuon.WPF.UI.1.1.15\lib\net462\Panuon.WPF.UI.dll + + ..\packages\Panuon.WPF.UI.1.1.15.3\lib\net462\Panuon.WPF.UI.dll diff --git a/VPet-Simulator.Core/packages.config b/VPet-Simulator.Core/packages.config index 8237a5c..36b6e51 100644 --- a/VPet-Simulator.Core/packages.config +++ b/VPet-Simulator.Core/packages.config @@ -1,7 +1,7 @@  - + - - + + \ No newline at end of file diff --git a/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj b/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj index 09c36b8..93e92da 100644 --- a/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj +++ b/VPet-Simulator.Windows.Interface/VPet-Simulator.Windows.Interface.csproj @@ -90,16 +90,16 @@ - ..\packages\LinePutScript.1.8.3\lib\net462\LinePutScript.dll + ..\packages\LinePutScript.1.9.2\lib\net462\LinePutScript.dll ..\packages\LinePutScript.Localization.WPF.1.0.6\lib\net462\LinePutScript.Localization.WPF.dll - - ..\packages\Panuon.WPF.1.0.1\lib\net462\Panuon.WPF.dll + + ..\packages\Panuon.WPF.1.0.2\lib\net462\Panuon.WPF.dll - - ..\packages\Panuon.WPF.UI.1.1.15\lib\net462\Panuon.WPF.UI.dll + + ..\packages\Panuon.WPF.UI.1.1.15.3\lib\net462\Panuon.WPF.UI.dll diff --git a/VPet-Simulator.Windows.Interface/packages.config b/VPet-Simulator.Windows.Interface/packages.config index 8237a5c..36b6e51 100644 --- a/VPet-Simulator.Windows.Interface/packages.config +++ b/VPet-Simulator.Windows.Interface/packages.config @@ -1,7 +1,7 @@  - + - - + + \ No newline at end of file diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index 4de5215..12bd9aa 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -104,8 +104,7 @@ namespace VPet_Simulator.Windows var l = Core.Save.ToLine(); if (HashCheck) { - int hs = l.GetHashCode(); - l[(gint)"hash"] = hs; + l[(gi64)"hash"] = new Line(l.ToString()).GetLongHashCode(); } else l[(gint)"hash"] = -1; @@ -387,10 +386,10 @@ namespace VPet_Simulator.Windows public void GameLoad(ILine line) { Core.Save = GameSave.Load(line); - int hash = line.GetInt("hash"); + long hash = line.GetInt64("hash"); if (line.Remove("hash")) { - HashCheck = line.GetHashCode() == hash; + HashCheck = line.GetLongHashCode() == hash; } } } diff --git a/VPet-Simulator.Windows/MainWindow.xaml.cs b/VPet-Simulator.Windows/MainWindow.xaml.cs index bbe93b9..77b9922 100644 --- a/VPet-Simulator.Windows/MainWindow.xaml.cs +++ b/VPet-Simulator.Windows/MainWindow.xaml.cs @@ -271,6 +271,21 @@ namespace VPet_Simulator.Windows rndtext.Add("关注 {0} 谢谢喵".Translate(Environment.UserName)); } + //旧版本设置兼容 + var cgpteb = Set["CGPT"].Find("enable"); + if (cgpteb != null) + { + if (Set["CGPT"][(gbol)"enable"]) + { + Set["CGPT"][(gstr)"type"] = "API"; + } + else + { + Set["CGPT"][(gstr)"type"] = "LB"; + } + Set["CGPT"].Remove(cgpteb); + } + Dispatcher.Invoke(new Action(() => { LoadingText.Content = "尝试加载动画和生成缓存".Translate(); @@ -282,16 +297,22 @@ namespace VPet_Simulator.Windows winBetterBuy = new winBetterBuy(this); Main = new Main(Core) { }; Main.NoFunctionMOD = Set.CalFunState; - if (!Set["CGPT"][(gbol)"enable"] && IsSteamUser) + + switch (Set["CGPT"][(gstr)"type"]) { - TalkBox = new TalkBox(this); - Main.ToolBar.MainGrid.Children.Add(TalkBox); - } - else if (Set["CGPT"][(gbol)"enable"]) - { - TalkBox = new TalkBoxAPI(this); - Main.ToolBar.MainGrid.Children.Add(TalkBox); + case "API": + TalkBox = new TalkBoxAPI(this); + Main.ToolBar.MainGrid.Children.Add(TalkBox); + break; + case "LB": + if (IsSteamUser) + { + TalkBox = new TalkBox(this); + Main.ToolBar.MainGrid.Children.Add(TalkBox); + } + break; } + LoadingText.Content = "正在加载游戏".Translate(); var m = new System.Windows.Controls.MenuItem() { @@ -513,11 +534,11 @@ namespace VPet_Simulator.Windows petHelper?.Close(); Main?.Dispose(); - if(notifyIcon != null) + if (notifyIcon != null) { notifyIcon.Visible = false; notifyIcon.Dispose(); - } + } System.Environment.Exit(0); } diff --git a/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj b/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj index f29e64d..33976fc 100644 --- a/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj +++ b/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj @@ -98,7 +98,7 @@ ..\packages\Facepunch.Steamworks.2.3.3\lib\net46\Facepunch.Steamworks.Win64.dll - ..\packages\LinePutScript.1.8.3\lib\net462\LinePutScript.dll + ..\packages\LinePutScript.1.9.2\lib\net462\LinePutScript.dll ..\packages\LinePutScript.Localization.WPF.1.0.6\lib\net462\LinePutScript.Localization.WPF.dll @@ -106,11 +106,11 @@ ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll - - ..\packages\Panuon.WPF.1.0.1\lib\net462\Panuon.WPF.dll + + ..\packages\Panuon.WPF.1.0.2\lib\net462\Panuon.WPF.dll - - ..\packages\Panuon.WPF.UI.1.1.15\lib\net462\Panuon.WPF.UI.dll + + ..\packages\Panuon.WPF.UI.1.1.15.3\lib\net462\Panuon.WPF.UI.dll diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml index 8453060..a3ef92d 100644 --- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml +++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml @@ -20,7 +20,7 @@ pu:TabControlHelper.ItemsHoverBackground="{DynamicResource PrimaryLight}" pu:TabControlHelper.ItemsSelectedBackground="{DynamicResource PrimaryDark}" pu:TabControlHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}" - Foreground="{DynamicResource PrimaryText}"> + Foreground="{DynamicResource PrimaryText}" SelectionChanged="MainTab_SelectionChanged"> @@ -291,6 +291,10 @@ + + + + @@ -298,6 +302,12 @@ Content="{ll:Str '使用桌宠开发者\ 提供的免费API'}" ToolTip="{ll:Str 需遵循相关协议法律法规并有聊天字数限制}" GroupName="cgpttype" IsChecked="True" Checked="CGPType_Checked" /> + +