diff --git a/VPet-Simulator.Core/Display/MainDisplay.cs b/VPet-Simulator.Core/Display/MainDisplay.cs index 13fc4b1..31f77c3 100644 --- a/VPet-Simulator.Core/Display/MainDisplay.cs +++ b/VPet-Simulator.Core/Display/MainDisplay.cs @@ -62,7 +62,7 @@ namespace VPet_Simulator.Core var graph = Core.Graph.FindGraph(DisplayType.Name, AnimatType.C_End, Core.Save.Mode); if (graph != null) { - if(State == WorkingState.Sleep) + if (State == WorkingState.Sleep) State = WorkingState.Nomal; Display(graph, EndAction); return true; @@ -120,7 +120,7 @@ namespace VPet_Simulator.Core /// 结束后接下来,不结束也运行 public void DisplayStopForce(Action EndAction) { - if(!DisplayStop(EndAction)) + if (!DisplayStop(EndAction)) EndAction?.Invoke(); } /// @@ -216,12 +216,12 @@ namespace VPet_Simulator.Core { looptimes = 0; CountNomal = 0; - var name = Core.Graph.FindName(GraphType.State_ONE); - var list = Core.Graph.FindGraphs(name, AnimatType.A_Start, Core.Save.Mode)?.FindAll(x => x.GraphInfo.Type == GraphType.State_ONE); + var name = Core.Graph.FindName(GraphType.StateONE); + var list = Core.Graph.FindGraphs(name, AnimatType.A_Start, Core.Save.Mode)?.FindAll(x => x.GraphInfo.Type == GraphType.StateONE); if (list != null && list.Count > 0) Display(list[Function.Rnd.Next(list.Count)], () => DisplayIdel_StateONEing(name)); else - Display(GraphType.State_ONE, AnimatType.A_Start, DisplayIdel_StateONEing); + Display(GraphType.StateONE, AnimatType.A_Start, DisplayIdel_StateONEing); } /// /// 显示待机(模式1)情况 @@ -235,12 +235,12 @@ namespace VPet_Simulator.Core DisplayIdel_StateTWO(graphname); break; default: - Display(graphname, AnimatType.C_End, GraphType.State_ONE, DisplayNomal); + Display(graphname, AnimatType.C_End, GraphType.StateONE, DisplayNomal); break; } else { - Display(graphname, AnimatType.B_Loop, GraphType.State_ONE, DisplayIdel_StateONEing); + Display(graphname, AnimatType.B_Loop, GraphType.StateONE, DisplayIdel_StateONEing); } } /// @@ -250,7 +250,7 @@ namespace VPet_Simulator.Core { looptimes = 0; CountNomal++; - Display(graphname, AnimatType.A_Start, GraphType.State_TWO, DisplayIdel_StateTWOing); + Display(graphname, AnimatType.A_Start, GraphType.StateTWO, DisplayIdel_StateTWOing); } /// /// 显示待机(模式2)情况 @@ -259,11 +259,11 @@ namespace VPet_Simulator.Core { if (Function.Rnd.Next(++looptimes) > Core.Graph.GraphConfig.GetDuration(graphname)) { - Display(graphname, AnimatType.C_End, GraphType.State_TWO, DisplayIdel_StateONEing); + Display(graphname, AnimatType.C_End, GraphType.StateTWO, DisplayIdel_StateONEing); } else { - Display(graphname, AnimatType.B_Loop, GraphType.State_TWO, DisplayIdel_StateTWOing); + Display(graphname, AnimatType.B_Loop, GraphType.StateTWO, DisplayIdel_StateTWOing); } } @@ -326,7 +326,7 @@ namespace VPet_Simulator.Core Display(GraphType.Sleep, AnimatType.A_Start, DisplayBLoopingForce); } else - Display(GraphType.Sleep, AnimatType.A_Start, (x) => DisplayBLoopingToNomal(Core.Graph.GraphConfig.GetDuration(x))); + Display(GraphType.Sleep, AnimatType.A_Start, (x) => DisplayBLoopingToNomal(x, Core.Graph.GraphConfig.GetDuration(x))); } /// /// 显示B循环 (强制) diff --git a/VPet-Simulator.Core/Graph/GraphCore.cs b/VPet-Simulator.Core/Graph/GraphCore.cs index e40edef..1e49124 100644 --- a/VPet-Simulator.Core/Graph/GraphCore.cs +++ b/VPet-Simulator.Core/Graph/GraphCore.cs @@ -224,7 +224,7 @@ namespace VPet_Simulator.Core /// /// 动画名称 /// 持续时间 - public int GetDuration(string name) => Duration.GetInt(name, 20); + public int GetDuration(string name) => Duration.GetInt(name ?? "", 10); /// /// 获得 Str 里面储存的文本 (已翻译) /// diff --git a/VPet-Simulator.Core/Graph/GraphInfo.cs b/VPet-Simulator.Core/Graph/GraphInfo.cs index 68ae34e..b04aedf 100644 --- a/VPet-Simulator.Core/Graph/GraphInfo.cs +++ b/VPet-Simulator.Core/Graph/GraphInfo.cs @@ -83,11 +83,11 @@ namespace VPet_Simulator.Core /// /// 待机 模式1 (开始&循环&结束) /// - State_ONE, + StateONE, /// /// 待机 模式2 (开始&循环&结束) /// - State_TWO, + StateTWO, /// /// 开机 * /// diff --git a/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps b/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps index 9ffa388..fddbd6d 100644 --- a/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps +++ b/VPet-Simulator.Windows/mod/0000_core/pet/vup.lps @@ -18,4 +18,5 @@ move:|graph#walk.right:|TriggerRight#200:|TriggerType#32:|CheckRight#100:|CheckT move:|graph#walk.left.faster:|TriggerLeft#200:|TriggerType#16:|CheckLeft#100:|CheckType#16:|SpeedX#-20:|Distance#5:|ModeType#2:| move:|graph#walk.right.faster:|TriggerRight#200:|TriggerType#32:|CheckRight#100:|CheckType#32:|SpeedX#20:|Distance#5:|ModeType#2:| move:|graph#crawl.left:|TriggerLeft#200:|TriggerType#16:|CheckLeft#100:|CheckType#16:|SpeedX#-10:|Distance#8:|ModeType#14:| -move:|graph#crawl.right:|TriggerRight#200:|TriggerType#32:|CheckRight#100:|CheckType#32:|SpeedX#10:|Distance#8:|ModeType#14:| \ No newline at end of file +move:|graph#crawl.right:|TriggerRight#200:|TriggerType#32:|CheckRight#100:|CheckType#32:|SpeedX#10:|Distance#8:|ModeType#14:| +duration:|state#10:|squat#20:|boring#20:|sleep#20:| \ No newline at end of file