forked from IcePlugins/AntiLock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.cs
52 lines (46 loc) · 1.83 KB
/
Main.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
using Rocket.Core.Logging;
using Rocket.Core.Plugins;
using Rocket.API.Collections;
using HarmonyLib;
namespace AntiLock
{
public class Main : RocketPlugin<Config>
{
public static Main Instance;
Harmony Harmony;
internal static Main inst => Instance;
internal static Config conf => Instance.Configuration.Instance;
protected override void Load()
{
Instance = this;
Harmony = new Harmony("antilock.harmony");
Harmony.PatchAll();
if (conf.DisplayLoadMessage)
{
Logger.Log($"Loaded AntiLock! Default locks allocated: {conf.DefaultMaxLocks}");
Logger.Log("Groups:");
foreach (var group in conf.LockGroups)
Logger.Log($" {group.Permission} | {group.MaxLocks} locks");
}
}
protected override void Unload()
{
Harmony.UnpatchAll(Harmony.Id);
}
public const string
NoPermission = "command_no_permission",
ClearSuccessOther = nameof(ClearSuccessOther),
ClearSuccess = nameof(ClearSuccess),
PlayerNotFound = nameof(PlayerNotFound),
MaxLockedNotice = nameof(MaxLockedNotice),
LockedNotice = nameof(LockedNotice);
public override TranslationList DefaultTranslations => new TranslationList
{
{ ClearSuccessOther, "You've unlocked all of {0}'s vehicles. ({1} in total.)" },
{ ClearSuccess, "You've unlocked all of your vehicles. ({0} in total.)" },
{ PlayerNotFound, "The specified player was not found." },
{ MaxLockedNotice, "You have reached your allocated number of vehicle locks. ({0})" },
{ LockedNotice, "You have locked a vehicle. ({0}/{1} locks remaining.)" }
};
}
}