From f3e0b10b6de534d358a3cfd1de1888fb0856c06f Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Wed, 13 Jul 2022 09:51:21 +0600 Subject: [PATCH] Fixes, add vehicle health menu --- resource/CheatMenuSA/data/textures.toml | 3 +++ resource/common/locale/English.toml | 8 ++++---- src/menu.cpp | 2 +- src/paint.h | 2 +- src/vehicle.cpp | 4 +++- src/visual.cpp | 11 ++++++----- 6 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 resource/CheatMenuSA/data/textures.toml diff --git a/resource/CheatMenuSA/data/textures.toml b/resource/CheatMenuSA/data/textures.toml new file mode 100644 index 0000000..e6551b3 --- /dev/null +++ b/resource/CheatMenuSA/data/textures.toml @@ -0,0 +1,3 @@ +############################################################################## +# Texture Favoirites +############################################################################## \ No newline at end of file diff --git a/resource/common/locale/English.toml b/resource/common/locale/English.toml index 95ba697..d04e9a7 100644 --- a/resource/common/locale/English.toml +++ b/resource/common/locale/English.toml @@ -230,9 +230,9 @@ Left-click selects hotkey. Left clicking outside deselects. Right click disables hotkey.""" VehEngineKey = "Toggle vehicle engine" -VehHealth = "Veh Health: %.f" +VehHealth = "Vehicle health" VehicleSpawned = "Vehicle spawned" -VehSpeed = "Veh Speed: %d" +VehSpeed = "Vehicle speed: %d" VehStartKey = "Vehicle instant start" VehStopKey = "Vehicle instant start" Version = "Version" @@ -720,8 +720,8 @@ WhiteScanlines = "White scanlines" [Weapon] Ammo = "Ammo" CurrentWeapon = "Current weapon: %s" -DropAll = "Drop all" -DropCurrent = "Drop current" +DropAll = "Remove all" +DropCurrent = "Remove current" DropWeapon = "Drop weapon" DualWeild = "Dual wield" DualWeildText = """ diff --git a/src/menu.cpp b/src/menu.cpp index 4a4b566..c7f736c 100644 --- a/src/menu.cpp +++ b/src/menu.cpp @@ -153,7 +153,7 @@ void Menu::DrawOverlay() { if (Overlay::bVehHealth) { - ImGui::Text(TEXT("Menu.VehHealth"), pPlayer->m_pVehicle->m_fHealth); + ImGui::Text((TEXT_S("Menu.VehHealth") + ": %.f").c_str(), pPlayer->m_pVehicle->m_fHealth); } if (Overlay::bVehSpeed) diff --git a/src/paint.h b/src/paint.h index 8a1888b..065309b 100644 --- a/src/paint.h +++ b/src/paint.h @@ -74,7 +74,7 @@ private: static void NodeWrapperRecursive(RwFrame* frame, CVehicle* pVeh, std::function func); public: - static inline ResourceStore m_TextureData { "textures", eResourceType::TYPE_IMAGE, ImVec2(100, 80) }; + static inline ResourceStore m_TextureData { "textures", eResourceType::TYPE_IMAGE_TEXT, ImVec2(100, 80) }; static void InjectHooks(); static void GenerateNodeList(CVehicle* pVeh, std::vector& names_vec, std::string& selected); diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 91d0be4..1f3cf1e 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -980,7 +980,9 @@ void Vehicle::ShowPage() ImGui::Spacing(); ImGui::Separator(); } -#endif +#endif + + Widget::EditAddr(TEXT("Menu.VehHealth"), (int)&pVeh->m_fHealth, 0, 0, 1000); if (ImGui::CollapsingHeader(TEXT("Vehicle.SetSpeed"))) { Widget::Checkbox(TEXT("Vehicle.LockSpeed"), &m_bLockSpeed); diff --git a/src/visual.cpp b/src/visual.cpp index 702e2de..420ae27 100644 --- a/src/visual.cpp +++ b/src/visual.cpp @@ -923,6 +923,12 @@ void Visual::ShowPage() init_patches = true; } + + ImGui::Spacing(); + ImGui::SameLine(); + ImGui::TextWrapped(TEXT("Visual.IncompatibleMods")); + Widget::Tooltip(TEXT("Visual.IncompatibleModsText")); + ImGui::Spacing(); #endif if (ImGui::BeginChild("VisualsChild")) { @@ -943,11 +949,6 @@ void Visual::ShowPage() ImGui::Separator(); } #ifdef GTASA - ImGui::Spacing(); - ImGui::SameLine(); - ImGui::TextWrapped(TEXT("Visual.IncompatibleMods")); - Widget::Tooltip(TEXT("Visual.IncompatibleModsText")); - ImGui::Spacing(); ColorPickerAddr(TEXT("Visual.ArmourbarColor"), *(int*)0x5890FC, ImVec4(225, 225, 225, 255)); Widget::EditAddr(TEXT("Visual.ArmourbarPosX"), 0x866B78, -999, 94, 999); Widget::EditAddr(TEXT("Visual.ArmourbarPosY"), 0x862D38, -999, 48, 999);