From 68654beaa3cce669b37b4057c621493c54a718e7 Mon Sep 17 00:00:00 2001 From: eXhumer <62310242+eXhumer@users.noreply.github.com> Date: Wed, 11 Jun 2025 03:58:35 +0300 Subject: [PATCH 1/2] feat(ui): allow configuration of slider for int/float command items (#403) --- src/game/features/self/SuperRun.cpp | 6 ++---- src/game/frontend/items/FloatCommandItem.cpp | 7 ++++--- src/game/frontend/items/IntCommandItem.cpp | 7 ++++--- src/game/frontend/items/Items.hpp | 6 ++++-- src/game/frontend/submenus/Self.cpp | 4 ++-- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/game/features/self/SuperRun.cpp b/src/game/features/self/SuperRun.cpp index bbc5380..c21858a 100644 --- a/src/game/features/self/SuperRun.cpp +++ b/src/game/features/self/SuperRun.cpp @@ -5,10 +5,8 @@ namespace YimMenu::Features { - // not setting a max speed on purpose to avoid value slider showing up - // maybe bring this up as an issue and fix? - static FloatCommand _SuperRunMoveRateOverride{"moverateoverride", "Move Rate Override", "Multipler for base run/sprint speed", 0.0f, std::nullopt, 2.0f}; - static FloatCommand _SuperRunRunSprintMultiplier{"runsprintswimmultiplier", "Run/Sprint/Swim Multiplier", "Multipler with which the run/sprint/swim speed is increased with until maximum speed is reached", 1.0f, std::nullopt, 1.0f}; + static FloatCommand _SuperRunMoveRateOverride{"moverateoverride", "Move Rate Override", "Multipler for base run/sprint speed", 0.0f, 10.0f, 2.0f}; + static FloatCommand _SuperRunRunSprintMultiplier{"runsprintswimmultiplier", "Run/Sprint/Swim Multiplier", "Multipler with which the run/sprint/swim speed is increased with until maximum speed is reached", 1.0f, 1.49f, 1.0f}; class SuperRun : public LoopedCommand { diff --git a/src/game/frontend/items/FloatCommandItem.cpp b/src/game/frontend/items/FloatCommandItem.cpp index 4d78673..4cb1ec7 100644 --- a/src/game/frontend/items/FloatCommandItem.cpp +++ b/src/game/frontend/items/FloatCommandItem.cpp @@ -6,7 +6,8 @@ namespace YimMenu { - FloatCommandItem::FloatCommandItem(joaat_t id, std::optional label_override) : + FloatCommandItem::FloatCommandItem(joaat_t id, std::optional label_override, bool use_slider) : + m_useSlider(use_slider), m_Command(Commands::GetCommand(id)), m_LabelOverride(label_override) { @@ -20,9 +21,9 @@ namespace YimMenu return; } - auto value = m_Command->GetState(); + auto value = m_Command->GetState(); auto label = m_LabelOverride.has_value() ? m_LabelOverride.value().c_str() : m_Command->GetLabel().c_str(); - if (!m_Command->GetMinimum().has_value() || !m_Command->GetMaximum().has_value()) + if (!m_Command->GetMinimum().has_value() || !m_Command->GetMaximum().has_value() || !m_useSlider) { ImGui::SetNextItemWidth(150); if (ImGui::InputFloat(label, &value)) diff --git a/src/game/frontend/items/IntCommandItem.cpp b/src/game/frontend/items/IntCommandItem.cpp index a41e73d..c164e39 100644 --- a/src/game/frontend/items/IntCommandItem.cpp +++ b/src/game/frontend/items/IntCommandItem.cpp @@ -6,7 +6,8 @@ namespace YimMenu { - IntCommandItem::IntCommandItem(joaat_t id, std::optional label_override) : + IntCommandItem::IntCommandItem(joaat_t id, std::optional label_override, bool use_slider) : + m_useSlider(use_slider), m_Command(Commands::GetCommand(id)), m_LabelOverride(label_override) { @@ -20,9 +21,9 @@ namespace YimMenu return; } - int value = m_Command->GetState(); + int value = m_Command->GetState(); auto label = m_LabelOverride.has_value() ? m_LabelOverride.value().c_str() : m_Command->GetLabel().c_str(); - if (!m_Command->GetMinimum().has_value() || !m_Command->GetMaximum().has_value()) + if (!m_Command->GetMinimum().has_value() || !m_Command->GetMaximum().has_value() || !m_useSlider) { ImGui::SetNextItemWidth(150); if (ImGui::InputInt(label, &value)) diff --git a/src/game/frontend/items/Items.hpp b/src/game/frontend/items/Items.hpp index bd15723..323bb12 100644 --- a/src/game/frontend/items/Items.hpp +++ b/src/game/frontend/items/Items.hpp @@ -64,10 +64,11 @@ namespace YimMenu class IntCommandItem : public UIItem { public: - explicit IntCommandItem(joaat_t id, std::optional label_override = std::nullopt); + explicit IntCommandItem(joaat_t id, std::optional label_override = std::nullopt, bool use_slider = true); void Draw() override; private: + bool m_useSlider; IntCommand* m_Command; std::optional m_LabelOverride; }; @@ -75,10 +76,11 @@ namespace YimMenu class FloatCommandItem : public UIItem { public: - explicit FloatCommandItem(joaat_t id, std::optional label_override = std::nullopt); + explicit FloatCommandItem(joaat_t id, std::optional label_override = std::nullopt, bool use_slider = true); void Draw() override; private: + bool m_useSlider; FloatCommand* m_Command; std::optional m_LabelOverride; }; diff --git a/src/game/frontend/submenus/Self.cpp b/src/game/frontend/submenus/Self.cpp index 9cfc8ca..ea0057d 100644 --- a/src/game/frontend/submenus/Self.cpp +++ b/src/game/frontend/submenus/Self.cpp @@ -48,8 +48,8 @@ namespace YimMenu::Submenus movementGroup->AddItem(std::make_shared("standonvehicles"_J)); movementGroup->AddItem(std::make_shared("disableactionmode"_J)); movementGroup->AddItem(std::make_shared("superrun"_J)); - movementGroup->AddItem(std::make_shared("superrun"_J, std::make_shared("moverateoverride"_J))); - movementGroup->AddItem(std::make_shared("superrun"_J, std::make_shared("runsprintswimmultiplier"_J))); + movementGroup->AddItem(std::make_shared("superrun"_J, std::make_shared("moverateoverride"_J, std::nullopt, false))); + movementGroup->AddItem(std::make_shared("superrun"_J, std::make_shared("runsprintswimmultiplier"_J, std::nullopt, false))); movementGroup->AddItem(std::make_shared("superjump"_J)); movementGroup->AddItem(std::make_shared("noclip"_J)); movementGroup->AddItem(std::make_shared("noclip"_J, std::make_shared("noclipspeed"_J))); From 84841215297ad9e303bd61bb3c0b11a6e97a0982 Mon Sep 17 00:00:00 2001 From: DJ ANDRE <71947479+djandre00@users.noreply.github.com> Date: Wed, 11 Jun 2025 02:58:55 +0200 Subject: [PATCH 2/2] feat(recovery): free change appearance & allow gender change (#405) * feat(recovery): free change appearance & allow gender change * Update AllowGenderChange.cpp --- .../features/recovery/AllowGenderChange.cpp | 22 +++++++++++++++ .../recovery/FreeChangeAppearance.cpp | 26 ++++++++++++++++++ .../recovery/NoChangeAppearanceCooldown.cpp | 27 +++++++++++++++++++ src/game/frontend/submenus/Recovery.cpp | 5 ++++ 4 files changed, 80 insertions(+) create mode 100644 src/game/features/recovery/AllowGenderChange.cpp create mode 100644 src/game/features/recovery/FreeChangeAppearance.cpp create mode 100644 src/game/features/recovery/NoChangeAppearanceCooldown.cpp diff --git a/src/game/features/recovery/AllowGenderChange.cpp b/src/game/features/recovery/AllowGenderChange.cpp new file mode 100644 index 0000000..e27c817 --- /dev/null +++ b/src/game/features/recovery/AllowGenderChange.cpp @@ -0,0 +1,22 @@ +#include "core/commands/BoolCommand.hpp" +#include "game/gta/Stats.hpp" + +namespace YimMenu::Features +{ + class AllowGenderChange : public BoolCommand + { + using BoolCommand::BoolCommand; + + virtual void OnEnable() override + { + Stats::SetInt("MPX_ALLOW_GENDER_CHANGE", 52); + } + + virtual void OnDisable() override + { + Stats::SetInt("MPX_ALLOW_GENDER_CHANGE", 0); + } + }; + + static AllowGenderChange _AllowGenderChange{"allowgenderchange", "Allow Gender Change", "Allows the player to change the character's gender"}; +} \ No newline at end of file diff --git a/src/game/features/recovery/FreeChangeAppearance.cpp b/src/game/features/recovery/FreeChangeAppearance.cpp new file mode 100644 index 0000000..10a254d --- /dev/null +++ b/src/game/features/recovery/FreeChangeAppearance.cpp @@ -0,0 +1,26 @@ +#include "core/commands/BoolCommand.hpp" +#include "game/backend/Tunables.hpp" + +namespace YimMenu::Features +{ + + class FreeChangeAppearance : public BoolCommand + { + using BoolCommand::BoolCommand; + + Tunable m_CharacterAppearanceCharge{"CHARACTER_APPEARANCE_CHARGE"_J}; + + virtual void OnEnable() override + { + if(m_CharacterAppearanceCharge.IsReady()) m_CharacterAppearanceCharge.Set(0); + } + + virtual void OnDisable() override + { + if (m_CharacterAppearanceCharge.IsReady()) + m_CharacterAppearanceCharge.Set(100000); + } + }; + + static FreeChangeAppearance _FreeChangeAppearance{"freechangeappearance", "Change Appearance For Free", "Allows the player to change the character's appearance for free"}; +} \ No newline at end of file diff --git a/src/game/features/recovery/NoChangeAppearanceCooldown.cpp b/src/game/features/recovery/NoChangeAppearanceCooldown.cpp new file mode 100644 index 0000000..cee0005 --- /dev/null +++ b/src/game/features/recovery/NoChangeAppearanceCooldown.cpp @@ -0,0 +1,27 @@ +#include "core/commands/BoolCommand.hpp" +#include "game/backend/Tunables.hpp" + + +namespace YimMenu::Features +{ + class NoChangeAppearanceCooldown : public BoolCommand + { + using BoolCommand::BoolCommand; + + Tunable m_CharacterAppearanceCooldown{"CHARACTER_APPEARANCE_COOLDOWN"_J}; + + virtual void OnEnable() override + { + if (m_CharacterAppearanceCooldown.IsReady()) + m_CharacterAppearanceCooldown.Set(0); + } + + virtual void OnDisable() override + { + if (m_CharacterAppearanceCooldown.IsReady()) + m_CharacterAppearanceCooldown.Set(2880000); + } + }; + + static NoChangeAppearanceCooldown _NoChangeAppearanceCooldown{"nochangeappearancecooldown", "No Change Appearance Cooldown", "Removes the cooldown for changing appearance"}; +} \ No newline at end of file diff --git a/src/game/frontend/submenus/Recovery.cpp b/src/game/frontend/submenus/Recovery.cpp index d3d7179..d1e9e05 100644 --- a/src/game/frontend/submenus/Recovery.cpp +++ b/src/game/frontend/submenus/Recovery.cpp @@ -22,6 +22,11 @@ namespace YimMenu::Submenus generalGroup->AddItem(std::make_shared("unlockgtaplus"_J)); generalGroup->AddItem(std::make_shared("overriderpmultiplier"_J)); generalGroup->AddItem(std::make_shared("overriderpmultiplier"_J, std::make_shared("rpmultiplierinput"_J))); + + generalGroup->AddItem(std::make_shared("freechangeappearance"_J)); + generalGroup->AddItem(std::make_shared("nochangeappearancecooldown"_J)); + generalGroup->AddItem(std::make_shared("allowgenderchange"_J)); + businessGroup->AddItem(std::make_shared("businesssafe"_J)); businessGroup->AddItem(std::make_shared("claimsafeearnings"_J));