2023-08-19 11:01:08 +00:00
|
|
|
#include "pointers.hpp"
|
2023-06-24 23:12:20 +02:00
|
|
|
#include "util/entity.hpp"
|
|
|
|
#include "util/notify.hpp"
|
2023-06-27 14:05:44 +02:00
|
|
|
#include "util/ped.hpp"
|
2023-06-24 23:12:20 +02:00
|
|
|
#include "util/vehicle.hpp"
|
2023-06-27 14:05:44 +02:00
|
|
|
#include "views/view.hpp"
|
2023-04-07 23:08:34 +02:00
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
2023-06-27 14:05:44 +02:00
|
|
|
void view::world()
|
|
|
|
{
|
|
|
|
ImGui::SeparatorText("GUI_TAB_TIME_N_WEATHER"_T.data());
|
|
|
|
{
|
|
|
|
view::time_and_weather();
|
|
|
|
}
|
|
|
|
|
2023-11-08 23:16:10 +01:00
|
|
|
ImGui::SeparatorText("GUI_TAB_GRAVITY"_T.data());
|
|
|
|
{
|
|
|
|
view::gravity();
|
|
|
|
}
|
|
|
|
|
2023-11-05 22:39:53 +01:00
|
|
|
ImGui::SeparatorText("GUI_TAB_OCEAN"_T.data());
|
|
|
|
{
|
|
|
|
view::ocean();
|
|
|
|
}
|
|
|
|
|
2023-11-08 23:16:10 +01:00
|
|
|
ImGui::SeparatorText("GUI_TAB_WAYPOINT_N_OBJECTIVE"_T.data());
|
|
|
|
{
|
|
|
|
view::waypoint_and_objective();
|
|
|
|
}
|
|
|
|
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::SeparatorText("PED"_T.data());
|
2023-06-24 23:12:20 +02:00
|
|
|
|
2023-10-20 12:24:44 -04:00
|
|
|
components::button<ImVec2(110, 0), ImVec4(0.70196f, 0.3333f, 0.00392f, 1.f)>("VIEW_DEBUG_THREADS_KILL"_T, [] {
|
2023-06-24 23:12:20 +02:00
|
|
|
for (auto peds : entity::get_entities(false, true))
|
|
|
|
{
|
2023-06-27 14:05:44 +02:00
|
|
|
if (!PED::IS_PED_A_PLAYER(peds))
|
|
|
|
ped::kill_ped(peds);
|
2023-06-24 23:12:20 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
2023-10-20 12:24:44 -04:00
|
|
|
components::button<ImVec2(110, 0), ImVec4(0.76078f, 0.f, 0.03529f, 1.f)>("VIEW_WORLD_KILL_ENEMIES"_T, [] {
|
2023-07-05 07:30:06 +00:00
|
|
|
for (auto ped : entity::get_entities(false, true))
|
2023-06-24 23:12:20 +02:00
|
|
|
{
|
2023-07-05 07:30:06 +00:00
|
|
|
if (!PED::IS_PED_A_PLAYER(ped))
|
|
|
|
{
|
|
|
|
auto relation = PED::GET_RELATIONSHIP_BETWEEN_PEDS(ped, self::ped);
|
2023-11-09 04:34:00 -05:00
|
|
|
if (relation == 4 || relation == 5 || relation == 3)
|
2023-07-05 07:30:06 +00:00
|
|
|
ped::kill_ped(ped);
|
|
|
|
}
|
2023-06-24 23:12:20 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
// Nearby Ped Loops / Toggles
|
|
|
|
components::command_checkbox<"pedsignore">();
|
|
|
|
ImGui::SameLine(140.f);
|
|
|
|
components::command_checkbox<"pedrain">();
|
|
|
|
ImGui::SameLine(265.f);
|
|
|
|
components::command_checkbox<"riotmode">();
|
|
|
|
components::command_checkbox<"highalert">();
|
|
|
|
ImGui::SameLine(140.f);
|
|
|
|
components::command_checkbox<"pedrush">();
|
|
|
|
ImGui::SameLine();
|
|
|
|
components::command_checkbox<"autodisarm">();
|
2023-10-20 12:24:44 -04:00
|
|
|
components::options_modal("VIEW_WORLD_AUTO_DISARM"_T.data(), [] {
|
|
|
|
ImGui::Checkbox("VIEW_WORLD_NEUTRALIZE"_T.data(), &g.world.nearby.auto_disarm.neutralize);
|
2023-06-24 23:12:20 +02:00
|
|
|
});
|
|
|
|
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::SeparatorText("VEHICLES"_T.data());
|
2023-06-24 23:12:20 +02:00
|
|
|
|
2023-11-08 18:12:31 -05:00
|
|
|
components::button<ImVec2(0, 0), ImVec4(0.02745f, 0.4745f, 0.10196f, 1.f)>("MAX_VEHICLE"_T, [] {
|
2023-06-24 23:12:20 +02:00
|
|
|
for (auto vehs : entity::get_entities(true, false))
|
|
|
|
{
|
|
|
|
if (entity::take_control_of(vehs))
|
|
|
|
{
|
|
|
|
vehicle::max_vehicle(vehs);
|
|
|
|
script::get_current()->yield();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
2023-11-08 18:12:31 -05:00
|
|
|
components::button<ImVec2(0, 0), ImVec4(0.4549f, 0.03529f, 0.03529f, 1.f)>("VIEW_WORLD_DOWNGRADE"_T, [] {
|
2023-06-24 23:12:20 +02:00
|
|
|
for (auto vehs : entity::get_entities(true, false))
|
|
|
|
{
|
|
|
|
if (entity::take_control_of(vehs))
|
|
|
|
{
|
|
|
|
vehicle::downgrade(vehs);
|
|
|
|
script::get_current()->yield();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
components::command_checkbox<"vehiclerain">();
|
|
|
|
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::SeparatorText("VIEW_BLACKHOLE_ENTITIES"_T.data());
|
2023-06-24 23:12:20 +02:00
|
|
|
|
|
|
|
static bool included_entity_types[3];
|
2023-08-19 11:01:08 +00:00
|
|
|
static bool own_vehicle, deleting, force;
|
2023-06-24 23:12:20 +02:00
|
|
|
static int quantity, remaining;
|
|
|
|
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::Text("VIEW_WORLD_INCLUDE"_T.data());
|
|
|
|
ImGui::Checkbox("VEHICLES"_T.data(), &included_entity_types[0]);
|
2023-06-24 23:12:20 +02:00
|
|
|
ImGui::SameLine();
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::Checkbox("PED"_T.data(), &included_entity_types[1]);
|
2023-06-24 23:12:20 +02:00
|
|
|
ImGui::SameLine();
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::Checkbox("VIEW_WORLD_PROPS"_T.data(), &included_entity_types[2]);
|
2023-06-24 23:12:20 +02:00
|
|
|
|
|
|
|
if (included_entity_types[0])
|
2023-08-19 11:01:08 +00:00
|
|
|
{
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::Checkbox("VIEW_WORLD_SELF_VEHICLE"_T.data(), &own_vehicle);
|
2023-08-19 11:01:08 +00:00
|
|
|
ImGui::SameLine();
|
|
|
|
}
|
|
|
|
|
2023-10-20 12:24:44 -04:00
|
|
|
ImGui::Checkbox("FORCE"_T.data(), &force);
|
2023-06-24 23:12:20 +02:00
|
|
|
|
|
|
|
if (deleting)
|
|
|
|
{
|
|
|
|
float progress = 1 - static_cast<float>(remaining) / quantity;
|
|
|
|
ImGui::ProgressBar(progress, ImVec2(200, 25));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-10-20 12:24:44 -04:00
|
|
|
components::button("VIEW_WORLD_DELETE_ALL"_T, [&] {
|
2023-06-24 23:12:20 +02:00
|
|
|
auto list = entity::get_entities(included_entity_types[0], included_entity_types[1], included_entity_types[2], own_vehicle);
|
|
|
|
|
|
|
|
quantity = list.size();
|
|
|
|
remaining = quantity;
|
2024-03-23 00:04:49 +01:00
|
|
|
g_notification_service.push("GUI_TAB_TIME_N_WEATHER"_T.data(), std::format("Deleting {} entities", quantity));
|
2023-06-24 23:12:20 +02:00
|
|
|
deleting = true;
|
|
|
|
int failed = 0;
|
2023-07-05 07:30:06 +00:00
|
|
|
|
2023-06-24 23:12:20 +02:00
|
|
|
for (auto ent : list)
|
|
|
|
{
|
2023-07-05 07:30:06 +00:00
|
|
|
if (PED::IS_PED_A_PLAYER(ent))
|
2023-06-24 23:12:20 +02:00
|
|
|
continue;
|
|
|
|
|
|
|
|
if (ENTITY::DOES_ENTITY_EXIST(ent))
|
|
|
|
{
|
|
|
|
if (ENTITY::IS_ENTITY_A_VEHICLE(ent))
|
|
|
|
if (ent == self::veh && own_vehicle)
|
|
|
|
TASK::CLEAR_PED_TASKS_IMMEDIATELY(self::ped);
|
2023-06-27 14:05:44 +02:00
|
|
|
|
2023-08-19 11:01:08 +00:00
|
|
|
if (force)
|
|
|
|
{
|
|
|
|
auto ptr = g_pointers->m_gta.m_handle_to_ptr(ent);
|
|
|
|
|
|
|
|
switch (ptr->m_entity_type)
|
|
|
|
{
|
|
|
|
case 4: g_pointers->m_gta.m_delete_ped(reinterpret_cast<CPed*>(ptr)); break;
|
|
|
|
case 3: g_pointers->m_gta.m_delete_vehicle(reinterpret_cast<CVehicle*>(ptr)); break;
|
|
|
|
case 5: g_pointers->m_gta.m_delete_object(reinterpret_cast<CObject*>(ptr), false); break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (entity::take_control_of(ent, 25))
|
|
|
|
entity::delete_entity(ent);
|
|
|
|
}
|
2023-06-24 23:12:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (ENTITY::DOES_ENTITY_EXIST(ent))
|
|
|
|
failed++;
|
|
|
|
else
|
|
|
|
remaining--;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (failed > 0)
|
2024-03-23 00:04:49 +01:00
|
|
|
g_notification_service.push_warning("GUI_TAB_TIME_N_WEATHER"_T.data(), std::format("Failed deleting {} entities", failed));
|
2023-06-24 23:12:20 +02:00
|
|
|
|
|
|
|
deleting = false;
|
|
|
|
});
|
|
|
|
}
|
2023-06-27 14:05:44 +02:00
|
|
|
}
|
2024-03-23 00:04:49 +01:00
|
|
|
}
|