-
Notifications
You must be signed in to change notification settings - Fork 6
/
NoxusBoss.cs
65 lines (58 loc) · 2.15 KB
/
NoxusBoss.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
global using Luminance.Core.Graphics;
global using static System.MathF;
global using static Luminance.Common.Utilities.Utilities;
global using static Luminance.Core.Graphics.ScreenShakeSystem;
global using static Microsoft.Xna.Framework.MathHelper;
global using static NoxusBoss.Assets.CommonSoundsRegistry;
global using static NoxusBoss.Assets.MiscTexturesRegistry;
global using static NoxusBoss.Common.Utilities.Utilities;
using Luminance.Core.ModCalls;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace NoxusBoss
{
public class NoxusBoss : Mod
{
// If this is enabled, various development-specific tools are operational, such as the automatic shader compiler and the keyboard shader debug drawer.
// If it's disabled, they do not run at all, and where possible don't even load in the first place.
// This means that this isn't something that other mods can just turn by flipping this property to true, since it will be too late for
// automatic loading to happen.
// The reason for this is mainly performance. No use having a bunch of resources in the background on the 1/100 chance a single person actually cares.
#if DEBUG
public static bool DebugFeaturesEnabled
{
get;
private set;
} = true;
#endif
#if !DEBUG
public static bool DebugFeaturesEnabled
{
get;
private set;
}
#endif
public static Mod Instance
{
get;
private set;
}
public override void Load()
{
Instance = this;
if (Main.netMode != NetmodeID.Server)
LoadParticlesForCalamity();
}
private static void LoadParticlesForCalamity()
{
Main.QueueMainThreadAction(() =>
{
if (ModLoader.TryGetMod("CalamityMod", out Mod cal))
cal?.Call("LoadParticleInstances", Instance);
});
}
// Defer mod-call interpretation to a separate class.
public override object Call(params object[] args) => ModCallManager.ProcessAllModCalls(this, args);
}
}