This repository was archived by the owner on Feb 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathPluginUI.cs
More file actions
148 lines (140 loc) · 6.23 KB
/
PluginUI.cs
File metadata and controls
148 lines (140 loc) · 6.23 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
using ImGuiNET;
using System.Numerics;
using Dalamud.Game.ClientState;
namespace DeepDungeonDex
{
public class PluginUI
{
public bool IsVisible { get; set; }
private Configuration config;
private ClientState clientState;
public PluginUI(Configuration config, ClientState clientState)
{
this.config = config;
this.clientState = clientState;
}
private readonly bool[] cjstun =
{
true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, false, true, false, false, false, false, true, true, false, true, false, true, false, true, true, false, true, false
};
private readonly bool[] cjsleep =
{
true, false, false, false, false, false, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, false, false, false, false, true, false, true, true, false, false, false, true
};
private readonly bool[] cjbind =
{
true, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, true, true, false, false, false, false, true, false, true, false, false
};
private readonly bool[] cjheavy =
{
true, false, false, false, false, true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false, true, true, false, false, false, false, true, false, true, false, false
};
private readonly bool[] cjslow =
{
true, true, true, true, true, true, false, false, false, false, false, false, false, false, false, false, false, false, false, true, true, true, true, true, false, false, false, false, false, true, true, true, true, false, true, false, true, true, true, true, false
};
private void PrintSingleVuln(bool? isVulnerable, string message)
{
switch (isVulnerable)
{
case true:
ImGui.PushStyleColor(ImGuiCol.Text, 0xFF00FF00);
ImGui.Text(message);
ImGui.PopStyleColor();
break;
case false:
if (!config.HideRedVulns)
{
ImGui.PushStyleColor(ImGuiCol.Text, 0xFF0000FF);
ImGui.Text(message);
ImGui.PopStyleColor();
}
break;
default:
ImGui.PushStyleColor(ImGuiCol.Text, 0x50FFFFFF);
ImGui.Text(message);
ImGui.PopStyleColor();
break;
}
}
public void Draw()
{
if (!IsVisible)
return;
var cjid = clientState.LocalPlayer == null ? 0 : clientState.LocalPlayer.ClassJob.GameData.RowId;
var mobData = DataHandler.Mobs(TargetData.NameID);
if (mobData == null) return;
var flags = ImGuiWindowFlags.NoResize | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoTitleBar;
if (config.IsClickthrough)
{
flags |= ImGuiWindowFlags.NoInputs;
}
ImGui.SetNextWindowSizeConstraints(new Vector2(250, 0), new Vector2(9001, 9001));
ImGui.SetNextWindowBgAlpha(config.Opacity);
ImGui.Begin("cool strati window", flags);
ImGui.Text("Name:\n"+TargetData.Name);
ImGui.NewLine();
ImGui.Columns(3, null, false);
ImGui.Text("Aggro Type:\n");
ImGui.Text(mobData.Aggro.ToString());
ImGui.NextColumn();
ImGui.Text("Threat:\n");
switch (mobData.Threat)
{
case DataHandler.MobData.ThreatLevel.Easy:
ImGui.PushStyleColor(ImGuiCol.Text, 0xFF00FF00);
ImGui.Text("Easy");
ImGui.PopStyleColor();
break;
case DataHandler.MobData.ThreatLevel.Caution:
ImGui.PushStyleColor(ImGuiCol.Text, 0xFF00FFFF);
ImGui.Text("Caution");
ImGui.PopStyleColor();
break;
case DataHandler.MobData.ThreatLevel.Dangerous:
ImGui.PushStyleColor(ImGuiCol.Text, 0xFF0000FF);
ImGui.Text("Dangerous");
ImGui.PopStyleColor();
break;
case DataHandler.MobData.ThreatLevel.Vicious:
ImGui.PushStyleColor(ImGuiCol.Text, 0xFFFF00FF);
ImGui.Text("Vicious");
ImGui.PopStyleColor();
break;
default:
ImGui.Text("Undefined");
break;
}
ImGui.NextColumn();
if (!config.HideBasedOnJob || cjstun[cjid])
{
PrintSingleVuln(mobData.Vuln.CanStun, "Stun");
}
if (!config.HideBasedOnJob || cjsleep[cjid])
{
PrintSingleVuln(mobData.Vuln.CanSleep, "Sleep");
}
if (!config.HideBasedOnJob || cjbind[cjid])
{
PrintSingleVuln(mobData.Vuln.CanBind, "Bind");
}
if (!config.HideBasedOnJob || cjheavy[cjid])
{
PrintSingleVuln(mobData.Vuln.CanHeavy, "Heavy");
}
if (!config.HideBasedOnJob || cjslow[cjid])
{
PrintSingleVuln(mobData.Vuln.CanSlow, "Slow");
}
if (!(TargetData.NameID >= 7262 && TargetData.NameID <= 7610))
{
PrintSingleVuln(mobData.Vuln.IsUndead, "Undead");
}
ImGui.NextColumn();
ImGui.Columns(1);
ImGui.NewLine();
ImGui.TextWrapped(mobData.MobNotes);
ImGui.End();
}
}
}