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:
maybegreat48
2023-03-01 21:27:15 +00:00
committed by GitHub
parent 6a2cd866c0
commit 9ccb77e8eb
467 changed files with 55742 additions and 36204 deletions

View File

@ -1,17 +1,21 @@
#include "views/view.hpp"
#include "pointers.hpp"
#include "services/gui/gui_service.hpp"
namespace big
{
void view::active_view() {
if (g_gui_service->get_selected()->func == nullptr) return;
void view::active_view()
{
if (g_gui_service->get_selected()->func == nullptr)
return;
static float alpha = 1.f;
ImGui::SetNextWindowPos({ 300.f + 20.f, 100.f }, ImGuiCond_Always);
ImGui::SetNextWindowSize({ 0.f, 0.f });
ImGui::SetNextWindowSizeConstraints({ 300.f, 100.f }, { (float)*g_pointers->m_resolution_x - 270.f, (float)*g_pointers->m_resolution_y - 110.f });
ImGui::SetNextWindowPos({(300.f + 20.f) * g.window.gui_scale, 100.f * g.window.gui_scale}, ImGuiCond_Always);
ImGui::SetNextWindowSize({0.f, 0.f});
ImGui::SetNextWindowSizeConstraints({300.f, 100.f},
{(float)*g_pointers->m_resolution_x - 270.f, (float)*g_pointers->m_resolution_y - 110.f});
if (ImGui::Begin("main", nullptr, window_flags))
{
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha);

View File

@ -1,27 +1,30 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "views/view.hpp"
namespace big
{
void view::heading()
{
ImGui::SetNextWindowSize({ 300.f, 80.f });
ImGui::SetNextWindowPos({ 10.f, 10.f });
ImGui::SetNextWindowSize({300.f * g.window.gui_scale, 80.f * g.window.gui_scale});
ImGui::SetNextWindowPos({10.f, 10.f});
if (ImGui::Begin("menu_heading", nullptr, window_flags | ImGuiWindowFlags_NoScrollbar))
{
ImGui::BeginGroup();
ImGui::Text("HEADING_WELCOME"_T.data());
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.172f, 0.380f, 0.909f, 1.f));
ImGui::Text(g_local_player == nullptr || g_local_player->m_player_info == nullptr ? "UNKNOWN_USERNAME"_T.data() : g_local_player->m_player_info->m_net_player_data.m_name);
ImGui::Text(g_local_player == nullptr || g_local_player->m_player_info == nullptr ?
"UNKNOWN_USERNAME"_T.data() :
g_local_player->m_player_info->m_net_player_data.m_name);
ImGui::PopStyleColor();
ImGui::EndGroup();
ImGui::SameLine();
ImGui::SetCursorPos({ 300.f - ImGui::CalcTextSize("UNLOAD"_T.data()).x - ImGui::GetStyle().ItemSpacing.x, ImGui::GetStyle().WindowPadding.y / 2 + ImGui::GetStyle().ItemSpacing.y + (ImGui::CalcTextSize("W").y / 2) });
ImGui::SetCursorPos(
{(300.f * g.window.gui_scale) - ImGui::CalcTextSize("UNLOAD"_T.data()).x - ImGui::GetStyle().ItemSpacing.x,
ImGui::GetStyle().WindowPadding.y / 2 + ImGui::GetStyle().ItemSpacing.y + (ImGui::CalcTextSize("W").y / 2)});
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.69f, 0.29f, 0.29f, 1.00f));
if (components::nav_button("UNLOAD"_T))
{
g_fiber_pool->queue_job([]
{
g_fiber_pool->queue_job([] {
for (auto& command : g_looped_commands)
if (command->is_enabled())
command->on_disable();

View File

@ -3,9 +3,10 @@
namespace big
{
void view::navigation() {
ImGui::SetNextWindowPos({ 10.f, 100.f }, ImGuiCond_Always);
ImGui::SetNextWindowSize({ 300.f, 0.f }, ImGuiCond_Always);
void view::navigation()
{
ImGui::SetNextWindowPos({10.f, 100.f * g.window.gui_scale}, ImGuiCond_Always);
ImGui::SetNextWindowSize({300.f * g.window.gui_scale, 0.f}, ImGuiCond_Always);
if (ImGui::Begin("navigation", 0, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav))
{
@ -15,14 +16,11 @@ namespace big
switch (navItem.first)
{
case tabs::PLAYER:
case tabs::DEBUG:
continue;
default:
components::nav_item(navItem, 0);
case tabs::DEBUG: continue;
default: components::nav_item(navItem, 0);
}
}
ImGui::End();
}
ImGui::End();
}
}

View File

@ -5,19 +5,19 @@ namespace big
{
float draw_notification(float start_pos, ImDrawList* dl, std::string title, std::string message, ImVec4 color)
{
ImColor textCol = ImGui::ColorConvertFloat4ToU32({ 1.f, 1.f, 1.f, 1.f });
color.w = 0.5f;
ImColor textCol = ImGui::ColorConvertFloat4ToU32({1.f, 1.f, 1.f, 1.f});
color.w = 0.5f;
ImColor fadeBegin = ImGui::ColorConvertFloat4ToU32(color);
color.w = 0.f;
ImColor fadeEnd = ImGui::ColorConvertFloat4ToU32(color);
color.w = 0.f;
ImColor fadeEnd = ImGui::ColorConvertFloat4ToU32(color);
int j = 0;
int prevSpace = 0;
int j = 0;
int prevSpace = 0;
float total_size = 0.f;
std::vector<std::string> split_points;
for (int i = 0; i <= message.size(); i++)
{
std::string current_message = message.substr(j, i - j);
std::string current_message = message.substr(j, i - j);
if (message.substr(i, 1) == " ")
{
@ -40,14 +40,20 @@ namespace big
}
}
dl->AddRectFilled({ (float)*g_pointers->m_resolution_x - 360.f, 10.f + start_pos }, { (float)*g_pointers->m_resolution_x - 10.f, start_pos + 45.f + total_size }, g.window.color);
dl->AddRectFilledMultiColor({ (float)*g_pointers->m_resolution_x - 360.f, 10.f + start_pos }, { (float)*g_pointers->m_resolution_x - 255.f, start_pos + 45.f + total_size }, fadeBegin, fadeEnd, fadeEnd, fadeBegin);
dl->AddRectFilled({(float)*g_pointers->m_resolution_x - 360.f, 10.f + start_pos},
{(float)*g_pointers->m_resolution_x - 10.f, start_pos + 45.f + total_size},
g.window.color);
dl->AddRectFilledMultiColor({(float)*g_pointers->m_resolution_x - 360.f, 10.f + start_pos}, {(float)*g_pointers->m_resolution_x - 255.f, start_pos + 45.f + total_size}, fadeBegin, fadeEnd, fadeEnd, fadeBegin);
dl->AddText(g.window.font_sub_title, 22.f, { (float)*g_pointers->m_resolution_x - 350.f, 15.f + start_pos }, textCol, title.c_str());
dl->AddText(g.window.font_sub_title,
22.f,
{(float)*g_pointers->m_resolution_x - 350.f, 15.f + start_pos},
textCol,
title.c_str());
int i = 0;
for (std::string txt : split_points)
{
dl->AddText({ (float)*g_pointers->m_resolution_x - 350.f, 40.f + (i * 20.f) + start_pos}, textCol, txt.c_str());
dl->AddText({(float)*g_pointers->m_resolution_x - 350.f, 40.f + (i * 20.f) + start_pos}, textCol, txt.c_str());
i++;
}
@ -65,7 +71,8 @@ namespace big
{
notification& n = notifications[i];
prev_pos = draw_notification(prev_pos, draw_list, n.title, n.message, g_notification_service->notification_colors.at(n.type));
prev_pos =
draw_notification(prev_pos, draw_list, n.title, n.message, g_notification_service->notification_colors.at(n.type));
}
/*ImGui::SetNextWindowSize({ (float)g.window.x * 0.2f, (float)g.window.y });

View File

@ -1,14 +1,14 @@
#include "views/view.hpp"
#include "pointers.hpp"
#include "gta_util.hpp"
#include "gui.hpp"
#include "pointers.hpp"
#include "views/view.hpp"
namespace big
{
void view::overlay()
{
if (!g.window.ingame_overlay.opened || (g_gui->is_open() && !g.window.ingame_overlay.show_with_menu_opened))
return;
return;
ImGui::SetNextWindowPos(ImVec2(10.0f, 10.0f), ImGuiCond_FirstUseEver, ImVec2(0.0f, 0.0f));
ImGui::SetNextWindowBgAlpha(0.5f);
@ -22,8 +22,9 @@ namespace big
if (g.window.ingame_overlay.show_fps)
ImGui::Text("%.0f FPS", ImGui::GetIO().Framerate / 2);
if (CNetworkPlayerMgr *network_player_mgr = gta_util::get_network_player_mgr(); g.window.ingame_overlay.show_players)
ImGui::Text(std::format("Players: {}/{}", network_player_mgr->m_player_count, network_player_mgr->m_player_limit).c_str());
if (CNetworkPlayerMgr* network_player_mgr = gta_util::get_network_player_mgr(); g.window.ingame_overlay.show_players)
ImGui::Text(std::format("Players: {}/{}", network_player_mgr->m_player_count, network_player_mgr->m_player_limit)
.c_str());
//if (g.window.ingame_overlay.show_time)
// ImGui::Text(std::format("Time: {:%d-%m-%Y %H:%M:%OS}", std::chrono::current_zone()->to_local(std::chrono::system_clock::now())).c_str());
@ -32,16 +33,25 @@ namespace big
{
ImGui::Separator();
if(replay_interface->m_ped_interface)
ImGui::Text(std::format("Ped Pool: {}/{}", replay_interface->m_ped_interface->m_cur_peds, replay_interface->m_ped_interface->m_max_peds).c_str());
if (replay_interface->m_ped_interface)
ImGui::Text(std::format("Ped Pool: {}/{}",
replay_interface->m_ped_interface->m_cur_peds,
replay_interface->m_ped_interface->m_max_peds)
.c_str());
if(replay_interface->m_vehicle_interface)
ImGui::Text(std::format("Vehicle Pool: {}/{}", replay_interface->m_vehicle_interface->m_cur_vehicles, replay_interface->m_vehicle_interface->m_max_vehicles).c_str());
if(replay_interface->m_object_interface)
ImGui::Text(std::format("Object Pool: {}/{}", replay_interface->m_object_interface->m_cur_objects, replay_interface->m_object_interface->m_max_objects).c_str());
if (replay_interface->m_vehicle_interface)
ImGui::Text(std::format("Vehicle Pool: {}/{}",
replay_interface->m_vehicle_interface->m_cur_vehicles,
replay_interface->m_vehicle_interface->m_max_vehicles)
.c_str());
if (replay_interface->m_object_interface)
ImGui::Text(std::format("Object Pool: {}/{}",
replay_interface->m_object_interface->m_cur_objects,
replay_interface->m_object_interface->m_max_objects)
.c_str());
}
if (g.window.ingame_overlay.show_game_versions)
{
ImGui::Separator();

View File

@ -1,6 +1,7 @@
#include "services/gui/gui_service.hpp"
#include "view_debug.hpp"
#include "services/gui/gui_service.hpp"
namespace big
{
void debug::main()

View File

@ -9,8 +9,11 @@ namespace big
{
if (ImGui::BeginTabItem("DEBUG_TAB_GLOBALS"_T.data()))
{
if (ImGui::Checkbox("DEBUG_GLOBALS_ENABLE_FREEZING"_T.data(), &g_globals_service->m_running) && g_globals_service->m_running)
g_thread_pool->push([&]() { g_globals_service->loop(); });
if (ImGui::Checkbox("DEBUG_GLOBALS_ENABLE_FREEZING"_T.data(), &g_globals_service->m_running)
&& g_globals_service->m_running)
g_thread_pool->push([&]() {
g_globals_service->loop();
});
if (components::button("LOAD"_T))
g_globals_service->load();
@ -27,11 +30,11 @@ namespace big
if (ImGui::BeginPopupModal("DEBUG_GLOBALS_NEW"_T.data()))
{
static int base_address = 0;
static bool freeze = false;
static char name[32] = "";
static int(*offsets)[2] = nullptr;
static int offset_count = 0;
static int base_address = 0;
static bool freeze = false;
static char name[32] = "";
static int(*offsets)[2] = nullptr;
static int offset_count = 0;
static int previous_offset_count = 0;
ImGui::Text("DEBUG_GLOBALS_NAME"_T.data());
@ -43,12 +46,14 @@ namespace big
ImGui::Text("DEBUG_GLOBAL_OFFSET_COUNT"_T.data());
ImGui::InputInt("##modal_offset_count", &offset_count);
if (offset_count < 0) offset_count = 0;
else if (offset_count > 10) offset_count = 10;
if (offset_count < 0)
offset_count = 0;
else if (offset_count > 10)
offset_count = 10;
if (offset_count != previous_offset_count)
{
int(*new_offsets)[2] = new int[offset_count][2]{ 0 };
int(*new_offsets)[2] = new int[offset_count][2]{0};
memcpy(new_offsets, offsets, sizeof(int) * std::min(offset_count, previous_offset_count) * 2);
delete[] offsets;
@ -80,8 +85,8 @@ namespace big
strcpy(name, "");
freeze = false;
delete[] offsets;
offsets = nullptr;
offset_count = 0;
offsets = nullptr;
offset_count = 0;
previous_offset_count = 0;
ImGui::CloseCurrentPopup();
@ -97,8 +102,8 @@ namespace big
strcpy(name, "");
freeze = false;
delete[] offsets;
offsets = nullptr;
offset_count = 0;
offsets = nullptr;
offset_count = 0;
previous_offset_count = 0;
ImGui::CloseCurrentPopup();

View File

@ -6,7 +6,6 @@ namespace big
{
if (ImGui::BeginTabItem("DEBUG_TAB_LOCALS"_T.data()))
{
ImGui::EndTabItem();
}
}

View File

@ -1,13 +1,13 @@
#include "gta/joaat.hpp"
#include "gta_util.hpp"
#include "gui/components/components.hpp"
#include "natives.hpp"
#include "util/system.hpp"
#include "util/misc.hpp"
#include "view_debug.hpp"
#include "network/Network.hpp"
#include "script.hpp"
#include "gta/joaat.hpp"
#include "script_global.hpp"
#include "gta_util.hpp"
#include "util/misc.hpp"
#include "util/system.hpp"
#include "view_debug.hpp"
namespace big
{
@ -18,7 +18,7 @@ namespace big
if (components::button("MOV QWORD"))
{
*static_cast<uint64_t*>(nullptr) = 0;
uint64_t i = *static_cast<uint64_t*>(nullptr);
uint64_t i = *static_cast<uint64_t*>(nullptr);
}
if (components::button("MOV 0xdead"))
@ -31,39 +31,39 @@ namespace big
system::dump_entry_points();
}
components::button("Network Bail", []
{
components::button("Network Bail", [] {
NETWORK::NETWORK_BAIL(16, 0, 0);
});
components::button("DEBUG_REMOVE_FROM_BAD_SPORT"_T, []
{
components::button("DEBUG_REMOVE_FROM_BAD_SPORT"_T, [] {
STATS::STAT_SET_FLOAT(RAGE_JOAAT("mpply_overall_badsport"), 0.0f, TRUE);
STATS::STAT_SET_BOOL(RAGE_JOAAT("mpply_was_i_bad_sport"), FALSE, TRUE);
});
components::button("Load MP Map", [] { DLC::ON_ENTER_MP(); });
components::button("Load MP Map", [] {
DLC::ON_ENTER_MP();
});
ImGui::SameLine();
components::button("Load SP Map", [] { DLC::ON_ENTER_SP(); });
components::button("Skip Cutscene", [] { CUTSCENE::STOP_CUTSCENE_IMMEDIATELY(); });
components::button("Load SP Map", [] {
DLC::ON_ENTER_SP();
});
components::button("Refresh Interior", []\
{
components::button("Skip Cutscene", [] {
CUTSCENE::STOP_CUTSCENE_IMMEDIATELY();
});
components::button("Refresh Interior", [] {
Interior interior = INTERIOR::GET_INTERIOR_AT_COORDS(self::pos.x, self::pos.y, self::pos.z);
INTERIOR::REFRESH_INTERIOR(interior);
});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("You Will Have To Refresh Again When Exiting Interior.\n SPAMMING WILL CRASH GAME");
components::button("Network Shutdown And Launch Single Player Game", []\
{
components::button("Network Shutdown And Launch Single Player Game", [] {
NETWORK::SHUTDOWN_AND_LAUNCH_SINGLE_PLAYER_GAME();
});
components::button("Network Shutdown And Load Most Recent Save", []\
{
components::button("Network Shutdown And Load Most Recent Save", [] {
NETWORK::SHUTDOWN_AND_LOAD_MOST_RECENT_SAVE();
});

View File

@ -23,7 +23,7 @@ namespace big
if (event_arg_count != previous_arg_count)
{
int64_t* temp_args = new int64_t[event_arg_count]{ 0 };
int64_t* temp_args = new int64_t[event_arg_count]{0};
memcpy(temp_args, args, sizeof(int64_t) * std::min(event_arg_count, previous_arg_count));
delete[] args;
@ -54,9 +54,8 @@ namespace big
ImGui::InputInt("###player_bits", &event_player_bits);
}
components::button("DEBUG_SCRIPT_EVENT_SEND_EVENT"_T, []
{
args[1] = self::id; // prevent detection from AC
components::button("DEBUG_SCRIPT_EVENT_SEND_EVENT"_T, [] {
args[1] = self::id;// prevent detection from AC
g_pointers->m_trigger_script_event(1, args, event_arg_count, event_everyone ? -1 : 1 << event_player_bits);
});

View File

@ -1,6 +1,6 @@
#include "view_debug.hpp"
#include "gui/components/components.hpp"
#include "script_mgr.hpp"
#include "view_debug.hpp"
namespace big
{
@ -8,18 +8,18 @@ namespace big
{
if (ImGui::BeginTabItem("DEBUG_TAB_SCRIPTS"_T.data()))
{
components::sub_title("DEBUG_SCRIPTS_SUB_TITLE"_T);
components::sub_title("DEBUG_SCRIPTS_SUB_TITLE"_T);
for (const auto& script : g_script_mgr.scripts())
{
if (script->is_toggleable())
{
if (ImGui::Checkbox(script->name(), script->toggle_ptr()))
{
g_notification_service->push(std::string(script->name()).append(" script"), script->is_enabled() ? "Resumed" : "Halted");
}
}
}
for (const auto& script : g_script_mgr.scripts())
{
if (script->is_toggleable())
{
if (ImGui::Checkbox(script->name(), script->toggle_ptr()))
{
g_notification_service->push(std::string(script->name()).append(" script"), script->is_enabled() ? "Resumed" : "Halted");
}
}
}
ImGui::EndTabItem();
}
}

View File

@ -1,25 +1,23 @@
#include "gui/components/components.hpp"
#include "natives.hpp"
#include "util/system.hpp"
#include "util/misc.hpp"
#include "view_debug.hpp"
#include "network/Network.hpp"
#include "script.hpp"
#include "gta/joaat.hpp"
#include "script_global.hpp"
#include "gta_util.hpp"
#include "core/data/all_script_names.hpp"
#include "core/data/stack_sizes.hpp"
#include "fiber_pool.hpp"
#include "gta/joaat.hpp"
#include "gta_util.hpp"
#include "gui/components/components.hpp"
#include "natives.hpp"
#include "network/Network.hpp"
#include "script.hpp"
#include "script_global.hpp"
#include "util/misc.hpp"
#include "util/system.hpp"
#include "view_debug.hpp"
static rage::scrThread* selected_thread;
static int selected_stack_size = 128;
static int free_stacks = -1;
static int selected_stack_size = 128;
static int free_stacks = -1;
static const char* selected_stack_size_str = "MULTIPLAYER_MISSION";
static const char* selected_script = "<SELECT>";
static const char* selected_script = "<SELECT>";
static std::chrono::high_resolution_clock::time_point last_stack_update_time{};
@ -82,7 +80,9 @@ namespace big
{
ImGui::Combo("State", (int*)&selected_thread->m_context.m_state, "RUNNING\0WAITING\0KILLED\0PAUSED\0STATE_4");
ImGui::Text("Stack Pointer / Stack Size %d/%d", selected_thread->m_context.m_stack_pointer, selected_thread->m_context.m_stack_size);
ImGui::Text("Stack Pointer / Stack Size %d/%d",
selected_thread->m_context.m_stack_pointer,
selected_thread->m_context.m_stack_size);
ImGui::Text("IP: %X", selected_thread->m_context.m_instruction_pointer);
if (selected_thread->m_context.m_state == rage::eThreadState::killed)
ImGui::Text("Exit Reason: %s", selected_thread->m_exit_message);
@ -105,7 +105,6 @@ namespace big
if (ImGui::Selectable(script, script == selected_script))
{
selected_script = script;
}
if (script == selected_script)
@ -121,10 +120,9 @@ namespace big
if (ImGui::Selectable(std::format("{} ({})", p.first, p.second).data(), selected_stack_size == p.second))
{
selected_stack_size_str = p.first;
selected_stack_size = p.second;
selected_stack_size = p.second;
g_fiber_pool->queue_job([]
{
g_fiber_pool->queue_job([] {
update_free_stacks_count();
});
}
@ -137,8 +135,7 @@ namespace big
ImGui::Text("Free Stacks: %d", free_stacks);
components::button("Start", []
{
components::button("Start", [] {
auto hash = rage::joaat(selected_script);
if (!SCRIPT::DOES_SCRIPT_WITH_NAME_HASH_EXIST(hash))
@ -167,8 +164,7 @@ namespace big
if (*g_pointers->m_game_state != eGameState::Invalid && std::chrono::high_resolution_clock::now() - last_stack_update_time > 100ms)
{
last_stack_update_time = std::chrono::high_resolution_clock::now();
g_fiber_pool->queue_job([]
{
g_fiber_pool->queue_job([] {
update_free_stacks_count();
});
}

View File

@ -9,7 +9,7 @@ namespace big
if (ImGui::BeginTabItem("DEBUG_TABS_LOGS"_T.data()))
{
ImGui::Checkbox("DEBUG_LOG_METRICS"_T.data(), &g.debug.logs.metric_logs);
ImGui::Checkbox("Log Packets", &g.debug.logs.packet_logs); // TODO: translate
ImGui::Checkbox("Log Packets", &g.debug.logs.packet_logs);// TODO: translate
ImGui::Checkbox("DEBUG_LOG_NATIVE_SCRIPT_HOOKS"_T.data(), &g.debug.logs.script_hook_logs);
if (ImGui::TreeNode("DEBUG_LOG_TREE_SCRIPT_EVENT"_T.data()))

View File

@ -1,4 +1,5 @@
#include "view_esp.hpp"
#include "gta_util.hpp"
#include "pointers.hpp"
#include "services/players/player_service.hpp"
@ -7,20 +8,19 @@
namespace big
{
static ImColor death_bg = ImColor(0.117f, 0.113f, 0.172f, .75f);
static ImColor armor_blue_bg = ImColor(0.36f, 0.71f, 0.89f, .75f);
static ImColor armor_blue = ImColor(0.36f, 0.71f, 0.89f, 1.f);
static ImColor health_green_bg = ImColor(0.29f, 0.69f, 0.34f, .75f);
static ImColor health_green = ImColor(0.29f, 0.69f, 0.34f, 1.f);
static ImColor death_bg = ImColor(0.117f, 0.113f, 0.172f, .75f);
static ImColor armor_blue_bg = ImColor(0.36f, 0.71f, 0.89f, .75f);
static ImColor armor_blue = ImColor(0.36f, 0.71f, 0.89f, 1.f);
static ImColor health_green_bg = ImColor(0.29f, 0.69f, 0.34f, .75f);
static ImColor health_green = ImColor(0.29f, 0.69f, 0.34f, 1.f);
static ImColor health_yellow_bg = ImColor(0.69f, 0.49f, 0.29f, .75f);
static ImColor health_yellow = ImColor(0.69f, 0.49f, 0.29f, 1.f);
static ImColor health_red_bg = ImColor(0.69f, 0.29f, 0.29f, .75f);
static ImColor health_red = ImColor(0.69f, 0.29f, 0.29f, 1.f);
static ImColor health_yellow = ImColor(0.69f, 0.49f, 0.29f, 1.f);
static ImColor health_red_bg = ImColor(0.69f, 0.29f, 0.29f, .75f);
static ImColor health_red = ImColor(0.69f, 0.29f, 0.29f, 1.f);
void esp::draw_player(const player_ptr& plyr, ImDrawList* const draw_list) {
if (!plyr->is_valid() ||
!plyr->get_ped() ||
!plyr->get_ped()->m_navigation)
void esp::draw_player(const player_ptr& plyr, ImDrawList* const draw_list)
{
if (!plyr->is_valid() || !plyr->get_ped() || !plyr->get_ped()->m_navigation)
return;
if (g.esp.hide_self && plyr->is_valid() && plyr->id() == g_player_service->get_self()->id())
return;
@ -30,9 +30,10 @@ namespace big
float screen_x, screen_y;
const float distance = math::calculate_distance_from_game_cam(player_pos);
const float multplr = distance > g.esp.global_render_distance[1] ? -1.f : 6.17757f / distance;
const float multplr = distance > g.esp.global_render_distance[1] ? -1.f : 6.17757f / distance;
if (multplr == -1.f || g.esp.global_render_distance[0] > distance) return;
if (multplr == -1.f || g.esp.global_render_distance[0] > distance)
return;
uint32_t ped_damage_bits = plyr->get_ped()->m_damage_bits;
@ -42,28 +43,32 @@ namespace big
const auto esp_y = (float)*g_pointers->m_resolution_y * screen_y;
std::string name_str;
ImVec2 name_pos = { esp_x - (62.5f * multplr), esp_y - (175.f * multplr) - 20.f };
ImVec2 name_pos = {esp_x - (62.5f * multplr), esp_y - (175.f * multplr) - 20.f};
ImU32 esp_color = g.esp.default_color;
if (plyr->is_friend())
{
esp_color = g.esp.friend_color;
}
else if (g.esp.change_esp_color_from_dist) {
else if (g.esp.change_esp_color_from_dist)
{
if (distance <= g.esp.distance_threshold[0])
esp_color = g.esp.enemy_color;
else if (distance >= g.esp.distance_threshold[0] && distance < g.esp.distance_threshold[1])
esp_color = g.esp.enemy_near_color;
}
const auto armor_perc = plyr->get_ped()->m_armor / 50.f;
const auto armor_perc = plyr->get_ped()->m_armor / 50.f;
const auto health_perc = plyr->get_ped()->m_health / (plyr->get_ped()->m_maxhealth + 0.001f);
if (distance < g.esp.tracer_render_distance[1] && distance > g.esp.tracer_render_distance[0] && g.esp.tracer)
draw_list->AddLine({ (float)*g_pointers->m_resolution_x * g.esp.tracer_draw_position[0], (float)*g_pointers->m_resolution_y * g.esp.tracer_draw_position[1] }, { esp_x, esp_y }, esp_color);
draw_list->AddLine({(float)*g_pointers->m_resolution_x * g.esp.tracer_draw_position[0],
(float)*g_pointers->m_resolution_y * g.esp.tracer_draw_position[1]},
{esp_x, esp_y},
esp_color);
if (distance < g.esp.box_render_distance[1] && distance > g.esp.box_render_distance[0] && g.esp.box)
draw_list->AddRect({ esp_x - (62.5f * multplr), esp_y - (175.f * multplr) }, { esp_x - (62.5f * multplr) + (125.f * multplr), esp_y - (175.f * multplr) + (350.f * multplr) }, esp_color);
draw_list->AddRect({esp_x - (62.5f * multplr), esp_y - (175.f * multplr)}, {esp_x - (62.5f * multplr) + (125.f * multplr), esp_y - (175.f * multplr) + (350.f * multplr)}, esp_color);
if (g.esp.name)
name_str = plyr->get_name();
@ -78,7 +83,8 @@ namespace big
draw_list->AddText(name_pos, esp_color, name_str.c_str());
if (g.esp.god) {
if (g.esp.god)
{
std::string mode_str = "";
if (ped_damage_bits & (uint32_t)eEntityProofs::GOD)
@ -99,40 +105,72 @@ namespace big
if (!mode_str.empty())
{
draw_list->AddText({ esp_x - (62.5f * multplr), esp_y - (175.f * multplr) - 40.f }, ImColor(1.f, 0.f, 0.f, 1.f), mode_str.c_str());
draw_list->AddText({esp_x - (62.5f * multplr), esp_y - (175.f * multplr) - 40.f},
ImColor(1.f, 0.f, 0.f, 1.f),
mode_str.c_str());
}
}
if (!(ped_damage_bits & (uint32_t)eEntityProofs::GOD))
{
if (g.esp.health) {
if (g.esp.scale_health_from_dist) {
draw_list->AddLine({ esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + 5.f }, { esp_x - (62.5f * multplr) + (125.f * multplr), esp_y + (175.f * multplr) + 5.f }, health_perc == 0.f ? death_bg : health_perc < 0.25f ? health_red_bg : health_perc < 0.65f ? health_yellow_bg : health_green_bg, 4);
draw_list->AddLine({ esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + 5.f }, { esp_x - (62.5f * multplr) + (125.f * multplr) * health_perc, esp_y + (175.f * multplr) + 5.f }, health_perc < 0.25f ? health_red : health_perc < 0.65f ? health_yellow : health_green, 4);
if (g.esp.health)
{
if (g.esp.scale_health_from_dist)
{
draw_list->AddLine({esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + 5.f},
{esp_x - (62.5f * multplr) + (125.f * multplr), esp_y + (175.f * multplr) + 5.f},
health_perc == 0.f ? death_bg :
health_perc < 0.25f ? health_red_bg :
health_perc < 0.65f ? health_yellow_bg :
health_green_bg,
4);
draw_list->AddLine({esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + 5.f},
{esp_x - (62.5f * multplr) + (125.f * multplr) * health_perc, esp_y + (175.f * multplr) + 5.f},
health_perc < 0.25f ? health_red :
health_perc < 0.65f ? health_yellow :
health_green,
4);
}
else {
draw_list->AddLine({ esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + 5.f }, { esp_x - (62.5f * multplr) + (100.f), esp_y + (175.f * multplr) + 5.f }, health_perc == 0.f ? death_bg : health_perc < 0.25f ? health_red_bg : health_perc < 0.65f ? health_yellow_bg : health_green_bg, 4);
draw_list->AddLine({ esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + 5.f }, { esp_x - (62.5f * multplr) + (100.f * health_perc), esp_y + (175.f * multplr) + 5.f }, health_perc < 0.25f ? health_red : health_perc < 0.65f ? health_yellow : health_green, 4);
else
{
draw_list->AddLine({esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + 5.f},
{esp_x - (62.5f * multplr) + (100.f), esp_y + (175.f * multplr) + 5.f},
health_perc == 0.f ? death_bg :
health_perc < 0.25f ? health_red_bg :
health_perc < 0.65f ? health_yellow_bg :
health_green_bg,
4);
draw_list->AddLine({esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + 5.f},
{esp_x - (62.5f * multplr) + (100.f * health_perc), esp_y + (175.f * multplr) + 5.f},
health_perc < 0.25f ? health_red :
health_perc < 0.65f ? health_yellow :
health_green,
4);
}
}
if (g.esp.armor && plyr->get_ped()->m_armor > 0) {
if (g.esp.armor && plyr->get_ped()->m_armor > 0)
{
float offset = 5.f;
offset = g.esp.health ? 10.f : 5.f;
if (g.esp.scale_armor_from_dist) {
draw_list->AddLine({ esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + offset }, { esp_x - (62.5f * multplr) + (125.f * multplr), esp_y + (175.f * multplr) + offset }, armor_blue_bg, 4);
draw_list->AddLine({ esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + offset }, { esp_x - (62.5f * multplr) + (125.f * multplr) * armor_perc, esp_y + (175.f * multplr) + offset }, armor_blue, 4);
offset = g.esp.health ? 10.f : 5.f;
if (g.esp.scale_armor_from_dist)
{
draw_list->AddLine({esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + offset}, {esp_x - (62.5f * multplr) + (125.f * multplr), esp_y + (175.f * multplr) + offset}, armor_blue_bg, 4);
draw_list->AddLine({esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + offset}, {esp_x - (62.5f * multplr) + (125.f * multplr) * armor_perc, esp_y + (175.f * multplr) + offset}, armor_blue, 4);
}
else {
draw_list->AddLine({ esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + offset }, { esp_x - (62.5f * multplr) + (100.f), esp_y + (175.f * multplr) + offset }, armor_blue_bg, 4);
draw_list->AddLine({ esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + offset }, { esp_x - (62.5f * multplr) + (100.f * armor_perc), esp_y + (175.f * multplr) + offset }, armor_blue, 4);
else
{
draw_list->AddLine({esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + offset}, {esp_x - (62.5f * multplr) + (100.f), esp_y + (175.f * multplr) + offset}, armor_blue_bg, 4);
draw_list->AddLine({esp_x - (62.5f * multplr), esp_y + (175.f * multplr) + offset}, {esp_x - (62.5f * multplr) + (100.f * armor_perc), esp_y + (175.f * multplr) + offset}, armor_blue, 4);
}
}
}
}
}
void esp::draw() {
if (!g.esp.enabled) return;
void esp::draw()
{
if (!g.esp.enabled)
return;
if (const auto draw_list = ImGui::GetBackgroundDrawList(); draw_list)
{

View File

@ -1,9 +1,9 @@
#include "views/view.hpp"
#include "core/scr_globals.hpp"
#include "fiber_pool.hpp"
#include "gta_util.hpp"
#include "core/scr_globals.hpp"
#include "script_local.hpp"
#include "util/scripts.hpp"
#include "views/view.hpp"
namespace big
{
@ -27,31 +27,61 @@ namespace big
components::sub_title("Event Starter");
ImGui::BeginGroup();
components::button("Hot Target", [] { scripts::start_launcher_script(36); });
components::button("Kill List", [] { scripts::start_launcher_script(37); });
components::button("Checkpoints", [] { scripts::start_launcher_script(39); });
components::button("Challenges", [] { scripts::start_launcher_script(40); });
components::button("Penned In", [] { scripts::start_launcher_script(41); });
components::button("Hot Target", [] {
scripts::start_launcher_script(36);
});
components::button("Kill List", [] {
scripts::start_launcher_script(37);
});
components::button("Checkpoints", [] {
scripts::start_launcher_script(39);
});
components::button("Challenges", [] {
scripts::start_launcher_script(40);
});
components::button("Penned In", [] {
scripts::start_launcher_script(41);
});
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("Hot Property", [] { scripts::start_launcher_script(43); });
components::button("King Of The Castle", [] { scripts::start_launcher_script(45); });
components::button("Criminal Damage", [] { scripts::start_launcher_script(46); });
components::button("Hunt The Beast", [] { scripts::start_launcher_script(47); });
components::button("Business Battles", [] { scripts::start_launcher_script(114); });
components::button("Hot Property", [] {
scripts::start_launcher_script(43);
});
components::button("King Of The Castle", [] {
scripts::start_launcher_script(45);
});
components::button("Criminal Damage", [] {
scripts::start_launcher_script(46);
});
components::button("Hunt The Beast", [] {
scripts::start_launcher_script(47);
});
components::button("Business Battles", [] {
scripts::start_launcher_script(114);
});
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("One-On-One Deathmatch", [] { scripts::start_launcher_script(197); });
components::button("Impromptu Race", [] { scripts::start_launcher_script(16); });
components::button("Flight School", [] { scripts::start_launcher_script(196); });
components::button("Golf", [] { scripts::start_launcher_script(193); });
components::button("Tutorial", [] { scripts::start_launcher_script(20); });
components::button("One-On-One Deathmatch", [] {
scripts::start_launcher_script(197);
});
components::button("Impromptu Race", [] {
scripts::start_launcher_script(16);
});
components::button("Flight School", [] {
scripts::start_launcher_script(196);
});
components::button("Golf", [] {
scripts::start_launcher_script(193);
});
components::button("Tutorial", [] {
scripts::start_launcher_script(20);
});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Only works on joining players");
ImGui::EndGroup();
@ -59,11 +89,21 @@ namespace big
ImGui::SameLine();
ImGui::BeginGroup();
components::button("Gunslinger", [] { scripts::start_launcher_script(211); });
components::button("Space Monkey", [] { scripts::start_launcher_script(216); });
components::button("Wizard", [] { scripts::start_launcher_script(212); });
components::button("QUB3D", [] { scripts::start_launcher_script(217); });
components::button("Camhedz", [] { scripts::start_launcher_script(218); });
components::button("Gunslinger", [] {
scripts::start_launcher_script(211);
});
components::button("Space Monkey", [] {
scripts::start_launcher_script(216);
});
components::button("Wizard", [] {
scripts::start_launcher_script(212);
});
components::button("QUB3D", [] {
scripts::start_launcher_script(217);
});
components::button("Camhedz", [] {
scripts::start_launcher_script(218);
});
ImGui::EndGroup();
ImGui::Separator();
@ -77,15 +117,13 @@ namespace big
*script_local(script->m_stack, scr_locals::am_criminal_damage::broadcast_idx).at(43).as<int*>() = 0;
});
ImGui::SameLine();
components::button("Finish Event##criminal_damage", []
{
components::button("Finish Event##criminal_damage", [] {
if (scripts::force_host(RAGE_JOAAT("am_criminal_damage")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_criminal_damage")))
*script_local(script->m_stack, scr_locals::am_criminal_damage::broadcast_idx).at(39).as<int*>() = 0;
});
components::button("Max Score", []
{
components::button("Max Score", [] {
if (auto criminal_damage = gta_util::find_script_thread(RAGE_JOAAT("am_criminal_damage")))
*script_local(criminal_damage->m_stack, scr_locals::am_criminal_damage::score_idx).as<int*>() = 999'999'999;
});
@ -95,24 +133,24 @@ namespace big
{
components::sub_title("Checkpoints");
components::button("Start Event##cp_collection", []
{
components::button("Start Event##cp_collection", [] {
if (scripts::force_host(RAGE_JOAAT("am_cp_collection")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
*script_local(script->m_stack, scr_locals::am_cp_collection::broadcast_idx).at(667).as<int*>() = 0;
});
ImGui::SameLine();
components::button("Finish Event##cp_collection", []
{
components::button("Finish Event##cp_collection", [] {
if (scripts::force_host(RAGE_JOAAT("am_cp_collection")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
*script_local(script->m_stack, scr_locals::am_cp_collection::broadcast_idx).at(661).as<int*>() = 0;
});
components::button("Win Event", []
{
components::button("Win Event", [] {
if (auto checkpoints = gta_util::find_script_thread(RAGE_JOAAT("am_cp_collection")))
*script_local(checkpoints->m_stack, scr_locals::am_cp_collection::player_broadcast_idx).at(checkpoints->m_net_component->m_local_participant_index, 5).at(4).as<int*>() = 999'999'999;
*script_local(checkpoints->m_stack, scr_locals::am_cp_collection::player_broadcast_idx)
.at(checkpoints->m_net_component->m_local_participant_index, 5)
.at(4)
.as<int*>() = 999'999'999;
script::get_current()->yield(1s);
@ -125,15 +163,15 @@ namespace big
}
});
ImGui::SameLine();
components::button("Scramble Checkpoints", []
{
components::button("Scramble Checkpoints", [] {
std::vector<Vector3> active_player_positions;
for (auto& plyr : g_player_service->players())
{
if (plyr.second->is_valid() && NETWORK::NETWORK_IS_PLAYER_A_PARTICIPANT_ON_SCRIPT(plyr.second->id(), "am_cp_collection", -1))
{
active_player_positions.push_back(ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(plyr.second->id()), false));
active_player_positions.push_back(
ENTITY::GET_ENTITY_COORDS(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(plyr.second->id()), false));
}
}
@ -143,7 +181,10 @@ namespace big
{
for (int i = 0; i < 100; i++)
{
*script_local(checkpoints->m_stack, scr_locals::am_cp_collection::broadcast_idx).at(10).at(i, 5).as<Vector3*>() = active_player_positions[i % active_player_positions.size()];
*script_local(checkpoints->m_stack, scr_locals::am_cp_collection::broadcast_idx)
.at(10)
.at(i, 5)
.as<Vector3*>() = active_player_positions[i % active_player_positions.size()];
}
}
}
@ -153,46 +194,93 @@ namespace big
if (check_script(RAGE_JOAAT("am_king_of_the_castle")))
{
components::sub_title("King Of The Castle");
components::button("Complete Event##kotc", []
{
components::button("Complete Event##kotc", [] {
if (scripts::force_host(RAGE_JOAAT("am_king_of_the_castle")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_king_of_the_castle")))
*script_local(script->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(1).at(1).as<int*>() = 0;
});
ImGui::SameLine();
components::button("Expire Event (if possible)##kotc", []
{
components::button("Expire Event (if possible)##kotc", [] {
if (scripts::force_host(RAGE_JOAAT("am_king_of_the_castle")))
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("am_king_of_the_castle")))
*script_local(script->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(1).at(3).as<int*>() = 0;
});
components::button("Become The King##kotc", []
{
components::button("Become The King##kotc", [] {
if (scripts::force_host(RAGE_JOAAT("am_king_of_the_castle")))
{
if (auto kotc = gta_util::find_script_thread(RAGE_JOAAT("am_king_of_the_castle")))
{
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(0, 4).as<int*>() = 0;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(0, 4).at(1).as<int*>() = self::id;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(0, 4).at(2).as<int*>() = self::id;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(0, 4).at(3).as<float*>() = 999999999.0f;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx)
.at(6)
.at(0, 204)
.at(74)
.at(0, 4)
.as<int*>() = 0;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx)
.at(6)
.at(0, 204)
.at(74)
.at(0, 4)
.at(1)
.as<int*>() = self::id;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx)
.at(6)
.at(0, 204)
.at(74)
.at(0, 4)
.at(2)
.as<int*>() = self::id;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx)
.at(6)
.at(0, 204)
.at(74)
.at(0, 4)
.at(3)
.as<float*>() = 999999999.0f;
}
}
});
ImGui::SameLine();
components::button("Dethrone Everyone##kotc", []
{
components::button("Dethrone Everyone##kotc", [] {
if (scripts::force_host(RAGE_JOAAT("am_king_of_the_castle")))
{
if (auto kotc = gta_util::find_script_thread(RAGE_JOAAT("am_king_of_the_castle")))
{
for (int i = 0; i < *script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).as<int*>(); i++)
for (int i = 0; i < *script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx)
.at(6)
.at(0, 204)
.at(74)
.as<int*>();
i++)
{
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(i, 4).as<int*>() = -1;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(i, 4).at(1).as<int*>() = -1;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(i, 4).at(2).as<int*>() = -1;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx).at(6).at(0, 204).at(74).at(i, 4).at(3).as<float*>() = -1.0f;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx)
.at(6)
.at(0, 204)
.at(74)
.at(i, 4)
.as<int*>() = -1;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx)
.at(6)
.at(0, 204)
.at(74)
.at(i, 4)
.at(1)
.as<int*>() = -1;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx)
.at(6)
.at(0, 204)
.at(74)
.at(i, 4)
.at(2)
.as<int*>() = -1;
*script_local(kotc->m_stack, scr_locals::am_king_of_the_castle::broadcast_idx)
.at(6)
.at(0, 204)
.at(74)
.at(i, 4)
.at(3)
.as<float*>() = -1.0f;
}
}
}

View File

@ -1,13 +1,13 @@
#include "views/view.hpp"
#include "core/data/block_join_reasons.hpp"
#include "core/data/command_access_levels.hpp"
#include "core/data/infractions.hpp"
#include "fiber_pool.hpp"
#include "pointers.hpp"
#include "services/players/player_service.hpp"
#include "services/player_database/player_database_service.hpp"
#include "services/api/api_service.hpp"
#include "core/data/block_join_reasons.hpp"
#include "core/data/infractions.hpp"
#include "core/data/command_access_levels.hpp"
#include "services/player_database/player_database_service.hpp"
#include "services/players/player_service.hpp"
#include "util/session.hpp"
#include "views/view.hpp"
namespace big
{
@ -21,9 +21,9 @@ namespace big
ImGui::SetNextItemWidth(300.f);
components::input_text_with_hint("PLAYER"_T, "SEARCH"_T, search, sizeof(search), ImGuiInputTextFlags_None);
if (ImGui::ListBoxHeader("###players", { 180, static_cast<float>(*g_pointers->m_resolution_y - 400 - 38 * 4) }))
if (ImGui::ListBoxHeader("###players", {180, static_cast<float>(*g_pointers->m_resolution_y - 400 - 38 * 4)}))
{
auto& item_arr = g_player_database_service->get_players();
auto& item_arr = g_player_database_service->get_players();
if (item_arr.size() > 0)
{
std::string lower_search = search;
@ -41,21 +41,16 @@ namespace big
ImGui::PushID(item.first);
float circle_size = 7.5f;
auto cursor_pos = ImGui::GetCursorScreenPos();
auto plyr_state = player.online_state;
auto cursor_pos = ImGui::GetCursorScreenPos();
auto plyr_state = player.online_state;
//render status circle
ImGui::GetWindowDrawList()->AddCircleFilled(
ImVec2(
cursor_pos.x + 4.f + circle_size,
cursor_pos.y + 4.f + circle_size),
circle_size,
ImColor(
plyr_state == PlayerOnlineStatus::ONLINE ? ImVec4(0.f, 1.f, 0.f, 1.f)
: plyr_state == PlayerOnlineStatus::OFFLINE ? ImVec4(1.f, 0.f, 0.f, 1.f)
: plyr_state == PlayerOnlineStatus::UNKNOWN ? ImVec4(.5f, .5f, .5f, 1.0f)
: ImVec4(.5f, .5f, .5f, 1.0f)
));
ImGui::GetWindowDrawList()->AddCircleFilled(ImVec2(cursor_pos.x + 4.f + circle_size, cursor_pos.y + 4.f + circle_size),
circle_size,
ImColor(plyr_state == PlayerOnlineStatus::ONLINE ? ImVec4(0.f, 1.f, 0.f, 1.f) :
plyr_state == PlayerOnlineStatus::OFFLINE ? ImVec4(1.f, 0.f, 0.f, 1.f) :
plyr_state == PlayerOnlineStatus::UNKNOWN ? ImVec4(.5f, .5f, .5f, 1.0f) :
ImVec4(.5f, .5f, .5f, 1.0f)));
//we need some padding
ImVec2 cursor = ImGui::GetCursorPos();
@ -83,7 +78,7 @@ namespace big
if (auto selected = g_player_database_service->get_selected())
{
ImGui::SameLine();
if (ImGui::BeginChild("###selected_player", { 500, static_cast<float>(*g_pointers->m_resolution_y - 388 - 38 * 4) }, false, ImGuiWindowFlags_NoBackground))
if (ImGui::BeginChild("###selected_player", {500, static_cast<float>(*g_pointers->m_resolution_y - 388 - 38 * 4)}, false, ImGuiWindowFlags_NoBackground))
{
if (ImGui::InputText("NAME"_T.data(), name_buf, sizeof(name_buf)))
{
@ -116,7 +111,8 @@ namespace big
ImGui::SetTooltip("ONLY_AS_HOST"_T.data());
if (ImGui::BeginCombo("CHAT_COMMAND_PERMISSIONS"_T.data(), COMMAND_ACCESS_LEVELS[current_player.command_access_level.value_or(g.session.chat_command_default_access_level)]))
if (ImGui::BeginCombo("CHAT_COMMAND_PERMISSIONS"_T.data(),
COMMAND_ACCESS_LEVELS[current_player.command_access_level.value_or(g.session.chat_command_default_access_level)]))
{
for (const auto& [type, name] : COMMAND_ACCESS_LEVELS)
{
@ -144,8 +140,7 @@ namespace big
}
}
components::button("JOIN_SESSION"_T, []
{
components::button("JOIN_SESSION"_T, [] {
session::join_by_rockstar_id(current_player.rockstar_id);
});
@ -153,8 +148,7 @@ namespace big
components::input_text("INPUT_MSG"_T, message, sizeof(message));
if (components::button("SEND_MSG"_T))
{
g_thread_pool->push([selected]
{
g_thread_pool->push([selected] {
if (g_api_service->send_socialclub_message(selected->rockstar_id, message))
{
g_notification_service->push("SCAPI"_T.data(), "MSG_SENT_SUCCESS"_T.data());
@ -192,8 +186,7 @@ namespace big
ImGui::SameLine();
components::button("RELOAD_PLYR_ONLINE_STATES"_T, []
{
components::button("RELOAD_PLYR_ONLINE_STATES"_T, [] {
g_player_database_service->update_player_states();
});

View File

@ -1,15 +1,15 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "util/session.hpp"
#include "core/data/apartment_names.hpp"
#include "core/data/command_access_levels.hpp"
#include "core/data/region_codes.hpp"
#include "core/data/warehouse_names.hpp"
#include "fiber_pool.hpp"
#include "gta_util.hpp"
#include "hooking.hpp"
#include "util/notify.hpp"
#include "util/scripts.hpp"
#include "util/session.hpp"
#include "util/toxic.hpp"
#include "core/data/apartment_names.hpp"
#include "core/data/warehouse_names.hpp"
#include "core/data/command_access_levels.hpp"
#include "hooking.hpp"
#include "views/view.hpp"
#include <network/Network.hpp>
#include <script/globals/GPBD_FM_3.hpp>
@ -20,8 +20,7 @@ namespace big
{
static uint64_t rid = 0;
ImGui::InputScalar("INPUT_RID"_T.data(), ImGuiDataType_U64, &rid);
components::button("JOIN_BY_RID"_T, []
{
components::button("JOIN_BY_RID"_T, [] {
session::join_by_rockstar_id(rid);
});
@ -34,15 +33,13 @@ namespace big
static char base64[500]{};
components::input_text("SESSION_INFO"_T, base64, sizeof(base64));
components::button("JOIN_SESSION_INFO"_T, []
{
components::button("JOIN_SESSION_INFO"_T, [] {
rage::rlSessionInfo info;
g_pointers->m_decode_session_info(&info, base64, nullptr);
session::join_session(info);
});
ImGui::SameLine();
components::button("COPY_SESSION_INFO"_T, []
{
components::button("COPY_SESSION_INFO"_T, [] {
char buf[0x100]{};
g_pointers->m_encode_session_info(&gta_util::get_network()->m_game_session.m_rline_session.m_session_info, buf, 0xA9, nullptr);
ImGui::SetClipboardText(buf);
@ -53,21 +50,19 @@ namespace big
{
for (const auto& session_type : sessions)
{
components::selectable(session_type.name, false, [&session_type]
{
components::selectable(session_type.name, false, [&session_type] {
session::join_type(session_type.id);
});
}
ImGui::EndListBox();
}
components::sub_title("REGION_SWITCHER"_T);
if (ImGui::ListBoxHeader("###region_switch"))
{
for (const auto& region_type : regions)
{
components::selectable(region_type.name, *g_pointers->m_region_code == region_type.id, [&region_type]
{
components::selectable(region_type.name, *g_pointers->m_region_code == region_type.id, [&region_type] {
*g_pointers->m_region_code = region_type.id;
});
}
@ -88,7 +83,7 @@ namespace big
ImGui::Checkbox("AUTO_KICK_CHAT_SPAMMERS"_T.data(), &g.session.kick_chat_spammers);
ImGui::Checkbox("DISABLE_FILTER"_T.data(), &g.session.chat_force_clean);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Your sent chat messages will not be censored to the receivers"); // TODO: add translation
ImGui::SetTooltip("Your sent chat messages will not be censored to the receivers");// TODO: add translation
ImGui::Checkbox("LOG_CHAT_MSG"_T.data(), &g.session.log_chat_messages);
ImGui::Checkbox("LOG_TXT_MSG"_T.data(), &g.session.log_text_messages);
static char msg[256];
@ -96,11 +91,13 @@ namespace big
ImGui::SameLine();
ImGui::Checkbox("IS_TEAM"_T.data(), &g.session.is_team);
ImGui::SameLine();
components::button("SEND"_T, []
{
if (const auto net_game_player = gta_util::get_network_player_mgr()->m_local_net_player; net_game_player)
components::button("SEND"_T, [] {
if (const auto net_game_player = gta_util::get_network_player_mgr()->m_local_net_player; net_game_player)
{
if (g_hooking->get_original<hooks::send_chat_message>()(*g_pointers->m_send_chat_ptr, net_game_player->get_net_data(), msg, g.session.is_team))
if (g_hooking->get_original<hooks::send_chat_message>()(*g_pointers->m_send_chat_ptr,
net_game_player->get_net_data(),
msg,
g.session.is_team))
notify::draw_chat(msg, net_game_player->get_name(), g.session.is_team);
}
});
@ -144,16 +141,15 @@ namespace big
if (ImGui::Checkbox("FORCE_SCRIPT_HOST"_T.data(), &g.session.force_script_host))
{
if (g.session.force_script_host)
g_fiber_pool->queue_job([]
{
scripts::force_host(RAGE_JOAAT("freemode"));
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("freemode")); script && script->m_net_component)
script->m_net_component->block_host_migration(true);
g_fiber_pool->queue_job([] {
scripts::force_host(RAGE_JOAAT("freemode"));
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("freemode")); script && script->m_net_component)
script->m_net_component->block_host_migration(true);
scripts::force_host(RAGE_JOAAT("fmmc_launcher"));
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("fmmc_launcher")); script && script->m_net_component)
script->m_net_component->block_host_migration(true);
});
scripts::force_host(RAGE_JOAAT("fmmc_launcher"));
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("fmmc_launcher")); script && script->m_net_component)
script->m_net_component->block_host_migration(true);
});
}
components::sub_title("REMOTE_NAME_SPOOFING"_T);
@ -206,42 +202,50 @@ namespace big
*scr_globals::globalplayer_bd.at(self::id, scr_globals::size::globalplayer_bd).at(213).as<int*>() = global_wanted_level;
}
components::command_button<"killall">({ }, "KILL_ALL"_T);
components::command_button<"killall">({}, "KILL_ALL"_T);
ImGui::SameLine();
components::command_button<"explodeall">({ }, "EXPLODE_ALL"_T);
components::command_button<"explodeall">({}, "EXPLODE_ALL"_T);
ImGui::SameLine();
components::command_button<"beastall">({ });
components::command_button<"beastall">({});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("INCLUDING_YOU"_T.data());
components::command_button<"giveweapsall">({ });
components::command_button<"giveweapsall">({});
ImGui::SameLine();
components::command_button<"remweapsall">({ });
components::command_button<"remweapsall">({});
components::command_button<"ceokickall">( { });
components::command_button<"ceokickall">({});
ImGui::SameLine();
components::command_button<"vehkickall">({ });
components::command_button<"vehkickall">({});
components::command_button<"ragdollall">({ }, "RAGDOLL_PLAYERS"_T);
components::command_button<"ragdollall">({}, "RAGDOLL_PLAYERS"_T);
ImGui::SameLine();
components::command_button<"intkickall">({ }, "KICK_ALL_FROM_INTERIORS"_T);
components::command_button<"intkickall">({}, "KICK_ALL_FROM_INTERIORS"_T);
components::command_button<"missionall">({ });
components::command_button<"missionall">({});
ImGui::SameLine();
components::command_button<"errorall">({ });
components::command_button<"errorall">({});
components::command_button<"ceoraidall">({ });
components::command_button<"ceoraidall">({});
ImGui::SameLine();
components::button("Trigger MC Raid", [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::BikerDefend); }); });
components::button("Trigger MC Raid", [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::BikerDefend);
});
});
ImGui::SameLine();
components::button("Trigger Bunker Raid", [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::GunrunningDefend); }); });
components::button("Trigger Bunker Raid", [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::GunrunningDefend);
});
});
components::command_button<"sextall">({ }, "Send Sexts");
components::command_button<"sextall">({}, "Send Sexts");
ImGui::SameLine();
components::command_button<"fakebanall">({ }, "Send Fake Ban Messages");
components::command_button<"fakebanall">({}, "Send Fake Ban Messages");
components::small_text("TELEPORTS"_T);
@ -265,7 +269,7 @@ namespace big
ImGui::SameLine();
components::command_button<"apartmenttpall">({ (uint64_t)g.session.send_to_apartment_idx }, "TP_ALL_TO_APARTMENT"_T);
components::command_button<"apartmenttpall">({(uint64_t)g.session.send_to_apartment_idx}, "TP_ALL_TO_APARTMENT"_T);
if (ImGui::BeginCombo("##warehouse", warehouse_names[g.session.send_to_warehouse_idx]))
{
@ -287,37 +291,53 @@ namespace big
ImGui::SameLine();
components::command_button<"warehousetpall">({ (uint64_t)g.session.send_to_warehouse_idx }, "TP_ALL_TO_WAREHOUSE"_T);
components::command_button<"warehousetpall">({(uint64_t)g.session.send_to_warehouse_idx}, "TP_ALL_TO_WAREHOUSE"_T);
components::button("TP_ALL_TO_DARTS"_T, [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::Darts); }); });
components::button("TP_ALL_TO_DARTS"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::Darts);
});
});
ImGui::SameLine();
components::button("TP_ALL_TO_FLIGHT_SCHOOL"_T, [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::PilotSchool); }); });
components::button("TP_ALL_TO_FLIGHT_SCHOOL"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::PilotSchool);
});
});
ImGui::SameLine();
components::button("TP_ALL_TO_MAP_CENTER"_T, [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::ArmWresling); }); });
components::button("TP_ALL_TO_MAP_CENTER"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::ArmWresling);
});
});
components::button("TP_ALL_TO_SKYDIVE"_T, [] { g_player_service->iterate([](auto& plyr) { toxic::start_activity(plyr.second, eActivityType::Skydive); }); });
components::button("TP_ALL_TO_SKYDIVE"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::Skydive);
});
});
ImGui::SameLine();
components::command_button<"interiortpall">({ 81 }, "TP_ALL_TO_MOC"_T);
components::command_button<"interiortpall">({81}, "TP_ALL_TO_MOC"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 123 }, "TP_ALL_TO_CASINO"_T);
components::command_button<"interiortpall">({123}, "TP_ALL_TO_CASINO"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 124 }, "TP_ALL_TO_PENTHOUSE"_T);
components::command_button<"interiortpall">({124}, "TP_ALL_TO_PENTHOUSE"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 128 }, "TP_ALL_TO_ARCADE"_T);
components::command_button<"interiortpall">({128}, "TP_ALL_TO_ARCADE"_T);
components::command_button<"interiortpall">({ 146 }, "TP_ALL_TO_MUSIC_LOCKER"_T);
components::command_button<"interiortpall">({146}, "TP_ALL_TO_MUSIC_LOCKER"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 148 }, "TP_ALL_TO_RECORD_A_STUDIOS"_T);
components::command_button<"interiortpall">({148}, "TP_ALL_TO_RECORD_A_STUDIOS"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 149 }, "TP_ALL_TO_CUSTOM_AUTO_SHOP"_T);
components::command_button<"interiortpall">({149}, "TP_ALL_TO_CUSTOM_AUTO_SHOP"_T);
components::command_button<"interiortpall">({ 155 }, "TP_ALL_TO_AGENCY"_T);
components::command_button<"interiortpall">({155}, "TP_ALL_TO_AGENCY"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 160 }, "TP_ALL_TO_FREAKSHOP"_T);
components::command_button<"interiortpall">({160}, "TP_ALL_TO_FREAKSHOP"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({ 161 }, "TP_ALL_TO_MULTI_FLOOR_GARAGE"_T);
components::command_button<"interiortpall">({161}, "TP_ALL_TO_MULTI_FLOOR_GARAGE"_T);
components::command_button<"tutorialall">();
ImGui::SameLine();
@ -345,17 +365,29 @@ namespace big
components::small_text("WARP_TIME"_T.data());
components::button("PLUS_1_MINUTE"_T, [] { toxic::warp_time_forward_all(60 * 1000); });
components::button("PLUS_1_MINUTE"_T, [] {
toxic::warp_time_forward_all(60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_5_MINUTES"_T, [] { toxic::warp_time_forward_all(5 * 60 * 1000); });
components::button("PLUS_5_MINUTES"_T, [] {
toxic::warp_time_forward_all(5 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_48_MINUTES"_T, [] { toxic::warp_time_forward_all(48 * 60 * 1000); });
components::button("PLUS_48_MINUTES"_T, [] {
toxic::warp_time_forward_all(48 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_96_MINUTES"_T, [] { toxic::warp_time_forward_all(96 * 60 * 1000); });
components::button("PLUS_96_MINUTES"_T, [] {
toxic::warp_time_forward_all(96 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_200_MINUTES"_T, [] { toxic::warp_time_forward_all(200 * 60 * 1000); });
components::button("PLUS_200_MINUTES"_T, [] {
toxic::warp_time_forward_all(200 * 60 * 1000);
});
ImGui::SameLine();
components::button("STOP_TIME"_T, [] { toxic::set_time_all(INT_MAX - 3000); });
components::button("STOP_TIME"_T, [] {
toxic::set_time_all(INT_MAX - 3000);
});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("STOP_TIME_DESC"_T.data());

View File

@ -1,12 +1,13 @@
#include "views/view.hpp"
#include "core/data/language_codes.hpp"
#include "core/data/region_codes.hpp"
#include "fiber_pool.hpp"
#include "pointers.hpp"
#include "script.hpp"
#include <network/Network.hpp>
#include "util/session.hpp"
#include "core/data/region_codes.hpp"
#include "core/data/language_codes.hpp"
#include "services/matchmaking/matchmaking_service.hpp"
#include "util/session.hpp"
#include "views/view.hpp"
#include <network/Network.hpp>
namespace big
{
@ -22,7 +23,7 @@ namespace big
ImGui::SetNextItemWidth(300.f);
if (ImGui::ListBoxHeader("###sessions", { 300, static_cast<float>(*g_pointers->m_resolution_y - 400 - 38 * 4) }))
if (ImGui::ListBoxHeader("###sessions", {300, static_cast<float>(*g_pointers->m_resolution_y - 400 - 38 * 4)}))
{
if (g_matchmaking_service->get_num_found_sessions())
{
@ -42,10 +43,11 @@ namespace big
if (ImGui::IsItemHovered())
{
ImGui::SetTooltip(std::format("Num Players: {}\nRegion: {}\nLanguage: {}\nHost: {}",
session.attributes.player_count,
regions[session.attributes.region].name,
languages[session.attributes.language].name,
session.info.m_net_player_data.m_gamer_handle.m_rockstar_id).c_str());
session.attributes.player_count,
regions[session.attributes.region].name,
languages[session.attributes.language].name,
session.info.m_net_player_data.m_gamer_handle.m_rockstar_id)
.c_str());
}
}
}
@ -60,7 +62,7 @@ namespace big
if (selected_session_idx != -1)
{
ImGui::SameLine();
if (ImGui::BeginChild("###selected_session", { 300, static_cast<float>(*g_pointers->m_resolution_y - 388 - 38 * 4) }, false, ImGuiWindowFlags_NoBackground))
if (ImGui::BeginChild("###selected_session", {300, static_cast<float>(*g_pointers->m_resolution_y - 388 - 38 * 4)}, false, ImGuiWindowFlags_NoBackground))
{
auto& session = g_matchmaking_service->get_found_sessions()[selected_session_idx];
@ -72,22 +74,19 @@ namespace big
auto& data = session.info.m_net_player_data;
ImGui::Text("SESSION_BROWSER_HOST_RID"_T.data(), data.m_gamer_handle.m_rockstar_id);
components::button("COPY_SESSION_INFO"_T, []
{
components::button("COPY_SESSION_INFO"_T, [] {
ImGui::SetClipboardText(session_info);
});
ImGui::SameLine();
components::button("JOIN"_T, [session]
{
if (SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) != 0 ||
STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS())
components::button("JOIN"_T, [session] {
if (SCRIPT::GET_NUMBER_OF_THREADS_RUNNING_THE_SCRIPT_WITH_THIS_HASH(RAGE_JOAAT("maintransition")) != 0 || STREAMING::IS_PLAYER_SWITCH_IN_PROGRESS())
{
g_notification_service->push_error("JOIN_SESSION"_T.data(), "PLAYER_SWITCH_IN_PROGRESS"_T.data());
return;
}
bool is_session_free_aim = session.attributes.discriminator & (1 << 17);
bool is_local_free_aim = PAD::GET_LOCAL_PLAYER_GAMEPAD_AIM_STATE() > 1;
bool is_local_free_aim = PAD::GET_LOCAL_PLAYER_GAMEPAD_AIM_STATE() > 1;
if (is_session_free_aim != is_local_free_aim)
PLAYER::SET_PLAYER_TARGETING_MODE(is_session_free_aim ? 3 : 1);
@ -120,7 +119,6 @@ namespace big
}
ImGui::EndCombo();
}
}
ImGui::Checkbox("LANGUAGE"_T.data(), &g.session_browser.language_filter_enabled);
@ -171,13 +169,13 @@ namespace big
ImGui::TreePop();
}
if (ImGui::Checkbox("REPLACE_GAME_MATCHMAKING"_T.data(), &g.session_browser.replace_game_matchmaking));
if (ImGui::Checkbox("REPLACE_GAME_MATCHMAKING"_T.data(), &g.session_browser.replace_game_matchmaking))
;
if (ImGui::IsItemHovered())
ImGui::SetTooltip("REPLACE_GAME_MATCHMAKING_DESC"_T.data());
components::button("REFRESH"_T, []
{
components::button("REFRESH"_T, [] {
selected_session_idx = -1;
if (!g_matchmaking_service->matchmake())

View File

@ -1,18 +1,88 @@
#include "views/view.hpp"
#include "core/data/blip_types.hpp"
#include "core/data/language_codes.hpp"
#include "core/data/region_codes.hpp"
#include "fiber_pool.hpp"
#include "util/teleport.hpp"
#include "core/data/region_codes.hpp"
#include "core/data/language_codes.hpp"
#include "views/view.hpp"
#include <network/ClanData.hpp>
namespace big
{
void view::spoofing()
{
components::small_text("SPOOFING_DESCRIPTION"_T);
// requires translation
ImGui::Checkbox("Hide From Player List", &g.spoofing.hide_from_player_list);
components::script_patch_checkbox("Spoof Blip Type", &g.spoofing.spoof_blip);
if (g.spoofing.spoof_blip)
{
ImGui::SameLine();
if (ImGui::BeginCombo("###blip_type_select", blip_types[g.spoofing.blip_type]))
{
for (int i = 0; i < blip_types.size(); i++)
{
if (ImGui::Selectable(blip_types[i], g.spoofing.blip_type == i))
{
g.spoofing.blip_type = i;
}
}
ImGui::EndCombo();
}
}
ImGui::Checkbox("Spoof Rank", &g.spoofing.spoof_rank);
if (g.spoofing.spoof_rank)
{
ImGui::SameLine();
if (ImGui::InputInt("###rank", &g.spoofing.rank))
{
*g_pointers->m_force_player_card_refresh = true;
}
}
ImGui::Checkbox("Spoof K/D Ratio", &g.spoofing.spoof_kd_ratio);
if (g.spoofing.spoof_kd_ratio)
{
ImGui::SameLine();
if (ImGui::InputFloat("###kd_ratio", &g.spoofing.kd_ratio))
{
*g_pointers->m_force_player_card_refresh = true;
}
}
ImGui::Checkbox("Spoof Badsport State", &g.spoofing.spoof_bad_sport);
if (g.spoofing.spoof_bad_sport)
{
ImGui::SameLine();
if (ImGui::Combo("###badsport_select", &g.spoofing.badsport_type, "Clean Player\0Dirty Player\0Bad Sport"))
{
*g_pointers->m_force_player_card_refresh = true;
}
}
ImGui::Checkbox("Spoof Job Points", &g.spoofing.spoof_job_points);
if (g.spoofing.spoof_job_points)
{
ImGui::SameLine();
ImGui::InputInt("###jp", &g.spoofing.job_points);
}
ImGui::Checkbox("Spoof Player Model", &g.spoofing.spoof_player_model);
if (g.spoofing.spoof_player_model)
{
static char model[32];
strcpy_s(model, sizeof(model), g.spoofing.player_model.c_str());
ImGui::SameLine();
components::input_text("##model_input", model, sizeof(model));
if (model != g.spoofing.player_model)
g.spoofing.player_model = std::string(model);
}
components::sub_title("SPOOFING_HIDE_FEATURES"_T);
ImGui::Checkbox("SPOOFING_HIDE_GOD_MODE"_T.data(), &g.spoofing.spoof_hide_god);
ImGui::Checkbox("SPOOFING_HIDE_SPECTATE"_T.data(), &g.spoofing.spoof_hide_spectate);

View File

@ -1,11 +1,12 @@
#include "views/view.hpp"
#include "services/player_database/player_database_service.hpp"
#include "core/data/command_access_levels.hpp"
#include "core/scr_globals.hpp"
#include "core/data/language_codes.hpp"
#include <script/globals/GlobalPlayerBD.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include "core/scr_globals.hpp"
#include "services/player_database/player_database_service.hpp"
#include "views/view.hpp"
#include <script/globals/GPBD_FM.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
@ -13,10 +14,10 @@ namespace big
{
if (ImGui::TreeNode("INFO"_T.data()))
{
ImGui::Text("PLAYER_INFO_ID"_T.data(), g_player_service->get_selected()->id());
ImGui::Text("PLAYER_INFO_SESSION_HOST"_T.data(), g_player_service->get_selected()->is_host() ? "YES"_T.data() : "NO"_T.data());
ImGui::Text("PLAYER_INFO_SESSION_HOST"_T.data(),
g_player_service->get_selected()->is_host() ? "YES"_T.data() : "NO"_T.data());
ImGui::Separator();
@ -26,18 +27,18 @@ namespace big
}
uint32_t ped_damage_bits = 0;
uint32_t ped_task_flag = 0;
uint32_t ped_health = 0;
uint32_t ped_maxhealth = 0;
uint32_t ped_task_flag = 0;
uint32_t ped_health = 0;
uint32_t ped_maxhealth = 0;
uint32_t veh_damage_bits = 0;
std::string mode_str = "";
std::string mode_str = "";
if (CPed* ped = g_player_service->get_selected()->get_ped(); ped != nullptr)
{
ped_damage_bits = ped->m_damage_bits;
ped_task_flag = ped->m_ped_task_flag;
ped_health = ped->m_health;
ped_maxhealth = ped->m_maxhealth;
ped_task_flag = ped->m_ped_task_flag;
ped_health = ped->m_health;
ped_maxhealth = ped->m_maxhealth;
}
if (ped_damage_bits & (uint32_t)eEntityProofs::GOD)
@ -113,29 +114,21 @@ namespace big
ImGui::SameLine();
ImGui::PushID("##rid");
if (ImGui::Button("COPY"_T.data())) ImGui::SetClipboardText(std::to_string(net_player_data->m_gamer_handle.m_rockstar_id).data());
if (ImGui::Button("COPY"_T.data()))
ImGui::SetClipboardText(std::to_string(net_player_data->m_gamer_handle.m_rockstar_id).data());
ImGui::PopID();
auto ip = g_player_service->get_selected()->get_ip_address();
auto ip = g_player_service->get_selected()->get_ip_address();
auto port = g_player_service->get_selected()->get_port();
ImGui::Text(
"PLAYER_INFO_IP"_T.data(),
ip.m_field1,
ip.m_field2,
ip.m_field3,
ip.m_field4,
port
);
ImGui::Text("PLAYER_INFO_IP"_T.data(), ip.m_field1, ip.m_field2, ip.m_field3, ip.m_field4, port);
ImGui::SameLine();
ImGui::PushID("##ip");
if (ImGui::Button("COPY"_T.data())) ImGui::SetClipboardText(std::format("{}.{}.{}.{}:{}", ip.m_field1,
ip.m_field2,
ip.m_field3,
ip.m_field4,
port).data());
if (ImGui::Button("COPY"_T.data()))
ImGui::SetClipboardText(
std::format("{}.{}.{}.{}:{}", ip.m_field1, ip.m_field2, ip.m_field3, ip.m_field4, port).data());
ImGui::PopID();
}
@ -145,7 +138,7 @@ namespace big
if (id != -1)
{
auto& stats = scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].PlayerStats;
auto& stats = scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].PlayerStats;
auto& boss_goon = scr_globals::gpbd_fm_3.as<GPBD_FM_3*>()->Entries[id].BossGoon;
if (boss_goon.Language >= 0 && boss_goon.Language < 13)
@ -157,24 +150,27 @@ namespace big
ImGui::Text("PLAYER_INFO_BANK"_T.data(), stats.Money - stats.WalletBalance);
ImGui::Text("PLAYER_INFO_TOTAL_MONEY"_T.data(), stats.Money);
ImGui::Text("PLAYER_INFO_RANK"_T.data(), stats.Rank, stats.RP);
ImGui::Text("Health: %d (MaxHealth: %d)", ped_health, ped_maxhealth); // TODO: translate
ImGui::Text("Health: %d (MaxHealth: %d)", ped_health, ped_maxhealth);// TODO: translate
ImGui::Text("PLAYER_INFO_KD"_T.data(), stats.KdRatio);
ImGui::Text("PLAYER_INFO_KILLS"_T.data(), stats.KillsOnPlayers);
ImGui::Text("PLAYER_INFO_DEATHS"_T.data(), stats.DeathsByPlayers);
ImGui::Text("PLAYER_INFO_PROSTITUTES"_T.data(), stats.ProstitutesFrequented);
ImGui::Text("PLAYER_INFO_LAP_DANCES"_T.data(), stats.LapDancesBought);
ImGui::Text("PLAYER_INFO_MISSIONS_CREATED"_T.data(), stats.MissionsCreated);
ImGui::Text("PLAYER_INFO_METLDOWN_COMPLETE"_T.data(), scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].MeltdownComplete ? "YES"_T.data() : "NO"_T.data()); // curious to see if anyone has actually played singleplayer
ImGui::Text("PLAYER_INFO_METLDOWN_COMPLETE"_T.data(),
scr_globals::gpbd_fm_1.as<GPBD_FM*>()->Entries[id].MeltdownComplete ? "YES"_T.data() : "NO"_T.data());// curious to see if anyone has actually played singleplayer
ImGui::Separator();
}
if (ImGui::BeginCombo("CHAT_COMMAND_PERMISSIONS"_T.data(), COMMAND_ACCESS_LEVELS[g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)]))
if (ImGui::BeginCombo("CHAT_COMMAND_PERMISSIONS"_T.data(),
COMMAND_ACCESS_LEVELS[g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)]))
{
for (const auto& [type, name] : COMMAND_ACCESS_LEVELS)
{
if (ImGui::Selectable(name, type == g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)))
if (ImGui::Selectable(name,
type == g_player_service->get_selected()->command_access_level.value_or(g.session.chat_command_default_access_level)))
{
g.session.chat_command_default_access_level = type;
g_player_database_service->get_or_create_player(g_player_service->get_selected())->command_access_level = type;

View File

@ -1,6 +1,6 @@
#include "views/view.hpp"
#include "util/teleport.hpp"
#include "util/toxic.hpp"
#include "views/view.hpp"
namespace big
{
@ -8,13 +8,14 @@ namespace big
{
if (ImGui::TreeNode("KICK"_T.data()))
{
auto const is_session_host = [] { return gta_util::get_network()->m_game_session_ptr->is_host(); };
auto const is_session_host = [] {
return gta_util::get_network()->m_game_session_ptr->is_host();
};
components::player_command_button<"breakup">(g_player_service->get_selected());
ImGui::SameLine();
components::command_checkbox<"breakupcheating">();
components::disable_unless(std::not_fn(is_session_host), []
{
components::disable_unless(std::not_fn(is_session_host), [] {
components::player_command_button<"lckick">(g_player_service->get_selected());
});

View File

@ -1,6 +1,6 @@
#include "views/view.hpp"
#include "util/scripts.hpp"
#include "script/globals/GPBD_FM_3.hpp"
#include "util/scripts.hpp"
#include "views/view.hpp"
namespace big
{
@ -25,8 +25,7 @@ namespace big
ImGui::Checkbox("NEVER_WANTED"_T.data(), &g_player_service->get_selected()->never_wanted);
ImGui::Checkbox("SEMI_GODMODE"_T.data(), &g_player_service->get_selected()->semi_godmode);
components::button("Gooch Test", []
{
components::button("Gooch Test", [] {
*script_global(1890140).at(244).at(1).as<Player*>() = g_player_service->get_selected()->id();
scripts::start_launcher_script(171);
});

View File

@ -1,8 +1,8 @@
#include "views/view.hpp"
#include "util/teleport.hpp"
#include "util/toxic.hpp"
#include "core/data/apartment_names.hpp"
#include "core/data/warehouse_names.hpp"
#include "util/teleport.hpp"
#include "util/toxic.hpp"
#include "views/view.hpp"
namespace big
{
@ -30,9 +30,13 @@ namespace big
components::player_command_button<"ceoraid">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::button("Trigger MC Raid", [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::BikerDefend); });
components::button("Trigger MC Raid", [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::BikerDefend);
});
ImGui::SameLine();
components::button("Trigger Bunker Raid", [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::GunrunningDefend); });
components::button("Trigger Bunker Raid", [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::GunrunningDefend);
});
components::player_command_button<"sext">(g_player_service->get_selected(), {});
ImGui::SameLine();
@ -41,7 +45,7 @@ namespace big
static int wanted_level;
ImGui::SliderInt("WANTED_LVL"_T.data(), &wanted_level, 0, 5);
ImGui::SameLine();
components::player_command_button<"wanted">(g_player_service->get_selected(), { (uint64_t)wanted_level }, "Set");
components::player_command_button<"wanted">(g_player_service->get_selected(), {(uint64_t)wanted_level}, "Set");
components::small_text("TELEPORTS"_T);
@ -65,7 +69,7 @@ namespace big
ImGui::SameLine();
components::player_command_button<"apartmenttp">(g_player_service->get_selected(), { (uint64_t)g.session.send_to_apartment_idx });
components::player_command_button<"apartmenttp">(g_player_service->get_selected(), {(uint64_t)g.session.send_to_apartment_idx});
if (ImGui::BeginCombo("##warehouse", warehouse_names[g.session.send_to_warehouse_idx]))
{
@ -87,74 +91,94 @@ namespace big
ImGui::SameLine();
components::player_command_button<"warehousetp">(g_player_service->get_selected(), { (uint64_t)g.session.send_to_warehouse_idx });
components::player_command_button<"warehousetp">(g_player_service->get_selected(), {(uint64_t)g.session.send_to_warehouse_idx});
components::button("TP_TO_DARTS"_T, [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::Darts); });
components::button("TP_TO_DARTS"_T, [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::Darts);
});
ImGui::SameLine();
components::button("TP_TO_FLIGHT_SCHOOL"_T, [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::PilotSchool); });
components::button("TP_TO_FLIGHT_SCHOOL"_T, [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::PilotSchool);
});
ImGui::SameLine();
components::button("TP_TO_MAP_CENTER"_T, [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::ArmWresling); });
components::button("TP_TO_MAP_CENTER"_T, [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::ArmWresling);
});
components::button("TP_TO_SKYDIVE"_T, [] { toxic::start_activity(g_player_service->get_selected(), eActivityType::Skydive); });
components::button("TP_TO_SKYDIVE"_T, [] {
toxic::start_activity(g_player_service->get_selected(), eActivityType::Skydive);
});
ImGui::SameLine();
components::player_command_button<"cayotp">(g_player_service->get_selected(), { });
components::player_command_button<"cayotp">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 81 }, "TP To MOC");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {81}, "TP To MOC");
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 123 }, "TP To Casino");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {123}, "TP To Casino");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 124 }, "TP To Penthouse");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {124}, "TP To Penthouse");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 128 }, "TP To Arcade");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {128}, "TP To Arcade");
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 146 }, "TP To Music Locker");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {146}, "TP To Music Locker");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 148 }, "TP To Record A Studios");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {148}, "TP To Record A Studios");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 149 }, "TP To Custom Auto Shop");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {149}, "TP To Custom Auto Shop");
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 155 }, "TP To Agency");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {155}, "TP To Agency");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 160 }, "TP To Freakshop");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {160}, "TP To Freakshop");
ImGui::SameLine();
components::player_command_button<"interiortp">(g_player_service->get_selected(), { 161 }, "TP To Multi Floor Garage");
components::player_command_button<"interiortp">(g_player_service->get_selected(), {161}, "TP To Multi Floor Garage");
ImGui::SameLine();
components::player_command_button<"giveweaps">(g_player_service->get_selected(), { });
ImGui::SameLine();
components::player_command_button<"remweaps">(g_player_service->get_selected(), { });
components::player_command_button<"tutorial">(g_player_service->get_selected(), { });
components::player_command_button<"giveweaps">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"golf">(g_player_service->get_selected(), { });
ImGui::SameLine();
components::player_command_button<"flightschool">(g_player_service->get_selected(), { });
ImGui::SameLine();
components::player_command_button<"darts">(g_player_service->get_selected(), { });
components::player_command_button<"remweaps">(g_player_service->get_selected(), {});
components::player_command_button<"badlands">(g_player_service->get_selected(), { });
components::player_command_button<"tutorial">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"spacemonkey">(g_player_service->get_selected(), { });
components::player_command_button<"golf">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"wizard">(g_player_service->get_selected(), { });
components::player_command_button<"flightschool">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"darts">(g_player_service->get_selected(), {});
components::player_command_button<"qub3d">(g_player_service->get_selected(), { });
components::player_command_button<"badlands">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"camhedz">(g_player_service->get_selected(), { });
components::player_command_button<"spacemonkey">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"wizard">(g_player_service->get_selected(), {});
components::player_command_button<"qub3d">(g_player_service->get_selected(), {});
ImGui::SameLine();
components::player_command_button<"camhedz">(g_player_service->get_selected(), {});
components::small_text("WARP_TIME"_T);
components::button("PLUS_1_MINUTE"_T, [] { toxic::warp_time_forward(g_player_service->get_selected(), 60 * 1000); });
components::button("PLUS_1_MINUTE"_T, [] {
toxic::warp_time_forward(g_player_service->get_selected(), 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_5_MINUTES"_T, [] { toxic::warp_time_forward(g_player_service->get_selected(), 5 * 60 * 1000); });
components::button("PLUS_5_MINUTES"_T, [] {
toxic::warp_time_forward(g_player_service->get_selected(), 5 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_48_MINUTES"_T, [] { toxic::warp_time_forward(g_player_service->get_selected(), 48 * 60 * 1000); });
components::button("PLUS_48_MINUTES"_T, [] {
toxic::warp_time_forward(g_player_service->get_selected(), 48 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_96_MINUTES"_T, [] { toxic::warp_time_forward(g_player_service->get_selected(), 96 * 60 * 1000); });
components::button("PLUS_96_MINUTES"_T, [] {
toxic::warp_time_forward(g_player_service->get_selected(), 96 * 60 * 1000);
});
ImGui::SameLine();
components::button("PLUS_200_MINUTES"_T, [] { toxic::warp_time_forward(g_player_service->get_selected(), 200 * 60 * 1000); });
components::button("PLUS_200_MINUTES"_T, [] {
toxic::warp_time_forward(g_player_service->get_selected(), 200 * 60 * 1000);
});
ImGui::SameLine();
components::button("STOP_TIME"_T, [] { toxic::set_time(g_player_service->get_selected(), INT_MAX - 3000); });
components::button("STOP_TIME"_T, [] {
toxic::set_time(g_player_service->get_selected(), INT_MAX - 3000);
});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("PLAYER_TOXIC_NO_WAY_BACK"_T.data());

View File

@ -1,7 +1,7 @@
#include "views/view.hpp"
#include "util/teleport.hpp"
#include "util/vehicle.hpp"
#include "util/troll.hpp"
#include "util/vehicle.hpp"
#include "views/view.hpp"
namespace big
{
@ -17,12 +17,14 @@ namespace big
components::player_command_button<"rcplayer">(g_player_service->get_selected());
static int bounty_value = 0;
ImGui::SliderInt("BOUNTY"_T.data(), &bounty_value, 0, 10000);
ImGui::SameLine();
components::command_checkbox<"anonbounty">();
ImGui::SameLine();
components::button("SET"_T, [] { troll::set_bounty_on_player(g_player_service->get_selected(), bounty_value, g.session.anonymous_bounty);});
components::button("SET"_T, [] {
troll::set_bounty_on_player(g_player_service->get_selected(), bounty_value, g.session.anonymous_bounty);
});
ImGui::TreePop();
}

View File

@ -6,7 +6,7 @@ namespace big
{
ImGui::Text("VIEW_PLAYER_PLAYER_OPTIONS"_T.data(), g_player_service->get_selected()->get_name());
ImGui::Checkbox("SPECTATE"_T.data(), &g.player.spectating);
if (g_player_service->get_selected()->is_valid())
{
view::player_info();

View File

@ -1,10 +1,10 @@
#include "fiber_pool.hpp"
#include "fonts/fonts.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "services/gui/gui_service.hpp"
#include "services/players/player_service.hpp"
#include "views/view.hpp"
#include "fonts/fonts.hpp"
#include "natives.hpp"
#include "fiber_pool.hpp"
#define IMGUI_DEFINE_PLACEMENT_NEW
#define IMGUI_DEFINE_MATH_OPERATORS
@ -25,7 +25,7 @@ namespace big
if (const auto ped = plyr->get_ped(); ped != nullptr && ped->m_ped_task_flag & (uint8_t)ePedTask::TASK_DRIVING)
player_icons += FONT_ICON_VEHICLE;
const auto player_iconsc = player_icons.c_str();
const auto player_iconsc = player_icons.c_str();
const auto player_icons_end = player_iconsc + player_icons.size();
// calculate icons width
@ -42,9 +42,9 @@ namespace big
if (selected_player)
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.29f, 0.45f, 0.69f, 1.f));
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, { 0.0, 0.5 });
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, {0.0, 0.5});
ImGui::PushID(plyr->id());
if (ImGui::Button(plyr->get_name(), { 300.0f - ImGui::GetStyle().ScrollbarSize, 0.f }))
if (ImGui::Button(plyr->get_name(), {300.0f - ImGui::GetStyle().ScrollbarSize, 0.f}))
{
g_player_service->set_selected(plyr);
g_gui_service->set_selected(tabs::PLAYER);
@ -69,22 +69,25 @@ namespace big
{
const auto player_count = g_player_service->players().size() + 1;
if (!*g_pointers->m_is_session_started && player_count < 2) return;
float window_pos = 110.f + g_gui_service->nav_ctr * ImGui::CalcTextSize("W").y + g_gui_service->nav_ctr * ImGui::GetStyle().ItemSpacing.y + g_gui_service->nav_ctr * ImGui::GetStyle().ItemInnerSpacing.y + ImGui::GetStyle().WindowPadding.y;
if (!*g_pointers->m_is_session_started && player_count < 2)
return;
float window_pos = 110.f + g_gui_service->nav_ctr * ImGui::CalcTextSize("W").y
+ g_gui_service->nav_ctr * ImGui::GetStyle().ItemSpacing.y
+ g_gui_service->nav_ctr * ImGui::GetStyle().ItemInnerSpacing.y + ImGui::GetStyle().WindowPadding.y;
ImGui::SetNextWindowSize({ 300.f, 0.f });
ImGui::SetNextWindowPos({ 10.f, window_pos });
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, { 2.0f, 2.0f });
ImGui::SetNextWindowSize({300.f, 0.f});
ImGui::SetNextWindowPos({10.f, window_pos});
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, {2.0f, 2.0f});
if (ImGui::Begin("playerlist", nullptr, window_flags))
{
float window_height = (ImGui::CalcTextSize("A").y + ImGui::GetStyle().ItemInnerSpacing.y * 2 + 6.0f) * player_count + 10.0f;
window_height = window_height + window_pos > (float)*g_pointers->m_resolution_y - 10.f ? (float)*g_pointers->m_resolution_y - (window_pos + 40.f) : window_height;
ImGui::PushStyleColor(ImGuiCol_FrameBg, { 0.f, 0.f, 0.f, 0.f });
ImGui::PushStyleColor(ImGuiCol_ScrollbarBg, { 0.f, 0.f, 0.f, 0.f });
ImGui::PushStyleColor(ImGuiCol_FrameBg, {0.f, 0.f, 0.f, 0.f});
ImGui::PushStyleColor(ImGuiCol_ScrollbarBg, {0.f, 0.f, 0.f, 0.f});
if (ImGui::BeginListBox("##players", { ImGui::GetWindowSize().x - ImGui::GetStyle().WindowPadding.x * 2 , window_height }))
if (ImGui::BeginListBox("##players", {ImGui::GetWindowSize().x - ImGui::GetStyle().WindowPadding.x * 2, window_height}))
{
player_button(g_player_service->get_self());

View File

@ -5,9 +5,10 @@
namespace big
{
void view::mobile() {
ImGui::SetWindowSize({ 0.f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always);
void view::mobile()
{
ImGui::SetWindowSize({0.f, (float)*g_pointers->m_resolution_y}, ImGuiCond_Always);
components::sub_title("MERRYWEATHER"_T);
ImGui::Separator();
@ -35,8 +36,9 @@ namespace big
components::button("MORS_FIX_ALL"_T, [] {
int amount_fixed = mobile::mors_mutual::fix_all();
g_notification_service->push("MOBILE"_T.data(),
std::vformat("VEHICLE_FIX_AMOUNT"_T, std::make_format_args(amount_fixed, amount_fixed == 1 ? "VEHICLE_FIX_HAS"_T.data() : "VEHICLE_FIX_HAVE"_T.data()))
);
std::vformat("VEHICLE_FIX_AMOUNT"_T,
std::make_format_args(amount_fixed,
amount_fixed == 1 ? "VEHICLE_FIX_HAS"_T.data() : "VEHICLE_FIX_HAVE"_T.data())));
});
components::sub_title("CEO_ABILITIES"_T);

View File

@ -1,10 +1,10 @@
#include "core/data/hud_component_names.hpp"
#include "core/data/ptfx_effects.hpp"
#include "fiber_pool.hpp"
#include "util/entity.hpp"
#include "util/local_player.hpp"
#include "views/view.hpp"
#include "core/data/hud_component_names.hpp"
#include "util/scripts.hpp"
#include "core/data/ptfx_effects.hpp"
#include "views/view.hpp"
namespace big
{
@ -42,9 +42,9 @@ namespace big
components::command_checkbox<"fastrun">();
ImGui::Checkbox("NO_IDLE_KICK"_T.data(), &g.tunables.no_idle_kick);
components::command_checkbox<"walkunder">();
if(!g.self.super_jump)
if (!g.self.super_jump)
components::command_checkbox<"beastjump">();
if(!g.self.beast_jump)
if (!g.self.beast_jump)
components::command_checkbox<"superjump">();
ImGui::EndGroup();
ImGui::SameLine();
@ -52,7 +52,7 @@ namespace big
components::command_checkbox<"invis">();
if (g.self.invisibility)
components::command_checkbox<"localvis">(); // TODO: does nothing in SP
components::command_checkbox<"localvis">();// TODO: does nothing in SP
components::command_checkbox<"cleanloop">();
components::command_checkbox<"nocollision">();
components::command_checkbox<"mobileradio">();
@ -74,9 +74,9 @@ namespace big
{
if (ImGui::Selectable(ptfx_named[i].friendly_name, ptfx_named[i].asset_name == g.self.ptfx_effects.asset))
{
g.self.ptfx_effects.asset = ptfx_named[i].asset_name; // Update our asset name to be used
g.self.ptfx_effects.asset = ptfx_named[i].asset_name;// Update our asset name to be used
g.self.ptfx_effects.select = i;
g.self.ptfx_effects.effect = ptfx_named[i].effect_names.at(0); // set the effect to the first instance in the vector
g.self.ptfx_effects.effect = ptfx_named[i].effect_names.at(0);// set the effect to the first instance in the vector
}
if (ptfx_named[i].asset_name == g.self.ptfx_effects.asset)
@ -91,7 +91,7 @@ namespace big
for (const auto& ptfx_type : ptfx_named[g.self.ptfx_effects.select].effect_names)
{
if (ImGui::Selectable(ptfx_type, ptfx_type == g.self.ptfx_effects.effect))
g.self.ptfx_effects.effect = ptfx_type; // Update our ptfx effect
g.self.ptfx_effects.effect = ptfx_type;// Update our ptfx effect
if (ptfx_type == g.self.ptfx_effects.effect)
ImGui::SetItemDefaultFocus();
@ -99,38 +99,37 @@ namespace big
ImGui::EndCombo();
}
}
ImGui::Separator();
components::sub_title("PROOFS"_T);
if (ImGui::Button("CHECK_ALL"_T.data()))
{
g.self.proof_bullet = true;
g.self.proof_fire = true;
g.self.proof_bullet = true;
g.self.proof_fire = true;
g.self.proof_collision = true;
g.self.proof_melee = true;
g.self.proof_melee = true;
g.self.proof_explosion = true;
g.self.proof_steam = true;
g.self.proof_drown = true;
g.self.proof_water = true;
g.self.proof_steam = true;
g.self.proof_drown = true;
g.self.proof_water = true;
}
ImGui::SameLine();
if (ImGui::Button("UNCHECK_ALL"_T.data()))
{
g.self.proof_bullet = false;
g.self.proof_fire = false;
g.self.proof_bullet = false;
g.self.proof_fire = false;
g.self.proof_collision = false;
g.self.proof_melee = false;
g.self.proof_melee = false;
g.self.proof_explosion = false;
g.self.proof_steam = false;
g.self.proof_drown = false;
g.self.proof_water = false;
g.self.proof_steam = false;
g.self.proof_drown = false;
g.self.proof_water = false;
}
ImGui::BeginGroup();
@ -173,11 +172,8 @@ namespace big
if (ImGui::IsItemHovered())
ImGui::SetTooltip("FORCE_WANTED_LVL_INFO"_T.data());
ImGui::Text("WANTED_LVL"_T.data());
if (
ImGui::SliderInt("###wanted_level", &g.self.wanted_level, 0, 5) &&
!g.self.force_wanted_level &&
g_local_player != nullptr
) {
if (ImGui::SliderInt("###wanted_level", &g.self.wanted_level, 0, 5) && !g.self.force_wanted_level && g_local_player != nullptr)
{
g_local_player->m_player_info->m_wanted_level = g.self.wanted_level;
}
}
@ -210,7 +206,7 @@ namespace big
components::button("HIDE_ALL"_T, [] {
g.self.hide_radar = true;
g.self.hide_ammo = true;
g.self.hide_ammo = true;
for (int i = 0; i < (int)HudComponents::HUD_WEAPONS; i++)
{
g.self.hud_components_states[i] = true;
@ -219,7 +215,7 @@ namespace big
ImGui::SameLine();
components::button("SHOW_ALL"_T, [] {
g.self.hide_radar = false;
g.self.hide_ammo = false;
g.self.hide_ammo = false;
for (int i = 0; i < (int)HudComponents::HUD_WEAPONS; i++)
{
g.self.hud_components_states[i] = false;

View File

@ -1,9 +1,9 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "util/globals.hpp"
#include "util/mobile.hpp"
#include "util/teleport.hpp"
#include "util/vehicle.hpp"
#include "views/view.hpp"
namespace big
{

View File

@ -1,16 +1,17 @@
#include "core/data/custom_weapons.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "core/data/special_ammo_types.hpp"
#include "core/data/bullet_impact_types.hpp"
#include "services/gta_data/gta_data_service.hpp"
#include "core/data/custom_weapons.hpp"
#include "core/data/special_ammo_types.hpp"
#include "fiber_pool.hpp"
#include "gta/joaat.hpp"
#include "views/view.hpp"
#include "natives.hpp"
#include "pointers.hpp"
#include "services/gta_data/gta_data_service.hpp"
#include "views/view.hpp"
namespace big
{
void view::weapons() {
void view::weapons()
{
components::sub_title("AMMO"_T);
ImGui::BeginGroup();
@ -34,7 +35,7 @@ namespace big
ImGui::Checkbox("ENABLE_SPECIAL_AMMO"_T.data(), &g.weapons.ammo_special.toggle);
eAmmoSpecialType selected_ammo = g.weapons.ammo_special.type;
eAmmoSpecialType selected_ammo = g.weapons.ammo_special.type;
eExplosionTag selected_explosion = g.weapons.ammo_special.explosion_tag;
if (ImGui::BeginCombo("SPECIAL_AMMO"_T.data(), SPECIAL_AMMOS[(int)selected_ammo].name))
@ -83,8 +84,7 @@ namespace big
ImGui::SameLine();
components::command_checkbox<"nospread">();
components::button("GET_ALL_WEAPONS"_T, []
{
components::button("GET_ALL_WEAPONS"_T, [] {
for (const auto& [_, weapon] : g_gta_data_service->weapons())
{
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(self::ped, weapon.m_hash, 9999, false);
@ -94,8 +94,7 @@ namespace big
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(self::ped, parachute_hash, 0, true);
});
ImGui::SameLine();
components::button("REMOVE_CUR_WEAPON"_T, []
{
components::button("REMOVE_CUR_WEAPON"_T, [] {
Hash weaponHash;
WEAPON::GET_CURRENT_PED_WEAPON(self::ped, &weaponHash, 1);
if (weaponHash != RAGE_JOAAT("WEAPON_UNARMED"))
@ -133,8 +132,8 @@ namespace big
switch (selected)
{
case CustomWeapon::GRAVITY_GUN:
ImGui::Checkbox("Launch on release", &g.weapons.gravity_gun.launch_on_release);
break;
ImGui::Checkbox("Launch on release", &g.weapons.gravity_gun.launch_on_release);
break;
case CustomWeapon::VEHICLE_GUN:
// this some ugly ass looking code
static char vehicle_gun[12];
@ -145,8 +144,7 @@ namespace big
}
if (ImGui::IsItemActive())
{
g_fiber_pool->queue_job([]
{
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
}
@ -156,14 +154,18 @@ namespace big
ImGui::Separator();
components::sub_title("Aim Assistance");
components::command_checkbox<"triggerbot">(); ImGui::SameLine();
components::command_checkbox<"triggerbot">();
ImGui::SameLine();
components::command_checkbox<"aimbot">();
if (g.weapons.aimbot.enable)
if (g.weapons.aimbot.enable)
{
components::command_checkbox<"aimatplayer">(); ImGui::SameLine();
components::command_checkbox<"aimatnpc">(); ImGui::SameLine();
components::command_checkbox<"aimatpolice">(); ImGui::SameLine();
components::command_checkbox<"aimatplayer">();
ImGui::SameLine();
components::command_checkbox<"aimatnpc">();
ImGui::SameLine();
components::command_checkbox<"aimatpolice">();
ImGui::SameLine();
components::command_checkbox<"aimatenemy">();
components::command_checkbox<"smoothing">();

View File

@ -1,5 +1,5 @@
#include "views/view.hpp"
#include "services/context_menu/context_menu_service.hpp"
#include "views/view.hpp"
namespace big
{
@ -10,13 +10,21 @@ namespace big
if (g.context_menu.enabled)
{
ImGui::Text("SETTINGS_CONTEXT_MENU_ENTITY_TYPES"_T.data());
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_OBJECT"_T.data(), reinterpret_cast<int*>(&g.context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::OBJECT));
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_OBJECT"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::OBJECT));
ImGui::SameLine();
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_PED"_T.data(), reinterpret_cast<int*>(&g.context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::PED));
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_PED"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::PED));
ImGui::SameLine();
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_PLAYER"_T.data(), reinterpret_cast<int*>(&g.context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::PLAYER));
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_PLAYER"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::PLAYER));
ImGui::SameLine();
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_VEHICLE"_T.data(), reinterpret_cast<int*>(&g.context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::VEHICLE));
ImGui::CheckboxFlags("SETTINGS_CONTEXT_MENU_ENTITY_TYPE_VEHICLE"_T.data(),
reinterpret_cast<int*>(&g.context_menu.allowed_entity_types),
static_cast<int>(ContextEntityType::VEHICLE));
static ImVec4 selected_option_color = ImGui::ColorConvertU32ToFloat4(g.context_menu.selected_option_color);
ImGui::Text("SETTINGS_CONTEXT_MENU_COLOR"_T.data());

View File

@ -14,17 +14,25 @@ namespace big
ImGui::SliderFloat2("###Global Render Distance", g.esp.global_render_distance, 0.f, 1500.f);
ImGui::Checkbox("SETTINGS_ESP_TRACER"_T.data(), &g.esp.tracer);
if (g.esp.tracer) {
if (g.esp.tracer)
{
ImGui::Text("SETTINGS_ESP_TRACER_POSITION"_T.data());
ImGui::SliderFloat2("###Draw Position", g.esp.tracer_draw_position, 0.f, 1.f);
ImGui::Text("SETTINGS_ESP_TRACER_RENDER_DISTANCE"_T.data());
ImGui::SliderFloat2("###Tracer Render Distance", g.esp.tracer_render_distance, g.esp.global_render_distance[0], g.esp.global_render_distance[1]);
ImGui::SliderFloat2("###Tracer Render Distance",
g.esp.tracer_render_distance,
g.esp.global_render_distance[0],
g.esp.global_render_distance[1]);
}
ImGui::Checkbox("SETTINGS_ESP_BOX"_T.data(), &g.esp.box);
if (g.esp.box) {
if (g.esp.box)
{
ImGui::Text("SETTINGS_ESP_BOX_RENDER_DISTANCE"_T.data());
ImGui::SliderFloat2("###Box Render Distance", g.esp.box_render_distance, g.esp.global_render_distance[0], g.esp.global_render_distance[1]);
ImGui::SliderFloat2("###Box Render Distance",
g.esp.box_render_distance,
g.esp.global_render_distance[0],
g.esp.global_render_distance[1]);
}
ImGui::Checkbox("SETTINGS_ESP_PLAYER_NAME"_T.data(), &g.esp.name);
@ -40,17 +48,21 @@ namespace big
if (g.esp.armor)
ImGui::Checkbox("SETTINGS_ESP_SCALE_ARMOR"_T.data(), &g.esp.scale_armor_from_dist);
static ImVec4 col_enemy = ImGui::ColorConvertU32ToFloat4(g.esp.enemy_color);
static ImVec4 col_enemy = ImGui::ColorConvertU32ToFloat4(g.esp.enemy_color);
static ImVec4 col_enemy_near = ImGui::ColorConvertU32ToFloat4(g.esp.enemy_near_color);
static ImVec4 col_default = ImGui::ColorConvertU32ToFloat4(g.esp.default_color);
static ImVec4 col_friend = ImGui::ColorConvertU32ToFloat4(g.esp.friend_color);
static ImVec4 col_default = ImGui::ColorConvertU32ToFloat4(g.esp.default_color);
static ImVec4 col_friend = ImGui::ColorConvertU32ToFloat4(g.esp.friend_color);
ImGui::Text("SETTINGS_ESP_DISTANCE_THRESHOLD"_T.data());
ImGui::SliderFloat2("###Distance threshold", g.esp.distance_threshold, g.esp.global_render_distance[0], g.esp.global_render_distance[1]);
ImGui::SliderFloat2("###Distance threshold",
g.esp.distance_threshold,
g.esp.global_render_distance[0],
g.esp.global_render_distance[1]);
if (ImGui::TreeNode("SETTINGS_ESP_COLORS"_T.data()))
{
if (g.esp.change_esp_color_from_dist) {
if (g.esp.change_esp_color_from_dist)
{
ImGui::Text("SETTINGS_ESP_ENEMY_CLOSE_COLOR"_T.data());
if (ImGui::ColorEdit4("###Enemy ESP Color##esp_picker", (float*)&col_enemy, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{

View File

@ -1,17 +1,13 @@
#include "views/view.hpp"
#include "renderer.hpp"
#include "views/view.hpp"
namespace big
{
void view::gui_settings()
{
components::sub_title("SETTINGS_UI_SCALE"_T);
ImGui::SliderFloat("##gui-scale", &g.window.gui_scale, 1.f, 1.5f, "%.2f");
ImGui::SameLine();
if (ImGui::Button("APPLY"_T.data()))
if (ImGui::SliderFloat("##gui-scale", &g.window.gui_scale, 1.f, 1.5f, "%.2f"))
g_renderer->rescale(g.window.gui_scale);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("SETTINGS_UI_SCALE_DESCRIPTION"_T.data());
components::sub_title("SETTINGS_UI_COLOR"_T);
static ImVec4 col_gui = ImGui::ColorConvertU32ToFloat4(g.window.color);

View File

@ -1,6 +1,6 @@
#include "services/hotkey/hotkey_service.hpp"
#include "views/view.hpp"
#include "widgets/imgui_hotkey.hpp"
#include "services/hotkey/hotkey_service.hpp"
namespace big
{
@ -9,7 +9,7 @@ namespace big
ImGui::PushItemWidth(350.f);
if (ImGui::Hotkey("Menu Toggle", &g.settings.hotkeys.menu_toggle))
g.settings.hotkeys.editing_menu_toggle = true; // make our menu reappear
g.settings.hotkeys.editing_menu_toggle = true;// make our menu reappear
if (ImGui::Hotkey("Teleport to waypoint", &g.settings.hotkeys.teleport_waypoint))
g_hotkey_service->update_hotkey("waypoint", g.settings.hotkeys.teleport_waypoint);

View File

@ -1,6 +1,6 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "views/view.hpp"
namespace big::helper
{
@ -31,44 +31,44 @@ namespace big
static int year, month, day, hour, minute, second, millisecond;
static char stat_int_read_result[256] = {};
static char stat_int_text[256] = {};
static char stat_int_value[256] = {};
static char stat_int_text[256] = {};
static char stat_int_value[256] = {};
static char stat_bool_read_result[256] = {};
static char stat_bool_text[256] = {};
static char stat_bool_value[256] = {};
static char stat_bool_text[256] = {};
static char stat_bool_value[256] = {};
static char stat_float_read_result[256] = {};
static char stat_float_text[256] = {};
static char stat_float_value[256] = {};
static char stat_float_text[256] = {};
static char stat_float_value[256] = {};
static char stat_increment_text[256] = {};
static char stat_increment_text[256] = {};
static char stat_increment_value[256] = {};
static char stat_date_read_result[256] = {};
static char stat_date_text[256] = {};
static char stat_date_value[256] = {};
static char stat_date_text[256] = {};
static char stat_date_value[256] = {};
static char stat_string_read_result[256] = {};
static char stat_string_text[256] = {};
static char stat_string_value[256] = {};
static char stat_string_text[256] = {};
static char stat_string_value[256] = {};
static char stat_label_text[256] = {};
static char stat_label_text[256] = {};
static char stat_label_value[256] = {};
static char stat_user_id_read_result[256] = {};
static char stat_user_id_text[256] = {};
static char stat_user_id_value[256] = {};
static char stat_user_id_text[256] = {};
static char stat_user_id_value[256] = {};
static char packed_stat_int_read_result[256] = {};
static char packed_stat_int_text[256] = {};
static char packed_stat_int_value[256] = {};
static char packed_stat_int_text[256] = {};
static char packed_stat_int_value[256] = {};
static char packed_stat_bool_read_result[256] = {};
static char packed_stat_bool_text[256] = {};
static char packed_stat_bool_value[256] = {};
static char packed_stat_bool_text[256] = {};
static char packed_stat_bool_value[256] = {};
template <typename T>
template<typename T>
static std::enable_if_t<std::is_same_v<T, std::string>, T> get_text_value(std::string text)
{
return text;
@ -125,97 +125,160 @@ namespace big
IMPORT
};
ImGui::RadioButton("Int", &g.stat_editor.stat.radio_button_index, INT); ImGui::SameLine();
ImGui::RadioButton("Bool", &g.stat_editor.stat.radio_button_index, BOOLEAN); ImGui::SameLine();
ImGui::RadioButton("Float", &g.stat_editor.stat.radio_button_index, FLOAT); ImGui::SameLine();
ImGui::RadioButton("Increment", &g.stat_editor.stat.radio_button_index, INCREMENT); ImGui::SameLine();
ImGui::RadioButton("Date", &g.stat_editor.stat.radio_button_index, DATE); ImGui::SameLine();
ImGui::RadioButton("String", &g.stat_editor.stat.radio_button_index, STRING); ImGui::SameLine();
ImGui::RadioButton("Label", &g.stat_editor.stat.radio_button_index, LABEL); ImGui::SameLine();
ImGui::RadioButton("User Id", &g.stat_editor.stat.radio_button_index, USER_ID); ImGui::SameLine();
ImGui::RadioButton("Int", &g.stat_editor.stat.radio_button_index, INT);
ImGui::SameLine();
ImGui::RadioButton("Bool", &g.stat_editor.stat.radio_button_index, BOOLEAN);
ImGui::SameLine();
ImGui::RadioButton("Float", &g.stat_editor.stat.radio_button_index, FLOAT);
ImGui::SameLine();
ImGui::RadioButton("Increment", &g.stat_editor.stat.radio_button_index, INCREMENT);
ImGui::SameLine();
ImGui::RadioButton("Date", &g.stat_editor.stat.radio_button_index, DATE);
ImGui::SameLine();
ImGui::RadioButton("String", &g.stat_editor.stat.radio_button_index, STRING);
ImGui::SameLine();
ImGui::RadioButton("Label", &g.stat_editor.stat.radio_button_index, LABEL);
ImGui::SameLine();
ImGui::RadioButton("User Id", &g.stat_editor.stat.radio_button_index, USER_ID);
ImGui::SameLine();
ImGui::RadioButton("Import", &g.stat_editor.stat.radio_button_index, IMPORT);
switch (g.stat_editor.stat.radio_button_index)
{
case INT:
{
components::input_text("Stat", stat_int_text, sizeof(stat_int_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.int_text = stat_int_text; });
components::input_text("Value", stat_int_value, sizeof(stat_int_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.int_value = stat_int_value; });
components::button("Apply", [] { helper::stat_set_int(stat_int_text, stat_int_value); }); ImGui::SameLine();
components::input_text("Stat", stat_int_text, sizeof(stat_int_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.int_text = stat_int_text;
});
components::input_text("Value", stat_int_value, sizeof(stat_int_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.int_value = stat_int_value;
});
components::button("Apply", [] {
helper::stat_set_int(stat_int_text, stat_int_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.int_read);
components::input_text("##read_result", stat_int_read_result, sizeof(stat_int_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case BOOLEAN:
{
components::input_text("Stat", stat_bool_text, sizeof(stat_bool_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.bool_text = stat_bool_text; });
components::input_text("Value", stat_bool_value, sizeof(stat_bool_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.bool_value = stat_bool_value; });
components::button("Apply", [] { helper::stat_set_bool(stat_bool_text, stat_bool_value); }); ImGui::SameLine();
components::input_text("Stat", stat_bool_text, sizeof(stat_bool_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.bool_text = stat_bool_text;
});
components::input_text("Value", stat_bool_value, sizeof(stat_bool_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.bool_value = stat_bool_value;
});
components::button("Apply", [] {
helper::stat_set_bool(stat_bool_text, stat_bool_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.bool_read);
components::input_text("##read_result", stat_bool_read_result, sizeof(stat_bool_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case FLOAT:
{
components::input_text("Stat", stat_float_text, sizeof(stat_float_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.float_text = stat_float_text; });
components::input_text("Value", stat_float_value, sizeof(stat_float_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.float_value = stat_float_value; });
components::button("Apply", [] { helper::stat_set_float(stat_float_text, stat_float_value); }); ImGui::SameLine();
components::input_text("Stat", stat_float_text, sizeof(stat_float_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.float_text = stat_float_text;
});
components::input_text("Value", stat_float_value, sizeof(stat_float_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.float_value = stat_float_value;
});
components::button("Apply", [] {
helper::stat_set_float(stat_float_text, stat_float_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.float_read);
components::input_text("##read_result", stat_float_read_result, sizeof(stat_float_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case INCREMENT:
{
components::input_text("Stat", stat_increment_text, sizeof(stat_increment_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.increment_text = stat_increment_text; });
components::input_text("Value", stat_increment_value, sizeof(stat_increment_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.increment_value = stat_increment_value; });
components::button("Apply", [] { helper::stat_increment(stat_increment_text, stat_increment_value); }); ImGui::SameLine();
components::input_text("Stat", stat_increment_text, sizeof(stat_increment_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.increment_text = stat_increment_text;
});
components::input_text("Value", stat_increment_value, sizeof(stat_increment_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.increment_value = stat_increment_value;
});
components::button("Apply", [] {
helper::stat_increment(stat_increment_text, stat_increment_value);
});
ImGui::SameLine();
ImGui::SameLine();
ImGui::Checkbox("Loop Write", &g.stat_editor.stat.increment_loop_write);
}
break;
break;
case DATE:
{
components::input_text("Stat", stat_date_text, sizeof(stat_date_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.date_text = stat_date_text; });
components::input_text("Value", stat_date_value, sizeof(stat_date_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.date_value = stat_date_value; });
components::input_text("Stat", stat_date_text, sizeof(stat_date_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.date_text = stat_date_text;
});
components::input_text("Value", stat_date_value, sizeof(stat_date_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.date_value = stat_date_value;
});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("year month day hour minute second millisecond\nexample: 2022 1 17 21 34 55");
components::button("Apply", [] { helper::stat_set_date(stat_date_text, stat_date_value); }); ImGui::SameLine();
components::button("Apply", [] {
helper::stat_set_date(stat_date_text, stat_date_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.date_read);
components::input_text("##read_result", stat_date_read_result, sizeof(stat_date_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case STRING:
{
components::input_text("Stat", stat_string_text, sizeof(stat_string_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.string_text = stat_string_text; });
components::input_text("Value", stat_string_value, sizeof(stat_string_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.string_value = stat_string_value; });
components::button("Apply", [] { helper::stat_set_string(stat_string_text, stat_string_value); }); ImGui::SameLine();
components::input_text("Stat", stat_string_text, sizeof(stat_string_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.string_text = stat_string_text;
});
components::input_text("Value", stat_string_value, sizeof(stat_string_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.string_value = stat_string_value;
});
components::button("Apply", [] {
helper::stat_set_string(stat_string_text, stat_string_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.string_read);
components::input_text("##read_result", stat_string_read_result, sizeof(stat_string_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case LABEL:
{
components::input_text("Stat", stat_label_text, sizeof(stat_label_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.label_text = stat_label_text; });
components::input_text("Value", stat_label_value, sizeof(stat_label_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.label_value = stat_label_value; });
components::button("Apply", [] { helper::stat_set_label(stat_label_text, stat_label_value); }); ImGui::SameLine();
components::input_text("Stat", stat_label_text, sizeof(stat_label_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.label_text = stat_label_text;
});
components::input_text("Value", stat_label_value, sizeof(stat_label_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.label_value = stat_label_value;
});
components::button("Apply", [] {
helper::stat_set_label(stat_label_text, stat_label_value);
});
ImGui::SameLine();
}
break;
break;
case USER_ID:
{
components::input_text("Stat", stat_user_id_text, sizeof(stat_user_id_text), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.user_id_text = stat_user_id_text; });
components::input_text("Value", stat_user_id_value, sizeof(stat_user_id_value), ImGuiInputTextFlags_None, [] { g.stat_editor.stat.user_id_value = stat_user_id_value; });
components::button("Apply", [] { helper::stat_set_user_id(stat_user_id_text, stat_user_id_value); }); ImGui::SameLine();
components::input_text("Stat", stat_user_id_text, sizeof(stat_user_id_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.user_id_text = stat_user_id_text;
});
components::input_text("Value", stat_user_id_value, sizeof(stat_user_id_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.stat.user_id_value = stat_user_id_value;
});
components::button("Apply", [] {
helper::stat_set_user_id(stat_user_id_text, stat_user_id_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.stat.user_id_read);
components::input_text("##read_result", stat_user_id_read_result, sizeof(stat_user_id_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case IMPORT:
{
ImGui::Text("0:Int\n1:Bool\n2:Float\n3:Increment\n4:Date\n5:String\n6:Label\n7:User Id");
ImGui::Text("Example:\n$MPX_CHAR_NAME\n5:name\n$MPX_DEFAULT_STATS_SET\n1:0");
components::button("Import From Clipboard", []
{
std::string clipboard_text = ImGui::GetClipboardText();
components::button("Import From Clipboard", [] {
std::string clipboard_text = ImGui::GetClipboardText();
std::vector<std::string> lines = split(clipboard_text, '\n');
if (!lines.size() || lines.size() % 2)
return;
@ -225,43 +288,25 @@ namespace big
continue;
std::vector<std::string> strs = split(lines[i + 1], ':');
if (strs.size() == 1)
strs.push_back(""); //In case the string is to set a ""
strs.push_back("");//In case the string is to set a ""
int type = get_text_value<int>(strs[0]);
switch (type)
{
case INT:
helper::stat_set_int(lines[i], strs[1]);
break;
case BOOLEAN:
helper::stat_set_bool(lines[i], strs[1]);
break;
case FLOAT:
helper::stat_set_float(lines[i], strs[1]);
break;
case INCREMENT:
helper::stat_increment(lines[i], strs[1]);
break;
case DATE:
helper::stat_set_date(lines[i], strs[1]);
break;
case STRING:
helper::stat_set_string(lines[i], strs[1]);
break;
case LABEL:
helper::stat_set_label(lines[i], strs[1]);
break;
case USER_ID:
helper::stat_set_user_id(lines[i], strs[1]);
break;
default:
break;
case INT: helper::stat_set_int(lines[i], strs[1]); break;
case BOOLEAN: helper::stat_set_bool(lines[i], strs[1]); break;
case FLOAT: helper::stat_set_float(lines[i], strs[1]); break;
case INCREMENT: helper::stat_increment(lines[i], strs[1]); break;
case DATE: helper::stat_set_date(lines[i], strs[1]); break;
case STRING: helper::stat_set_string(lines[i], strs[1]); break;
case LABEL: helper::stat_set_label(lines[i], strs[1]); break;
case USER_ID: helper::stat_set_user_id(lines[i], strs[1]); break;
default: break;
}
}
});
}
break;
default:
break;
break;
default: break;
}
ImGui::EndTabItem();
@ -281,37 +326,52 @@ namespace big
IMPORT
};
ImGui::RadioButton("Int", &g.stat_editor.packed_stat.radio_button_index, INT); ImGui::SameLine();
ImGui::RadioButton("Bool", &g.stat_editor.packed_stat.radio_button_index, BOOLEAN); ImGui::SameLine();
ImGui::RadioButton("Int", &g.stat_editor.packed_stat.radio_button_index, INT);
ImGui::SameLine();
ImGui::RadioButton("Bool", &g.stat_editor.packed_stat.radio_button_index, BOOLEAN);
ImGui::SameLine();
ImGui::RadioButton("Import", &g.stat_editor.packed_stat.radio_button_index, IMPORT);
switch (g.stat_editor.packed_stat.radio_button_index)
{
case INT:
{
components::input_text("Index", packed_stat_int_text, sizeof(packed_stat_int_text), ImGuiInputTextFlags_None, [] { g.stat_editor.packed_stat.int_text = packed_stat_int_text; });
components::input_text("Value", packed_stat_int_value, sizeof(packed_stat_int_value), ImGuiInputTextFlags_None, [] { g.stat_editor.packed_stat.int_value = packed_stat_int_value; });
components::button("Apply", [] { helper::packed_stat_set_int(packed_stat_int_text, packed_stat_int_value); }); ImGui::SameLine();
components::input_text("Index", packed_stat_int_text, sizeof(packed_stat_int_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.packed_stat.int_text = packed_stat_int_text;
});
components::input_text("Value", packed_stat_int_value, sizeof(packed_stat_int_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.packed_stat.int_value = packed_stat_int_value;
});
components::button("Apply", [] {
helper::packed_stat_set_int(packed_stat_int_text, packed_stat_int_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.packed_stat.int_read);
components::input_text("##read_result", packed_stat_int_read_result, sizeof(packed_stat_int_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case BOOLEAN:
{
components::input_text("Index", packed_stat_bool_text, sizeof(packed_stat_bool_text), ImGuiInputTextFlags_None, [] { g.stat_editor.packed_stat.bool_text = packed_stat_bool_text; });
components::input_text("Value", packed_stat_bool_value, sizeof(packed_stat_bool_value), ImGuiInputTextFlags_None, [] { g.stat_editor.packed_stat.bool_value = packed_stat_bool_value; });
components::button("Apply", [] { helper::packed_stat_set_bool(packed_stat_bool_text, packed_stat_bool_value); }); ImGui::SameLine();
components::input_text("Index", packed_stat_bool_text, sizeof(packed_stat_bool_text), ImGuiInputTextFlags_None, [] {
g.stat_editor.packed_stat.bool_text = packed_stat_bool_text;
});
components::input_text("Value", packed_stat_bool_value, sizeof(packed_stat_bool_value), ImGuiInputTextFlags_None, [] {
g.stat_editor.packed_stat.bool_value = packed_stat_bool_value;
});
components::button("Apply", [] {
helper::packed_stat_set_bool(packed_stat_bool_text, packed_stat_bool_value);
});
ImGui::SameLine();
ImGui::Checkbox("Read", &g.stat_editor.packed_stat.bool_read);
components::input_text("##read_result", packed_stat_bool_read_result, sizeof(packed_stat_bool_read_result), ImGuiInputTextFlags_ReadOnly);
}
break;
break;
case IMPORT:
{
ImGui::Text("0:Int\n1:Bool");
ImGui::Text("Example:\n31786\n0:123\n31786 32786\n1:1");
components::button("Import From Clipboard", []
{
std::string clipboard_text = ImGui::GetClipboardText();
components::button("Import From Clipboard", [] {
std::string clipboard_text = ImGui::GetClipboardText();
std::vector<std::string> lines = split(clipboard_text, '\n');
if (!lines.size() || lines.size() % 2)
return;
@ -325,21 +385,15 @@ namespace big
int type = get_text_value<int>(strs[0]);
switch (type)
{
case INT:
helper::packed_stat_set_int(lines[i], strs[1]);
break;
case BOOLEAN:
helper::packed_stat_set_bool(lines[i], strs[1]);
break;
default:
break;
case INT: helper::packed_stat_set_int(lines[i], strs[1]); break;
case BOOLEAN: helper::packed_stat_set_bool(lines[i], strs[1]); break;
default: break;
}
}
});
}
break;
default:
break;
break;
default: break;
}
ImGui::EndTabItem();
@ -373,8 +427,7 @@ namespace big
strcpy_s(packed_stat_bool_value, sizeof(packed_stat_bool_value), g.stat_editor.packed_stat.bool_value.c_str());
}(), true);
g_fiber_pool->queue_job([]
{
g_fiber_pool->queue_job([] {
STATS::STAT_GET_INT(RAGE_JOAAT("MPPLY_LAST_MP_CHAR"), &character_index, -1);
CLOCK::GET_POSIX_TIME(&year, &month, &day, &hour, &minute, &second);
if (g.stat_editor.stat.int_read)
@ -388,13 +441,21 @@ namespace big
if (g.stat_editor.stat.date_read)
strcpy_s(stat_date_read_result, sizeof(stat_date_read_result), helper::stat_get_date(stat_date_text).c_str());
if (g.stat_editor.stat.string_read)
strcpy_s(stat_string_read_result, sizeof(stat_string_read_result), helper::stat_get_string(stat_string_text).c_str());
strcpy_s(stat_string_read_result,
sizeof(stat_string_read_result),
helper::stat_get_string(stat_string_text).c_str());
if (g.stat_editor.stat.user_id_read)
strcpy_s(stat_user_id_read_result, sizeof(stat_user_id_read_result), helper::stat_get_user_id(stat_user_id_text).c_str());
if(g.stat_editor.packed_stat.int_read)
strcpy_s(packed_stat_int_read_result, sizeof(packed_stat_int_read_result), helper::packed_stat_get_int(packed_stat_int_text).c_str());
strcpy_s(stat_user_id_read_result,
sizeof(stat_user_id_read_result),
helper::stat_get_user_id(stat_user_id_text).c_str());
if (g.stat_editor.packed_stat.int_read)
strcpy_s(packed_stat_int_read_result,
sizeof(packed_stat_int_read_result),
helper::packed_stat_get_int(packed_stat_int_text).c_str());
if (g.stat_editor.packed_stat.bool_read)
strcpy_s(packed_stat_bool_read_result, sizeof(packed_stat_bool_read_result), helper::packed_stat_get_bool(packed_stat_bool_text).c_str());
strcpy_s(packed_stat_bool_read_result,
sizeof(packed_stat_bool_read_result),
helper::packed_stat_get_bool(packed_stat_bool_text).c_str());
});
components::sub_title(std::format("Posix Time: {}-{}-{} {}:{}:{}", year, month, day, hour, minute, second));
@ -447,7 +508,7 @@ namespace big::helper
std::vector<int64_t> strs = split<int64_t>(value, ' ');
int64_t dates[7]{};
STATS::STAT_GET_DATE(get_text_stat_hash(stat), (Any*)dates, 7, -1);
while (strs.size() < 7) //Writing will succeed only when size is greater than or equal to 7
while (strs.size() < 7)//Writing will succeed only when size is greater than or equal to 7
strs.push_back(dates[strs.size()]);
STATS::STAT_SET_DATE(get_text_stat_hash(stat), (Any*)strs.data(), strs.size(), TRUE);
}
@ -526,8 +587,8 @@ namespace big::helper
if (index == "" || value == "")
return;
std::vector<int> index_v = split<int>(index, ' ');
int index_min = index_v[0];
int index_max = index_min;
int index_min = index_v[0];
int index_max = index_min;
if (index_v.size() >= 2)
index_max = index_v[1];
int value_n = get_text_value<int>(value);
@ -540,8 +601,8 @@ namespace big::helper
if (index == "" || value == "")
return;
std::vector<int> index_v = split<int>(index, ' ');
int index_min = index_v[0];
int index_max = index_min;
int index_min = index_v[0];
int index_max = index_min;
if (index_v.size() >= 2)
index_max = index_v[1];
int value_b = get_text_value<bool>(value);

View File

@ -5,7 +5,7 @@ namespace big
void view::translation_settings()
{
const auto& language_entries = g_translation_service.available_translations();
const auto current_pack = g_translation_service.current_language_pack();
const auto current_pack = g_translation_service.current_language_pack();
ImGui::Text("SETTINGS_LANGUAGES"_T.data());
if (ImGui::BeginCombo("##combo-languages", language_entries.at(current_pack).name.c_str()))

View File

@ -1,12 +1,12 @@
#include "core/data/speed_units.hpp"
#include "core/enums.hpp"
#include "fiber_pool.hpp"
#include "script.hpp"
#include "views/view.hpp"
#include "util/vehicle.hpp"
#include "util/mobile.hpp"
#include "core/data/speed_units.hpp"
#include "services/gta_data/gta_data_service.hpp"
#include "services/model_preview/model_preview_service.hpp"
#include "util/mobile.hpp"
#include "util/vehicle.hpp"
#include "views/view.hpp"
#include <imgui_internal.h>
@ -29,7 +29,6 @@ namespace big
ready = false;
g_fiber_pool->queue_job([] {
std::map<int, bool> tmp_seats;
int num_of_seats = VEHICLE::GET_VEHICLE_MAX_NUMBER_OF_PASSENGERS(self::veh);
@ -66,7 +65,8 @@ namespace big
name = "FUN_VEHICLE_SEAT"_T.data() + std::to_string(idx + 1);
}
if ((idx + 1) % 4 != 0) {
if ((idx + 1) % 4 != 0)
{
ImGui::SameLine();
}
@ -87,16 +87,17 @@ namespace big
{
float auto_drive_speed_user_unit = vehicle::mps_to_speed(g.vehicle.auto_drive_speed, g.vehicle.speed_unit);
if (ImGui::SliderFloat(
std::vformat("FUN_VEHICLE_TOP_SPEED"_T, std::make_format_args(speed_unit_strings[(int)g.vehicle.speed_unit])).c_str(),
&auto_drive_speed_user_unit,
vehicle::mps_to_speed(0.f, g.vehicle.speed_unit),
vehicle::mps_to_speed(150.f, g.vehicle.speed_unit),
"%.1f"
)) {
std::vformat("FUN_VEHICLE_TOP_SPEED"_T, std::make_format_args(speed_unit_strings[(int)g.vehicle.speed_unit]))
.c_str(),
&auto_drive_speed_user_unit,
vehicle::mps_to_speed(0.f, g.vehicle.speed_unit),
vehicle::mps_to_speed(150.f, g.vehicle.speed_unit),
"%.1f"))
{
g.vehicle.auto_drive_speed = vehicle::speed_to_mps(auto_drive_speed_user_unit, g.vehicle.speed_unit);
}
const char* driving_style_names[] = { "LAW_ABIDING"_T.data(), "ROAD_IS_YOURS"_T.data() };
const char* driving_style_names[] = {"LAW_ABIDING"_T.data(), "ROAD_IS_YOURS"_T.data()};
if (ImGui::BeginCombo("DRIVING_STYLE"_T.data(), driving_style_names[(int)g.vehicle.auto_drive_style]))
{
for (int i = 0; i < 2; i++)
@ -104,10 +105,8 @@ namespace big
if (ImGui::Selectable(driving_style_names[i], g.vehicle.auto_drive_style == (AutoDriveStyle)i))
{
g.vehicle.auto_drive_style = (AutoDriveStyle)i;
g_notification_service->push_warning(
"AUTO_DRIVE"_T.data(),
std::vformat("DRIVING_STYLE_SET_TO"_T.data(), std::make_format_args(driving_style_names[i]))
);
g_notification_service->push_warning("AUTO_DRIVE"_T.data(),
std::vformat("DRIVING_STYLE_SET_TO"_T.data(), std::make_format_args(driving_style_names[i])));
}
if (g.vehicle.auto_drive_style == (AutoDriveStyle)i)
@ -119,21 +118,23 @@ namespace big
ImGui::EndCombo();
}
if (components::button("TO_OBJECTIVE"_T)) {
if (components::button("TO_OBJECTIVE"_T))
g.vehicle.auto_drive_destination = AutoDriveDestination::OBJECTITVE;
}
ImGui::SameLine();
if (components::button("TO_WAYPOINT"_T)) {
if (components::button("TO_WAYPOINT"_T))
g.vehicle.auto_drive_destination = AutoDriveDestination::WAYPOINT;
}
ImGui::SameLine();
if (components::button("WANDER"_T)) {
if (components::button("WANDER"_T))
g.vehicle.auto_drive_destination = AutoDriveDestination::WANDER;
}
ImGui::SameLine();
if (components::button("EMERGENCY_STOP"_T)) {
if (components::button("EMERGENCY_STOP"_T))
g.vehicle.auto_drive_destination = AutoDriveDestination::EMERGENCY_STOP;
}
}
ImGui::Separator();
@ -148,7 +149,7 @@ namespace big
ImGui::SameLine();
ImGui::Checkbox("SMOKE"_T.data(), &g.vehicle.rainbow_paint.smoke);
const char* rgb_types[] = { "OFF"_T.data(), "FADE"_T.data(), "SPASM"_T.data() };
const char* rgb_types[] = {"OFF"_T.data(), "FADE"_T.data(), "SPASM"_T.data()};
ImGui::SetNextItemWidth(120);
if (ImGui::BeginCombo("RGB_TYPE"_T.data(), rgb_types[(int)g.vehicle.rainbow_paint.type]))
@ -179,7 +180,7 @@ namespace big
}
ImGui::Separator();
const char* boost_behaviors[] = { "DEFAULT"_T.data(), "INSTANT_REFILL"_T.data(), "INFINITE"_T.data() };
const char* boost_behaviors[] = {"DEFAULT"_T.data(), "INSTANT_REFILL"_T.data(), "INFINITE"_T.data()};
if (ImGui::BeginCombo("BOOST_BEHAVIOR"_T.data(), boost_behaviors[static_cast<int>(g.vehicle.boost_behavior)]))
{
for (int i = 0; i < 3; i++)
@ -221,12 +222,13 @@ namespace big
float fly_speed_user_unit = vehicle::mps_to_speed(g.vehicle.fly.speed, g.vehicle.speed_unit);
if (ImGui::SliderFloat(
std::vformat("FUN_VEHICLE_SPEED"_T.data(), std::make_format_args(speed_unit_strings[(int)g.vehicle.speed_unit])).c_str(),
&fly_speed_user_unit,
vehicle::mps_to_speed(0.f, g.vehicle.speed_unit),
vehicle::mps_to_speed(150.f, g.vehicle.speed_unit),
"%.1f"
)) {
std::vformat("FUN_VEHICLE_SPEED"_T.data(), std::make_format_args(speed_unit_strings[(int)g.vehicle.speed_unit]))
.c_str(),
&fly_speed_user_unit,
vehicle::mps_to_speed(0.f, g.vehicle.speed_unit),
vehicle::mps_to_speed(150.f, g.vehicle.speed_unit),
"%.1f"))
{
g.vehicle.fly.speed = vehicle::speed_to_mps(fly_speed_user_unit, g.vehicle.speed_unit);
}
}

View File

@ -1,10 +1,11 @@
#include "core/data/lsc_types.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "script.hpp"
#include "services/vehicle_helper/vehicle_helper.hpp"
#include "core/data/lsc_types.hpp"
#include "views/view.hpp"
#include "util/vehicle.hpp"
#include "views/view.hpp"
#include <imgui_internal.h>
namespace big
@ -12,7 +13,7 @@ namespace big
void view::lsc()
{
static Vehicle player_vehicle = 0;
static bool ready = true;
static bool ready = true;
static std::map<int, int32_t> owned_mods;
static std::map<int, std::string> slot_display_names;
@ -20,14 +21,14 @@ namespace big
static std::map<std::string, std::vector<int>> front_wheel_map;
static std::map<std::string, std::vector<int>> rear_wheel_map;
static int selected_slot = -1;
static bool is_bennys = false;
static int selected_slot = -1;
static bool is_bennys = false;
static int front_wheel_stock_mod = -1;
static int rear_wheel_stock_mod = -1;
static int rear_wheel_stock_mod = -1;
if (self::veh == 0 || player_vehicle != self::veh)
{
if (self::veh == 0 )
if (self::veh == 0)
{
owned_mods.clear();
slot_display_names.clear();
@ -44,7 +45,7 @@ namespace big
if (player_vehicle != self::veh && ready == true)
{
ready = false;
ready = false;
player_vehicle = self::veh;
g_fiber_pool->queue_job([] {
@ -54,7 +55,7 @@ namespace big
HUD::REQUEST_ADDITIONAL_TEXT("MOD_MNU", 10);
script::get_current()->yield();
}
VEHICLE::SET_VEHICLE_MOD_KIT(player_vehicle, 0);
Hash model = ENTITY::GET_ENTITY_MODEL(player_vehicle);
@ -69,17 +70,13 @@ namespace big
tmp_slot_display_names[MOD_PLATE_STYLE] = "PLATE_STYLE"_T.data();
tmp_slot_display_names[MOD_WINDOW_TINT] = "WINDOW_TINT"_T.data();
tmp_slot_display_names[MOD_WHEEL_TYPE] = "WHEEL_TYPE"_T.data();
tmp_slot_display_names[MOD_WHEEL_TYPE] = "WHEEL_TYPE"_T.data();
tmp_mod_display_names[MOD_PLATE_STYLE].insert(lsc_plate_styles.begin(), lsc_plate_styles.end());
tmp_mod_display_names[MOD_WINDOW_TINT].insert(lsc_window_tint_types.begin(), lsc_window_tint_types.end());
tmp_mod_display_names[MOD_WHEEL_TYPE].insert(lsc_wheel_styles.begin(), lsc_wheel_styles.end());
is_bennys = owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_BENNYS_ORIGINAL ||
owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_BENNYS_BESPOKE ||
owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_OPEN_WHEEL ||
owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_STREET ||
owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_TRACK;
is_bennys = owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_BENNYS_ORIGINAL || owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_BENNYS_BESPOKE || owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_OPEN_WHEEL || owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_STREET || owned_mods[MOD_WHEEL_TYPE] == WHEEL_TYPE_TRACK;
for (int slot = MOD_SPOILERS; slot <= MOD_LIGHTBAR; slot++)
{
@ -125,7 +122,6 @@ namespace big
{
mod_name = new_mod_name;
}
}
}
@ -141,7 +137,7 @@ namespace big
is_repeated = true;
}
}
else if(slot == MOD_REARWHEEL)
else if (slot == MOD_REARWHEEL)
{
if (is_bennys)
{
@ -153,7 +149,6 @@ namespace big
{
mod_name = new_mod_name;
}
}
}
@ -186,9 +181,9 @@ namespace big
}
slot_display_names = tmp_slot_display_names;
mod_display_names = tmp_mod_display_names;
front_wheel_map = tmp_front_wheel_map;
rear_wheel_map = tmp_rear_wheel_map;
mod_display_names = tmp_mod_display_names;
front_wheel_map = tmp_front_wheel_map;
rear_wheel_map = tmp_rear_wheel_map;
ready = true;
});
@ -279,8 +274,8 @@ namespace big
if (selected_slot != -1)
{
auto wheel_stock_mod = &front_wheel_stock_mod;
auto wheel_custom = &owned_mods[MOD_FRONTWHEEL_VAR];
bool is_wheel_mod = false;
auto wheel_custom = &owned_mods[MOD_FRONTWHEEL_VAR];
bool is_wheel_mod = false;
if (selected_slot == MOD_FRONTWHEEL)
{
@ -289,8 +284,8 @@ namespace big
else if (selected_slot == MOD_REARWHEEL)
{
wheel_stock_mod = &rear_wheel_stock_mod;
wheel_custom = &owned_mods[MOD_REARWHEEL_VAR];
is_wheel_mod = true;
wheel_custom = &owned_mods[MOD_REARWHEEL_VAR];
is_wheel_mod = true;
}
else
{
@ -305,7 +300,7 @@ namespace big
{
for (const auto& it : mod_display_names[selected_slot])
{
const auto& mod = it.first;
const auto& mod = it.first;
const auto& name = it.second;
bool item_selected = mod == owned_mods[selected_slot];
@ -328,7 +323,7 @@ namespace big
if (is_wheel_mod)
{
*wheel_stock_mod = mod;
*wheel_custom = false;
*wheel_custom = false;
}
}
else if (selected_slot == MOD_WINDOW_TINT)
@ -356,9 +351,8 @@ namespace big
ImGui::EndGroup();
if (
is_wheel_mod && *wheel_stock_mod != -1
) {
if (is_wheel_mod && *wheel_stock_mod != -1)
{
auto wheel_map = front_wheel_map;
if (selected_slot == MOD_REARWHEEL)
@ -373,7 +367,7 @@ namespace big
if (ImGui::ListBoxHeader("##style", ImVec2(200, 200)))
{
std::string mod_name = mod_display_names[selected_slot][*wheel_stock_mod];
auto wheel_mods = wheel_map[mod_name];
auto wheel_mods = wheel_map[mod_name];
for (int i = 0; i < wheel_mods.size(); i++)
{
@ -415,7 +409,6 @@ namespace big
}
ImGui::Separator();
components::sub_title("NEON_LIGHT_OPTIONS"_T);
@ -458,11 +451,11 @@ namespace big
ImGui::SameLine();
ImGui::PushID("##neon_check_all");
components::button("CHECK_ALL"_T, [] {
owned_mods[MOD_XENON_LIGHTS] = true;
owned_mods[MOD_NEON_LEFT_ON] = true;
owned_mods[MOD_XENON_LIGHTS] = true;
owned_mods[MOD_NEON_LEFT_ON] = true;
owned_mods[MOD_NEON_RIGHT_ON] = true;
owned_mods[MOD_NEON_FRONT_ON] = true;
owned_mods[MOD_NEON_BACK_ON] = true;
owned_mods[MOD_NEON_BACK_ON] = true;
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_XENON_LIGHTS, owned_mods[MOD_XENON_LIGHTS]);
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_LEFT, owned_mods[MOD_NEON_LEFT_ON]);
@ -474,11 +467,11 @@ namespace big
ImGui::SameLine();
ImGui::PushID("##neon_uncheck_all");
components::button("UNCHECK_ALL"_T, [] {
owned_mods[MOD_XENON_LIGHTS] = false;
owned_mods[MOD_NEON_LEFT_ON] = false;
owned_mods[MOD_XENON_LIGHTS] = false;
owned_mods[MOD_NEON_LEFT_ON] = false;
owned_mods[MOD_NEON_RIGHT_ON] = false;
owned_mods[MOD_NEON_FRONT_ON] = false;
owned_mods[MOD_NEON_BACK_ON] = false;
owned_mods[MOD_NEON_BACK_ON] = false;
VEHICLE::TOGGLE_VEHICLE_MOD(player_vehicle, MOD_XENON_LIGHTS, owned_mods[MOD_XENON_LIGHTS]);
VEHICLE::SET_VEHICLE_NEON_ENABLED(player_vehicle, NEON_LEFT, owned_mods[MOD_NEON_LEFT_ON]);
@ -492,14 +485,12 @@ namespace big
components::sub_title("COLOR_OPTIONS"_T);
static int color_to_change = 0;
static int color_type = 8;
static int color_type = 8;
if (
(color_to_change == 7 && !owned_mods[MOD_XENON_LIGHTS]) ||
(color_to_change == 5 && !owned_mods[MOD_TYRE_SMOKE])
) {
if ((color_to_change == 7 && !owned_mods[MOD_XENON_LIGHTS]) || (color_to_change == 5 && !owned_mods[MOD_TYRE_SMOKE]))
{
color_to_change = 0;
color_type = 8;
color_type = 8;
}
if (ImGui::ListBoxHeader("##color_options", ImVec2(120, 254)))
@ -517,19 +508,19 @@ namespace big
if (ImGui::Selectable("PEARLESCENT"_T.data(), color_to_change == 2))
{
color_to_change = 2;
color_type = 4;
color_type = 4;
}
if (ImGui::Selectable("INTERIOR"_T.data(), color_to_change == 3))
{
color_to_change = 3;
color_type = 6;
color_type = 6;
}
if (ImGui::Selectable("DASHBOARD"_T.data(), color_to_change == 4))
{
color_to_change = 4;
color_type = 7;
color_type = 7;
}
if (!owned_mods[MOD_TYRE_SMOKE])
@ -539,7 +530,7 @@ namespace big
if (ImGui::Selectable("TIRE_SMOKE"_T.data(), color_to_change == 5))
{
color_to_change = 5;
color_type = 8;
color_type = 8;
}
if (!owned_mods[MOD_TYRE_SMOKE])
{
@ -549,7 +540,7 @@ namespace big
if (ImGui::Selectable("WHEEL_COLOR"_T.data(), color_to_change == 6))
{
color_to_change = 6;
color_type = 5;
color_type = 5;
}
if (!owned_mods[MOD_XENON_LIGHTS])
@ -560,7 +551,7 @@ namespace big
if (ImGui::Selectable("HEADLIGHT"_T.data(), color_to_change == 7))
{
color_to_change = 7;
color_type = 9;
color_type = 9;
}
ImGui::PopID();
if (!owned_mods[MOD_XENON_LIGHTS])
@ -571,7 +562,7 @@ namespace big
if (ImGui::Selectable("NEON"_T.data(), color_to_change == 8))
{
color_to_change = 8;
color_type = 8;
color_type = 8;
}
ImGui::ListBoxFooter();
@ -638,10 +629,10 @@ namespace big
{
// custom color
static float color[3] = { 1, 1, 1 };
auto color_r = &owned_mods[MOD_PRIMARY_COL_R];
auto color_g = &owned_mods[MOD_PRIMARY_COL_G];
auto color_b = &owned_mods[MOD_PRIMARY_COL_B];
static float color[3] = {1, 1, 1};
auto color_r = &owned_mods[MOD_PRIMARY_COL_R];
auto color_g = &owned_mods[MOD_PRIMARY_COL_G];
auto color_b = &owned_mods[MOD_PRIMARY_COL_B];
if (color_to_change == 1)
{
@ -674,7 +665,7 @@ namespace big
for (const auto& it : lsc_tire_smoke_rgb)
{
auto& name = it.first;
auto& rgb = it.second;
auto& rgb = it.second;
if (ImGui::Selectable(name.c_str(), false))
{
@ -685,7 +676,6 @@ namespace big
*color_g = rgb[1];
*color_b = rgb[2];
}
}
ImGui::ListBoxFooter();
@ -699,7 +689,7 @@ namespace big
for (const auto& it : lsc_neon_rgb)
{
auto& name = it.first;
auto& rgb = it.second;
auto& rgb = it.second;
if (ImGui::Selectable(name.c_str(), false))
{
@ -733,12 +723,8 @@ namespace big
case 1:
VEHICLE::SET_VEHICLE_CUSTOM_SECONDARY_COLOUR(player_vehicle, *color_r, *color_g, *color_b);
break;
case 5:
VEHICLE::SET_VEHICLE_TYRE_SMOKE_COLOR(player_vehicle, *color_r, *color_g, *color_b);
break;
case 8:
VEHICLE::SET_VEHICLE_NEON_COLOUR(player_vehicle, *color_r, *color_g, *color_b);
break;
case 5: VEHICLE::SET_VEHICLE_TYRE_SMOKE_COLOR(player_vehicle, *color_r, *color_g, *color_b); break;
case 8: VEHICLE::SET_VEHICLE_NEON_COLOUR(player_vehicle, *color_r, *color_g, *color_b); break;
}
});
}
@ -750,21 +736,11 @@ namespace big
int selected_color = 0;
switch (color_type)
{
case 4:
selected_color = owned_mods[MOD_PEARLESCENT_COL];
break;
case 5:
selected_color = owned_mods[MOD_WHEEL_COL];
break;
case 6:
selected_color = owned_mods[MOD_INTERIOR_COL];
break;
case 7:
selected_color = owned_mods[MOD_DASHBOARD_COL];
break;
case 9:
selected_color = owned_mods[MOD_XENON_COL];
break;
case 4: selected_color = owned_mods[MOD_PEARLESCENT_COL]; break;
case 5: selected_color = owned_mods[MOD_WHEEL_COL]; break;
case 6: selected_color = owned_mods[MOD_INTERIOR_COL]; break;
case 7: selected_color = owned_mods[MOD_DASHBOARD_COL]; break;
case 9: selected_color = owned_mods[MOD_XENON_COL]; break;
default:
selected_color = (color_to_change == 0) ? owned_mods[MOD_PRIMARY_COL] : owned_mods[MOD_SECONDARY_COL];
}
@ -778,7 +754,7 @@ namespace big
{
switch (color_type)
{
case 0: //Chrome
case 0://Chrome
{
if (ImGui::Selectable("CHROME"_T.data(), selected_color == COLOR_CHROME))
{
@ -797,7 +773,7 @@ namespace big
}
break;
}
case 1: //Classic
case 1://Classic
{
for (const auto& [color, name] : lsc_classic_colors)
{
@ -818,11 +794,10 @@ namespace big
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
});
}
}
break;
}
case 2: //Matte
case 2://Matte
{
for (const auto& [color, name] : lsc_matte_colors)
{
@ -843,11 +818,10 @@ namespace big
VEHICLE::SET_VEHICLE_COLOURS(player_vehicle, owned_mods[MOD_PRIMARY_COL], owned_mods[MOD_SECONDARY_COL]);
});
}
}
break;
}
case 3: //Metals
case 3://Metals
{
for (const auto& [color, name] : lsc_metal_colors)
{
@ -871,13 +845,13 @@ namespace big
}
break;
}
case 4: //Pearlescent
case 4://Pearlescent
{
for (const auto& [color, name] : lsc_classic_colors)
{
if (ImGui::Selectable(name.c_str(), selected_color == color))
{
selected_color = color;
selected_color = color;
owned_mods[MOD_PEARLESCENT_COL] = color;
g_fiber_pool->queue_job([] {
@ -887,13 +861,13 @@ namespace big
}
break;
}
case 5: //Wheel Color
case 5://Wheel Color
{
for (const auto& [color, name] : lsc_classic_colors)
{
if (ImGui::Selectable(name.c_str(), selected_color == color))
{
selected_color = color;
selected_color = color;
owned_mods[MOD_WHEEL_COL] = color;
g_fiber_pool->queue_job([] {
@ -903,13 +877,13 @@ namespace big
}
break;
}
case 6: //Interior Color
case 6://Interior Color
{
for (const auto& [color, name] : lsc_classic_colors)
{
if (ImGui::Selectable(name.c_str(), selected_color == color))
{
selected_color = color;
selected_color = color;
owned_mods[MOD_INTERIOR_COL] = color;
g_fiber_pool->queue_job([] {
@ -919,13 +893,13 @@ namespace big
}
break;
}
case 7: //Dashboard Color
case 7://Dashboard Color
{
for (const auto& [color, name] : lsc_classic_colors)
{
if (ImGui::Selectable(name.c_str(), selected_color == color))
{
selected_color = color;
selected_color = color;
owned_mods[MOD_DASHBOARD_COL] = color;
g_fiber_pool->queue_job([] {
@ -935,13 +909,13 @@ namespace big
}
break;
}
case 9: //Headlight Color
case 9://Headlight Color
{
for (const auto& [color, name] : lsc_headlight_colors)
{
if (ImGui::Selectable(name.c_str(), selected_color == color))
{
selected_color = color;
selected_color = color;
owned_mods[MOD_XENON_COL] = color;
g_fiber_pool->queue_job([] {

View File

@ -1,10 +1,10 @@
#include "core/data/speed_units.hpp"
#include "fiber_pool.hpp"
#include "script.hpp"
#include "services/vehicle/persist_car_service.hpp"
#include "util/mobile.hpp"
#include "util/vehicle.hpp"
#include "views/view.hpp"
#include "util/mobile.hpp"
#include "core/data/speed_units.hpp"
#include "services/vehicle/persist_car_service.hpp"
namespace big
{
@ -64,20 +64,15 @@ namespace big
static char vehicle_file_name_input[50]{};
ImGui::PushItemWidth(250);
components::input_text_with_hint(
"VEHICLE_FILE_NAME"_T,
"VEHICLE_FILE_NAME_EXAMPLE"_T,
vehicle_file_name_input, IM_ARRAYSIZE(vehicle_file_name_input));
components::input_text_with_hint("VEHICLE_FILE_NAME"_T, "VEHICLE_FILE_NAME_EXAMPLE"_T, vehicle_file_name_input, IM_ARRAYSIZE(vehicle_file_name_input));
ImGui::SameLine();
components::button("SAVE_VEHICLE"_T, []
{
components::button("SAVE_VEHICLE"_T, [] {
save_vehicle(vehicle_file_name_input);
});
components::button("LOAD_VEHICLE"_T, []
{
components::button("LOAD_VEHICLE"_T, [] {
load_vehicle(selected_vehicle_file);
});

View File

@ -1,15 +1,16 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "services/mobile/mobile_service.hpp"
#include "services/gta_data/gta_data_service.hpp"
#include "services/mobile/mobile_service.hpp"
#include "services/model_preview/model_preview_service.hpp"
#include "util/vehicle.hpp"
#include "views/view.hpp"
namespace big
{
void view::pv() {
ImGui::SetWindowSize({ 0.f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always);
void view::pv()
{
ImGui::SetWindowSize({0.f, (float)*g_pointers->m_resolution_y}, ImGuiCond_Always);
if (ImGui::Checkbox("PREVIEW"_T.data(), &g.clone_pv.preview_vehicle))
{
@ -22,8 +23,8 @@ namespace big
ImGui::Checkbox("SPAWN_IN"_T.data(), &g.clone_pv.spawn_inside);
ImGui::SameLine();
static char plate_buf[9] = { 0 };
int num_of_rows = 3;
static char plate_buf[9] = {0};
int num_of_rows = 3;
ImGui::Checkbox("SPAWN_CLONE"_T.data(), &g.clone_pv.spawn_clone);
if (g.clone_pv.spawn_clone)
@ -51,10 +52,11 @@ namespace big
static int selected_class = -1;
const auto& class_arr = g_gta_data_service->vehicle_classes();
const auto& class_arr = g_gta_data_service->vehicle_classes();
ImGui::SetNextItemWidth(300.f);
if (ImGui::BeginCombo("VEHICLE_CLASS"_T.data(), selected_class == -1 ? "ALL"_T.data() : class_arr[selected_class].c_str()))
if (ImGui::BeginCombo("VEHICLE_CLASS"_T.data(),
selected_class == -1 ? "ALL"_T.data() : class_arr[selected_class].c_str()))
{
if (ImGui::Selectable("ALL"_T.data(), selected_class == -1))
{
@ -84,7 +86,7 @@ namespace big
components::input_text_with_hint("MODEL_NAME"_T, "SEARCH"_T, search, sizeof(search), ImGuiInputTextFlags_None);
g_mobile_service->refresh_personal_vehicles();
if (ImGui::ListBoxHeader("###personal_veh_list", { 300, static_cast<float>(*g_pointers->m_resolution_y - 188 - 38 * num_of_rows) }))
if (ImGui::ListBoxHeader("###personal_veh_list", {300, static_cast<float>(*g_pointers->m_resolution_y - 188 - 38 * num_of_rows)}))
{
if (g_mobile_service->personal_vehicles().empty())
{
@ -97,32 +99,28 @@ namespace big
for (const auto& it : g_mobile_service->personal_vehicles())
{
const auto& label = it.first;
const auto& label = it.first;
const auto& personal_veh = it.second;
const auto& item = g_gta_data_service->vehicle_by_hash(personal_veh->get_hash());
const auto& item = g_gta_data_service->vehicle_by_hash(personal_veh->get_hash());
std::string vehicle_class = item.m_vehicle_class;
std::string display_name = label;
std::string vehicle_class = item.m_vehicle_class;
std::string display_name = label;
std::string display_manufacturer = item.m_display_manufacturer;
std::transform(display_name.begin(), display_name.end(), display_name.begin(), ::tolower);
std::transform(display_manufacturer.begin(), display_manufacturer.end(), display_manufacturer.begin(), ::tolower);
if ((
selected_class == -1 || class_arr[selected_class] == vehicle_class
) && (
display_name.find(lower_search) != std::string::npos ||
display_manufacturer.find(lower_search) != std::string::npos
)) {
if ((selected_class == -1 || class_arr[selected_class] == vehicle_class)
&& (display_name.find(lower_search) != std::string::npos || display_manufacturer.find(lower_search) != std::string::npos))
{
ImGui::PushID('v' << 24 & personal_veh->get_id());
components::selectable(label, false, [&personal_veh] {
if (g.clone_pv.spawn_clone)
{
Vector3 spawn_location = vehicle::get_spawn_location(g.spawn_vehicle.spawn_inside);
float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
auto vehicle_idx = personal_veh->get_vehicle_idx();
auto owned_mods = vehicle::get_owned_mods_from_vehicle_idx(vehicle_idx);
auto owned_mods = vehicle::get_owned_mods_from_vehicle_idx(vehicle_idx);
const char* spawn_plate_buf = plate_buf;
if (g.clone_pv.clone_plate)
@ -169,9 +167,8 @@ namespace big
{
g_fiber_pool->queue_job([&personal_veh] {
g_model_preview_service->show_vehicle(
vehicle::get_owned_mods_from_vehicle_idx(personal_veh->get_vehicle_idx()),
g.clone_pv.spawn_maxed
);
vehicle::get_owned_mods_from_vehicle_idx(personal_veh->get_vehicle_idx()),
g.clone_pv.spawn_maxed);
});
}
}

View File

@ -1,15 +1,15 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "services/gta_data/gta_data_service.hpp"
#include "services/model_preview/model_preview_service.hpp"
#include "util/vehicle.hpp"
#include "views/view.hpp"
namespace big
{
void view::spawn_vehicle()
{
ImGui::SetWindowSize({ 0.f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always);
ImGui::SetWindowSize({0.f, (float)*g_pointers->m_resolution_y}, ImGuiCond_Always);
if (ImGui::Checkbox("PREVIEW"_T.data(), &g.spawn_vehicle.preview_vehicle))
{
@ -23,7 +23,7 @@ namespace big
ImGui::SameLine();
components::command_checkbox<"spawnmaxed">();
static char plate_buf[9] = { 0 };
static char plate_buf[9] = {0};
strncpy(plate_buf, g.spawn_vehicle.plate.c_str(), 9);
ImGui::SetNextItemWidth(300.f);
@ -31,12 +31,12 @@ namespace big
g.spawn_vehicle.plate = plate_buf;
});
static int selected_class = -1;
const auto& class_arr = g_gta_data_service->vehicle_classes();
const auto& class_arr = g_gta_data_service->vehicle_classes();
ImGui::SetNextItemWidth(300.f);
if (ImGui::BeginCombo("VEHICLE_CLASS"_T.data(), selected_class == -1 ? "ALL"_T.data() : class_arr[selected_class].c_str()))
if (ImGui::BeginCombo("VEHICLE_CLASS"_T.data(),
selected_class == -1 ? "ALL"_T.data() : class_arr[selected_class].c_str()))
{
if (ImGui::Selectable("ALL"_T.data(), selected_class == -1))
{
@ -66,12 +66,12 @@ namespace big
components::input_text_with_hint("MODEL_NAME"_T, "SEARCH"_T, search, sizeof(search), ImGuiInputTextFlags_None);
if (ImGui::ListBoxHeader("###vehicles", { 300, static_cast<float>(*g_pointers->m_resolution_y - 188 - 38 * 4) }))
if (ImGui::ListBoxHeader("###vehicles", {300, static_cast<float>(*g_pointers->m_resolution_y - 188 - 38 * 4)}))
{
if (self::veh)
{
static auto veh_hash = 0;
g_fiber_pool->queue_job([] {
veh_hash = ENTITY::GET_ENTITY_MODEL(self::veh);
});
@ -84,7 +84,7 @@ namespace big
if (self::veh)
{
Vector3 spawn_location = vehicle::get_spawn_location(g.spawn_vehicle.spawn_inside);
float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
float spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
auto owned_mods = vehicle::get_owned_mods_from_vehicle(self::veh);
@ -120,10 +120,8 @@ namespace big
else if (ImGui::IsItemHovered())
{
g_fiber_pool->queue_job([] {
g_model_preview_service->show_vehicle(
vehicle::get_owned_mods_from_vehicle(self::veh),
g.spawn_vehicle.spawn_maxed
);
g_model_preview_service->show_vehicle(vehicle::get_owned_mods_from_vehicle(self::veh),
g.spawn_vehicle.spawn_maxed);
});
}
}
@ -139,24 +137,20 @@ namespace big
{
const auto& vehicle = item.second;
std::string display_name = vehicle.m_display_name;
std::string display_name = vehicle.m_display_name;
std::string display_manufacturer = vehicle.m_display_manufacturer;
std::string clazz = vehicle.m_vehicle_class;
std::string clazz = vehicle.m_vehicle_class;
std::transform(display_name.begin(), display_name.end(), display_name.begin(), ::tolower);
std::transform(display_manufacturer.begin(), display_manufacturer.end(), display_manufacturer.begin(), ::tolower);
if ((
selected_class == -1 || class_arr[selected_class] == clazz
) && (
display_name.find(lower_search) != std::string::npos ||
display_manufacturer.find(lower_search) != std::string::npos
)) {
if ((selected_class == -1 || class_arr[selected_class] == clazz)
&& (display_name.find(lower_search) != std::string::npos || display_manufacturer.find(lower_search) != std::string::npos))
{
ImGui::PushID(vehicle.m_hash);
components::selectable(vehicle.m_display_name, false, [&vehicle]
{
components::selectable(vehicle.m_display_name, false, [&vehicle] {
const auto spawn_location = vehicle::get_spawn_location(g.spawn_vehicle.spawn_inside);
const auto spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
const auto spawn_heading = ENTITY::GET_ENTITY_HEADING(self::ped);
const auto veh = vehicle::spawn(vehicle.m_hash, spawn_location, spawn_heading);

View File

@ -1,8 +1,8 @@
#include "core/data/speed_units.hpp"
#include "fiber_pool.hpp"
#include "util/mobile.hpp"
#include "util/vehicle.hpp"
#include "views/view.hpp"
#include "util/mobile.hpp"
#include "core/data/speed_units.hpp"
namespace big
{
@ -11,8 +11,9 @@ namespace big
components::button("MORS_FIX_ALL"_T, [] {
int amount_fixed = mobile::mors_mutual::fix_all();
g_notification_service->push("MOBILE"_T.data(),
std::vformat("VEHICLE_FIX_AMOUNT"_T.data(), std::make_format_args(amount_fixed, amount_fixed == 1 ? "VEHICLE_FIX_HAS"_T.data() : "VEHICLE_FIX_HAVE"_T.data()))
);
std::vformat("VEHICLE_FIX_AMOUNT"_T.data(),
std::make_format_args(amount_fixed,
amount_fixed == 1 ? "VEHICLE_FIX_HAS"_T.data() : "VEHICLE_FIX_HAVE"_T.data())));
});
ImGui::SameLine();
components::button("REPAIR"_T, [] {
@ -42,21 +43,11 @@ namespace big
ImGui::Separator();
components::button("TURN_ENGINE_ON"_T, [] {
vehicle::set_engine_state(
self::veh,
true,
g.vehicle.change_engine_state_immediately,
g.vehicle.disable_engine_auto_start
);
vehicle::set_engine_state(self::veh, true, g.vehicle.change_engine_state_immediately, g.vehicle.disable_engine_auto_start);
});
ImGui::SameLine();
components::button("TURN_ENGINE_OFF"_T, [] {
vehicle::set_engine_state(
self::veh,
false,
g.vehicle.change_engine_state_immediately,
g.vehicle.disable_engine_auto_start
);
vehicle::set_engine_state(self::veh, false, g.vehicle.change_engine_state_immediately, g.vehicle.disable_engine_auto_start);
});
ImGui::Checkbox("DISABLE_ENGINE_AUTO_START"_T.data(), &g.vehicle.disable_engine_auto_start);
ImGui::SameLine();
@ -109,26 +100,26 @@ namespace big
{
if (ImGui::Button("CHECK_ALL"_T.data()))
{
g.vehicle.proof_bullet = true;
g.vehicle.proof_fire = true;
g.vehicle.proof_bullet = true;
g.vehicle.proof_fire = true;
g.vehicle.proof_collision = true;
g.vehicle.proof_melee = true;
g.vehicle.proof_melee = true;
g.vehicle.proof_explosion = true;
g.vehicle.proof_steam = true;
g.vehicle.proof_water = true;
g.vehicle.proof_steam = true;
g.vehicle.proof_water = true;
}
ImGui::SameLine();
if (ImGui::Button("UNCHECK_ALL"_T.data()))
{
g.vehicle.proof_bullet = false;
g.vehicle.proof_fire = false;
g.vehicle.proof_bullet = false;
g.vehicle.proof_fire = false;
g.vehicle.proof_collision = false;
g.vehicle.proof_melee = false;
g.vehicle.proof_melee = false;
g.vehicle.proof_explosion = false;
g.vehicle.proof_steam = false;
g.vehicle.proof_water = false;
g.vehicle.proof_steam = false;
g.vehicle.proof_water = false;
}
ImGui::BeginGroup();
@ -163,23 +154,11 @@ namespace big
components::sub_title("SPEED_UNIT"_T);
{
ImGui::RadioButton(
speed_unit_strings[(int)SpeedUnit::KMPH].c_str(),
(int*)&g.vehicle.speed_unit,
(int)SpeedUnit::KMPH
);
ImGui::RadioButton(speed_unit_strings[(int)SpeedUnit::KMPH].c_str(), (int*)&g.vehicle.speed_unit, (int)SpeedUnit::KMPH);
ImGui::SameLine();
ImGui::RadioButton(
speed_unit_strings[(int)SpeedUnit::MIPH].c_str(),
(int*)&g.vehicle.speed_unit,
(int)SpeedUnit::MIPH
);
ImGui::RadioButton(speed_unit_strings[(int)SpeedUnit::MIPH].c_str(), (int*)&g.vehicle.speed_unit, (int)SpeedUnit::MIPH);
ImGui::SameLine();
ImGui::RadioButton(
speed_unit_strings[(int)SpeedUnit::MPS].c_str(),
(int*)&g.vehicle.speed_unit,
(int)SpeedUnit::MPS
);
ImGui::RadioButton(speed_unit_strings[(int)SpeedUnit::MPS].c_str(), (int*)&g.vehicle.speed_unit, (int)SpeedUnit::MPS);
}
ImGui::Separator();
@ -191,7 +170,7 @@ namespace big
{
ImGui::Text("POS_X_Y"_T.data());
float pos[2] = { g.vehicle.speedo_meter.x, g.vehicle.speedo_meter.y };
float pos[2] = {g.vehicle.speedo_meter.x, g.vehicle.speedo_meter.y};
if (ImGui::SliderFloat2("###speedo_pos", pos, .001f, .999f, "%.3f"))
{

View File

@ -1,15 +1,15 @@
#pragma once
#include "debug/view_debug.hpp"
#include "esp/view_esp.hpp"
#include "gui/components/components.hpp"
#include "util/animator.hpp"
#include "esp/view_esp.hpp"
#include "debug/view_debug.hpp"
namespace big
{
class view
{
inline static animator window_animator = animator();
inline static animator window_animator = animator();
inline static ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav;
public:

View File

@ -1,11 +1,11 @@
#include "view.hpp"
#include "services/context_menu/context_menu_service.hpp"
#include "view.hpp"
namespace big
{
static void draw_model_bounding_box(ImDrawList* draw_list, const model_bounding_box_screen_space& m_model_bounding_box_screen_space)
{
const auto& box = g_context_menu_service->m_model_bounding_box_screen_space;
const auto& box = g_context_menu_service->m_model_bounding_box_screen_space;
const auto& color = g.context_menu.bounding_box_color;
draw_list->AddLine(box.edge1, box.edge2, color);
@ -28,9 +28,8 @@ namespace big
{
if (const auto draw_list = ImGui::GetBackgroundDrawList(); draw_list)
{
if (g_context_menu_service->enabled &&
g_context_menu_service->m_pointer &&
g_context_menu_service->m_pointer->m_navigation)
if (g_context_menu_service->enabled && g_context_menu_service->m_pointer
&& g_context_menu_service->m_pointer->m_navigation)
{
float context_screen_x;
float context_screen_y;
@ -49,14 +48,19 @@ namespace big
const auto cm_start_x = static_cast<float>(*g_pointers->m_resolution_x) * context_screen_x + (67.5f * context_target_multplr);
const auto cm_start_y = static_cast<float>(*g_pointers->m_resolution_y) * context_screen_y - (175.f * context_target_multplr);
const auto cm_col = ImGui::ColorConvertFloat4ToU32({ 0.549f, 0.639f, 0.710f, 0.3f });
const auto cm_col = ImGui::ColorConvertFloat4ToU32({0.549f, 0.639f, 0.710f, 0.3f});
draw_list->AddRectFilled({ cm_start_x - 2.f , cm_start_y }, { cm_start_x + 2.f + cm->menu_size.x, cm_start_y + cm->menu_size.y }, cm_col, 5.f);
draw_list->AddRectFilled({cm_start_x - 2.f, cm_start_y},
{cm_start_x + 2.f + cm->menu_size.x, cm_start_y + cm->menu_size.y},
cm_col,
5.f);
for (std::uint32_t i = 0; i < cm->options.size(); i++)
{
const auto co = cm->options.at(i);
draw_list->AddText({ cm_start_x + 7.f, cm_start_y + (20.f * static_cast<float>(i)) + 5.f }, cm->current_option == i ? g.context_menu.selected_option_color : ImGui::ColorConvertFloat4ToU32({ 1.f, 1.f, 1.f, 1.f }), co.name.c_str());
draw_list->AddText({cm_start_x + 7.f, cm_start_y + (20.f * static_cast<float>(i)) + 5.f},
cm->current_option == i ? g.context_menu.selected_option_color : ImGui::ColorConvertFloat4ToU32({1.f, 1.f, 1.f, 1.f}),
co.name.c_str());
}
if (g.context_menu.bounding_box_enabled)

View File

@ -1,7 +1,7 @@
#include "view.hpp"
#include "gui.hpp"
#include "pointers.hpp"
#include "services/gta_data/gta_data_service.hpp"
#include "view.hpp"
namespace big
{
@ -16,8 +16,8 @@ namespace big
ImGui::OpenPopup("GAME_CACHE"_T.data());
}
ImGui::SetNextWindowSize({ 800, 210 }, ImGuiCond_FirstUseEver);
ImGui::SetNextWindowPos({ 200, 200 }, ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize({800, 210}, ImGuiCond_FirstUseEver);
ImGui::SetNextWindowPos({200, 200}, ImGuiCond_FirstUseEver);
if (ImGui::BeginPopupModal("GAME_CACHE"_T.data()))
{
switch (g_gta_data_service->state())

View File

@ -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"))
{

View File

@ -1,5 +1,5 @@
#include "views/view.hpp"
#include "util/local_player.hpp"
#include "views/view.hpp"
namespace big
{

View File

@ -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);

View File

@ -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">();
}
}

View File

@ -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);

View File

@ -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();
});

View File

@ -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);
}
}