From ab578ddfdc0be90478a056513b7347501c7d6dc6 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Mon, 7 Aug 2023 14:04:18 +1000 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E6=9C=80=E6=96=B0=E7=9A=84Ch?= =?UTF-8?q?atGPT=E6=A1=8C=E5=AE=A0API,=E6=94=AF=E6=8C=81=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=BF=83=E6=83=85/=E5=A5=BD=E6=84=9F=E5=81=9A=E5=87=BA?= =?UTF-8?q?=E5=8F=8D=E9=A6=88=E7=AD=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/MessageBar.xaml | 3 + .../Display/MessageBar.xaml.cs | 10 +- VPet-Simulator.Windows/MainWindow.cs | 9 +- .../VPet-Simulator.Windows.csproj | 27 ++ VPet-Simulator.Windows/WinDesign/TalkBox.xaml | 18 +- .../WinDesign/TalkBox.xaml.cs | 322 ++++++++++-------- .../WinDesign/TalkBoxAPI.xaml.cs | 13 +- .../mod/0000_core/lang/zh-Hans/Base2308.lps | 7 + .../mod/0000_core/lang/zh-Hans/CGPT2308.lps | 24 ++ 9 files changed, 282 insertions(+), 151 deletions(-) create mode 100644 VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/Base2308.lps create mode 100644 VPet-Simulator.Windows/mod/0000_core/lang/zh-Hans/CGPT2308.lps diff --git a/VPet-Simulator.Core/Display/MessageBar.xaml b/VPet-Simulator.Core/Display/MessageBar.xaml index bad8067..c446ada 100644 --- a/VPet-Simulator.Core/Display/MessageBar.xaml +++ b/VPet-Simulator.Core/Display/MessageBar.xaml @@ -18,6 +18,9 @@ + + + diff --git a/VPet-Simulator.Core/Display/MessageBar.xaml.cs b/VPet-Simulator.Core/Display/MessageBar.xaml.cs index 5c7f887..50a77f9 100644 --- a/VPet-Simulator.Core/Display/MessageBar.xaml.cs +++ b/VPet-Simulator.Core/Display/MessageBar.xaml.cs @@ -30,7 +30,12 @@ namespace VPet_Simulator.Core { if (Dispatcher.Invoke(() => Opacity) <= 0.05) { - Dispatcher.Invoke(() => this.Visibility = Visibility.Collapsed); + Dispatcher.Invoke(() => + { + this.Visibility = Visibility.Collapsed; + MessageBoxContent.Children.Clear(); + }); + EndAction?.Invoke(); } else @@ -96,7 +101,7 @@ namespace VPet_Simulator.Core { if (m.UIGrid.Children.IndexOf(this) != m.UIGrid.Children.Count - 1) { - Panel.SetZIndex(this, m.UIGrid.Children.Count); + Panel.SetZIndex(this, m.UIGrid.Children.Count - 1); } TText.Text = ""; outputtext = text.ToList(); @@ -132,6 +137,7 @@ namespace VPet_Simulator.Core { EndTimer.Stop(); ShowTimer.Stop(); CloseTimer.Close(); this.Visibility = Visibility.Collapsed; + MessageBoxContent.Children.Clear(); EndAction?.Invoke(); } public void Dispose() diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index e1ad669..4de5215 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -102,8 +102,13 @@ namespace VPet_Simulator.Windows if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"\Save.lps")) File.Move(AppDomain.CurrentDomain.BaseDirectory + @"\Save.lps", AppDomain.CurrentDomain.BaseDirectory + $"\\UserData\\Save_{st}.lps"); var l = Core.Save.ToLine(); - int hs = l.GetHashCode(); - l[(gint)"hash"] = hs; + if (HashCheck) + { + int hs = l.GetHashCode(); + l[(gint)"hash"] = hs; + } + else + l[(gint)"hash"] = -1; File.WriteAllText(AppDomain.CurrentDomain.BaseDirectory + @"\Save.lps", l.ToString()); } if (CGPTClient != null) diff --git a/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj b/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj index 2fb3864..f29e64d 100644 --- a/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj +++ b/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj @@ -16,6 +16,21 @@ true latest + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true AnyCPU @@ -280,5 +295,17 @@ True + + + False + Microsoft .NET Framework 4.6.2 %28x86 和 x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + \ No newline at end of file diff --git a/VPet-Simulator.Windows/WinDesign/TalkBox.xaml b/VPet-Simulator.Windows/WinDesign/TalkBox.xaml index 91df65d..d42253a 100644 --- a/VPet-Simulator.Windows/WinDesign/TalkBox.xaml +++ b/VPet-Simulator.Windows/WinDesign/TalkBox.xaml @@ -5,24 +5,32 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:pu="clr-namespace:Panuon.WPF.UI;assembly=Panuon.WPF.UI" Height="500" Width="500" VerticalAlignment="Top"> + VerticalAlignment="Top" Margin="5,50,5,5" CornerRadius="5" Padding="5,5,5,3"> + + + + + + pu:TextBoxHelper.Watermark="{ll:Str 和桌宠说}" FontSize="30" AcceptsReturn="True" + TextWrapping="WrapWithOverflow" PreviewKeyDown="tbTalk_KeyDown" />