-
Notifications
You must be signed in to change notification settings - Fork 3
/
spritersguildwip.cs
102 lines (88 loc) · 3.12 KB
/
spritersguildwip.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
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 Terraria;
using Terraria.ModLoader;
using System.Collections.Generic;
using Terraria.UI;
using spritersguildwip.GUI;
namespace spritersguildwip
{
public class spritersguildwip : Mod
{
public Stamina stamina;
public Collection collection;
public UserInterface customResources;
public UserInterface customResources2;
public static ModHotKey Dash;
public static ModHotKey Superdash;
public static ModHotKey Smash;
public static ModHotKey Float;
public spritersguildwip()
{
}
public override void UpdateMusic(ref int music, ref MusicPriority priority)
{
if (Main.myPlayer != -1 && !Main.gameMenu && Main.LocalPlayer.active)
{
if (Main.LocalPlayer.GetModPlayer<BiomeHandler>().ZoneGlass)
{
music = GetSoundSlot(SoundType.Music, "Sounds/Music/GlassPassive");
priority = MusicPriority.BiomeMedium;
}
}
return;
}
public override void Load()
{
Dash = RegisterHotKey("Dash", "LeftShift");
Superdash = RegisterHotKey("Void Dash", "Q");
Smash = RegisterHotKey("Smash", "Z");
Float = RegisterHotKey("Float", "F");
if (!Main.dedServ)
{
customResources = new UserInterface();
customResources2 = new UserInterface();
stamina = new Stamina();
collection = new Collection();
Stamina.visible = true;
customResources.SetState(stamina);
customResources2.SetState(collection);
}
}
public override void ModifyInterfaceLayers(List<GameInterfaceLayer> layers)
{
int MouseTextIndex = layers.FindIndex(layer => layer.Name.Equals("Vanilla: Mouse Text"));
if (MouseTextIndex != -1)
{
layers.Insert(MouseTextIndex, new LegacyGameInterfaceLayer("[PH]MODNAME: Cooldown",
delegate
{
if (Stamina.visible)
{
customResources.Update(Main._drawInterfaceGameTime);
stamina.Draw(Main.spriteBatch);
}
return true;
}, InterfaceScaleType.UI));
layers.Insert(MouseTextIndex + 1, new LegacyGameInterfaceLayer("[PH]MODNAME: Collection",
delegate
{
if (Collection.visible)
{
customResources2.Update(Main._drawInterfaceGameTime);
collection.Draw(Main.spriteBatch);
}
return true;
}, InterfaceScaleType.UI));
}
}
public override void Unload()
{
if (!Main.dedServ)
{
customResources = null;
customResources2 = null;
stamina = null;
collection = null;
}
}
}
}