-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlugin.cs
More file actions
80 lines (62 loc) · 2.54 KB
/
Plugin.cs
File metadata and controls
80 lines (62 loc) · 2.54 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using CustomizableUIMeow.Parser.ConditionParser;
using CustomizableUIMeow.Utilities;
using CustomizableUIMeow.Utilities.UI;
using Exiled.API.Enums;
using Exiled.API.Features;
using System;
namespace CustomizableUIMeow
{
internal class Plugin : Plugin<PluginConfig, PluginTranslation>
{
public override string Name => "CustomizableUIMeow";
public override string Author => "MeowServer";
public override Version Version => new Version(2, 2, 0);
public override Version RequiredExiledVersion => new Version(9, 0, 0);
public override PluginPriority Priority => PluginPriority.Default;
public static Plugin Instance;
public override void OnEnabled()
{
Instance = this;
PluginConfig.Instance = Config;
PluginTranslation.Instance = Translation;
FileReader.InitializeFile();
//UI
BoolExpressionParser.Instance = new BoolExpressionParser();
ConditionParserLoader.Instance = new ConditionParserLoader();
TagParserLoader.Instance = new TagParserLoader();
TemplateLoader.Instance = new TemplateLoader();
Exiled.Events.Handlers.Player.Verified += EventHandler.OnVerified;
Exiled.Events.Handlers.Player.Left += EventHandler.OnLeft;
Exiled.Events.Handlers.Player.ChangingRole += EventHandler.OnChangingRole;
//Data Recorder
Utilities.DataRecorder.EventHandler.BindEvent();
base.OnEnabled();
}
public override void OnDisabled()
{
Instance = null;
PluginConfig.Instance = null;
PluginTranslation.Instance = null;
//UI
BoolExpressionParser.Instance = null;
ConditionParserLoader.Instance = null;
TagParserLoader.Instance = null;
TemplateLoader.Instance = null;
Exiled.Events.Handlers.Player.Verified -= EventHandler.OnVerified;
Exiled.Events.Handlers.Player.Left -= EventHandler.OnLeft;
Exiled.Events.Handlers.Player.ChangingRole -= EventHandler.OnChangingRole;
//Data Recorder
Utilities.DataRecorder.EventHandler.UnbindEvent();
base.OnDisabled();
}
public override void OnReloaded()
{
DisplayManager.DisplayManagers.Clear();
foreach (Player player in Player.List)
{
DisplayManager.GetOrCreate(player).SetTemplate();
}
base.OnReloaded();
}
}
}