From 608ebce6f583fb8e6c55a0e7d9f3a5541bd8c773 Mon Sep 17 00:00:00 2001 From: ZouJin Date: Thu, 11 Apr 2024 23:36:01 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=93=E6=9E=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Display/MainDisplay.cs | 2 +- VPet-Simulator.Core/Graph/FoodAnimation.cs | 6 +++--- VPet-Simulator.Core/Graph/GraphHelper.cs | 2 +- VPet-Simulator.Core/Graph/IGraph.cs | 4 ++-- VPet-Simulator.Core/Graph/PNGAnimation.cs | 23 +++++++++++----------- VPet-Simulator.Core/Graph/Picture.cs | 2 +- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/VPet-Simulator.Core/Display/MainDisplay.cs b/VPet-Simulator.Core/Display/MainDisplay.cs index dc99e2b..fc67719 100644 --- a/VPet-Simulator.Core/Display/MainDisplay.cs +++ b/VPet-Simulator.Core/Display/MainDisplay.cs @@ -556,7 +556,7 @@ namespace VPet_Simulator.Core /// 查找可用与显示的Border (自动多层切换) /// /// 动画 - public Border FindDisplayBorder(IGraph graph) + public Decorator FindDisplayBorder(IGraph graph) { DisplayType = graph.GraphInfo; var PetGridTag = Dispatcher.Invoke(() => PetGrid.Tag); diff --git a/VPet-Simulator.Core/Graph/FoodAnimation.cs b/VPet-Simulator.Core/Graph/FoodAnimation.cs index f720be7..861047d 100644 --- a/VPet-Simulator.Core/Graph/FoodAnimation.cs +++ b/VPet-Simulator.Core/Graph/FoodAnimation.cs @@ -253,9 +253,9 @@ namespace VPet_Simulator.Core public Image Back; } - public void Run(Border parant, Action EndAction = null) => Run(parant, null, EndAction); + public void Run(Decorator parant, Action EndAction = null) => Run(parant, null, EndAction); - public void Run(Border parant, ImageSource image, Action EndAction = null) + public void Run(Decorator parant, ImageSource image, Action EndAction = null) { if (PlayState) {//如果当前正在运行,重置状态 @@ -273,7 +273,7 @@ namespace VPet_Simulator.Core { if (FoodGrid.Parent != null) { - ((Border)FoodGrid.Parent).Child = null; + ((Decorator)FoodGrid.Parent).Child = null; } parant.Child = FoodGrid; } diff --git a/VPet-Simulator.Core/Graph/GraphHelper.cs b/VPet-Simulator.Core/Graph/GraphHelper.cs index 6cffab9..e16b5ff 100644 --- a/VPet-Simulator.Core/Graph/GraphHelper.cs +++ b/VPet-Simulator.Core/Graph/GraphHelper.cs @@ -42,7 +42,7 @@ namespace VPet_Simulator.Core /// 显示位置 /// 结束方法 /// 额外图片 - public static void Run(this IGraph graph, Border parant, ImageSource image, Action EndAction = null) + public static void Run(this IGraph graph, Decorator parant, ImageSource image, Action EndAction = null) { if (graph is IRunImage iri) { diff --git a/VPet-Simulator.Core/Graph/IGraph.cs b/VPet-Simulator.Core/Graph/IGraph.cs index f10a775..6d50e7f 100644 --- a/VPet-Simulator.Core/Graph/IGraph.cs +++ b/VPet-Simulator.Core/Graph/IGraph.cs @@ -12,7 +12,7 @@ namespace VPet_Simulator.Core /// /// 从0开始运行该动画 /// - void Run(Border parant, Action EndAction = null); + void Run(Decorator parant, Action EndAction = null); /// /// 当前动画播放状态 /// @@ -49,7 +49,7 @@ namespace VPet_Simulator.Core /// 显示位置 /// 结束方法 /// 额外图片 - void Run(Border parant, ImageSource image, Action EndAction = null); + void Run(Decorator parant, ImageSource image, Action EndAction = null); } } } diff --git a/VPet-Simulator.Core/Graph/PNGAnimation.cs b/VPet-Simulator.Core/Graph/PNGAnimation.cs index 5ff2c07..7e5d6d6 100644 --- a/VPet-Simulator.Core/Graph/PNGAnimation.cs +++ b/VPet-Simulator.Core/Graph/PNGAnimation.cs @@ -237,23 +237,24 @@ namespace VPet_Simulator.Core else { parent.IsContinue = false; - //parent.Dispatcher.Invoke(Hidden); - if (parent.DoEndAction) - EndAction?.Invoke();//运行结束动画时事件 - parent.StopAction?.Invoke(); - parent.StopAction = null; - //Task.Run(() => - //{ - // Thread.Sleep(25); - // parent.Dispatcher.Invoke(Hidden); - //}); + //不运行结束事件 + ////parent.Dispatcher.Invoke(Hidden); + //if (parent.DoEndAction) + // EndAction?.Invoke();//运行结束动画时事件 + //parent.StopAction?.Invoke(); + //parent.StopAction = null; + ////Task.Run(() => + ////{ + //// Thread.Sleep(25); + //// parent.Dispatcher.Invoke(Hidden); + ////}); } } } /// /// 从0开始运行该动画 /// - public void Run(Border parant, Action EndAction = null) + public void Run(Decorator parant, Action EndAction = null) { //if(endwilldo != null && nowid != Animations.Count) //{ diff --git a/VPet-Simulator.Core/Graph/Picture.cs b/VPet-Simulator.Core/Graph/Picture.cs index 91498ff..9a92fad 100644 --- a/VPet-Simulator.Core/Graph/Picture.cs +++ b/VPet-Simulator.Core/Graph/Picture.cs @@ -69,7 +69,7 @@ namespace VPet_Simulator.Core public bool IsReady => true; - public void Run(Border parant, Action EndAction = null) + public void Run(Decorator parant, Action EndAction = null) { if (PlayState) {