修复切换动画不播放的问题

This commit is contained in:
ZouJin 2024-04-17 18:11:06 +08:00
parent 2d13220ab4
commit 47b1be214f
5 changed files with 25 additions and 8 deletions

View File

@ -319,7 +319,7 @@ namespace VPet_Simulator.Core
if (Core.Save.Mode != newmod) if (Core.Save.Mode != newmod)
{ {
//切换显示动画 //切换显示动画
playSwitchAnimat(Core.Save.Mode, newmod); PlaySwitchAnimat(Core.Save.Mode, newmod);
Core.Save.Mode = newmod; Core.Save.Mode = newmod;
} }
@ -329,7 +329,7 @@ namespace VPet_Simulator.Core
Dispatcher.Invoke(() => WorkTimer.Stop()); Dispatcher.Invoke(() => WorkTimer.Stop());
} }
} }
private void playSwitchAnimat(IGameSave.ModeType before, IGameSave.ModeType after) public void PlaySwitchAnimat(IGameSave.ModeType before, IGameSave.ModeType after)
{ {
if (!(DisplayType.Type == GraphType.Default || DisplayType.Type == GraphType.Switch_Down || DisplayType.Type == GraphType.Switch_Up)) if (!(DisplayType.Type == GraphType.Default || DisplayType.Type == GraphType.Switch_Down || DisplayType.Type == GraphType.Switch_Up))
{ {
@ -343,12 +343,12 @@ namespace VPet_Simulator.Core
else if (before < after) else if (before < after)
{ {
Display(Core.Graph.FindGraph(Core.Graph.FindName(GraphType.Switch_Down), AnimatType.Single, before), Display(Core.Graph.FindGraph(Core.Graph.FindName(GraphType.Switch_Down), AnimatType.Single, before),
() => playSwitchAnimat((IGameSave.ModeType)(((int)before) + 1), after)); () => PlaySwitchAnimat((IGameSave.ModeType)(((int)before) + 1), after));
} }
else else
{ {
Display(Core.Graph.FindGraph(Core.Graph.FindName(GraphType.Switch_Up), AnimatType.Single, before), Display(Core.Graph.FindGraph(Core.Graph.FindName(GraphType.Switch_Up), AnimatType.Single, before),
() => playSwitchAnimat((IGameSave.ModeType)(((int)before) - 1), after)); () => PlaySwitchAnimat((IGameSave.ModeType)(((int)before) - 1), after));
} }
} }
/// <summary> /// <summary>

View File

@ -27,6 +27,10 @@ namespace VPet_Simulator.Windows.Interface
/// </summary> /// </summary>
bool IsSteamUser { get; } bool IsSteamUser { get; }
/// <summary> /// <summary>
/// SteamID
/// </summary>
public ulong SteamID { get; }
/// <summary>
/// 游戏设置 /// 游戏设置
/// </summary> /// </summary>
ISetting Set { get; } ISetting Set { get; }

View File

@ -2117,8 +2117,18 @@ namespace VPet_Simulator.Windows
Main.Display(graphName, imageSource, () => Main.Display(graphName, imageSource, () =>
{ {
showeatanm = true; showeatanm = true;
Main.EventTimer_Elapsed(); var newmod = Core.Save.CalMode();
Main.DisplayToNomal(); if (Core.Save.Mode != newmod)
{
//魔改下参数以免不播放切换动画
Main.DisplayType.Type = GraphType.Default;
//切换显示动画
Main.PlaySwitchAnimat(Core.Save.Mode, newmod);
Core.Save.Mode = newmod;
}
else
Main.DisplayToNomal();
}); });
} }
else else
@ -2127,7 +2137,6 @@ namespace VPet_Simulator.Windows
{ {
showeatanm = true; showeatanm = true;
} }
Main.EventTimer_Elapsed();
} }
} }

View File

@ -1,5 +1,6 @@
using LinePutScript.Dictionary; using LinePutScript.Dictionary;
using LinePutScript.Localization.WPF; using LinePutScript.Localization.WPF;
using Steamworks;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@ -23,6 +24,10 @@ public partial class MainWindow
/// 版本号 /// 版本号
/// </summary> /// </summary>
public string Version => $"{version / 10000}.{version % 10000 / 100}.{version % 100:00}"; public string Version => $"{version / 10000}.{version % 10000 / 100}.{version % 100:00}";
/// <summary>
/// SteamID
/// </summary>
public ulong SteamID => IsSteamUser ? SteamClient.SteamId.Value : 0;
public List<LowText> LowFoodText { get; set; } = new List<LowText>(); public List<LowText> LowFoodText { get; set; } = new List<LowText>();

View File

@ -234,7 +234,6 @@ namespace VPet_Simulator.Windows
} }
mw.HashCheck = false; mw.HashCheck = false;
} }
mw.TakeItem(item); mw.TakeItem(item);
} }