forked from doubleespressobro/WheresMyPluginsAt-PoE2
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathPluginUpdater.cs
More file actions
33 lines (27 loc) · 787 Bytes
/
PluginUpdater.cs
File metadata and controls
33 lines (27 loc) · 787 Bytes
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
using System.Threading.Tasks;
using ExileCore2;
namespace PluginUpdater;
public class PluginUpdater : BaseSettingsPlugin<PluginUpdaterSettings>
{
public static PluginUpdater Instance;
private Task _startupTask;
public override bool Initialise()
{
Instance = this;
Settings.GameController = GameController;
_startupTask = Task.Run(Settings.PluginConfig.Startup);
return true;
}
public override void Render()
{
if (_startupTask == null || !_startupTask.IsCompletedSuccessfully)
{
if (_startupTask?.IsFaulted == true)
{
DebugWindow.LogError(_startupTask.Exception.ToString());
}
return;
}
Settings.PluginConfig.Update();
}
}