diff --git a/README.assets/ss7.gif b/README.assets/ss7.gif index 108fd65..166c937 100644 Binary files a/README.assets/ss7.gif and b/README.assets/ss7.gif differ diff --git a/README.assets/ss8.gif b/README.assets/ss8.gif new file mode 100644 index 0000000..fb08749 Binary files /dev/null and b/README.assets/ss8.gif differ diff --git a/README.assets/主图.png b/README.assets/主图.png new file mode 100644 index 0000000..ed2af74 Binary files /dev/null and b/README.assets/主图.png differ diff --git a/README.md b/README.md index f40b983..2cebc0c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 虚拟桌宠模拟器 一个开源的桌宠软件, 可以内置到任何WPF应用程序 -![ss4](README.assets/ss4.gif) +![主图](README.assets/%E4%B8%BB%E5%9B%BE.png) 获取虚拟桌宠模拟器 [OnSteam(免费)](https://store.steampowered.com/app/1920960/VPet) 或 通过[Nuget]()内置到你的WPF应用程序 @@ -26,7 +26,9 @@ ##### 提起 -![ss4](README.assets/ss4.gif) +![ss4](README.assets/ss4.gif)![ss4](README.assets/ss8.gif) + + ##### 爬墙 diff --git a/VPet-Simulator.Core/Display/Main.xaml.cs b/VPet-Simulator.Core/Display/Main.xaml.cs index cf6442b..f354b91 100644 --- a/VPet-Simulator.Core/Display/Main.xaml.cs +++ b/VPet-Simulator.Core/Display/Main.xaml.cs @@ -52,9 +52,8 @@ namespace VPet_Simulator.Core MsgBar = new MessageBar(); MsgBar.Visibility = Visibility.Collapsed; UIGrid.Children.Add(MsgBar); - //TODO:锚定设置 - Core.TouchEvent.Add(new TouchArea(new Point(138, 12), new Size(224, 176), DisplayTouchHead)); - Core.TouchEvent.Add(new TouchArea(new Point(0, 0), new Size(500, 180), DisplayRaised, true)); + Core.TouchEvent.Add(new TouchArea(Core.Graph.GraphConfig.TouchHeadLocate, Core.Graph.GraphConfig.TouchHeadSize, DisplayTouchHead)); + Core.TouchEvent.Add(new TouchArea(Core.Graph.GraphConfig.TouchRaisedLocate, Core.Graph.GraphConfig.TouchRaisedSize, DisplayRaised, true)); var ig = Core.Graph.FindGraph(GraphCore.GraphType.Default, Core.Save.Mode); PetGrid.Child = ig.This; ig.Run(DisplayNomal); @@ -108,7 +107,7 @@ namespace VPet_Simulator.Core private void MainGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { isPress = false; - if (rasetype != -1) + if (rasetype != int.MinValue) { MainGrid.MouseMove -= MainGrid_MouseMove; rasetype = -1; @@ -119,8 +118,8 @@ namespace VPet_Simulator.Core private void MainGrid_MouseMove(object sender, MouseEventArgs e) { var mp = e.GetPosition(MainGrid); - var x = mp.X - 290;//TODO:锚定设置 - var y = mp.Y - 128; + var x = mp.X - Core.Graph.GraphConfig.RaisePoint.X; + var y = mp.Y - Core.Graph.GraphConfig.RaisePoint.Y; Core.Controller.MoveWindows(x, y); if (Math.Abs(x) + Math.Abs(y) > 10) rasetype = 0; diff --git a/VPet-Simulator.Core/Display/MainDisplay.cs b/VPet-Simulator.Core/Display/MainDisplay.cs index abbb1b9..4101763 100644 --- a/VPet-Simulator.Core/Display/MainDisplay.cs +++ b/VPet-Simulator.Core/Display/MainDisplay.cs @@ -9,17 +9,26 @@ using System.Windows; using System.Windows.Controls; using System.Windows.Input; using System.Windows.Threading; +using static VPet_Simulator.Core.GraphCore; namespace VPet_Simulator.Core { public partial class Main { + /// + /// 当前动画类型 + /// public GraphCore.GraphType DisplayType = GraphCore.GraphType.Default; /// + /// 默认循环次数 + /// + public int CountNomal = 0; + /// /// 显示默认情况 /// public void DisplayNomal() { + CountNomal++; Display(Core.Graph.FindGraph(GraphCore.GraphType.Default, Core.Save.Mode), DisplayNomal); } /// @@ -46,15 +55,15 @@ namespace VPet_Simulator.Core /// public void DisplayTouchHead() { - if (petgridcrlf) + if (DisplayType == GraphCore.GraphType.Touch_Head_B_Loop) if (PetGrid.Child is IGraph ig && ig.GraphType == GraphCore.GraphType.Touch_Head_B_Loop) { - ((IGraph)PetGrid.Child).IsContinue = true; + ig.IsContinue = true; return; } else if (PetGrid2.Child is IGraph ig2 && ig2.GraphType == GraphCore.GraphType.Touch_Head_B_Loop) { - ((IGraph)PetGrid.Child).IsContinue = true; + ig2.IsContinue = true; return; } Display(Core.Graph.FindGraph(GraphCore.GraphType.Touch_Head_A_Start, Core.Save.Mode), () => @@ -120,7 +129,7 @@ namespace VPet_Simulator.Core // Display(Core.Graph.FindGraph(GraphCore.GraphType.Default, Core.Save.Mode) //)))); } - int rasetype = -1; + int rasetype = int.MinValue; int walklength = 0; /// /// 显示拖拽中 @@ -131,7 +140,7 @@ namespace VPet_Simulator.Core { case -1: DisplayFalled_Left(); - rasetype = -2; + rasetype = int.MinValue; return; case 0: case 1: @@ -174,7 +183,7 @@ namespace VPet_Simulator.Core walklength = 0; Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_A_Start, Core.Save.Mode), () => { - MoveTimerPoint = new Point(-20, 0);//TODO:锚定设置 + MoveTimerPoint = new Point(-Core.Graph.GraphConfig.SpeedWalk, 0); MoveTimer.Start(); DisplayWalk_Lefting(); }); @@ -233,12 +242,53 @@ namespace VPet_Simulator.Core Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_A_Start, Core.Save.Mode), () => { - MoveTimerPoint = new Point(-20, 0);//TODO:锚定设置 + MoveTimerPoint = new Point(Core.Graph.GraphConfig.SpeedWalk, 0); MoveTimer.Start(); DisplayWalk_Righting(); }); } } + /// + /// 显示向右走 + /// + private void DisplayWalk_Righting() + { + //看看距离是不是不足 + if (Core.Controller.GetWindowsDistanceRight() < 50 * Core.Controller.ZoomRatio) + {//是,停下恢复默认 or/爬墙 + switch (Function.Rnd.Next(3)) + { + case 0: + DisplayClimb_Right_UP(() => + { + MoveTimer.Stop(); + Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal); + }); + return; + case 1: + DisplayClimb_Right_DOWN(() => + { + MoveTimer.Stop(); + Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal); + }); + return; + default: + MoveTimer.Stop(); + Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal); + return; + } + } + //不是:继续右边走or停下 + if (Function.Rnd.Next(walklength++) < 5) + { + Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_B_Loop, Core.Save.Mode), DisplayWalk_Righting); + } + else + {//停下来 + MoveTimer.Stop(); + Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal); + } + } ///// ///// 显示向左爬 (有判断) ///// @@ -298,47 +348,6 @@ namespace VPet_Simulator.Core // } //} /// - /// 显示向右走 - /// - private void DisplayWalk_Righting() - { - //看看距离是不是不足 - if (Core.Controller.GetWindowsDistanceRight() < 50 * Core.Controller.ZoomRatio) - {//是,停下恢复默认 or/爬墙 - switch (Function.Rnd.Next(3)) - { - case 0: - DisplayClimb_Right_UP(() => - { - MoveTimer.Stop(); - Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal); - }); - return; - case 1: - DisplayClimb_Right_DOWN(() => - { - MoveTimer.Stop(); - Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal); - }); - return; - default: - MoveTimer.Stop(); - Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal); - return; - } - } - //不是:继续右边走or停下 - if (Function.Rnd.Next(walklength++) < 5) - { - Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_B_Loop, Core.Save.Mode), DisplayWalk_Righting); - } - else - {//停下来 - MoveTimer.Stop(); - Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_C_End, Core.Save.Mode), DisplayNomal); - } - } - /// /// 显示左墙壁爬行 上 /// public void DisplayClimb_Left_UP(Action ifNot = null) @@ -350,7 +359,7 @@ namespace VPet_Simulator.Core Core.Controller.MoveWindows(-Core.Controller.GetWindowsDistanceLeft() / Core.Controller.ZoomRatio - 145, 0);//TODO:锚定设置 Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_A_Start, Core.Save.Mode), () => { - MoveTimerPoint = new Point(0, -10);//TODO:锚定设置 + MoveTimerPoint = new Point(0, -Core.Graph.GraphConfig.SpeedClimb); MoveTimer.Start(); DisplayClimb_Lefting_UP(); }); @@ -404,7 +413,7 @@ namespace VPet_Simulator.Core Core.Controller.MoveWindows(-Core.Controller.GetWindowsDistanceLeft() / Core.Controller.ZoomRatio - 145, 0);//TODO:锚定设置 Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Left_A_Start, Core.Save.Mode), () => { - MoveTimerPoint = new System.Windows.Point(0, 10);//TODO:锚定设置 + MoveTimerPoint = new System.Windows.Point(0, Core.Graph.GraphConfig.SpeedClimb); MoveTimer.Start(); DisplayClimb_Lefting_DOWN(); }); @@ -448,7 +457,7 @@ namespace VPet_Simulator.Core Core.Controller.MoveWindows(Core.Controller.GetWindowsDistanceRight() / Core.Controller.ZoomRatio + 185, 0);//TODO:锚定设置 Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_A_Start, Core.Save.Mode), () => { - MoveTimerPoint = new Point(0, -10);//TODO:锚定设置 + MoveTimerPoint = new Point(0, -Core.Graph.GraphConfig.SpeedClimb); MoveTimer.Start(); DisplayClimb_Righting_UP(); }); @@ -502,7 +511,7 @@ namespace VPet_Simulator.Core Core.Controller.MoveWindows(Core.Controller.GetWindowsDistanceRight() / Core.Controller.ZoomRatio + 185, 0);//TODO:锚定设置 Display(Core.Graph.FindGraph(GraphCore.GraphType.Walk_Right_A_Start, Core.Save.Mode), () => { - MoveTimerPoint = new Point(0, 10);//TODO:锚定设置 + MoveTimerPoint = new Point(0, Core.Graph.GraphConfig.SpeedClimb); MoveTimer.Start(); DisplayClimb_Righting_DOWN(); }); @@ -543,7 +552,7 @@ namespace VPet_Simulator.Core walklength = 0; Core.Controller.MoveWindows(0, -Core.Controller.GetWindowsDistanceUp() / Core.Controller.ZoomRatio - 150);//TODO:锚定设置 - MoveTimerPoint = new Point(8, 0);//TODO:锚定设置 + MoveTimerPoint = new Point(Core.Graph.GraphConfig.SpeedClimbTop, 0); MoveTimer.Start(); DisplayClimb_Top_Righting(); } @@ -594,7 +603,7 @@ namespace VPet_Simulator.Core Core.Controller.MoveWindows(0, -Core.Controller.GetWindowsDistanceUp() / Core.Controller.ZoomRatio - 150);//TODO:锚定设置 - MoveTimerPoint = new Point(8, 0);//TODO:锚定设置 + MoveTimerPoint = new Point(-Core.Graph.GraphConfig.SpeedClimbTop, 0); MoveTimer.Start(); DisplayClimb_Top_Lefting(); } @@ -648,13 +657,17 @@ namespace VPet_Simulator.Core /// 动画 /// 结束操作 public void Display(IGraph graph, Action EndAction = null) - { + { + //if(graph.GraphType == GraphType.Climb_Up_Left) + //{ + // Dispatcher.Invoke(() => Say(graph.GraphType.ToString())); + //} DisplayType = graph.GraphType; if (PetGrid.Child == graph.This) { Dispatcher.Invoke(() => { - PetGrid.Visibility = Visibility; + PetGrid.Visibility = Visibility.Visible; PetGrid2.Visibility = Visibility.Collapsed; }); ((IGraph)(PetGrid.Child)).Run(EndAction); @@ -664,7 +677,7 @@ namespace VPet_Simulator.Core { Dispatcher.Invoke(() => { - PetGrid2.Visibility = Visibility; + PetGrid2.Visibility = Visibility.Visible; PetGrid.Visibility = Visibility.Collapsed; }); ((IGraph)(PetGrid2.Child)).Run(EndAction); @@ -678,9 +691,9 @@ namespace VPet_Simulator.Core ((IGraph)(PetGrid.Child)).Stop(true); Dispatcher.Invoke(() => { - PetGrid2.Visibility = Visibility; - PetGrid.Visibility = Visibility.Collapsed; PetGrid2.Child = graph.This; + PetGrid.Visibility = Visibility.Collapsed; + PetGrid2.Visibility = Visibility.Visible; }); //Task.Run(() => //{ @@ -693,9 +706,9 @@ namespace VPet_Simulator.Core ((IGraph)(PetGrid2.Child)).Stop(true); Dispatcher.Invoke(() => { - PetGrid.Visibility = Visibility; - PetGrid2.Visibility = Visibility.Collapsed; PetGrid.Child = graph.This; + PetGrid2.Visibility = Visibility.Collapsed; + PetGrid.Visibility = Visibility.Visible; }); //Task.Run(() => //{ diff --git a/VPet-Simulator.Core/Display/MainLogic.cs b/VPet-Simulator.Core/Display/MainLogic.cs index 6c7beda..b6fd3da 100644 --- a/VPet-Simulator.Core/Display/MainLogic.cs +++ b/VPet-Simulator.Core/Display/MainLogic.cs @@ -28,8 +28,8 @@ namespace VPet_Simulator.Core //UIHandle Dispatcher.Invoke(() => TimeUIHandle.Invoke(this)); - if (DisplayType == GraphCore.GraphType.Default) - switch (20)//Function.Rnd.Next(10)) + if (DisplayType == GraphCore.GraphType.Default) + switch (-1)//Function.Rnd.Next(10)) { case 0: //随机向右 @@ -56,10 +56,10 @@ namespace VPet_Simulator.Core case 11: DisplayClimb_Top_Left(); break; - case 20: + case 15: DisplayBoring(); break; - case 21: + case 16: DisplaySquat(); break; default: diff --git a/VPet-Simulator.Core/Graph/GraphCore.cs b/VPet-Simulator.Core/Graph/GraphCore.cs index be4d540..89b17a8 100644 --- a/VPet-Simulator.Core/Graph/GraphCore.cs +++ b/VPet-Simulator.Core/Graph/GraphCore.cs @@ -1,14 +1,17 @@ -using System; +using LinePutScript; +using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Windows; namespace VPet_Simulator.Core { public class GraphCore { + /// /// 动画类型 /// @@ -199,6 +202,13 @@ namespace VPet_Simulator.Core } Graphs[type].Add(graph); } + /// + /// 添加动画 自动创建 + /// + /// 位置 + /// 状态类型 + /// 动画类型 + /// 是否储存到内存以节约加载 public void AddGraph(string path, Save.ModeType modetype, GraphType graphtype, bool storemem = false) { var paths = new DirectoryInfo(path).GetFiles(); @@ -210,6 +220,12 @@ namespace VPet_Simulator.Core else AddGraph(new PNGAnimation(paths, modetype, graphtype, storemem), graphtype); } + /// + /// 查找动画 + /// + /// 动画类型 + /// 状态类型,找不到就找相同动画类型 + /// public IGraph FindGraph(GraphType type, Save.ModeType mode) { if (Graphs.ContainsKey(type)) @@ -227,6 +243,9 @@ namespace VPet_Simulator.Core return FindGraph(GraphType.Default, mode); } static string[] graphtypevalue = null; + /// + /// 动画类型默认前文本 + /// public static string[] GraphTypeValue { get @@ -244,5 +263,115 @@ namespace VPet_Simulator.Core } } + public Config GraphConfig; + /// + /// 动画设置 + /// + public class Config + { + /// + /// 摸头触发位置 + /// + public Point TouchHeadLocate; + /// + /// 提起触发位置 + /// + public Point TouchRaisedLocate; + /// + /// 摸头触发大小 + /// + public Size TouchHeadSize; + /// + /// 提起触发大小 + /// + public Size TouchRaisedSize; + + /// + /// 提起定位点 + /// + public Point RaisePoint; + /// + /// 行走速度 + /// + public double SpeedWalk; + /// + /// 侧边爬行速度 + /// + public double SpeedClimb; + /// + /// 顶部爬行速度 + /// + public double SpeedClimbTop; + /// + /// 爬行速度 + /// + public double SpeedCrawl; + /// + /// 定位爬行左边距离 + /// + public double LocateClimbLeft; + /// + /// 定位爬行右边距离 + /// + public double LocateClimbRight; + /// + /// 定位爬行上边距离 + /// + public double LocateClimbTop; + /// + /// 初始化设置 + /// + /// + public Config(LpsDocument lps) + { + TouchHeadLocate = new Point(lps["touchhead"][(gdbe)"px"], lps["touchhead"][(gdbe)"py"]); + TouchHeadSize = new Size(lps["touchhead"][(gdbe)"sw"], lps["touchhead"][(gdbe)"sh"]); + TouchRaisedLocate = new Point(lps["touchraised"][(gdbe)"px"], lps["touchraised"][(gdbe)"py"]); + TouchRaisedSize = new Size(lps["touchraised"][(gdbe)"sw"], lps["touchraised"][(gdbe)"sh"]); + RaisePoint = new Point(lps["raisepoint"][(gdbe)"x"], lps["raisepoint"][(gdbe)"y"]); + var s = lps["speed"]; + SpeedWalk = s[(gdbe)"walk"]; + SpeedClimb = s[(gdbe)"climb"]; + SpeedClimbTop = s[(gdbe)"climbtop"]; + SpeedCrawl = s[(gdbe)"crawl"]; + s = lps["locate"]; + LocateClimbLeft = s[(gdbe)"climbleft"]; + LocateClimbRight = s[(gdbe)"climbright"]; + LocateClimbTop = s[(gdbe)"climbtop"]; + } + /// + /// 加载更多设置,新的替换后来的,允许空内容 + /// + public void Set(LpsDocument lps) + { + if (lps.HaveLine("touchhead")) + { + TouchHeadLocate = new Point(lps["touchhead"][(gdbe)"px"], lps["touchhead"][(gdbe)"py"]); + TouchHeadSize = new Size(lps["touchhead"][(gdbe)"sw"], lps["touchhead"][(gdbe)"wh"]); + } + if (lps.HaveLine("touchraised")) + { + TouchRaisedLocate = new Point(lps["touchraised"][(gdbe)"px"], lps["touchraised"][(gdbe)"py"]); + TouchRaisedSize = new Size(lps["touchraised"][(gdbe)"sw"], lps["touchraised"][(gdbe)"wh"]); + } + if (lps.HaveLine("raisepoint")) + RaisePoint = new Point(lps["raisepoint"][(gdbe)"x"], lps["raisepoint"][(gdbe)"y"]); + var s = lps.FindLine("speed"); + if (s != null) + { + SpeedWalk = s.GetDouble("walk", SpeedWalk); + SpeedClimb = s.GetDouble("climb", SpeedWalk); + SpeedClimbTop = s.GetDouble("climbtop", SpeedWalk); + SpeedCrawl = s.GetDouble("crawl", SpeedWalk); + } + s = lps.FindLine("locate"); + if (s != null) + { + LocateClimbLeft = s.GetDouble("climbleft", LocateClimbLeft); + LocateClimbRight = s.GetDouble("climbright", LocateClimbRight); + LocateClimbTop = s.GetDouble("climbtop", LocateClimbTop); + } + } + } } } diff --git a/VPet-Simulator.Core/Graph/PNGAnimation.xaml.cs b/VPet-Simulator.Core/Graph/PNGAnimation.xaml.cs index 5dfe7c7..1c18f23 100644 --- a/VPet-Simulator.Core/Graph/PNGAnimation.xaml.cs +++ b/VPet-Simulator.Core/Graph/PNGAnimation.xaml.cs @@ -54,6 +54,7 @@ namespace VPet_Simulator.Core public GraphCore.GraphType GraphType { get; private set; } + private Action endwilldo; int nowid; /// /// 新建 PNG 动画 @@ -183,10 +184,11 @@ namespace VPet_Simulator.Core } else { - parent.Dispatcher.Invoke(Hidden); + parent.endwilldo = () => parent.Dispatcher.Invoke(Hidden); if (parent.DoEndAction) EndAction?.Invoke();//运行结束动画时事件 - //重新加载第一帧 + + //重新加载第一帧 //Task.Run(() => //{ // Thread.Sleep(25); @@ -203,13 +205,14 @@ namespace VPet_Simulator.Core else { parent.IsContinue = false; + parent.Dispatcher.Invoke(Hidden); if (parent.DoEndAction) EndAction?.Invoke();//运行结束动画时事件 - Task.Run(() => - { - Thread.Sleep(25); - parent.Dispatcher.Invoke(Hidden); - }); + //Task.Run(() => + //{ + // Thread.Sleep(25); + // parent.Dispatcher.Invoke(Hidden); + //}); } } } @@ -218,6 +221,11 @@ namespace VPet_Simulator.Core /// public void Run(Action EndAction = null) { + if(endwilldo != null && nowid != Animations.Count) + { + endwilldo.Invoke(); + endwilldo = null; + } nowid = 0; PlayState = true; DoEndAction = true; diff --git a/VPet-Simulator.Windows/Function/CorePet.cs b/VPet-Simulator.Core/Handle/PetLoader.cs similarity index 92% rename from VPet-Simulator.Windows/Function/CorePet.cs rename to VPet-Simulator.Core/Handle/PetLoader.cs index df81a34..a4155dc 100644 --- a/VPet-Simulator.Windows/Function/CorePet.cs +++ b/VPet-Simulator.Core/Handle/PetLoader.cs @@ -6,15 +6,14 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Threading; -using VPet_Simulator.Core; using static VPet_Simulator.Core.GraphCore; -namespace VPet_Simulator.Windows +namespace VPet_Simulator.Core { /// - /// 宠物 + /// 宠物加载器 /// - public class CorePet + public class PetLoader { /// /// 宠物图像 @@ -24,6 +23,7 @@ namespace VPet_Simulator.Windows var g = new GraphCore(); foreach (var p in path) LoadGraph(g, new DirectoryInfo(p), "", storemem); + g.GraphConfig = Config; return g; } /// @@ -38,13 +38,13 @@ namespace VPet_Simulator.Windows /// 宠物介绍 /// public string Intor; - public Line GraphSetting; - public CorePet(LpsDocument lps, DirectoryInfo directory) + public GraphCore.Config Config; + public PetLoader(LpsDocument lps, DirectoryInfo directory) { Name = lps.First().Info; Intor = lps.First()["intor"].Info; path.Add(directory.FullName + "\\" + lps.First()["path"].Info); - GraphSetting = lps["graph"]; + Config = new Config(lps); } public static void LoadGraph(GraphCore graph, DirectoryInfo di, string path_name,bool storemem) diff --git a/VPet-Simulator.Core/VPet-Simulator.Core.csproj b/VPet-Simulator.Core/VPet-Simulator.Core.csproj index 714ab6d..918490a 100644 --- a/VPet-Simulator.Core/VPet-Simulator.Core.csproj +++ b/VPet-Simulator.Core/VPet-Simulator.Core.csproj @@ -157,6 +157,7 @@ + diff --git a/VPet-Simulator.Windows/Function/CoreMOD.cs b/VPet-Simulator.Windows/Function/CoreMOD.cs index 480cbfc..9bc3d0e 100644 --- a/VPet-Simulator.Windows/Function/CoreMOD.cs +++ b/VPet-Simulator.Windows/Function/CoreMOD.cs @@ -73,12 +73,11 @@ namespace VPet_Simulator.Windows var name = lps.First().Info; var p = mw.Pets.FirstOrDefault(x => x.Name == name); if (p == null) - mw.Pets.Add(new CorePet(lps, di)); + mw.Pets.Add(new PetLoader(lps, di)); else { p.path.Add(di.FullName + "\\" + lps.First()["path"].Info); - foreach (var sub in lps["graph"]) - p.GraphSetting.AddorReplaceSub(sub); + p.Config.Set(lps); } } } diff --git a/VPet-Simulator.Windows/MainWindow.cs b/VPet-Simulator.Windows/MainWindow.cs index 4abe0a8..e83c2d8 100644 --- a/VPet-Simulator.Windows/MainWindow.cs +++ b/VPet-Simulator.Windows/MainWindow.cs @@ -12,7 +12,7 @@ namespace VPet_Simulator.Windows public readonly string ModPath = Environment.CurrentDirectory + @"\mod"; public readonly bool IsSteamUser; public Setting Set; - public List Pets = new List(); + public List Pets = new List(); public List CoreMODs = new List(); public GameCore Core = new GameCore(); public winGameSetting winSetting; diff --git a/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj b/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj index 0ba86ef..620a37f 100644 --- a/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj +++ b/VPet-Simulator.Windows/VPet-Simulator.Windows.csproj @@ -110,7 +110,6 @@ Designer - diff --git a/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps b/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps index fc79100..9ca6c3b 100644 --- a/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps +++ b/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps @@ -1 +1,6 @@ -pet#默认虚拟桌宠:|intor#虚拟主播模拟器默认人物形象:|path#vup:| \ No newline at end of file +pet#默认虚拟桌宠:|intor#虚拟主播模拟器默认人物形象:|path#vup:| +touchhead:|px#138:|py#12:|sw#224:|sh#176:| +touchraised:|px#0:|py#0:|sw#500:|sh#180:| +raisepoint:|x#290:|y#128:| +speed:|walk#20:|climb#10:|climbtop#8:|crawl#8:| +locate:|climbleft#145:|climbright#185:|climbtop#150:| \ No newline at end of file