-
Notifications
You must be signed in to change notification settings - Fork 23
/
BossChecklistPlayer.cs
52 lines (47 loc) · 1.87 KB
/
BossChecklistPlayer.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
using BossChecklist.UIElements;
using Terraria;
using Terraria.GameInput;
using Terraria.ID;
using Terraria.ModLoader;
namespace BossChecklist
{
class BossChecklistPlayer : ModPlayer {
public override void ProcessTriggers(TriggersSet triggersSet) {
if (BossChecklist.ToggleChecklistHotKey.JustPressed) {
if (!BossChecklistUI.Visible) {
BossUISystem.Instance.bossChecklistUI.UpdateCheckboxes();
}
BossChecklistUI.Visible = !BossChecklistUI.Visible;
}
if (BossChecklist.ToggleBossLog.JustPressed) {
BossLogUI.PendingToggleBossLogUI = true;
//BossUISystem.Instance.BossLog.ToggleBossLog(!BossUISystem.Instance.BossLog.BossLogVisible);
// Debug assistance, allows for reinitializing BossLog in-game
//BossChecklist.instance.BossLog.RemoveAllChildren();
//var isInitializedFieldInfo = typeof(Terraria.UI.UIElement).GetField("_isInitialized", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
//isInitializedFieldInfo.SetValue(BossChecklist.instance.BossLog, false);
//BossChecklist.instance.BossLog.Activate();
}
}
public override void SetControls() {
if (BossUISystem.Instance.BossLog.BossLogVisible) {
if (Main.LocalPlayer.controlInv) {
BossUISystem.Instance.BossLog.ToggleBossLog(false);
Main.LocalPlayer.releaseInventory = false;
}
else if (Main.LocalPlayer.controlCreativeMenu && Main.LocalPlayer.difficulty == PlayerDifficultyID.Creative) {
BossUISystem.Instance.BossLog.ToggleBossLog(false);
Main.LocalPlayer.releaseCreativeMenu = false;
}
}
}
public override void PostUpdate() {
if (Main.LocalPlayer.dead && BossUISystem.Instance.BossLog.BossLogVisible)
BossUISystem.Instance.BossLog.ToggleBossLog(false);
}
public override void OnEnterWorld() {
BossChecklistUI.Visible = false;
BossUISystem.Instance.BossLog.ToggleBossLog(false);
}
}
}