-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCampingMod.cs
64 lines (51 loc) · 1.94 KB
/
CampingMod.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
using System.Collections.Generic;
using Terraria;
using Terraria.Localization;
using Terraria.ModLoader;
namespace CampingMod
{
partial class CampingMod : Mod
{
internal const bool DEBUG_SAVE = false;
public static bool ThoriumModLoaded { get { return ModLoader.HasMod("ThoriumMod"); } }
public const string LANG_KEY = "Mods.CampingMod.";
public CampingMod() {
Sets.TemporarySpawn = new HashSet<int>();
}
public override void Load() {
SpawnInterfaceHelper.Load(this);
}
public override void Unload() {
Sets.TemporarySpawn = null;
SpawnInterfaceHelper.Unload();
}
public override void PostSetupContent() {
SetupModIntegration();
}
public static class Sets {
/// <summary> Tiles which are identified as temporary spawn points. </summary>
public static HashSet<int> TemporarySpawn;
}
/// <summary>
/// Prints a value from the mod's language file
/// </summary>
/// <param name="text"></param>
public static void Print(string text, byte r = 255, byte g = 255, byte b = 255) {
Main.NewText(Language.GetTextValue(LANG_KEY + text), r, g, b);
}
/// <summary>
/// Prints a value from the mod's language file in Yellow
/// </summary>
/// <param name="text"></param>
public static void PrintInfo(string text) {
Main.NewText(Language.GetTextValue(LANG_KEY + text), 255, 240, 20);
}
/// <summary>
/// Prints a value from the mod's language file in Yellow, with args used in String.Format (using {0}, {1} etc.)
/// </summary>
/// <param name="text"></param>
public static void PrintInfo(string text, params string[] args) {
Main.NewText(Language.GetTextValue(LANG_KEY + text, args), 255, 240, 20);
}
}
}