修复新播放系统相关BUG

This commit is contained in:
ZouJin 2023-07-19 04:39:12 +10:00
parent 722aa3188d
commit 8eddd5b318
4 changed files with 16 additions and 15 deletions

View File

@ -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
/// <param name="EndAction">结束后接下来,不结束也运行</param>
public void DisplayStopForce(Action EndAction)
{
if(!DisplayStop(EndAction))
if (!DisplayStop(EndAction))
EndAction?.Invoke();
}
/// <summary>
@ -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);
}
/// <summary>
/// 显示待机(模式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);
}
}
/// <summary>
@ -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);
}
/// <summary>
/// 显示待机(模式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)));
}
/// <summary>
/// 显示B循环 (强制)

View File

@ -224,7 +224,7 @@ namespace VPet_Simulator.Core
/// </summary>
/// <param name="name">动画名称</param>
/// <returns>持续时间</returns>
public int GetDuration(string name) => Duration.GetInt(name, 20);
public int GetDuration(string name) => Duration.GetInt(name ?? "", 10);
/// <summary>
/// 获得 Str 里面储存的文本 (已翻译)
/// </summary>

View File

@ -83,11 +83,11 @@ namespace VPet_Simulator.Core
/// <summary>
/// 待机 模式1 (开始&循环&结束)
/// </summary>
State_ONE,
StateONE,
/// <summary>
/// 待机 模式2 (开始&循环&结束)
/// </summary>
State_TWO,
StateTWO,
/// <summary>
/// 开机 *
/// </summary>

View File

@ -19,3 +19,4 @@ move:|graph#walk.left.faster:|TriggerLeft#200:|TriggerType#16:|CheckLeft#100:|Ch
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:|
duration:|state#10:|squat#20:|boring#20:|sleep#20:|