Add more spoofing options and added clang-format (#1020)
* feat(Spoofing): add spoofing * feat(Spoofing): prepare code for player attach * remove(PlayerAttach): isn't going to work due to netsync architecture * fix(GUI): fix scaling * feat(Project): add clang-format file * feat(Classes): update classes * fix(BlackHole): remove unnecessary cleanup * fix(Formatting): fix formatting for initializer lists * feat(clang-format): Set tab width and 1 space before comment Co-authored-by: Yimura <24669514+Yimura@users.noreply.github.com>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
#include "views/view.hpp"
|
||||
#include "pointers.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -12,12 +12,14 @@ namespace big
|
||||
static char dst_text[256];
|
||||
static char src_text[256];
|
||||
static size_t selected_index = -1;
|
||||
static float width = *g_pointers->m_resolution_x / 5.0;
|
||||
static float width = *g_pointers->m_resolution_x / 5.0;
|
||||
|
||||
ImGui::SetNextItemWidth(width);
|
||||
ImGui::InputText("Dst", dst_text, IM_ARRAYSIZE(dst_text)); ImGui::SameLine();
|
||||
ImGui::InputText("Dst", dst_text, IM_ARRAYSIZE(dst_text));
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(width);
|
||||
ImGui::InputText("Src", src_text, IM_ARRAYSIZE(src_text)); ImGui::SameLine();
|
||||
ImGui::InputText("Src", src_text, IM_ARRAYSIZE(src_text));
|
||||
ImGui::SameLine();
|
||||
|
||||
if (ImGui::Button("Add/Change"))
|
||||
{
|
||||
@ -36,7 +38,7 @@ namespace big
|
||||
transform(tmp.begin(), tmp.end(), tmp.begin(), ::tolower);
|
||||
if (str == tmp)
|
||||
{
|
||||
g.world.model_swapper.models[i].first = dst_text;
|
||||
g.world.model_swapper.models[i].first = dst_text;
|
||||
g.world.model_swapper.models[i].second = src_text;
|
||||
break;
|
||||
}
|
||||
@ -44,18 +46,21 @@ namespace big
|
||||
if (i == g.world.model_swapper.models.size())
|
||||
g.world.model_swapper.models.push_back(std::make_pair(dst_text, src_text));
|
||||
g.world.model_swapper.update = true;
|
||||
} ImGui::SameLine();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Delete"))
|
||||
{
|
||||
std::lock_guard lock(g.world.model_swapper.m);
|
||||
if (!g.world.model_swapper.models.size() || selected_index < 0 || selected_index >= g.world.model_swapper.models.size())
|
||||
if (!g.world.model_swapper.models.size() || selected_index < 0
|
||||
|| selected_index >= g.world.model_swapper.models.size())
|
||||
{
|
||||
g_notification_service->push_error("Model Swapper", "Invalid index");
|
||||
return;
|
||||
}
|
||||
g.world.model_swapper.models.erase(std::begin(g.world.model_swapper.models) + selected_index);
|
||||
g.world.model_swapper.update = true;
|
||||
} ImGui::SameLine();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Clear"))
|
||||
{
|
||||
std::lock_guard lock(g.world.model_swapper.m);
|
||||
@ -79,7 +84,8 @@ namespace big
|
||||
ImGui::SetItemDefaultFocus();
|
||||
}
|
||||
ImGui::EndListBox();
|
||||
} ImGui::SameLine();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
ImGui::SetNextItemWidth(width);
|
||||
if (ImGui::BeginListBox("Src##model_swapper_src"))
|
||||
{
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "views/view.hpp"
|
||||
#include "util/local_player.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
|
@ -1,10 +1,10 @@
|
||||
#include "fiber_pool.hpp"
|
||||
#include "script.hpp"
|
||||
#include "views/view.hpp"
|
||||
#include "services/creator_storage/creator_storage_service.hpp"
|
||||
#include "services/api/api_service.hpp"
|
||||
#include "util/scripts.hpp"
|
||||
#include "services/creator_storage/creator_storage_service.hpp"
|
||||
#include "thread_pool.hpp"
|
||||
#include "util/scripts.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
static bool cached_creator_files = false;
|
||||
static std::vector<std::string> creator_files;
|
||||
@ -16,7 +16,7 @@ namespace big
|
||||
static std::string selected_creator_file = "";
|
||||
if (!cached_creator_files)
|
||||
{
|
||||
creator_files = creator_storage_service::list_files();
|
||||
creator_files = creator_storage_service::list_files();
|
||||
cached_creator_files = true;
|
||||
}
|
||||
|
||||
@ -40,15 +40,13 @@ namespace big
|
||||
|
||||
if (!selected_creator_file.empty())
|
||||
{
|
||||
components::button("CREATOR_SAVE_TO_FILE"_T, []
|
||||
{
|
||||
components::button("CREATOR_SAVE_TO_FILE"_T, [] {
|
||||
creator_storage_service::save_file(selected_creator_file);
|
||||
});
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button("CREATOR_LOAD_FROM_FILE"_T, []
|
||||
{
|
||||
components::button("CREATOR_LOAD_FROM_FILE"_T, [] {
|
||||
creator_storage_service::load_file(selected_creator_file);
|
||||
});
|
||||
}
|
||||
@ -56,21 +54,16 @@ namespace big
|
||||
static char job_file_name_input[50]{};
|
||||
|
||||
ImGui::PushItemWidth(250);
|
||||
components::input_text_with_hint(
|
||||
"CREATOR_JOB_FILENAME"_T,
|
||||
"CREATOR_JOB_FILENAME_HINT"_T,
|
||||
job_file_name_input, IM_ARRAYSIZE(job_file_name_input));
|
||||
components::input_text_with_hint("CREATOR_JOB_FILENAME"_T, "CREATOR_JOB_FILENAME_HINT"_T, job_file_name_input, IM_ARRAYSIZE(job_file_name_input));
|
||||
|
||||
components::button("CREATOR_JOB_CREATE_FILE"_T, []
|
||||
{
|
||||
components::button("CREATOR_JOB_CREATE_FILE"_T, [] {
|
||||
cached_creator_files = false;
|
||||
creator_storage_service::create_file(std::string(job_file_name_input) + ".json");
|
||||
});
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button("REFRESH"_T, []
|
||||
{
|
||||
components::button("REFRESH"_T, [] {
|
||||
cached_creator_files = false;
|
||||
});
|
||||
|
||||
@ -79,10 +72,8 @@ namespace big
|
||||
static char job_link[69]{};
|
||||
components::input_text("CREATOR_JOB_LINK"_T, job_link, sizeof(job_link));
|
||||
|
||||
components::button("CREATOR_JOB_IMPORT"_T, []
|
||||
{
|
||||
g_thread_pool->push([]
|
||||
{
|
||||
components::button("CREATOR_JOB_IMPORT"_T, [] {
|
||||
g_thread_pool->push([] {
|
||||
std::string content_id = job_link;
|
||||
nlohmann::json job_details;
|
||||
if (content_id.starts_with("https://"))
|
||||
@ -100,14 +91,19 @@ namespace big
|
||||
if (g_api_service->download_job_metadata(content_id, f1 < 0 ? 0 : f1, f0 < 0 ? 0 : f0, NETWORK::UGC_GET_CONTENT_LANGUAGE(0)))
|
||||
{
|
||||
cached_creator_files = false;
|
||||
g_notification_service->push("CREATOR_JOB_IMPORT_NOTIFICATION"_T.data(), "CREATOR_JOB_IMPORT_SUCCESS"_T.data());
|
||||
g_notification_service->push("CREATOR_JOB_IMPORT_NOTIFICATION"_T.data(),
|
||||
"CREATOR_JOB_IMPORT_SUCCESS"_T.data());
|
||||
}
|
||||
else {
|
||||
g_notification_service->push_error("CREATOR_JOB_IMPORT_NOTIFICATION"_T.data(), "CREATOR_JOB_FAILED_METADATA_FETCH"_T.data());
|
||||
else
|
||||
{
|
||||
g_notification_service->push_error("CREATOR_JOB_IMPORT_NOTIFICATION"_T.data(),
|
||||
"CREATOR_JOB_FAILED_METADATA_FETCH"_T.data());
|
||||
}
|
||||
}
|
||||
else {
|
||||
g_notification_service->push_error("CREATOR_JOB_IMPORT_NOTIFICATION"_T.data(), "CREATOR_JOB_UGC_QUERY_FAILED"_T.data());
|
||||
else
|
||||
{
|
||||
g_notification_service->push_error("CREATOR_JOB_IMPORT_NOTIFICATION"_T.data(),
|
||||
"CREATOR_JOB_UGC_QUERY_FAILED"_T.data());
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -117,10 +113,21 @@ namespace big
|
||||
|
||||
components::sub_title("CREATOR_LAUNCH"_T);
|
||||
ImGui::BeginGroup();
|
||||
components::button("RACE"_T, [] { scripts::start_creator_script(RAGE_JOAAT("fm_race_creator")); }); ImGui::SameLine();
|
||||
components::button("CAPTURE"_T, [] { scripts::start_creator_script(RAGE_JOAAT("fm_capture_creator")); }); ImGui::SameLine();
|
||||
components::button("DEATHMATCH"_T, [] { scripts::start_creator_script(RAGE_JOAAT("fm_deathmatch_creator")); }); ImGui::SameLine();
|
||||
components::button("LTS"_T, [] { scripts::start_creator_script(RAGE_JOAAT("fm_lts_creator")); });
|
||||
components::button("RACE"_T, [] {
|
||||
scripts::start_creator_script(RAGE_JOAAT("fm_race_creator"));
|
||||
});
|
||||
ImGui::SameLine();
|
||||
components::button("CAPTURE"_T, [] {
|
||||
scripts::start_creator_script(RAGE_JOAAT("fm_capture_creator"));
|
||||
});
|
||||
ImGui::SameLine();
|
||||
components::button("DEATHMATCH"_T, [] {
|
||||
scripts::start_creator_script(RAGE_JOAAT("fm_deathmatch_creator"));
|
||||
});
|
||||
ImGui::SameLine();
|
||||
components::button("LTS"_T, [] {
|
||||
scripts::start_creator_script(RAGE_JOAAT("fm_lts_creator"));
|
||||
});
|
||||
ImGui::EndGroup();
|
||||
|
||||
components::sub_title("CREATOR_OPTIONS"_T);
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "views/view.hpp"
|
||||
#include "util/local_player.hpp"
|
||||
#include "util/entity.hpp"
|
||||
#include "util/local_player.hpp"
|
||||
#include "util/ped.hpp"
|
||||
#include "util/vehicle.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -10,57 +10,54 @@ namespace big
|
||||
{
|
||||
components::sub_title("Peds");
|
||||
// Nearby Ped Actions
|
||||
components::button<ImVec2(110, 0)>
|
||||
("Delete", []
|
||||
{
|
||||
for (auto peds : entity::get_entities(false, true))
|
||||
{
|
||||
entity::delete_entity(peds);
|
||||
}
|
||||
}); ImGui::SameLine();
|
||||
components::button<ImVec2(110, 0)>("Delete", [] {
|
||||
for (auto peds : entity::get_entities(false, true))
|
||||
{
|
||||
entity::delete_entity(peds);
|
||||
}
|
||||
});
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button<ImVec2(110, 0), ImVec4(0.70196f, 0.3333f, 0.00392f, 1.f)>
|
||||
("Kill", []
|
||||
{
|
||||
for (auto peds : entity::get_entities(false, true))
|
||||
{
|
||||
ped::kill_ped(peds);
|
||||
}
|
||||
}); ImGui::SameLine();
|
||||
components::button<ImVec2(110, 0), ImVec4(0.70196f, 0.3333f, 0.00392f, 1.f)>("Kill", [] {
|
||||
for (auto peds : entity::get_entities(false, true))
|
||||
{
|
||||
ped::kill_ped(peds);
|
||||
}
|
||||
});
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button<ImVec2(110, 0), ImVec4(0.76078f, 0.f, 0.03529f, 1.f)>("Kill Enemies", [] {
|
||||
for (auto peds : entity::get_entities(false, true))
|
||||
{
|
||||
ped::kill_ped_by_relation(peds, 4 || 5);
|
||||
}
|
||||
});
|
||||
|
||||
components::button<ImVec2(110, 0), ImVec4(0.76078f, 0.f, 0.03529f, 1.f)>
|
||||
("Kill Enemies", []
|
||||
{
|
||||
for (auto peds : entity::get_entities(false, true))
|
||||
{
|
||||
ped::kill_ped_by_relation(peds, 4 || 5);
|
||||
}
|
||||
});
|
||||
|
||||
// Nearby Ped Loops / Toggles
|
||||
components::command_checkbox<"pedsignore">(); ImGui::SameLine(140.f);
|
||||
components::command_checkbox<"pedrain">();
|
||||
components::command_checkbox<"highalert">(); ImGui::SameLine(140.f);
|
||||
components::command_checkbox<"pedsignore">();
|
||||
ImGui::SameLine(140.f);
|
||||
components::command_checkbox<"pedrain">();
|
||||
components::command_checkbox<"highalert">();
|
||||
ImGui::SameLine(140.f);
|
||||
components::command_checkbox<"pedrush">();
|
||||
|
||||
ImGui::Separator();
|
||||
components::sub_title("Vehicles");
|
||||
// Nearby Vehicle Actions
|
||||
|
||||
components::button<ImVec2(110, 0), ImVec4(0.02745f, 0.4745f, 0.10196f, 1.f)>
|
||||
("Max Upgrade", [] {
|
||||
components::button<ImVec2(110, 0), ImVec4(0.02745f, 0.4745f, 0.10196f, 1.f)>("Max Upgrade", [] {
|
||||
for (auto vehs : entity::get_entities(true, false))
|
||||
{
|
||||
if (entity::take_control_of(vehs))
|
||||
if (entity::take_control_of(vehs))
|
||||
{
|
||||
vehicle::max_vehicle(vehs);
|
||||
script::get_current()->yield();
|
||||
}
|
||||
}
|
||||
}); ImGui::SameLine();
|
||||
});
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button<ImVec2(110, 0), ImVec4(0.4549f, 0.03529f, 0.03529f, 1.f)>
|
||||
("Downgrade", [] {
|
||||
components::button<ImVec2(110, 0), ImVec4(0.4549f, 0.03529f, 0.03529f, 1.f)>("Downgrade", [] {
|
||||
for (auto vehs : entity::get_entities(true, false))
|
||||
{
|
||||
if (entity::take_control_of(vehs))
|
||||
@ -70,7 +67,7 @@ namespace big
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
components::command_checkbox<"vehiclerain">();
|
||||
}
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
#include "backend/looped/looped.hpp"
|
||||
#include "fiber_pool.hpp"
|
||||
#include "script.hpp"
|
||||
#include "natives.hpp"
|
||||
#include "pointers.hpp"
|
||||
#include "views/view.hpp"
|
||||
#include "util/ped.hpp"
|
||||
#include "script.hpp"
|
||||
#include "services/gta_data/gta_data_service.hpp"
|
||||
#include "services/model_preview/model_preview_service.hpp"
|
||||
#include "services/players/player_service.hpp"
|
||||
#include "backend/looped/looped.hpp"
|
||||
#include "util/ped.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include <imgui_internal.h>
|
||||
|
||||
@ -18,14 +18,12 @@
|
||||
#define SPAWN_PED_FOR_SELF -1
|
||||
#define SPAWN_PED_FOR_EVERYONE -2
|
||||
|
||||
static int selected_ped_weapon_type = SPAWN_PED_ALL_WEAPONS;
|
||||
static int selected_ped_weapon_type = SPAWN_PED_ALL_WEAPONS;
|
||||
static Hash selected_ped_weapon_hash = 0;
|
||||
|
||||
namespace big
|
||||
{
|
||||
void spawn_ped_give_weapon(
|
||||
const Ped ped
|
||||
)
|
||||
void spawn_ped_give_weapon(const Ped ped)
|
||||
{
|
||||
if (selected_ped_weapon_type == SPAWN_PED_NO_WEAPONS)
|
||||
{
|
||||
@ -35,16 +33,9 @@ namespace big
|
||||
const auto& weapon_type_arr = g_gta_data_service->weapon_types();
|
||||
for (auto& [_, weapon] : g_gta_data_service->weapons())
|
||||
{
|
||||
if (
|
||||
selected_ped_weapon_type == SPAWN_PED_ALL_WEAPONS ||
|
||||
weapon.m_weapon_type == weapon_type_arr[selected_ped_weapon_type]
|
||||
)
|
||||
if (selected_ped_weapon_type == SPAWN_PED_ALL_WEAPONS || weapon.m_weapon_type == weapon_type_arr[selected_ped_weapon_type])
|
||||
{
|
||||
if (
|
||||
(selected_ped_weapon_hash == 0 ||
|
||||
weapon.m_hash == selected_ped_weapon_hash)
|
||||
&& weapon.m_hash != RAGE_JOAAT("WEAPON_UNARMED")
|
||||
)
|
||||
if ((selected_ped_weapon_hash == 0 || weapon.m_hash == selected_ped_weapon_hash) && weapon.m_hash != RAGE_JOAAT("WEAPON_UNARMED"))
|
||||
{
|
||||
WEAPON::GIVE_WEAPON_TO_PED(ped, weapon.m_hash, 9999, false, selected_ped_weapon_hash != 0);
|
||||
}
|
||||
@ -52,13 +43,8 @@ namespace big
|
||||
}
|
||||
}
|
||||
|
||||
Ped spawn_ped_at_location(
|
||||
const int selected_ped_type,
|
||||
const char* ped_model_buf,
|
||||
const Player selected_ped_player_id,
|
||||
const Player selected_ped_for_player_id,
|
||||
const bool is_bodyguard
|
||||
) {
|
||||
Ped spawn_ped_at_location(const int selected_ped_type, const char* ped_model_buf, const Player selected_ped_player_id, const Player selected_ped_for_player_id, const bool is_bodyguard)
|
||||
{
|
||||
Hash hash = 0;
|
||||
Ped clone = 0;
|
||||
Vector3 location;
|
||||
@ -70,7 +56,7 @@ namespace big
|
||||
if (selected_ped_player_id == -1)
|
||||
{
|
||||
clone = self::ped;
|
||||
hash = ENTITY::GET_ENTITY_MODEL(clone);
|
||||
hash = ENTITY::GET_ENTITY_MODEL(clone);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -82,7 +68,7 @@ namespace big
|
||||
}
|
||||
|
||||
clone = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(plyr->id());
|
||||
hash = ENTITY::GET_ENTITY_MODEL(clone);
|
||||
hash = ENTITY::GET_ENTITY_MODEL(clone);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -93,8 +79,8 @@ namespace big
|
||||
|
||||
if (selected_ped_for_player_id == SPAWN_PED_FOR_SELF)
|
||||
{
|
||||
location = self::pos;
|
||||
player = self::id;
|
||||
location = self::pos;
|
||||
player = self::id;
|
||||
player_ped = self::ped;
|
||||
}
|
||||
else
|
||||
@ -111,7 +97,7 @@ namespace big
|
||||
location.x = player_pos.x;
|
||||
location.y = player_pos.y;
|
||||
location.z = player_pos.z;
|
||||
player = plyr->id();
|
||||
player = plyr->id();
|
||||
player_ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(player);
|
||||
}
|
||||
|
||||
@ -194,25 +180,28 @@ namespace big
|
||||
}
|
||||
|
||||
spawn_ped_give_weapon(ped);
|
||||
spawned_peds.push_back({ ped, selected_ped_for_player_id == SPAWN_PED_FOR_SELF ? self::id : selected_ped_for_player_id, is_bodyguard, g.world.spawn_ped.spawn_as_attacker });
|
||||
spawned_peds.push_back({ped,
|
||||
selected_ped_for_player_id == SPAWN_PED_FOR_SELF ? self::id : selected_ped_for_player_id,
|
||||
is_bodyguard,
|
||||
g.world.spawn_ped.spawn_as_attacker});
|
||||
return ped;
|
||||
}
|
||||
|
||||
void view::spawn_ped()
|
||||
{
|
||||
static int selected_ped_type = -2;
|
||||
static int selected_ped_type = -2;
|
||||
static bool ped_model_dropdown_open = false;
|
||||
static char ped_model_buf[64];
|
||||
static Player selected_ped_player_id = -1;
|
||||
|
||||
auto& ped_type_arr = g_gta_data_service->ped_types();
|
||||
auto& ped_arr = g_gta_data_service->peds();
|
||||
auto& ped_arr = g_gta_data_service->peds();
|
||||
|
||||
auto& weapon_type_arr = g_gta_data_service->weapon_types();
|
||||
auto& weapon_arr = g_gta_data_service->weapons();
|
||||
auto& weapon_arr = g_gta_data_service->weapons();
|
||||
|
||||
static Player selected_ped_for_player_id = -1;
|
||||
auto& player_arr = g_player_service->players();
|
||||
auto& player_arr = g_player_service->players();
|
||||
|
||||
if (!*g_pointers->m_is_session_started)
|
||||
{
|
||||
@ -228,7 +217,8 @@ namespace big
|
||||
selected_ped_player_id = -1;
|
||||
}
|
||||
|
||||
if (selected_ped_for_player_id != SPAWN_PED_FOR_SELF && selected_ped_for_player_id != SPAWN_PED_FOR_EVERYONE && g_player_service->get_by_id(selected_ped_for_player_id) == nullptr)
|
||||
if (selected_ped_for_player_id != SPAWN_PED_FOR_SELF && selected_ped_for_player_id != SPAWN_PED_FOR_EVERYONE
|
||||
&& g_player_service->get_by_id(selected_ped_for_player_id) == nullptr)
|
||||
{
|
||||
selected_ped_for_player_id = SPAWN_PED_FOR_SELF;
|
||||
}
|
||||
@ -241,13 +231,11 @@ namespace big
|
||||
ImGui::Text("PED_TYPE"_T.data());
|
||||
|
||||
ImGui::SetNextItemWidth(160.f);
|
||||
if (ImGui::BeginCombo(
|
||||
"##ped_type",
|
||||
selected_ped_type == -1 ? "ALL"_T.data() :
|
||||
selected_ped_type == -2 ? "ONLINE_PLAYER"_T.data() :
|
||||
ped_type_arr[selected_ped_type].c_str()
|
||||
)) {
|
||||
|
||||
if (ImGui::BeginCombo("##ped_type",
|
||||
selected_ped_type == -1 ? "ALL"_T.data() :
|
||||
selected_ped_type == -2 ? "ONLINE_PLAYER"_T.data() :
|
||||
ped_type_arr[selected_ped_type].c_str()))
|
||||
{
|
||||
if (ImGui::Selectable("ONLINE_PLAYER"_T.data(), selected_ped_type == -2))
|
||||
{
|
||||
selected_ped_type = -2;
|
||||
@ -263,7 +251,7 @@ namespace big
|
||||
if (ImGui::Selectable(ped_type_arr[i].c_str(), selected_ped_type == i))
|
||||
{
|
||||
selected_ped_type = i;
|
||||
ped_model_buf[0] = 0;
|
||||
ped_model_buf[0] = 0;
|
||||
}
|
||||
|
||||
if (selected_ped_type == i)
|
||||
@ -286,12 +274,10 @@ namespace big
|
||||
ImGui::Text("PLAYER"_T.data());
|
||||
|
||||
ImGui::SetNextItemWidth(240.f);
|
||||
if (ImGui::BeginCombo(
|
||||
"##ped_player",
|
||||
selected_ped_player_id == -1 ?
|
||||
"SELF"_T.data() :
|
||||
g_player_service->get_by_id(selected_ped_player_id)->get_name()
|
||||
)) {
|
||||
if (ImGui::BeginCombo("##ped_player",
|
||||
selected_ped_player_id == -1 ? "SELF"_T.data() :
|
||||
g_player_service->get_by_id(selected_ped_player_id)->get_name()))
|
||||
{
|
||||
if (ImGui::Selectable("SELF"_T.data(), selected_ped_player_id == -1))
|
||||
{
|
||||
selected_ped_player_id = -1;
|
||||
@ -304,10 +290,10 @@ namespace big
|
||||
else if (ImGui::IsItemHovered())
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
Ped ped = self::ped;
|
||||
Ped ped = self::ped;
|
||||
Hash hash = ENTITY::GET_ENTITY_MODEL(ped);
|
||||
g_model_preview_service->show_ped(hash, ped);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
if (selected_ped_player_id == -1)
|
||||
@ -319,7 +305,7 @@ namespace big
|
||||
{
|
||||
for (auto& item : player_arr)
|
||||
{
|
||||
auto plyr = item.second;
|
||||
auto plyr = item.second;
|
||||
auto plyr_id = plyr->id();
|
||||
|
||||
ImGui::PushID(plyr_id);
|
||||
@ -335,16 +321,14 @@ namespace big
|
||||
else if (ImGui::IsItemHovered())
|
||||
{
|
||||
g_fiber_pool->queue_job([plyr_id] {
|
||||
|
||||
auto plyr = g_player_service->get_by_id(plyr_id);
|
||||
if (plyr)
|
||||
{
|
||||
Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(plyr->id());
|
||||
Ped ped = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(plyr->id());
|
||||
Hash hash = ENTITY::GET_ENTITY_MODEL(ped);
|
||||
g_model_preview_service->show_ped(hash, ped);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
ImGui::PopID();
|
||||
|
||||
@ -367,13 +351,9 @@ namespace big
|
||||
ImGui::Text("MODEL_NAME"_T.data());
|
||||
|
||||
ImGui::SetNextItemWidth(240.f);
|
||||
components::input_text_with_hint(
|
||||
"##ped_model_name", "MODEL_NAME"_T,
|
||||
ped_model_buf, sizeof(ped_model_buf), ImGuiInputTextFlags_EnterReturnsTrue,
|
||||
[] {
|
||||
ped_model_dropdown_open = false;
|
||||
}
|
||||
);
|
||||
components::input_text_with_hint("##ped_model_name", "MODEL_NAME"_T, ped_model_buf, sizeof(ped_model_buf), ImGuiInputTextFlags_EnterReturnsTrue, [] {
|
||||
ped_model_dropdown_open = false;
|
||||
});
|
||||
}
|
||||
ImGui::EndGroup();
|
||||
|
||||
@ -388,14 +368,14 @@ namespace big
|
||||
|
||||
if (ped_model_dropdown_open)
|
||||
{
|
||||
bool is_open = true;
|
||||
bool is_open = true;
|
||||
bool item_hovered = false;
|
||||
|
||||
std::string lower_search = ped_model_buf;
|
||||
std::transform(lower_search.begin(), lower_search.end(), lower_search.begin(), tolower);
|
||||
|
||||
ImGui::SetNextWindowPos({ ImGui::GetItemRectMin().x, ImGui::GetItemRectMax().y });
|
||||
ImGui::SetNextWindowSize({ 300, 300 });
|
||||
ImGui::SetNextWindowPos({ImGui::GetItemRectMin().x, ImGui::GetItemRectMax().y});
|
||||
ImGui::SetNextWindowSize({300, 300});
|
||||
if (ImGui::Begin("##player_model_popup", &is_open, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_Tooltip))
|
||||
{
|
||||
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
|
||||
@ -404,16 +384,12 @@ namespace big
|
||||
for (const auto& [_, item] : ped_arr)
|
||||
{
|
||||
std::string ped_type = item.m_ped_type;
|
||||
std::string name = item.m_name;
|
||||
std::string name = item.m_name;
|
||||
|
||||
std::transform(name.begin(), name.end(), name.begin(), tolower);
|
||||
|
||||
if ((
|
||||
selected_ped_type == -1 || ped_type_arr[selected_ped_type] == ped_type
|
||||
) && (
|
||||
name.find(lower_search) != std::string::npos
|
||||
)) {
|
||||
|
||||
if ((selected_ped_type == -1 || ped_type_arr[selected_ped_type] == ped_type) && (name.find(lower_search) != std::string::npos))
|
||||
{
|
||||
bool selectable_highlighted = lower_search == name;
|
||||
bool selectable_clicked = ImGui::Selectable(item.m_name, selectable_highlighted);
|
||||
ped_model_dropdown_focused |= ImGui::IsItemFocused();
|
||||
@ -421,7 +397,7 @@ namespace big
|
||||
if (selectable_clicked)
|
||||
{
|
||||
strncpy(ped_model_buf, item.m_name, 64);
|
||||
ped_model_dropdown_open = false;
|
||||
ped_model_dropdown_open = false;
|
||||
ped_model_dropdown_focused = false;
|
||||
}
|
||||
|
||||
@ -460,14 +436,11 @@ namespace big
|
||||
ImGui::Text("WEAPON_TYPE"_T.data());
|
||||
|
||||
ImGui::SetNextItemWidth(160.f);
|
||||
if (ImGui::BeginCombo(
|
||||
"##ped_weapon_type",
|
||||
selected_ped_weapon_type == SPAWN_PED_ALL_WEAPONS ?
|
||||
"ALL"_T.data() :
|
||||
selected_ped_weapon_type == SPAWN_PED_NO_WEAPONS ?
|
||||
"NO_WEAPONS"_T.data() :
|
||||
weapon_type_arr[selected_ped_weapon_type].c_str()
|
||||
)) {
|
||||
if (ImGui::BeginCombo("##ped_weapon_type",
|
||||
selected_ped_weapon_type == SPAWN_PED_ALL_WEAPONS ? "ALL"_T.data() :
|
||||
selected_ped_weapon_type == SPAWN_PED_NO_WEAPONS ? "NO_WEAPONS"_T.data() :
|
||||
weapon_type_arr[selected_ped_weapon_type].c_str()))
|
||||
{
|
||||
if (ImGui::Selectable("ALL"_T.data(), selected_ped_weapon_type == SPAWN_PED_ALL_WEAPONS))
|
||||
{
|
||||
selected_ped_weapon_type = SPAWN_PED_ALL_WEAPONS;
|
||||
@ -514,14 +487,11 @@ namespace big
|
||||
ImGui::Text("WEAPON"_T.data());
|
||||
|
||||
ImGui::SetNextItemWidth(240.f);
|
||||
if (ImGui::BeginCombo(
|
||||
"##ped_weapon",
|
||||
selected_ped_weapon_type == SPAWN_PED_NO_WEAPONS ?
|
||||
"NO_WEAPONS"_T.data() :
|
||||
selected_ped_weapon_hash == 0 ?
|
||||
"ALL"_T.data() :
|
||||
g_gta_data_service->weapon_by_hash(selected_ped_weapon_hash).m_display_name
|
||||
)) {
|
||||
if (ImGui::BeginCombo("##ped_weapon",
|
||||
selected_ped_weapon_type == SPAWN_PED_NO_WEAPONS ? "NO_WEAPONS"_T.data() :
|
||||
selected_ped_weapon_hash == 0 ? "ALL"_T.data() :
|
||||
g_gta_data_service->weapon_by_hash(selected_ped_weapon_hash).m_display_name))
|
||||
{
|
||||
if (selected_ped_weapon_type != SPAWN_PED_NO_WEAPONS)
|
||||
{
|
||||
if (ImGui::Selectable("ALL"_T.data(), selected_ped_weapon_hash == 0))
|
||||
@ -536,10 +506,8 @@ namespace big
|
||||
|
||||
for (const auto& [_, weapon] : weapon_arr)
|
||||
{
|
||||
if (
|
||||
selected_ped_weapon_type == SPAWN_PED_ALL_WEAPONS ||
|
||||
weapon.m_weapon_type == weapon_type_arr[selected_ped_weapon_type]
|
||||
) {
|
||||
if (selected_ped_weapon_type == SPAWN_PED_ALL_WEAPONS || weapon.m_weapon_type == weapon_type_arr[selected_ped_weapon_type])
|
||||
{
|
||||
if (ImGui::Selectable(weapon.m_display_name, weapon.m_hash == selected_ped_weapon_hash))
|
||||
{
|
||||
selected_ped_weapon_hash = weapon.m_hash;
|
||||
@ -557,21 +525,18 @@ namespace big
|
||||
}
|
||||
}
|
||||
ImGui::EndGroup();
|
||||
|
||||
}
|
||||
ImGui::Separator();
|
||||
|
||||
|
||||
components::sub_title("SPAWN_FOR"_T);
|
||||
{
|
||||
if (ImGui::BeginCombo(
|
||||
"##ped_for",
|
||||
(selected_ped_for_player_id == SPAWN_PED_FOR_SELF ?
|
||||
"Self" :
|
||||
(selected_ped_for_player_id == SPAWN_PED_FOR_EVERYONE ?
|
||||
"Everyone" :
|
||||
g_player_service->get_by_id(selected_ped_for_player_id)->get_name()))
|
||||
))
|
||||
if (ImGui::BeginCombo("##ped_for",
|
||||
(selected_ped_for_player_id == SPAWN_PED_FOR_SELF ?
|
||||
"Self" :
|
||||
(selected_ped_for_player_id == SPAWN_PED_FOR_EVERYONE ?
|
||||
"Everyone" :
|
||||
g_player_service->get_by_id(selected_ped_for_player_id)->get_name()))))
|
||||
{
|
||||
if (ImGui::Selectable("Self", selected_ped_for_player_id == SPAWN_PED_FOR_SELF))
|
||||
{
|
||||
@ -631,8 +596,7 @@ namespace big
|
||||
ImGui::Checkbox("Invisible", &g.world.spawn_ped.spawn_invisible);
|
||||
ImGui::Checkbox("Attacker", &g.world.spawn_ped.spawn_as_attacker);
|
||||
|
||||
components::button("CHANGE_PLAYER_MODEL"_T, []
|
||||
{
|
||||
components::button("CHANGE_PLAYER_MODEL"_T, [] {
|
||||
if (selected_ped_type == -2)
|
||||
{
|
||||
if (selected_ped_player_id != -1)
|
||||
@ -660,12 +624,10 @@ namespace big
|
||||
ImGui::SameLine();
|
||||
|
||||
|
||||
components::button("SPAWN_PED"_T, []
|
||||
{
|
||||
components::button("SPAWN_PED"_T, [] {
|
||||
if (selected_ped_for_player_id == SPAWN_PED_FOR_EVERYONE)
|
||||
{
|
||||
g_player_service->iterate([](const big::player_entry& entry)
|
||||
{
|
||||
g_player_service->iterate([](const big::player_entry& entry) {
|
||||
spawn_ped_at_location(selected_ped_type, ped_model_buf, selected_ped_player_id, entry.second->id(), false);
|
||||
});
|
||||
}
|
||||
@ -677,12 +639,10 @@ namespace big
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button("SPAWN_BODYGUARD"_T, []
|
||||
{
|
||||
components::button("SPAWN_BODYGUARD"_T, [] {
|
||||
if (selected_ped_for_player_id == SPAWN_PED_FOR_EVERYONE)
|
||||
{
|
||||
g_player_service->iterate([](const big::player_entry& entry)
|
||||
{
|
||||
g_player_service->iterate([](const big::player_entry& entry) {
|
||||
spawn_ped_at_location(selected_ped_type, ped_model_buf, selected_ped_player_id, entry.second->id(), true);
|
||||
});
|
||||
}
|
||||
@ -692,8 +652,12 @@ namespace big
|
||||
}
|
||||
});
|
||||
|
||||
components::button("Cleanup Spawned Peds", []
|
||||
{
|
||||
components::button("Spoof As Model", [] {
|
||||
g.spoofing.spoof_player_model = true;
|
||||
g.spoofing.player_model = ped_model_buf;
|
||||
});
|
||||
|
||||
components::button("Cleanup Spawned Peds", [] {
|
||||
for (auto& ped : spawned_peds)
|
||||
{
|
||||
PED::DELETE_PED(&ped.ped_handle);
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "views/view.hpp"
|
||||
#include "fiber_pool.hpp"
|
||||
#include "util/session.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -22,15 +22,13 @@ namespace big
|
||||
|
||||
if (ImGui::TreeNode("LOCAL_WEATHER"_T.data()))
|
||||
{
|
||||
components::button("CLEAR_OVERRIDE"_T, []
|
||||
{
|
||||
components::button("CLEAR_OVERRIDE"_T, [] {
|
||||
MISC::CLEAR_OVERRIDE_WEATHER();
|
||||
});
|
||||
|
||||
if (ImGui::ListBox("##weather-listbox", &g.session.local_weather, session::weathers, 15))
|
||||
{
|
||||
g_fiber_pool->queue_job([]
|
||||
{
|
||||
g_fiber_pool->queue_job([] {
|
||||
session::local_weather();
|
||||
});
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#include "views/view.hpp"
|
||||
#include "util/train.hpp"
|
||||
#include "views/view.hpp"
|
||||
|
||||
#include <imgui_internal.h>
|
||||
|
||||
@ -8,38 +8,37 @@ namespace big
|
||||
{
|
||||
void view::train()
|
||||
{
|
||||
components::button("HIJACK_TRAIN"_T, []
|
||||
{
|
||||
components::button("HIJACK_TRAIN"_T, [] {
|
||||
train::hijack_train();
|
||||
});
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button("DELETE_TRAIN"_T, []
|
||||
{
|
||||
|
||||
components::button("DELETE_TRAIN"_T, [] {
|
||||
train::delete_train();
|
||||
});
|
||||
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::SetTooltip("DELETE_TRAIN_DESC"_T.data());
|
||||
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
components::button("EXIT_TRAIN"_T, []
|
||||
{
|
||||
|
||||
components::button("EXIT_TRAIN"_T, [] {
|
||||
train::exit_train();
|
||||
});
|
||||
|
||||
|
||||
static float train_speed = 0;
|
||||
|
||||
ImGui::SliderFloat("TRAIN_SPEED"_T.data(), &train_speed, -500.f, 500.f);
|
||||
ImGui::SameLine();
|
||||
components::button("SET"_T, [] { train::set_train_speed(train_speed); });
|
||||
components::button("SET"_T, [] {
|
||||
train::set_train_speed(train_speed);
|
||||
});
|
||||
|
||||
ImGui::Checkbox("DRIVE_TRAIN"_T.data(), &g.world.train.drive_train);
|
||||
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
|
||||
ImGui::Checkbox("DERAIL_TRAIN"_T.data(), &g.world.train.derail_train);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user