AxibugEmuOnline/AxibugEmuOnline.Client/Assets/Script/AppMain/UI/InGameUI/InGameUI_SaveState.cs

31 lines
853 B
C#
Raw Normal View History

2025-01-07 20:11:11 +08:00
using AxibugEmuOnline.Client.ClientCore;
2024-12-11 21:21:27 +08:00
using System.Diagnostics;
namespace AxibugEmuOnline.Client
{
public class InGameUI_SaveState : ExecuteMenu
{
private InGameUI m_gameUI;
public override bool Visible => !m_gameUI.IsNetPlay;
2025-01-07 20:11:11 +08:00
public override string Name => "保存快照";
2024-12-11 21:21:27 +08:00
2025-01-07 20:11:11 +08:00
public InGameUI_SaveState(InGameUI gameUI)
2024-12-11 21:21:27 +08:00
{
m_gameUI = gameUI;
}
public override void OnExcute(OptionUI optionUI, ref bool cancelHide)
{
if (m_gameUI.IsNetPlay) return;
Stopwatch sw = Stopwatch.StartNew();
object state = m_gameUI.Core.GetState();
m_gameUI.SaveQuickState(state);
sw.Stop();
2025-01-07 20:11:11 +08:00
App.log.Info($"{m_gameUI.RomFile.Platform}====>获取快照耗时:{sw.Elapsed.TotalMilliseconds}ms");
2024-12-11 21:21:27 +08:00
}
}
}