Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (G::settings.visuals_box)
- {
- auto color = Colour(G::settings.cBox[0] * 255, G::settings.cBox[1] * 255, G::settings.cBox[2] * 255, entity->is_dormant() ? G::settings.cBox[3] * 100 : G::settings.cBox[3] * 255);
- auto team = entity->get_team();
- G::interfaces.surface->set_draw_colour(color);
- G::interfaces.surface->draw_outlined_rect(data.x, data.y, data.w, data.h);
- /*
- * Outlines
- */
- G::interfaces.surface->set_draw_colour(Colour(0, 0, 0, entity->is_dormant() ? G::settings.cBox[3] * 100 : G::settings.cBox[3] * 255));
- G::interfaces.surface->draw_outlined_rect(data.x - 1, data.y - 1, data.w + 2, data.h + 2);
- G::interfaces.surface->draw_outlined_rect(data.x + 1, data.y + 1, data.w - 2, data.h - 2);
- }
- /*
- * HealthBar
- */
- if (G::settings.visuals_healthbar)
- {
- auto health = entity->get_health();
- if (health > 100)
- health = 100;
- if (health)
- {
- auto text_calc = std::clamp(health * data.h / 100, 0, data.h + 5);
- auto health_calc = std::clamp(health * data.h / 100, 0, data.h);
- auto health_colour = Colour().hsv_to_rgb(health + 25, 1, 1);//green to red
- auto health_colour1 = Colour(153, min(255, entity->get_health() * 225 / 100), 0, 200);//yellow to red
- auto health_colour22 = Colour(0, 201, 0);
- G::interfaces.surface->set_draw_colour(Colour(0, 0, 0, entity->is_dormant() ? 100 : 190));
- G::interfaces.surface->draw_filled_rect(data.x - 5, data.y - 1, 4, data.h + 2);
- G::interfaces.surface->set_draw_colour(health < 70 ? health_colour : health_colour22);
- G::interfaces.surface->draw_filled_rect(data.x - 4, data.y + data.h - health_calc, 2, health_calc);
- std::string hpt = std::to_string(health),
- s_hpt = (hpt.length() > 0 ? hpt : "##ERROR_empty_name");
- if (health < 80)
- {
- G::interfaces.surface->draw_string(data.x - 3/*4*/, data.y + data.h - text_calc + 11/*5*/, G::hooks.paint.ind_low, TEXT_ALIGN_CENTER_TOP, Colour(255, 255, 255, 255), s_hpt.c_str());
- }
- }
- }
- /*
- * ArmorBar
- */
- if (G::settings.visuals_armorbar)
- {
- auto color = Colour(G::settings.cAmmoBar[0] * 255, G::settings.cAmmoBar[1] * 255, G::settings.cAmmoBar[2] * 255, G::settings.cAmmoBar[3] * 255);
- auto armor = entity->get_armor();
- if (armor)
- {
- auto armor_calc = std::clamp(armor * data.w / 100, 0, data.w);
- G::interfaces.surface->set_draw_colour(Colour(0, 0, 0, 190));
- G::interfaces.surface->draw_filled_rect(data.x - 1, data.y + data.h - 1, data.w + 2, 4);
- G::interfaces.surface->set_draw_colour(Colour(G::settings.cAmmoBar[0] * 255, G::settings.cAmmoBar[1] * 255, G::settings.cAmmoBar[2] * 255, entity->is_dormant() ? G::settings.cAmmoBar[3] * 100 : G::settings.cAmmoBar[3] * 255));
- G::interfaces.surface->draw_filled_rect(data.x, data.y + data.h, armor_calc, 2);
- }
- }
- /*
- * Information
- */
- if (G::settings.visuals_name)
- {
- auto color = Colour(G::settings.cName[0] * 255, G::settings.cName[1] * 255, G::settings.cName[2] * 255, entity->is_dormant() ? G::settings.cName[3] * 100 : G::settings.cName[3] * 255);
- G::interfaces.surface->draw_string(data.x + data.w / 2, data.y - 1, G::hooks.paint.c_name, TEXT_ALIGN_CENTER_TOP, color, "%s", entity->get_info().name);
- }
- if (G::settings.visuals_weapon)
- {
- auto color = Colour(G::settings.cWeapon[0] * 255, G::settings.cWeapon[1] * 255, G::settings.cWeapon[2] * 255, entity->is_dormant() ? G::settings.cWeapon[3] * 100 : G::settings.cWeapon[3] * 255);
- auto weapon_handle = entity->get_weapon();
- if (weapon_handle != nullptr)
- {
- G::interfaces.surface->draw_string(data.x + data.w / 2, data.y + data.h + (G::settings.visuals_armorbar ? 2 : 0), G::settings.lweapon_types == 1 ? G::hooks.paint.ind_low : G::hooks.paint.c_weapon, TEXT_ALIGN_CENTER, color, "%s", G::settings.lweapon_types == 1 ? weapon_handle->get_weapon_name() : weapon_handle->GetGunIcon());
- }
- }
- /*
- * Flags
- */
- if (G::settings.flags_)
- {
- std::vector<side_infos> sideinfo;
- if (entity->fakeduck_check(entity))
- sideinfo.push_back({ "fake duck", _HOTPINK });
- if (entity)
- sideinfo.push_back({ "hk", Colour(255, 255, 255, G::settings.cWeapon[3] * 255) });
- if (entity->IsScopedIn())
- sideinfo.push_back({ "scoped", Colour(34, 50, 255, G::settings.cWeapon[3] * 255) });
- if (entity->is_flashed())
- sideinfo.push_back({ "flashed", Colour(255, 255, 0, G::settings.cWeapon[3] * 255) });
- int yOffset = 0;
- int textHeight = 8;
- for (auto i : sideinfo)
- {
- G::interfaces.surface->draw_string(data.x + data.w + 4, data.y + yOffset, G::hooks.paint.ind_low, i.color, i.str.c_str());
- yOffset += textHeight;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement