修复可能和L2D插件引起的错误

This commit is contained in:
ZouJin 2024-06-10 00:00:33 +08:00
parent 1f82987fd5
commit 0e0843bad8
2 changed files with 7 additions and 10 deletions

View File

@ -102,17 +102,12 @@ namespace VPet_Simulator.Core
public void Load_4_Start(IGraph startUPGraph = null)
{
IGraph ig = startUPGraph ?? Core.Graph.FindGraph(Core.Graph.FindName(GraphType.StartUP), AnimatType.Single, Core.Save.Mode);
ig ??= Core.Graph.FindGraph(Core.Graph.FindName(GraphType.Default), AnimatType.Single, Core.Save.Mode);
ig ??= Core.Graph.FindGraph(Core.Graph.FindName(GraphType.Default), AnimatType.Single, Core.Save.Mode);
Task.Run(() =>
{
ig.Run(PetGrid, () =>
{
IsWorking = true;
Dispatcher.Invoke(() =>
{
PetGrid.Tag = ig;
PetGrid2.Tag = ig;
});
{
IsWorking = true;
DisplayNomal();
});
});

View File

@ -505,7 +505,8 @@ namespace VPet_Simulator.Core
if (graph.Equals(PetGridTag))
{
petgridcrlf = true;
((IGraph)(PetGrid2Tag)).Stop(true);
if(PetGrid2Tag is IGraph ig)
ig.Stop(true);
Dispatcher.Invoke(() =>
{
PetGrid.Visibility = Visibility.Visible;
@ -517,7 +518,8 @@ namespace VPet_Simulator.Core
else if (graph.Equals(PetGrid2Tag))
{
petgridcrlf = false;
((IGraph)(PetGridTag)).Stop(true);
if (PetGridTag is IGraph ig)
ig.Stop(true);
Dispatcher.Invoke(() =>
{
PetGrid2.Visibility = Visibility.Visible;