forked from Marco15453-Archived/UIURescueSquad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UIURescueSquad.cs
76 lines (57 loc) · 2.41 KB
/
UIURescueSquad.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
namespace UIURescueSquad
{
using System;
using Exiled.API.Features;
using HarmonyLib;
using MapEvent = Exiled.Events.Handlers.Map;
using PlayerEvent = Exiled.Events.Handlers.Player;
using ServerEvent = Exiled.Events.Handlers.Server;
/// <summary>
/// The main class which inherits <see cref="Plugin{TConfig}"/>.
/// </summary>
public class UIURescueSquad : Plugin<Configs.Config>
{
/// <inheritdoc/>
public static UIURescueSquad Instance;
private Harmony hInstance;
/// <inheritdoc/>
public override void OnEnabled()
{
Instance = this;
hInstance = new Harmony($"jesus.uiurescuesquad-{DateTime.Now.Ticks}");
hInstance.PatchAll();
MapEvent.AnnouncingNtfEntrance += EventHandlers.OnAnnouncingNTF;
ServerEvent.RespawningTeam += EventHandlers.OnTeamRespawn;
ServerEvent.WaitingForPlayers += EventHandlers.OnWaitingForPlayers;
ServerEvent.RoundStarted += EventHandlers.OnRoundStart;
PlayerEvent.Destroying += EventHandlers.OnDestroy;
PlayerEvent.ChangingRole += EventHandlers.OnChanging;
PlayerEvent.Died += EventHandlers.OnDied;
base.OnEnabled();
}
/// <inheritdoc/>
public override void OnDisabled()
{
MapEvent.AnnouncingNtfEntrance -= EventHandlers.OnAnnouncingNTF;
ServerEvent.RespawningTeam -= EventHandlers.OnTeamRespawn;
ServerEvent.WaitingForPlayers -= EventHandlers.OnWaitingForPlayers;
ServerEvent.RoundStarted -= EventHandlers.OnRoundStart;
PlayerEvent.Destroying -= EventHandlers.OnDestroy;
PlayerEvent.ChangingRole -= EventHandlers.OnChanging;
PlayerEvent.Died -= EventHandlers.OnDied;
hInstance.UnpatchAll();
Instance = null;
base.OnDisabled();
}
/// <inheritdoc/>
public override string Name { get; } = "UIURescueSquad";
/// <inheritdoc/>
public override string Author { get; } = "JesusQC, maintained by Michal78900";
/// <inheritdoc/>
public override string Prefix { get; } = "UIURescueSquad";
/// <inheritdoc/>
public override Version Version { get; } = new Version(3, 0, 0);
/// <inheritdoc/>
public override Version RequiredExiledVersion => new Version(3, 0, 0);
}
}