@@ -10,12 +10,15 @@ void Base::Hacks::ESP_Info(playerinfo_t* p_info)
10
10
float BarWidth = Height / 2 ;
11
11
float BarHeight = Height / 20 ;
12
12
float Padding = Height / 14 ;
13
- float Space = 0 .0f ;
13
+ float SpaceDown = 0 .0f ;
14
+ float SpaceUp = 0 .0f ;
15
+ float FontHeight = 18 .0f ;
16
+ float FontWidth = FontHeight * 0 .325f ;
14
17
15
18
if (Data::Settings::EnableEspHealth)
16
19
{
17
- Space += Padding;
18
- ImVec2 HealthBarPos = ImVec2 (p_info->pos2D .x - BarWidth / 2 , p_info->pos2D .y + Space );
20
+ SpaceDown += Padding;
21
+ ImVec2 HealthBarPos = ImVec2 (p_info->pos2D .x - BarWidth / 2 , p_info->pos2D .y + SpaceDown );
19
22
ImVec2 HealthBarEnd = ImVec2 (p_info->pos2D .x + BarWidth / 2 , HealthBarPos.y + BarHeight);
20
23
ImColor DamageColor = ImColor (Data::Settings::EspHealthDmgColor[0 ], Data::Settings::EspHealthDmgColor[1 ], Data::Settings::EspHealthDmgColor[2 ], Data::Settings::EspHealthDmgColor[3 ]);
21
24
ImColor HealthColor = ImColor (Data::Settings::EspHealthColor[0 ], Data::Settings::EspHealthColor[1 ], Data::Settings::EspHealthColor[2 ], Data::Settings::EspHealthColor[3 ]);
@@ -33,13 +36,13 @@ void Base::Hacks::ESP_Info(playerinfo_t* p_info)
33
36
34
37
Draw->AddQuadFilled (p1, p2, p3, p4, HealthColor);
35
38
36
- Space += BarHeight;
39
+ SpaceDown += BarHeight;
37
40
}
38
41
39
42
if (Data::Settings::EnableEspArmor)
40
43
{
41
- Space += Padding;
42
- ImVec2 ArmorBarPos = ImVec2 (p_info->pos2D .x - BarWidth / 2 , p_info->pos2D .y + Space );
44
+ SpaceDown += Padding;
45
+ ImVec2 ArmorBarPos = ImVec2 (p_info->pos2D .x - BarWidth / 2 , p_info->pos2D .y + SpaceDown );
43
46
ImVec2 ArmorBarEnd = ImVec2 (p_info->pos2D .x + BarWidth / 2 , ArmorBarPos.y + BarHeight);
44
47
ImColor DamageColor = ImColor (Data::Settings::EspArmorDmgColor[0 ], Data::Settings::EspArmorDmgColor[1 ], Data::Settings::EspArmorDmgColor[2 ], Data::Settings::EspArmorDmgColor[3 ]);
45
48
ImColor ArmorColor = ImColor (Data::Settings::EspArmorColor[0 ], Data::Settings::EspArmorColor[1 ], Data::Settings::EspArmorColor[2 ], Data::Settings::EspArmorColor[3 ]);
@@ -57,6 +60,20 @@ void Base::Hacks::ESP_Info(playerinfo_t* p_info)
57
60
58
61
Draw->AddQuadFilled (p1, p2, p3, p4, ArmorColor);
59
62
60
- Space += BarHeight;
63
+ SpaceDown += BarHeight;
64
+ }
65
+
66
+ if (Data::Settings::EnableEspName)
67
+ {
68
+ SpaceUp += Padding;
69
+ size_t TextLength = strlen (p_info->ent ->name );
70
+ float TextWidth = (float )TextLength * FontWidth;
71
+ float TextHeight = FontHeight;
72
+ ImColor TextColor = ImColor (Data::Settings::EspNameColor[0 ], Data::Settings::EspNameColor[1 ], Data::Settings::EspNameColor[2 ], Data::Settings::EspNameColor[3 ]);
73
+ ImVec2 TextPos = ImVec2 (p_info->headpos2D .x - (TextWidth / 2 ), p_info->headpos2D .y - SpaceUp - TextHeight);
74
+
75
+ Draw->AddText (TextPos, TextColor, (const char *)p_info->ent ->name );
76
+
77
+ SpaceUp += TextHeight;
61
78
}
62
79
}
0 commit comments