diff --git a/src/Client/Module/Modules/Zoom/Zoom.hpp b/src/Client/Module/Modules/Zoom/Zoom.hpp index b62883be..626b2d19 100644 --- a/src/Client/Module/Modules/Zoom/Zoom.hpp +++ b/src/Client/Module/Modules/Zoom/Zoom.hpp @@ -9,7 +9,7 @@ class Zoom : public Module { public: - Zoom() : Module("Zoom", "Allows you to see distant places.", IDR_MAGNIFY_PNG, "C") { + Zoom() : Module("Zoom", "Allows you to see distant places.", R"(\Flarial\assets\magnify.png)", "C") { Module::setup(); @@ -32,6 +32,7 @@ class Zoom : public Module { if (settings.getSettingByName("SaveModifier") == nullptr) settings.addSetting("SaveModifier", true); if (settings.getSettingByName("hidehand") == nullptr) settings.addSetting("hidehand", true); if (settings.getSettingByName("hidemodules") == nullptr) settings.addSetting("hidemodules", false); + if (settings.getSettingByName("UseScroll") == nullptr) settings.addSetting("UseScroll", true); //if (settings.getSettingByName("hidehud") == nullptr) settings.addSetting("hidehud", false); if (settings.getSettingByName("modifier") == nullptr) settings.addSetting("modifier", 10.0f); if (settings.getSettingByName("anim") == nullptr) settings.addSetting("anim", 0.20f); @@ -150,8 +151,18 @@ class Zoom : public Module { "alwaysanim")->value)) this->settings.getSettingByName("alwaysanim")->value = !this->settings.getSettingByName( "alwaysanim")->value; + toggleY += Constraints::SpacingConstraint(0.25, textWidth); + FlarialGUI::FlarialTextWithFont(toggleX + Constraints::SpacingConstraint(0.60, textWidth), toggleY, + L"Use Scroll", textWidth * 3.0f, textHeight, + DWRITE_TEXT_ALIGNMENT_LEADING, + Constraints::RelativeConstraint(0.12, "height", true), + DWRITE_FONT_WEIGHT_NORMAL); + if (FlarialGUI::Toggle(7, toggleX, toggleY, this->settings.getSettingByName( + "UseScroll")->value)) + this->settings.getSettingByName("UseScroll")->value = !this->settings.getSettingByName( + "UseScroll")->value; FlarialGUI::UnsetScrollView(); } -}; \ No newline at end of file +}; diff --git a/src/Client/Module/Modules/Zoom/ZoomListener.hpp b/src/Client/Module/Modules/Zoom/ZoomListener.hpp index 0ace627d..2d99fc6e 100644 --- a/src/Client/Module/Modules/Zoom/ZoomListener.hpp +++ b/src/Client/Module/Modules/Zoom/ZoomListener.hpp @@ -75,29 +75,32 @@ class ZoomListener : public Listener { //todo make it so that modules work together auto fovchanger = ModuleManager::getModule("FOV Changer"); auto upsidedown = ModuleManager::getModule("Upside Down"); + if (this->module->settings.getSettingByName("UseScroll")->value == true) { + if (event.getAction() == MouseAction::ScrollUp) { + if ((fovchanger != nullptr && + fovchanger->settings.getSettingByName("fovvalue")->value > 180) || + (upsidedown != nullptr && upsidedown->isEnabled())) + zoomValue += this->module->settings.getSettingByName("modifier")->value; + else zoomValue -= this->module->settings.getSettingByName("modifier")->value; + } + if (event.getAction() != MouseAction::ScrollUp && event.getButton() == MouseButton::Scroll) { + if ((fovchanger != nullptr && + fovchanger->settings.getSettingByName("fovvalue")->value > 180) || + (upsidedown != nullptr && upsidedown->isEnabled())) + zoomValue -= this->module->settings.getSettingByName("modifier")->value; + else zoomValue += this->module->settings.getSettingByName("modifier")->value; + } + + if (zoomValue < 1) zoomValue = 1; + else if (zoomValue > realFov) zoomValue = realFov; + + if (event.getAction() == MouseAction::ScrollUp || + event.getAction() != MouseAction::ScrollUp && event.getButton() == MouseButton::Scroll) { + event.setButton(MouseButton::None); + event.setAction(MouseAction::Release); - if (event.getAction() == MouseAction::ScrollUp) { - if ((fovchanger != nullptr && - fovchanger->settings.getSettingByName("fovvalue")->value > 180) || - (upsidedown != nullptr && upsidedown->isEnabled())) - zoomValue += this->module->settings.getSettingByName("modifier")->value; - else zoomValue -= this->module->settings.getSettingByName("modifier")->value; - } - if (event.getAction() != MouseAction::ScrollUp && event.getButton() == MouseButton::Scroll) { - if ((fovchanger != nullptr && - fovchanger->settings.getSettingByName("fovvalue")->value > 180) || - (upsidedown != nullptr && upsidedown->isEnabled())) - zoomValue -= this->module->settings.getSettingByName("modifier")->value; - else zoomValue += this->module->settings.getSettingByName("modifier")->value; - } - - if (zoomValue < 1) zoomValue = 1; - else if (zoomValue > realFov) zoomValue = realFov; - if (event.getAction() == MouseAction::ScrollUp || - event.getAction() != MouseAction::ScrollUp && event.getButton() == MouseButton::Scroll) { - event.setButton(MouseButton::None); - event.setAction(MouseAction::Release); + } } } }