-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPlugin.cs
111 lines (92 loc) · 3.71 KB
/
Plugin.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
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
using System;
using CustomizableUIMeow.Parser.ConditionParser;
using CustomizableUIMeow.Utilities;
using CustomizableUIMeow.Utilities.UI;
using Exiled.API.Enums;
using Exiled.API.Features;
// * V1.0.0
// * Separate from HintServiceMeow and add new features
// * V2.0.0 Remake
// * V2.0.1 Bug Fixing
// * Fixing the bug that the plugin throw null reference error when the player leave
// * V2.0.2 Minor changes
// * Add API for other plugins to register their own tag parser and condition
// * Add Data Recorder tags for player kill count and death count
// * V2.0.3 Bug Fixing
// * Fix the bug that cause API not working properly
// * V2.0.4
// * Add randomize in CustomHints tag
// * V2.0.5
// * Add new tags for player's ID
// * V2.0.6
// * Fix the bug that cause the count tag does not work properly
// * Add RequiredExiledVersion
// * V2.0.7
// * Fix the bug that Player Data Recorder does not work properly when using NPC
// * V2.0.8
// * Fix the bug that Player Data Recorder does not work properly when using NPC (Again)
// * V2.0.9
// * Fix the bug that Player Data Recorder does not work properly when using NPC (Again 2)
// * V2.0.10
// * Remove Respawn to adapt Exiled 9.0
// * Remove RChaosTargetCounte to adapt Exiled 9.0
// * Code clean-up
// * V2.0.11
// * Updated to Exiled 9.2.2
// * Fixed several compatibility issues
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, 0, 11);
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();
}
}
}