-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
ARealmRecorded.cs
38 lines (31 loc) · 1.09 KB
/
ARealmRecorded.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Dalamud.Game.Gui.Toast;
using Dalamud.Game.Text.SeStringHandling;
using Dalamud.Plugin;
namespace ARealmRecorded;
public class ARealmRecorded(IDalamudPluginInterface pluginInterface) : DalamudPlugin<Configuration>(pluginInterface), IDalamudPlugin
{
public string Name => "A Realm Recorded";
protected override void Initialize()
{
Game.Initialize();
ReplayPacketManager.Initialize();
DalamudApi.ToastGui.Toast += OnToast;
}
protected override unsafe void ToggleConfig() => Common.UIModule->ExecuteMainCommand(76);
protected override void Draw()
{
ReplayListUI.Draw();
PlaybackControlsUI.Draw();
}
private static unsafe void OnToast(ref SeString message, ref ToastOptions options, ref bool isHandled)
{
if (isHandled || !Common.ContentsReplayModule->IsLoadingChapter && Common.ContentsReplayModule->speed < 5) return;
isHandled = true;
}
protected override void Dispose(bool disposing)
{
if (!disposing) return;
DalamudApi.ToastGui.Toast -= OnToast;
Game.Dispose();
}
}