HideReaction.cpp 1.6 KB

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