Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.66 KB | None | 0 0
  1. if (G::settings.visuals_box)
  2. {
  3. 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);
  4.  
  5. auto team = entity->get_team();
  6. G::interfaces.surface->set_draw_colour(color);
  7. G::interfaces.surface->draw_outlined_rect(data.x, data.y, data.w, data.h);
  8.  
  9. /*
  10. * Outlines
  11. */
  12. G::interfaces.surface->set_draw_colour(Colour(0, 0, 0, entity->is_dormant() ? G::settings.cBox[3] * 100 : G::settings.cBox[3] * 255));
  13. G::interfaces.surface->draw_outlined_rect(data.x - 1, data.y - 1, data.w + 2, data.h + 2);
  14. G::interfaces.surface->draw_outlined_rect(data.x + 1, data.y + 1, data.w - 2, data.h - 2);
  15.  
  16. }
  17.  
  18. /*
  19. * HealthBar
  20. */
  21. if (G::settings.visuals_healthbar)
  22. {
  23. auto health = entity->get_health();
  24. if (health > 100)
  25. health = 100;
  26.  
  27. if (health)
  28. {
  29. auto text_calc = std::clamp(health * data.h / 100, 0, data.h + 5);
  30. auto health_calc = std::clamp(health * data.h / 100, 0, data.h);
  31. auto health_colour = Colour().hsv_to_rgb(health + 25, 1, 1);//green to red
  32. auto health_colour1 = Colour(153, min(255, entity->get_health() * 225 / 100), 0, 200);//yellow to red
  33. auto health_colour22 = Colour(0, 201, 0);
  34.  
  35. G::interfaces.surface->set_draw_colour(Colour(0, 0, 0, entity->is_dormant() ? 100 : 190));
  36. G::interfaces.surface->draw_filled_rect(data.x - 5, data.y - 1, 4, data.h + 2);
  37.  
  38. G::interfaces.surface->set_draw_colour(health < 70 ? health_colour : health_colour22);
  39. G::interfaces.surface->draw_filled_rect(data.x - 4, data.y + data.h - health_calc, 2, health_calc);
  40.  
  41. std::string hpt = std::to_string(health),
  42. s_hpt = (hpt.length() > 0 ? hpt : "##ERROR_empty_name");
  43.  
  44. if (health < 80)
  45. {
  46. 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());
  47. }
  48. }
  49. }
  50.  
  51. /*
  52. * ArmorBar
  53. */
  54. if (G::settings.visuals_armorbar)
  55. {
  56. auto color = Colour(G::settings.cAmmoBar[0] * 255, G::settings.cAmmoBar[1] * 255, G::settings.cAmmoBar[2] * 255, G::settings.cAmmoBar[3] * 255);
  57. auto armor = entity->get_armor();
  58. if (armor)
  59. {
  60. auto armor_calc = std::clamp(armor * data.w / 100, 0, data.w);
  61.  
  62. G::interfaces.surface->set_draw_colour(Colour(0, 0, 0, 190));
  63. G::interfaces.surface->draw_filled_rect(data.x - 1, data.y + data.h - 1, data.w + 2, 4);
  64.  
  65. 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));
  66. G::interfaces.surface->draw_filled_rect(data.x, data.y + data.h, armor_calc, 2);
  67. }
  68. }
  69. /*
  70. * Information
  71. */
  72. if (G::settings.visuals_name)
  73. {
  74. 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);
  75. 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);
  76. }
  77. if (G::settings.visuals_weapon)
  78. {
  79. 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);
  80. auto weapon_handle = entity->get_weapon();
  81. if (weapon_handle != nullptr)
  82. {
  83. 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());
  84. }
  85. }
  86. /*
  87. * Flags
  88. */
  89. if (G::settings.flags_)
  90. {
  91. std::vector<side_infos> sideinfo;
  92.  
  93. if (entity->fakeduck_check(entity))
  94. sideinfo.push_back({ "fake duck", _HOTPINK });
  95.  
  96. if (entity)
  97. sideinfo.push_back({ "hk", Colour(255, 255, 255, G::settings.cWeapon[3] * 255) });
  98.  
  99. if (entity->IsScopedIn())
  100. sideinfo.push_back({ "scoped", Colour(34, 50, 255, G::settings.cWeapon[3] * 255) });
  101.  
  102. if (entity->is_flashed())
  103. sideinfo.push_back({ "flashed", Colour(255, 255, 0, G::settings.cWeapon[3] * 255) });
  104.  
  105. int yOffset = 0;
  106. int textHeight = 8;
  107.  
  108. for (auto i : sideinfo)
  109. {
  110. G::interfaces.surface->draw_string(data.x + data.w + 4, data.y + yOffset, G::hooks.paint.ind_low, i.color, i.str.c_str());
  111. yOffset += textHeight;
  112. }
  113.  
  114. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement