mirror of
https://github.com/LorisYounger/VPet.git
synced 2024-08-30 18:42:36 +00:00
新增防止空动画循环功能
This commit is contained in:
parent
e4ef475212
commit
76461367b2
@ -490,6 +490,7 @@ namespace VPet_Simulator.Core
|
|||||||
Display(Core.Graph.FindGraph(name, animat, Core.Save.Mode), EndAction);
|
Display(Core.Graph.FindGraph(name, animat, Core.Save.Mode), EndAction);
|
||||||
}
|
}
|
||||||
bool petgridcrlf = true;
|
bool petgridcrlf = true;
|
||||||
|
int nodisplayLoop = 0;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 显示动画 (自动多层切换)
|
/// 显示动画 (自动多层切换)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -499,9 +500,28 @@ namespace VPet_Simulator.Core
|
|||||||
{
|
{
|
||||||
if (graph == null)
|
if (graph == null)
|
||||||
{
|
{
|
||||||
|
if (nodisplayLoop++ > 20)
|
||||||
|
{//无动画时运行兼容性动画
|
||||||
|
if (nodisplayLoop < 100)
|
||||||
|
Display(GraphType.Default, AnimatType.Single, EndAction);
|
||||||
|
else
|
||||||
|
{//连Nomal都没有, 证明是未完成的动画, 修改设置+退出游戏
|
||||||
|
Dispatcher.Invoke(() =>
|
||||||
|
{
|
||||||
|
LabelDisplay.Content = "未找到可播放动画, 已停止运行桌宠模块".Translate();
|
||||||
|
LabelDisplay.Visibility = Visibility.Visible;
|
||||||
|
IsEnabled = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
EndAction?.Invoke();
|
EndAction?.Invoke();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nodisplayLoop = 0;
|
||||||
|
}
|
||||||
//if(graph.GraphType == GraphType.Climb_Up_Left)
|
//if(graph.GraphType == GraphType.Climb_Up_Left)
|
||||||
//{
|
//{
|
||||||
// Dispatcher.Invoke(() => Say(graph.GraphType.ToString()));
|
// Dispatcher.Invoke(() => Say(graph.GraphType.ToString()));
|
||||||
|
Loading…
Reference in New Issue
Block a user