Updates to checkboxes, added back teleporting to radar sprites
This commit is contained in:
parent
2cf0915bf7
commit
bbbd30b8b1
@ -78,6 +78,7 @@ CheatMenu::CheatMenu()
|
||||
// Load menu settings
|
||||
Globals::menu_size.x = config.GetValue<float>("window.sizeX", screen::GetScreenWidth() / 4.0f);
|
||||
Globals::menu_size.y = config.GetValue<float>("window.sizeY", screen::GetScreenHeight() / 1.2f);
|
||||
srand(CTimer::m_snTimeInMilliseconds);
|
||||
};
|
||||
|
||||
Events::processScriptsEvent += [this]
|
||||
|
@ -111,6 +111,7 @@
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Animation.cpp" />
|
||||
<ClCompile Include="CustomWidgets.cpp" />
|
||||
<ClCompile Include="external\imgui\imgui_impl_dx11.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='GTASA zDebug|Win32'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='GTASA Release|Win32'">NotUsing</PrecompiledHeader>
|
||||
@ -176,6 +177,7 @@
|
||||
<ClCompile Include="Weapon.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CustomWidgets.h" />
|
||||
<ClInclude Include="Events.h" />
|
||||
<ClInclude Include="Animation.h" />
|
||||
<ClInclude Include="external\imgui\imgui_impl_dx11.h" />
|
||||
|
@ -41,6 +41,7 @@
|
||||
<ClCompile Include="Paint.cpp" />
|
||||
<ClCompile Include="external\kiero\kiero.cpp" />
|
||||
<ClCompile Include="external\imgui\imgui_impl_dx11.cpp" />
|
||||
<ClCompile Include="CustomWidgets.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="CheatMenu.h" />
|
||||
@ -94,6 +95,7 @@
|
||||
<ClInclude Include="external\kiero\minhook\include\MinHook.h" />
|
||||
<ClInclude Include="external\imgui\imgui_impl_dx11.h" />
|
||||
<ClInclude Include="external\imgui\stb_image.h" />
|
||||
<ClInclude Include="CustomWidgets.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="external">
|
||||
|
90
CheatMenu/CustomWidgets.cpp
Normal file
90
CheatMenu/CustomWidgets.cpp
Normal file
@ -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;
|
||||
}
|
7
CheatMenu/CustomWidgets.h
Normal file
7
CheatMenu/CustomWidgets.h
Normal file
@ -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);
|
||||
};
|
||||
|
@ -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++)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -23,7 +23,7 @@ CJson::CJson(const char* name,bool create_new)
|
||||
}
|
||||
}
|
||||
|
||||
void CJson::LoadJsonData(std::vector<std::string>& vec, std::string& selected)
|
||||
void CJson::LoadJsonData(std::vector<std::string>& vec, std::string& selected) // Test
|
||||
{
|
||||
for (auto element : data.items())
|
||||
vec.push_back(element.key());
|
||||
|
@ -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 <typename T>
|
||||
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 <typename T>
|
||||
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<std::string>& vec, std::string& selected);
|
||||
CJson(const char* text, bool create_new = false);
|
||||
virtual ~CJson();
|
||||
|
@ -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>();
|
||||
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<Commands::FREEZE_CHAR_POSITION_AND_DONT_LOAD_COLLISION>(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<Commands::SET_VEHICLE_AREA_VISIBLE>(CPools::GetVehicleRef(player->m_pVehicle), interior_id); // setvehicleinterior
|
||||
}
|
||||
else
|
||||
{
|
||||
player->Teleport(CVector(pos->x, pos->y, pos->z), false);
|
||||
}
|
||||
|
||||
Command<Commands::SET_CHAR_AREA_VISIBLE>(CPools::GetPedRef(player), interior_id); // setcharinterior
|
||||
Command<Commands::SET_AREA_VISIBLE>(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();
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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<std::string>& combo_items, std::string& selected_item, ImGuiTextFilter& filter,
|
||||
|
@ -6,14 +6,21 @@ void Util::ClearCharTasksVehCheck(CPed* ped)
|
||||
{
|
||||
uint hped = CPools::GetPedRef(ped);
|
||||
uint hveh = NULL;
|
||||
bool veh_engine = true;
|
||||
|
||||
if (Command<Commands::IS_CHAR_IN_ANY_CAR>(hped))
|
||||
{
|
||||
hveh = CPools::GetVehicleRef(ped->m_pVehicle);
|
||||
veh_engine = ped->m_pVehicle->m_nVehicleFlags.bEngineOn;
|
||||
}
|
||||
|
||||
Command<Commands::CLEAR_CHAR_TASKS_IMMEDIATELY>(hped);
|
||||
|
||||
if (hveh)
|
||||
{
|
||||
Command<Commands::TASK_WARP_CHAR_INTO_CAR_AS_DRIVER>(hped, hveh);
|
||||
ped->m_pVehicle->m_nVehicleFlags.bEngineOn = veh_engine;
|
||||
}
|
||||
}
|
||||
|
||||
void Util::LoadTexturesInDirRecursive(const char * path, const char * file_ext,std::vector<std::string>& category_vec, std::vector<std::unique_ptr<TextureStructure>> &store_vec)
|
||||
|
@ -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<std::string>& category_vec, std::vector<std::unique_ptr<TextureStructure>> &store_vec);
|
||||
static bool IsOnMission();
|
||||
|
@ -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,14 +93,9 @@ Vehicle::Vehicle()
|
||||
{
|
||||
int hveh = CPools::GetVehicleRef(veh);
|
||||
|
||||
Command<Commands::SET_CAR_ENGINE_ON>(hveh, !veh_engine);
|
||||
Command<Commands::SET_CAR_HEAVY>(hveh, veh_heavy);
|
||||
Command<Commands::SET_CHAR_CAN_BE_KNOCKED_OFF_BIKE>(hplayer, !dont_fall_bike);
|
||||
Command<Commands::SET_CAR_WATERTIGHT>(hveh, veh_watertight);
|
||||
veh->m_bIsVisible = !veh_invisible;
|
||||
|
||||
if (veh_no_dmg)
|
||||
Command<Commands::SET_CAR_CAN_BE_DAMAGED>(hveh, false);
|
||||
|
||||
if (unlimited_nitro::enabled && player->m_pVehicle->m_nVehicleSubClass == VEHICLE_AUTOMOBILE)
|
||||
{
|
||||
@ -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<Commands::IS_CHAR_IN_ANY_CAR>(hplayer))
|
||||
{
|
||||
int hveh = CPools::GetVehicleRef(player->m_pVehicle);
|
||||
Command<Commands::FORCE_CAR_LIGHTS>(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<Commands::IS_CHAR_IN_ANY_CAR>(hplayer))
|
||||
{
|
||||
int hveh = CPools::GetVehicleRef(player->m_pVehicle);
|
||||
int door;
|
||||
Command<Commands::GET_CAR_DOOR_LOCK_STATUS>(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<Commands::IS_CHAR_IN_ANY_CAR>(hplayer))
|
||||
{
|
||||
int hveh = CPools::GetVehicleRef(player->m_pVehicle);
|
||||
|
||||
if (doors_locked)
|
||||
Command<Commands::LOCK_CAR_DOORS>(hveh, CARLOCK_LOCKED_PLAYER_INSIDE);
|
||||
else
|
||||
Command<Commands::LOCK_CAR_DOORS>(hveh, CARLOCK_UNLOCKED);
|
||||
}
|
||||
}
|
||||
|
||||
if (Ui::CheckboxWithHint("No damage", &veh_no_dmg))
|
||||
{
|
||||
if (Command<Commands::IS_CHAR_IN_ANY_CAR>(hplayer))
|
||||
{
|
||||
int hveh = CPools::GetVehicleRef(player->m_pVehicle);
|
||||
|
||||
if (!veh_no_dmg)
|
||||
Command<Commands::SET_CAR_CAN_BE_DAMAGED>(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\
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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 <ctime>
|
||||
#include <d3d9.h>
|
||||
#include <d3d11.h>
|
||||
#include <d3d11Shader.h>
|
||||
@ -17,7 +16,7 @@
|
||||
#include <fstream>
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <random>
|
||||
#include <stdlib.h>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <windows.h>
|
||||
@ -61,6 +60,7 @@
|
||||
// Globals
|
||||
typedef std::vector<std::pair<std::string, void(*)(void)>> 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;
|
66
Files/CheatMenu/json/radar sprite.json
Normal file
66
Files/CheatMenu/json/radar sprite.json
Normal file
@ -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"
|
||||
}
|
@ -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",
|
||||
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 721 KiB After Width: | Height: | Size: 721 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 45 KiB |
Loading…
Reference in New Issue
Block a user