From 3f68b42b85a5416110378b56f936a8109156390e Mon Sep 17 00:00:00 2001 From: ZouJin Date: Mon, 3 Jun 2024 23:45:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E9=BB=98=E8=AE=A4PNG=E5=BC=95?= =?UTF-8?q?=E6=93=8E=E5=A2=9E=E5=8A=A0=E8=AF=86=E5=88=AB=E6=A0=87=E5=87=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VPet-Simulator.Core/Graph/PNGAnimation.cs | 9 +++++++++ VPet-Simulator.Core/Graph/Picture.cs | 2 ++ 2 files changed, 11 insertions(+) diff --git a/VPet-Simulator.Core/Graph/PNGAnimation.cs b/VPet-Simulator.Core/Graph/PNGAnimation.cs index d7e6aa4..1d77317 100644 --- a/VPet-Simulator.Core/Graph/PNGAnimation.cs +++ b/VPet-Simulator.Core/Graph/PNGAnimation.cs @@ -85,6 +85,15 @@ namespace VPet_Simulator.Core return; } var paths = p.GetFiles("*.png"); + if (paths.Length == 0) + { + return; + } + else if (paths.Length == 1) + { + Picture.LoadGraph(graph, paths[0], info); + return; + } bool isLoop = info[(gbol)"loop"]; PNGAnimation pa = new PNGAnimation(graph, path.FullName, paths, new GraphInfo(path, info), isLoop); diff --git a/VPet-Simulator.Core/Graph/Picture.cs b/VPet-Simulator.Core/Graph/Picture.cs index c7c5c6e..6cbecfc 100644 --- a/VPet-Simulator.Core/Graph/Picture.cs +++ b/VPet-Simulator.Core/Graph/Picture.cs @@ -45,6 +45,8 @@ namespace VPet_Simulator.Core PNGAnimation.LoadGraph(graph, path, info); return; } + if (path.Extension != ".png") + return; int length = info.GetInt("length"); if (length == 0) {