HideDamage.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include "HideDamage.h"
  2. namespace cheat {
  3. void MonoParticleDamageTextContainer_ShowDamageText(void* __this, void* attackResult, void* attackee);
  4. HideDamage::HideDamage() : Function() {
  5. f_Enabled = config::getValue("functions:HideDamage", "enabled", false);
  6. f_Hotkey = Hotkey("functions:HideDamage");
  7. HookManager::install(app::MonoParticleDamageTextContainer_ShowDamageText, MonoParticleDamageTextContainer_ShowDamageText);
  8. }
  9. HideDamage& HideDamage::getInstance() {
  10. static HideDamage instance;
  11. return instance;
  12. }
  13. void HideDamage::GUI() {
  14. ConfigCheckbox(_("HIDE_DAMAGE_TITLE"), f_Enabled, _("HIDE_DAMAGE_DESCRIPTION"));
  15. if (f_Enabled.getValue()) {
  16. ImGui::Indent();
  17. f_Hotkey.Draw();
  18. ImGui::Unindent();
  19. }
  20. }
  21. void HideDamage::Outer() {
  22. if (f_Hotkey.IsPressed())
  23. f_Enabled.setValue(!f_Enabled.getValue());
  24. }
  25. void HideDamage::Status() {
  26. if (f_Enabled.getValue())
  27. ImGui::Text(_("HIDE_DAMAGE_TITLE"));
  28. }
  29. std::string HideDamage::getModule() {
  30. return _("MODULE_VISUALS");
  31. }
  32. void MonoParticleDamageTextContainer_ShowDamageText(void* __this, void* attackResult, void* attackee) {
  33. auto& hideDamage = HideDamage::getInstance();
  34. if (hideDamage.f_Enabled.getValue())
  35. return;
  36. CALL_ORIGIN(MonoParticleDamageTextContainer_ShowDamageText, __this, attackResult, attackee);
  37. }
  38. }