diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..8897664 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,14 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "(Windows) Attach", + "type": "cppvsdbg", + "request": "attach", + "processId": "${command:pickProcess}" + }, + ] +} \ No newline at end of file diff --git a/src/Game.cpp b/src/Game.cpp index 4d06bbb..70178b5 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -433,7 +433,7 @@ Lowers armour, health, stamina etc.")) ImGui::Separator(); } Ui::EditReference("Game speed", CTimer::ms_fTimeScale, 1, 1, 10); - Ui::EditFloat("Gravity", 0x863984, -1.0f, 0.008f, 1.0f); + Ui::EditFloat("Gravity", 0x863984, -1.0f, 0.008f, 1.0f, 1.0f, 0.01f); if (ImGui::CollapsingHeader("Set time")) { diff --git a/src/Menu.cpp b/src/Menu.cpp index 814234b..69192ca 100644 --- a/src/Menu.cpp +++ b/src/Menu.cpp @@ -125,7 +125,7 @@ void Menu::DrawOverlay() if (m_bShowMenu && ImGui::Begin("Overlay", nullptr, window_flags)) { - CVector pos; + CVector pos{0,0,0}; if (player) { pos = player->GetPosition(); diff --git a/src/Ui.cpp b/src/Ui.cpp index 9163dc7..ba034cd 100644 --- a/src/Ui.cpp +++ b/src/Ui.cpp @@ -752,7 +752,7 @@ void Ui::EditBits(const char* label, const int address, const std::vector min) + if (ImGui::Button("-", ImVec2(size, size)) && (val - change) > min) { - val -= 1; + val -= change; patch::SetFloat(address, val / mul, false); } ImGui::SameLine(0.0, 4.0); - if (ImGui::Button("+", ImVec2(size, size)) && val < max) + if (ImGui::Button("+", ImVec2(size, size)) && (val + change) < max) { - val += 1; + val += change; patch::SetFloat(address, val / mul, false); } ImGui::SameLine(0.0, 4.0); diff --git a/src/Ui.h b/src/Ui.h index fd4191e..f657df8 100644 --- a/src/Ui.h +++ b/src/Ui.h @@ -63,7 +63,7 @@ public: template static void EditAddress(const char* label, int address, int min = 0, int def = 0, int max = 100); static void EditBits(const char* label, int address, const std::vector& names); - static void EditFloat(const char* label, int address, float min, float def, float max, float mul = 1); + static void EditFloat(const char* label, int address, float min, float def, float max, float mul = 1, float change = 1.0f); template static void EditReference(const char* label, T& address, int min = 0, int def = 0, int max = 100); static void EditRadioButtonAddress(const char* label, std::vector& named_mem);