Peeking.cpp 1.3 KB

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