From cc1e18735fcea5a62269142759aa5118f8cbfd89 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Wed, 16 Aug 2023 13:09:32 +1000 Subject: [PATCH] =?UTF-8?q?=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Graph/GraphHelper.cs | 2 +- VPet-Simulator.Core/Graph/PNGAnimation.cs | 8 ++++---- VPet-Simulator.Core/Graph/Picture.cs | 8 ++++---- VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/VPet-Simulator.Core/Graph/GraphHelper.cs b/VPet-Simulator.Core/Graph/GraphHelper.cs index 6a30378..f41fd1e 100644 --- a/VPet-Simulator.Core/Graph/GraphHelper.cs +++ b/VPet-Simulator.Core/Graph/GraphHelper.cs @@ -65,7 +65,7 @@ namespace VPet_Simulator.Core /// 用于显示的Image /// 结束动画 /// 准备好的线程 - public static Thread Run(this IGraph graph, Image img, Action EndAction = null) + public static Task Run(this IGraph graph, Image img, Action EndAction = null) { if (graph is IImageRun iri) { diff --git a/VPet-Simulator.Core/Graph/PNGAnimation.cs b/VPet-Simulator.Core/Graph/PNGAnimation.cs index c13a55a..bf719ea 100644 --- a/VPet-Simulator.Core/Graph/PNGAnimation.cs +++ b/VPet-Simulator.Core/Graph/PNGAnimation.cs @@ -332,7 +332,7 @@ namespace VPet_Simulator.Core { if (parant.Tag == this) { - new Thread(() => Animations[0].Run((System.Windows.Controls.Image)parant.Child, EndAction)).Start(); + Task.Run(() => Animations[0].Run((System.Windows.Controls.Image)parant.Child, EndAction)); return; } System.Windows.Controls.Image img; @@ -378,7 +378,7 @@ namespace VPet_Simulator.Core /// 用于显示的Image /// 结束动画 /// 准备好的线程 - public Thread Run(System.Windows.Controls.Image img, Action EndAction = null) + public Task Run(System.Windows.Controls.Image img, Action EndAction = null) { nowid = 0; PlayState = true; @@ -387,12 +387,12 @@ namespace VPet_Simulator.Core { if (img.Tag == this) { - return new Thread(() => Animations[0].Run(img, EndAction)); + return new Task(() => Animations[0].Run(img, EndAction)); } img.Tag = this; img.Source = new BitmapImage(new Uri(Path)); img.Width = Width; - return new Thread(() => Animations[0].Run(img, EndAction)); + return new Task(() => Animations[0].Run(img, EndAction)); }); } public void Stop(bool StopEndAction = false) diff --git a/VPet-Simulator.Core/Graph/Picture.cs b/VPet-Simulator.Core/Graph/Picture.cs index 1a83e69..11c7a17 100644 --- a/VPet-Simulator.Core/Graph/Picture.cs +++ b/VPet-Simulator.Core/Graph/Picture.cs @@ -139,7 +139,7 @@ namespace VPet_Simulator.Core PlayState = false; this.DoEndAction = !StopEndAction; } - public Thread Run(System.Windows.Controls.Image img, Action EndAction = null) + public Task Run(System.Windows.Controls.Image img, Action EndAction = null) { PlayState = true; DoEndAction = true; @@ -147,7 +147,7 @@ namespace VPet_Simulator.Core { if (img.Tag == this) { - return new Thread(() => + return new Task(() => { Thread.Sleep(Length); if (IsLoop && PlayState) @@ -165,7 +165,7 @@ namespace VPet_Simulator.Core img.Tag = this; img.Source = new BitmapImage(new Uri(Path)); img.Width = 500; - return new Thread(() => + return new Task(() => { Thread.Sleep(Length); if (IsLoop && PlayState) @@ -189,7 +189,7 @@ namespace VPet_Simulator.Core /// 用于显示的Image /// 结束动画 /// 准备好的线程 - Thread Run(System.Windows.Controls.Image img, Action EndAction = null); + Task Run(System.Windows.Controls.Image img, Action EndAction = null); } } diff --git a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs index 8ec1dfe..4f83eda 100644 --- a/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs +++ b/VPet-Simulator.Windows/WinDesign/winGameSetting.xaml.cs @@ -667,7 +667,7 @@ namespace VPet_Simulator.Windows private void Group_Click(object sender, RoutedEventArgs e) { if (LocalizeCore.CurrentCulture.StartsWith("zh")) - ExtensionSetting.StartURL("https://jq.qq.com/?_wv=1027&k=zmeWNHyI"); + ExtensionSetting.StartURL("https://tieba.baidu.com/f?kw=%E8%99%9A%E6%8B%9F%E4%B8%BB%E6%92%AD%E6%A8%A1%E6%8B%9F%E5%99%A8"); else ExtensionSetting.StartURL("https://github.com/LorisYounger/VPet"); }