forked from SamsonAllen13/ClickerClass
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClickerClass.cs
More file actions
102 lines (88 loc) · 2.08 KB
/
ClickerClass.cs
File metadata and controls
102 lines (88 loc) · 2.08 KB
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
using ClickerClass.Effects;
using ClickerClass.UI;
using Microsoft.Xna.Framework;
using System.Collections.Generic;
using Terraria;
using Terraria.ModLoader;
using Terraria.UI;
namespace ClickerClass
{
public class ClickerClass : Mod
{
public static ModHotKey AutoClickKey;
internal static ClickerClass mod;
/// <summary>
/// To prevent certain methods being called when they shouldn't
/// </summary>
internal static bool finalizedRegisterCompat = false;
public override void Load()
{
finalizedRegisterCompat = false;
mod = this;
AutoClickKey = RegisterHotKey("Clicker Accessory", "G");
ClickerSystem.Load();
ClickEffect.LoadMiscEffects();
if (!Main.dedServ)
{
LoadClient();
}
}
public override void Unload()
{
finalizedRegisterCompat = false;
ShaderManager.Unload();
ClickerSystem.Unload();
ClickEffect.Unload();
ClickerInterfaceResources.Unload();
AutoClickKey = null;
mod = null;
}
private void LoadClient()
{
ShaderManager.Load();
ClickerInterfaceResources.Load();
}
private GameTime _lastUpdateUIGameTime;
public override void UpdateUI(GameTime gameTime)
{
_lastUpdateUIGameTime = gameTime;
ClickerInterfaceResources.Update(gameTime);
}
public override void ModifyInterfaceLayers(List<GameInterfaceLayer> layers)
{
ClickerInterfaceResources.AddDrawLayers(layers);
//Remove Mouse Cursor
if (Main.cursorOverride == -1 && ClickerConfigClient.Instance.ShowCustomCursors)
{
Player player = Main.LocalPlayer;
if (ClickerCursor.CanDrawCursor(player.HeldItem))
{
for (int i = 0; i < layers.Count; i++)
{
if (layers[i].Name.Equals("Vanilla: Cursor"))
{
layers.RemoveAt(i);
break;
}
}
}
}
}
public override object Call(params object[] args)
{
return ClickerModCalls.Call(args);
}
public override void AddRecipes()
{
ClickerRecipes.AddRecipes();
}
public override void PostAddRecipes()
{
finalizedRegisterCompat = true;
}
public override void AddRecipeGroups()
{
ClickerRecipes.AddRecipeGroups();
}
}
}