From bbbd30b8b1697821bd655b8e5943a919d3eabff6 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Wed, 9 Dec 2020 19:15:50 +0600 Subject: [PATCH] Updates to checkboxes, added back teleporting to radar sprites --- CheatMenu/CheatMenu.cpp | 1 + CheatMenu/CheatMenu.vcxproj.vcxproj | 2 + CheatMenu/CheatMenu.vcxproj.vcxproj.filters | 2 + CheatMenu/CustomWidgets.cpp | 90 ++++++++++++++++ CheatMenu/CustomWidgets.h | 7 ++ CheatMenu/Game.cpp | 2 +- CheatMenu/Hook.cpp | 4 +- CheatMenu/Json.cpp | 2 +- CheatMenu/Json.h | 15 +++ CheatMenu/Teleport.cpp | 43 ++++++-- CheatMenu/Teleport.h | 8 ++ CheatMenu/Ui.cpp | 8 +- CheatMenu/Ui.h | 2 +- CheatMenu/Util.cpp | 7 ++ CheatMenu/Util.h | 2 +- CheatMenu/Vehicle.cpp | 102 ++++++------------ CheatMenu/Vehicle.h | 5 - CheatMenu/pch.cpp | 8 +- CheatMenu/pch.h | 16 ++- Files/CheatMenu/json/radar sprite.json | 66 ++++++++++++ Files/CheatMenu/json/teleport.json | 1 + .../paintjobs/{ => Default}/carbonfiber.png | Bin .../paintjobs/{ => Default}/stickerbomb.png | Bin .../paintjobs/{ => Default}/uvtest.png | Bin 24 files changed, 290 insertions(+), 103 deletions(-) create mode 100644 CheatMenu/CustomWidgets.cpp create mode 100644 CheatMenu/CustomWidgets.h create mode 100644 Files/CheatMenu/json/radar sprite.json rename Files/CheatMenu/vehicles/paintjobs/{ => Default}/carbonfiber.png (100%) rename Files/CheatMenu/vehicles/paintjobs/{ => Default}/stickerbomb.png (100%) rename Files/CheatMenu/vehicles/paintjobs/{ => Default}/uvtest.png (100%) diff --git a/CheatMenu/CheatMenu.cpp b/CheatMenu/CheatMenu.cpp index c39c723..14feef3 100644 --- a/CheatMenu/CheatMenu.cpp +++ b/CheatMenu/CheatMenu.cpp @@ -78,6 +78,7 @@ CheatMenu::CheatMenu() // Load menu settings Globals::menu_size.x = config.GetValue("window.sizeX", screen::GetScreenWidth() / 4.0f); Globals::menu_size.y = config.GetValue("window.sizeY", screen::GetScreenHeight() / 1.2f); + srand(CTimer::m_snTimeInMilliseconds); }; Events::processScriptsEvent += [this] diff --git a/CheatMenu/CheatMenu.vcxproj.vcxproj b/CheatMenu/CheatMenu.vcxproj.vcxproj index fb82e2c..380826e 100644 --- a/CheatMenu/CheatMenu.vcxproj.vcxproj +++ b/CheatMenu/CheatMenu.vcxproj.vcxproj @@ -111,6 +111,7 @@ + NotUsing NotUsing @@ -176,6 +177,7 @@ + diff --git a/CheatMenu/CheatMenu.vcxproj.vcxproj.filters b/CheatMenu/CheatMenu.vcxproj.vcxproj.filters index dcf1479..b1e316c 100644 --- a/CheatMenu/CheatMenu.vcxproj.vcxproj.filters +++ b/CheatMenu/CheatMenu.vcxproj.vcxproj.filters @@ -41,6 +41,7 @@ + @@ -94,6 +95,7 @@ + diff --git a/CheatMenu/CustomWidgets.cpp b/CheatMenu/CustomWidgets.cpp new file mode 100644 index 0000000..6509a2c --- /dev/null +++ b/CheatMenu/CustomWidgets.cpp @@ -0,0 +1,90 @@ +#include "pch.h" +#include "CustomWidgets.h" + +// Checkbox with support for hints, disable +bool CustomWidgets::Checkbox(const char * label, bool *v, const char * hint, bool is_disabled) +{ + // set things up + bool pressed = false; + const ImGuiStyle& style = ImGui::GetStyle(); + const ImVec2 text_size = ImGui::CalcTextSize(label, NULL, true); + float square_sz = ImGui::GetFrameHeight(); + ImDrawList *drawlist = ImGui::GetWindowDrawList(); + ImU32 color = ImGui::GetColorU32(ImGuiCol_FrameBg); + std::string slabel = "##InvCheckboxBtn" + std::string(label); + + if (is_disabled) + ImGui::PushStyleVar(ImGuiStyleVar_Alpha, ImGui::GetStyle().Alpha * 0.5f); + + // process the button states + if (ImGui::InvisibleButton(slabel.c_str(), ImVec2(square_sz, square_sz)) && !is_disabled) + { + pressed = true; + *v = !*v; + } + + if (ImGui::IsItemHovered() && !is_disabled) + color = ImGui::GetColorU32(ImGuiCol_FrameBgHovered); + + + // draw the button + ImVec2 min = ImGui::GetItemRectMin(); + ImVec2 max = ImGui::GetItemRectMax(); + drawlist->AddRectFilled(min, max, color); + + int pad = int(square_sz / 6.0); + pad = (pad < 1) ? 1 : pad; + + if (*v) + { // draw the checkmark + float sz = (square_sz - pad * 2.0); + float thickness = sz / 5.0; + thickness = (thickness < 1.0) ? 1.0 : thickness; + sz = sz - thickness * 0.5; + + ImVec2 pos = ImVec2(min.x + pad, min.y + pad); + pos.x = pos.x + thickness * 0.25; + pos.y = pos.y + thickness * 0.25; + + float third = sz / 3.0; + float bx = pos.x + third; + float by = pos.y + sz - third * 0.5; + + drawlist->PathLineTo(ImVec2(bx - third, by - third)); + drawlist->PathLineTo(ImVec2(bx, by)); + drawlist->PathLineTo(ImVec2(bx + third * 2.0, by - third * 2.0)); + drawlist->PathStroke(ImGui::GetColorU32(ImGuiCol_CheckMark), false, thickness); + } + + // draw label + ImGui::SameLine(0, style.ItemInnerSpacing.x); + if (ImGui::InvisibleButton(label, ImVec2(ImGui::CalcTextSize(label, NULL, true).x, square_sz)) && !is_disabled) + { + pressed = true; + *v = !*v; + } + min = ImGui::GetItemRectMin(); + drawlist->AddText(ImVec2(min.x, min.y + style.ItemInnerSpacing.y), ImGui::GetColorU32(ImGuiCol_Text), label); + + // draw hint + if (hint != nullptr) + { + ImGui::SameLine(0, style.ItemInnerSpacing.x); + ImGui::InvisibleButton("?", ImGui::CalcTextSize("?", NULL, true)); + min = ImGui::GetItemRectMin(); + drawlist->AddText(ImVec2(min.x, min.y + style.ItemInnerSpacing.y), ImGui::GetColorU32(ImGuiCol_TextDisabled), "?"); + + if (ImGui::IsItemHovered() && !is_disabled) + { + ImGui::BeginTooltip(); + ImGui::Text(hint); + ImGui::Spacing(); + ImGui::EndTooltip(); + } + } + + if (is_disabled) + ImGui::PopStyleVar(); + + return pressed; +} diff --git a/CheatMenu/CustomWidgets.h b/CheatMenu/CustomWidgets.h new file mode 100644 index 0000000..586c0c7 --- /dev/null +++ b/CheatMenu/CustomWidgets.h @@ -0,0 +1,7 @@ +#pragma once +class CustomWidgets +{ +public: + static bool Checkbox(const char* label, bool* v, const char* hint = nullptr, bool is_disabled = false); +}; + diff --git a/CheatMenu/Game.cpp b/CheatMenu/Game.cpp index 5e27edf..fd9229e 100644 --- a/CheatMenu/Game.cpp +++ b/CheatMenu/Game.cpp @@ -121,7 +121,7 @@ Game::Game() if (random_cheats::enable && (timer - random_cheats::timer) > (uint(random_cheats::enable_wait_time)*1000)) { - int id = cheat_id(gen); + int id = rand() % 92; for (int i = 0; i < 92; i++) { diff --git a/CheatMenu/Hook.cpp b/CheatMenu/Hook.cpp index 78f2f20..82e942d 100644 --- a/CheatMenu/Hook.cpp +++ b/CheatMenu/Hook.cpp @@ -1,7 +1,7 @@ #include "pch.h" #include "Hook.h" -#include "external\kiero\kiero.h" -#include "external\kiero\minhook\include\MinHook.h" +#include "external/kiero/kiero.h" +#include "external/kiero/minhook/include/MinHook.h" WNDPROC Hook::oWndProc = NULL; f_Reset Hook::oReset9 = NULL; diff --git a/CheatMenu/Json.cpp b/CheatMenu/Json.cpp index 879d1d1..b810c2c 100644 --- a/CheatMenu/Json.cpp +++ b/CheatMenu/Json.cpp @@ -23,7 +23,7 @@ CJson::CJson(const char* name,bool create_new) } } -void CJson::LoadJsonData(std::vector& vec, std::string& selected) +void CJson::LoadJsonData(std::vector& vec, std::string& selected) // Test { for (auto element : data.items()) vec.push_back(element.key()); diff --git a/CheatMenu/Json.h b/CheatMenu/Json.h index 3d5f395..99700e8 100644 --- a/CheatMenu/Json.h +++ b/CheatMenu/Json.h @@ -8,6 +8,11 @@ private: std::string file_path; public: nlohmann::json data; + + /* + Returns a value from json structure hierarchy using '.' + Example: "Menu.Window.X" + */ template T GetValue(std::string&& key, T&& default_val) { @@ -32,6 +37,11 @@ public: return default_val; } } + + /* + Allows to save values in json hierarchy using '.' + Example: "Menu.Window.X" + */ template void SetValue(std::string&& key, T&& val) { @@ -49,6 +59,11 @@ public: else *json = val; } + + /* + Loads the section names into a category vector. + Used to create drop down category menus + */ void LoadJsonData(std::vector& vec, std::string& selected); CJson(const char* text, bool create_new = false); virtual ~CJson(); diff --git a/CheatMenu/Teleport.cpp b/CheatMenu/Teleport.cpp index 05b0468..e6f26ac 100644 --- a/CheatMenu/Teleport.cpp +++ b/CheatMenu/Teleport.cpp @@ -17,10 +17,39 @@ std::string Teleport::selected_item = "All"; uint quick_teleport_timer = 0; CJson Teleport::json = CJson("teleport"); +CJson Teleport::sprite_name_json = CJson("radar sprite"); + +void Teleport::FetchRadarSpriteData() +{ + uint cur_timer = CTimer::m_snTimeInMilliseconds; + static uint timer = cur_timer; + + // Update the radar list each 5 seconds + if (cur_timer - timer < 5000) + return; + + json.data.erase("Radar"); + + // 175 is the max number of sprites, FLA can increase this limit, might need to update this + for (int i = 0; i != 175; ++i) + { + CVector pos = CRadar::ms_RadarTrace[i].m_vPosition; + uchar sprite = CRadar::ms_RadarTrace[i].m_nBlipSprite; + std::string sprite_name = sprite_name_json.data[std::to_string(sprite)].get(); + std::string key_name = sprite_name + ", " + Util::GetLocationName(&pos); + + json.data["Radar"][key_name] = "0, " + std::to_string(pos.x) + ", " + std::to_string(pos.y) + ", " + std::to_string(pos.z); + + /* + "Radar" : { + "key_name" : "0, x, y, z", + } + */ + } +} Teleport::Teleport() { - json.LoadJsonData(search_categories, selected_item); Events::initGameEvent += [] @@ -39,13 +68,9 @@ Teleport::Teleport() STeleport::pos.z = CWorld::FindGroundZFor3DCoord(Teleport::STeleport::pos.x, Teleport::STeleport::pos.y, STeleport::pos.z + 100.0f, 0, &player_entity) + 1.0f; if (player->m_pVehicle) - { player->m_pVehicle->Teleport(STeleport::pos, false); - } else - { player->Teleport(STeleport::pos, false); - } STeleport::_bool = false; Command(CPools::GetPedRef(player), false); @@ -65,6 +90,11 @@ Teleport::Teleport() Events::shutdownRwEvent += [] { + // Clear the Radar coordinates + json.data.erase("Radar"); + json.data["Radar"] = {}; + + config.SetValue("quick_teleport", quick_teleport); }; } @@ -104,9 +134,7 @@ void Teleport::TeleportPlayer(bool get_marker, CVector* pos, short interior_id) Command(CPools::GetVehicleRef(player->m_pVehicle), interior_id); // setvehicleinterior } else - { player->Teleport(CVector(pos->x, pos->y, pos->z), false); - } Command(CPools::GetPedRef(player), interior_id); // setcharinterior Command(interior_id); @@ -212,6 +240,7 @@ void Teleport::Main() if (ImGui::BeginTabItem("Search")) { + FetchRadarSpriteData(); ImGui::Spacing(); Ui::DrawJSON(json, search_categories, selected_item, filter, &TeleportToLocation, &RemoveTeleportEntry); ImGui::EndTabItem(); diff --git a/CheatMenu/Teleport.h b/CheatMenu/Teleport.h index 7c1feff..82410ab 100644 --- a/CheatMenu/Teleport.h +++ b/CheatMenu/Teleport.h @@ -21,6 +21,14 @@ private: static uint timer; }; + static CJson sprite_name_json; + + /* + Generates radar sprite coordinates on the fly. + Shouldn't get saved in 'teleport.json', needs to be cleared at game shutdown. + */ + static void FetchRadarSpriteData(); + protected: Teleport(); virtual ~Teleport(); diff --git a/CheatMenu/Ui.cpp b/CheatMenu/Ui.cpp index fb65f52..4053aff 100644 --- a/CheatMenu/Ui.cpp +++ b/CheatMenu/Ui.cpp @@ -1,5 +1,6 @@ #include "pch.h" #include "Ui.h" +#include "CustomWidgets.h" std::string Ui::current_hotkey = ""; @@ -123,16 +124,13 @@ void Ui::ShowTooltip(const char* text) } } -bool Ui::CheckboxWithHint(const char* label, bool* state, const char* hint) +bool Ui::CheckboxWithHint(const char* label, bool* state, const char* hint, const bool is_disabled) { bool rtn = false; - if (ImGui::Checkbox(label, state)) + if (CustomWidgets::Checkbox(label,state,hint,is_disabled)) rtn = true; - if (hint != nullptr) - ShowTooltip(hint); - return rtn; } diff --git a/CheatMenu/Ui.h b/CheatMenu/Ui.h index 5cb072d..44e1e3a 100644 --- a/CheatMenu/Ui.h +++ b/CheatMenu/Ui.h @@ -37,7 +37,7 @@ public: static bool CheckboxAddressVar(const char* label, bool val, int addr, const char* hint = nullptr); static bool CheckboxAddressVarEx(const char* label, bool val, int addr, int enabled_val, int disabled_val, const char* hint = nullptr); static bool CheckboxBitFlag(const char* label, uint flag, const char* hint = nullptr); - static bool CheckboxWithHint(const char* label, bool* state, const char* hint = nullptr); + static bool CheckboxWithHint(const char* label, bool* state, const char* hint = nullptr, const bool is_disabled = false); static void DrawHeaders(unsortedMap& data); static void DrawJSON(CJson& json, std::vector& combo_items, std::string& selected_item, ImGuiTextFilter& filter, diff --git a/CheatMenu/Util.cpp b/CheatMenu/Util.cpp index 4129ab8..73865da 100644 --- a/CheatMenu/Util.cpp +++ b/CheatMenu/Util.cpp @@ -6,14 +6,21 @@ void Util::ClearCharTasksVehCheck(CPed* ped) { uint hped = CPools::GetPedRef(ped); uint hveh = NULL; + bool veh_engine = true; if (Command(hped)) + { hveh = CPools::GetVehicleRef(ped->m_pVehicle); + veh_engine = ped->m_pVehicle->m_nVehicleFlags.bEngineOn; + } Command(hped); if (hveh) + { Command(hped, hveh); + ped->m_pVehicle->m_nVehicleFlags.bEngineOn = veh_engine; + } } void Util::LoadTexturesInDirRecursive(const char * path, const char * file_ext,std::vector& category_vec, std::vector> &store_vec) diff --git a/CheatMenu/Util.h b/CheatMenu/Util.h index 0e76baa..a188ae8 100644 --- a/CheatMenu/Util.h +++ b/CheatMenu/Util.h @@ -6,7 +6,7 @@ private: public: static void ClearCharTasksVehCheck(CPed* ped); - static CVehicle* GetClosestVehicle(CPlayerPed* player); + static CVehicle *GetClosestVehicle(CPlayerPed* player); static int GetLargestGangInZone(); static void LoadTexturesInDirRecursive(const char * path, const char * file_ext, std::vector& category_vec, std::vector> &store_vec); static bool IsOnMission(); diff --git a/CheatMenu/Vehicle.cpp b/CheatMenu/Vehicle.cpp index 5bc23c4..ec8c03e 100644 --- a/CheatMenu/Vehicle.cpp +++ b/CheatMenu/Vehicle.cpp @@ -3,11 +3,7 @@ bool Vehicle::bike_fly = false; bool Vehicle::dont_fall_bike = false; -bool Vehicle::veh_engine = false; bool Vehicle::veh_heavy = false; -bool Vehicle::veh_invisible = false; -bool Vehicle::veh_lights = false; -bool Vehicle::veh_no_dmg = false; bool Vehicle::veh_watertight = false; bool Vehicle::lock_speed = false; @@ -48,7 +44,6 @@ bool Vehicle::neon::rainbow = false; uint Vehicle::neon::rainbow_timer = 0; bool Vehicle::neon::traffic = false; uint Vehicle::neon::traffic_timer = 0; -std::uniform_int_distribution<> Vehicle::neon::random_val(0,255); bool Vehicle::unlimited_nitro::enabled = false; bool Vehicle::unlimited_nitro::comp_added = false; @@ -98,15 +93,10 @@ Vehicle::Vehicle() { int hveh = CPools::GetVehicleRef(veh); - Command(hveh, !veh_engine); Command(hveh, veh_heavy); Command(hplayer, !dont_fall_bike); Command(hveh, veh_watertight); - veh->m_bIsVisible = !veh_invisible; - if (veh_no_dmg) - Command(hveh, false); - if (unlimited_nitro::enabled && player->m_pVehicle->m_nVehicleSubClass == VEHICLE_AUTOMOBILE) { patch::Set(0x969165, 0, true); // All cars have nitro @@ -151,25 +141,16 @@ Vehicle::Vehicle() int chance = 0; if (veh->m_nVehicleClass == CLASS_NORMAL) // Normal - { - std::uniform_int_distribution<> class_random(1,20); // 5% - chance = class_random(gen); - } + chance = rand() % 21 + 1; if (veh->m_nVehicleClass == CLASS_RICHFAMILY) // Rich family - { - std::uniform_int_distribution<> class_random(1, 5); // 20% - chance = class_random(gen); - } + chance = rand() % 5 + 1; if (veh->m_nVehicleClass == CLASS_EXECUTIVE) // Executive - { - std::uniform_int_distribution<> class_random(1, 3); // 33% - chance = class_random(gen); - } + chance = rand() % 3 + 1; if (chance == 1 && !IsNeonInstalled(veh) && veh->m_pDriver != player) - InstallNeon(veh, Vehicle::neon::random_val(gen), Vehicle::neon::random_val(gen), Vehicle::neon::random_val(gen)); + InstallNeon(veh, rand() % 255, rand() % 255, rand() % 255); } neon::traffic_timer = timer; } @@ -184,14 +165,13 @@ Vehicle::Vehicle() ) > 0.0 && CTimer::ms_fTimeStep > 0.0) { - veh->FlyingControl(3, -9999.9902, -9999.9902, -9999.9902, -9999.9902); + veh->FlyingControl(3, -9999.9902f, -9999.9902f, -9999.9902f, -9999.9902f); } } } }; } - void Vehicle::AddComponent(const std::string& component, const bool display_message) { try { @@ -261,8 +241,7 @@ int Vehicle::GetRandomTrainIdForModel(int model) return -1; } - std::uniform_int_distribution<> random(_start, _end); - return train_ids[random(gen)]; + return train_ids[rand() % _end + _start]; } // Get vehicle HandlingId @@ -619,6 +598,7 @@ void Vehicle::Main() if (ImGui::BeginTabBar("Vehicle", ImGuiTabBarFlags_NoTooltip + ImGuiTabBarFlags_FittingPolicyScroll)) { + bool is_driver = player->m_pVehicle && player->m_pVehicle->IsDriver(player); ImGui::Spacing(); if (ImGui::BeginTabItem("Checkboxes")) @@ -633,61 +613,49 @@ void Vehicle::Main() Ui::CheckboxAddress("All taxis have nitro", 0x96918B); Ui::CheckboxWithHint("Bikes fly", &bike_fly); Ui::CheckboxAddress("Boats fly", 0x969153); - Ui::CheckboxWithHint("Car engine", &veh_engine); Ui::CheckboxAddress("Cars fly", 0x969160); - Ui::CheckboxWithHint("Car heavy", &veh_heavy); + Ui::CheckboxWithHint("Cars heavy", &veh_heavy); Ui::CheckboxAddress("Decreased traffic", 0x96917A); Ui::CheckboxWithHint("Don't fall off bike", &dont_fall_bike); Ui::CheckboxAddress("Drive on water", 0x969152); + bool engine = is_driver + && (!player->m_pVehicle->m_nVehicleFlags.bEngineBroken || player->m_pVehicle->m_nVehicleFlags.bEngineOn); + if (Ui::CheckboxWithHint("Engine on", &engine, "Applies to this vehicle only", !is_driver)) + { + player->m_pVehicle->m_nVehicleFlags.bEngineBroken = !engine; + player->m_pVehicle->m_nVehicleFlags.bEngineOn = engine; + } + + ImGui::NextColumn(); Ui::CheckboxAddressEx("Lock train camera", 0x52A52F, 171, 6); Ui::CheckboxAddress("Float away when hit", 0x969166); Ui::CheckboxAddress("Green traffic lights", 0x96914E); - Ui::CheckboxWithHint("Invisible car", &veh_invisible); - if (Ui::CheckboxWithHint("Lights on", &veh_lights)) + + bool visible = is_driver && !player->m_pVehicle->m_bIsVisible; + if (Ui::CheckboxWithHint("Invisible car", &visible, "Applies to this vehicle only", !is_driver)) + player->m_pVehicle->m_bIsVisible = !visible; + + bool lights = is_driver && !player->m_pVehicle->ms_forceVehicleLightsOff; + if (Ui::CheckboxWithHint("Lights on", &lights, "Applies to this vehicle only", !is_driver)) + player->m_pVehicle->ms_forceVehicleLightsOff = !lights; + + bool lock_status = is_driver && (player->m_pVehicle->m_nDoorLock == CARLOCK_LOCKED_PLAYER_INSIDE); + if (Ui::CheckboxWithHint("Lock doors", &lock_status, "Applies to this vehicle only", !is_driver)) { - if (Command(hplayer)) - { - int hveh = CPools::GetVehicleRef(player->m_pVehicle); - Command(hveh, !veh_lights); - } + if (lock_status) + player->m_pVehicle->m_nDoorLock = CARLOCK_LOCKED_PLAYER_INSIDE; + else + player->m_pVehicle->m_nDoorLock = CARLOCK_UNLOCKED; } - bool doors_locked = false; + bool no_dmg = is_driver && (!player->m_pVehicle->m_nVehicleFlags.bCanBeDamaged); - if (Command(hplayer)) - { - int hveh = CPools::GetVehicleRef(player->m_pVehicle); - int door; - Command(hveh, &door); - doors_locked = (door == CARLOCK_LOCKED_PLAYER_INSIDE); - } + if (Ui::CheckboxWithHint("No damage", &no_dmg, "Applies to this vehicle only", !is_driver)) + player->m_pVehicle->m_nVehicleFlags.bCanBeDamaged = !no_dmg; - if (Ui::CheckboxWithHint("Lock doors", &doors_locked)) - { - if (Command(hplayer)) - { - int hveh = CPools::GetVehicleRef(player->m_pVehicle); - - if (doors_locked) - Command(hveh, CARLOCK_LOCKED_PLAYER_INSIDE); - else - Command(hveh, CARLOCK_UNLOCKED); - } - } - - if (Ui::CheckboxWithHint("No damage", &veh_no_dmg)) - { - if (Command(hplayer)) - { - int hveh = CPools::GetVehicleRef(player->m_pVehicle); - - if (!veh_no_dmg) - Command(hveh, true); - } - } Ui::CheckboxAddress("Perfect handling", 0x96914C); Ui::CheckboxAddress("Tank mode", 0x969164); Ui::CheckboxWithHint("Unlimited nitro", &unlimited_nitro::enabled, "Nitro will activate when left clicked\n\ diff --git a/CheatMenu/Vehicle.h b/CheatMenu/Vehicle.h index 7f05f25..7efbec8 100644 --- a/CheatMenu/Vehicle.h +++ b/CheatMenu/Vehicle.h @@ -7,11 +7,7 @@ class Vehicle : NeonAPI, Paint private: static bool bike_fly; static bool dont_fall_bike; - static bool veh_engine; static bool veh_heavy; - static bool veh_invisible; - static bool veh_lights; - static bool veh_no_dmg; static bool veh_watertight; static int door_menu_button; @@ -39,7 +35,6 @@ private: static uint rainbow_timer; static bool traffic; static uint traffic_timer; - static std::uniform_int_distribution<> random_val; }; struct spawner diff --git a/CheatMenu/pch.cpp b/CheatMenu/pch.cpp index 58a2fe3..c87450d 100644 --- a/CheatMenu/pch.cpp +++ b/CheatMenu/pch.cpp @@ -12,7 +12,7 @@ ID3D11Device *Globals::device11 = nullptr; CJson config = CJson("config", true); std::ofstream flog = std::ofstream("CheatMenu.log"); - -std::random_device rd; -std::mt19937 gen(rd()); -std::uniform_int_distribution<> cheat_id(0, 91); +// +//std::random_device rd; +//std::mt19937 gen(rd()); +//std::uniform_int_distribution<> cheat_id(0, 91); diff --git a/CheatMenu/pch.h b/CheatMenu/pch.h index 6c81891..0ef19cd 100644 --- a/CheatMenu/pch.h +++ b/CheatMenu/pch.h @@ -4,10 +4,9 @@ #define INPUT_BUFFER_SIZE 64 #define SPAWN_PED_LIMIT 20 #define MENU_VERSION "2.5-beta" -#define BUILD_NUMBER "20201206" +#define BUILD_NUMBER "20201209" #define STB_IMAGE_IMPLEMENTATION -#include #include #include #include @@ -17,7 +16,7 @@ #include #include #include -#include +#include #include #include #include @@ -61,6 +60,7 @@ // Globals typedef std::vector> unsortedMap; using namespace plugin; +namespace fs = std::experimental::filesystem; enum Renderer { @@ -98,11 +98,9 @@ extern CJson config; extern std::ofstream flog; // Random cheats -extern std::random_device rd; -extern std::mt19937 gen; -extern std::uniform_int_distribution<> cheat_id; +//extern std::random_device rd; +//extern std::mt19937 gen; +//extern std::uniform_int_distribution<> cheat_id; #include "Ui.h" -#include "Util.h" - -namespace fs = std::experimental::filesystem; \ No newline at end of file +#include "Util.h" \ No newline at end of file diff --git a/Files/CheatMenu/json/radar sprite.json b/Files/CheatMenu/json/radar sprite.json new file mode 100644 index 0000000..2138a1f --- /dev/null +++ b/Files/CheatMenu/json/radar sprite.json @@ -0,0 +1,66 @@ +{ + "0": "No sprite", + "1": "White sprite", + "10": "Burgershot sprite", + "11": "Bulldozer sprite", + "12": "Catalinapink sprite", + "13": "Cesarviapando sprite", + "14": "Chicken sprite", + "15": "Cj sprite", + "16": "Crash1 sprite", + "17": "Diner sprite", + "18": "Emmetgun sprite", + "19": "Enemyattack sprite", + "2": "Centre sprite", + "20": "Fire sprite", + "21": "Girlfriend sprite", + "22": "Hostpital sprite", + "23": "Logosyndicate sprite", + "24": "Maddog sprite", + "25": "Mafiacasino sprite", + "26": "Mcstrap sprite", + "27": "Modgarage sprite", + "28": "Ogloc sprite", + "29": "Pizza sprite", + "3": "Map sprite", + "30": "Police sprite", + "31": "Propertyg sprite", + "32": "Propertyr sprite", + "33": "Race sprite", + "34": "Ryder sprite", + "35": "Savegame sprite", + "36": "School sprite", + "37": "Qmark sprite", + "38": "Sweet sprite", + "39": "Tattoo sprite", + "4": "North sprite", + "40": "Thetruth sprite", + "41": "Waypoint sprite", + "42": "Torenoranch sprite", + "43": "Triads sprite", + "44": "Triadscasino sprite", + "45": "Tshirt sprite", + "46": "Woozie sprite", + "47": "Zero sprite", + "48": "Datedisco sprite", + "49": "Datedrink sprite", + "5": "Airport sprite", + "50": "Datefood sprite", + "51": "Truck sprite", + "52": "Cash sprite", + "53": "Flag sprite", + "54": "Gym sprite", + "55": "Impound sprite", + "56": "Light sprite", + "57": "Runway sprite", + "58": "Gangb sprite", + "59": "Gangp sprite", + "6": "Ammunation sprite", + "60": "Gangy sprite", + "61": "Gangn sprite", + "62": "Gangg sprite", + "63": "Sprayshop sprite", + "7": "Barber sprite", + "8": "Bigsmoke sprite", + "9": "Boatyard sprite" +} diff --git a/Files/CheatMenu/json/teleport.json b/Files/CheatMenu/json/teleport.json index 4fbc28a..3a4375a 100644 --- a/Files/CheatMenu/json/teleport.json +++ b/Files/CheatMenu/json/teleport.json @@ -420,6 +420,7 @@ "Oyster 8": "0, 1249, -2687, -1", "Oyster 9": "0, 725, -1849, -5" }, + "Radar": null, "Snapshots": { "Snapshot 1": "0, -2511.28, -672.99, 195.75", "Snapshot 10": "0, -2773.04, 783.45, 67.66", diff --git a/Files/CheatMenu/vehicles/paintjobs/carbonfiber.png b/Files/CheatMenu/vehicles/paintjobs/Default/carbonfiber.png similarity index 100% rename from Files/CheatMenu/vehicles/paintjobs/carbonfiber.png rename to Files/CheatMenu/vehicles/paintjobs/Default/carbonfiber.png diff --git a/Files/CheatMenu/vehicles/paintjobs/stickerbomb.png b/Files/CheatMenu/vehicles/paintjobs/Default/stickerbomb.png similarity index 100% rename from Files/CheatMenu/vehicles/paintjobs/stickerbomb.png rename to Files/CheatMenu/vehicles/paintjobs/Default/stickerbomb.png diff --git a/Files/CheatMenu/vehicles/paintjobs/uvtest.png b/Files/CheatMenu/vehicles/paintjobs/Default/uvtest.png similarity index 100% rename from Files/CheatMenu/vehicles/paintjobs/uvtest.png rename to Files/CheatMenu/vehicles/paintjobs/Default/uvtest.png