-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPotionOverhaul.cs
63 lines (62 loc) · 1.53 KB
/
PotionOverhaul.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
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using Terraria.UI;
using Terraria.ID;
using PotionOverhaul.UI;
using System.Collections.Generic;
namespace PotionOverhaul
{
public class PotionOverhaul : Mod
{
internal UserInterface InterfaceAlchUI;
internal AlchUI AlchUI;
private GameTime _lastUpdateUiGameTime;
public override void Load()
{
if (!Main.dedServ)
{
InterfaceAlchUI = new UserInterface();
AlchUI = new AlchUI();
AlchUI.Activate();
InterfaceAlchUI?.SetState(AlchUI);
}
}
public override void Unload()
{
AlchUI = null;
}
public override void UpdateUI(GameTime gameTime)
{
_lastUpdateUiGameTime = gameTime;
if (InterfaceAlchUI?.CurrentState != null)
{
InterfaceAlchUI.Update(gameTime);
}
}
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(
"PotionOverhaul: InterfaceAlchUI",
delegate
{
if (_lastUpdateUiGameTime != null && InterfaceAlchUI?.CurrentState != null)
{
InterfaceAlchUI.Draw(Main.spriteBatch, _lastUpdateUiGameTime);
}
return true;
},
InterfaceScaleType.UI));
}
}
public static List<int> PotionIngredients = new List<int>()
{
ItemID.Daybloom,
ItemID.Fireblossom,
ItemID.Shiverthorn
};
}
}