esp emoji scaling

This commit is contained in:
nullifiedcat 2017-07-05 00:25:03 +03:00
parent 6aa72146c2
commit 0edfa592a8
2 changed files with 14 additions and 9 deletions

View File

@ -79,11 +79,11 @@ void DrawCheatVisuals() {
PROF_SECTION(PT_spyalert);
SAFE_CALL(hacks::tf::spyalert::Draw());
}
DrawSpinner();
{
PROF_SECTION(DRAW_esp);
hacks::shared::esp::Draw();
}
DrawSpinner();
Prediction_PaintTraverse();
}
{

View File

@ -591,6 +591,7 @@ std::unordered_map<studiohdr_t*, bonelist_s> bonelist_map {};
CatEnum emoji_esp({ "None", "Joy", "Thinking" });
CatVar joy_esp(CV_SWITCH, "esp_emoji", "0", "Emoji ESP");
CatVar joy_esp_size(CV_FLOAT, "esp_emoji_size", "32", "Emoji ESP Size");
CatVar emoji_esp_scaling(CV_SWITCH, "esp_emoji_scaling", "0", "Emoji ESP Scaling");
textures::AtlasTexture joy_texture(64 * 4, textures::atlas_height - 64 * 4, 64, 64);
textures::AtlasTexture thinking_texture(64 * 5, textures::atlas_height - 64 * 4, 64, 64);
@ -650,14 +651,18 @@ void _FASTCALL ProcessEntityPT(CachedEntity* ent) {
if (!fg) fg = colors::EntityF(ent);
if (transparent) fg = colors::Transparent(fg);
if (joy_esp) {
Vector head_pos = ent->hitboxes.GetHitbox(0)->center;
Vector head_scr;
if (draw::WorldToScreen(head_pos, head_scr)) {
textures::AtlasTexture* tx = nullptr;
if (int(joy_esp) == 1) tx = &joy_texture;
if (int(joy_esp) == 2) tx = &thinking_texture;
if (tx)
tx->Draw(head_scr.x - float(joy_esp_size) / 2, head_scr.y - float(joy_esp_size) / 2, float(joy_esp_size), float(joy_esp_size));
auto hb = ent->hitboxes.GetHitbox(0);
Vector hbm, hbx;
if (draw::WorldToScreen(hb->min, hbm) && draw::WorldToScreen(hb->max, hbx)) {
Vector head_scr;
if (draw::WorldToScreen(hb->center, head_scr)) {
float size = emoji_esp_scaling ? fabs(hbm.y - hbx.y) : float(joy_esp_size);
textures::AtlasTexture* tx = nullptr;
if (int(joy_esp) == 1) tx = &joy_texture;
if (int(joy_esp) == 2) tx = &thinking_texture;
if (tx)
tx->Draw(head_scr.x - size / 2, head_scr.y - size / 2, size, size);
}
}
}
DrawBox(ent, fg, static_cast<bool>(box_healthbar), CE_INT(ent, netvar.iHealth), ent->m_iMaxHealth);