feat(GUI): Simplifying the gui (#118)

Co-authored-by: Maddy <59680197+xM4ddy@users.noreply.github.com>
Co-authored-by: Yimura <andreas.maerten@scarlet.be>
This commit is contained in:
LiamD-Flop 2022-05-04 19:16:40 +02:00 committed by GitHub
parent 93f38b20fc
commit 0bd7c97337
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 1766 additions and 1368 deletions

View File

@ -0,0 +1,83 @@
#include "backend/looped/looped.hpp"
#include "script.hpp"
namespace big
{
enum rgb_controller_t
{
rgb_controller_green_up,
rgb_controller_red_down,
rgb_controller_blue_up,
rgb_controller_green_down,
rgb_controller_red_up,
rgb_controller_blue_down,
};
void looped::rgb_synced_fade()
{
if (g->rgb.fade)
{
static int rgb_controller_v = rgb_controller_green_up;
switch (rgb_controller_v)
{
case rgb_controller_green_up:
g->rgb.g += g->rgb.speed;
if (g->rgb.g >= 255)
{
g->rgb.g = 255;
rgb_controller_v = rgb_controller_red_down;
}
break;
case rgb_controller_red_down:
g->rgb.r -= g->rgb.speed;
if (g->rgb.r < 0)
{
g->rgb.r = 0;
rgb_controller_v = rgb_controller_blue_up;
}
break;
case rgb_controller_blue_up:
g->rgb.b += g->rgb.speed;
if (g->rgb.b >= 255)
{
g->rgb.b = 255;
rgb_controller_v = rgb_controller_green_down;
}
break;
case rgb_controller_green_down:
g->rgb.g -= g->rgb.speed;
if (g->rgb.g < 0)
{
g->rgb.g = 0;
rgb_controller_v = rgb_controller_red_up;
}
break;
case rgb_controller_red_up:
g->rgb.r += g->rgb.speed;
if (g->rgb.r >= 255)
{
g->rgb.r = 255;
rgb_controller_v = rgb_controller_blue_down;
}
break;
case rgb_controller_blue_down:
g->rgb.b -= g->rgb.speed;
if (g->rgb.b < 0)
{
g->rgb.b = 0;
rgb_controller_v = rgb_controller_green_up;
}
break;
default:
throw std::runtime_error("Invalid case provided to RGB controller!");
}
}
}
}

View File

@ -0,0 +1,18 @@
#include "backend/looped/looped.hpp"
#include "script.hpp"
namespace big
{
void looped::rgb_synced_spasm()
{
auto delay = std::chrono::milliseconds(1000 - (g->rgb.speed * 100));
if (g->rgb.spasm)
{
g->rgb.r = rand() % 256;
g->rgb.g = rand() % 256;
g->rgb.b = rand() % 256;
}
script::get_current()->yield(delay);
}
}

View File

@ -0,0 +1,65 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
#include "script.hpp"
#include "util/entity.hpp"
namespace big
{
void looped::vehicle_drive_on_water()
{
if (g->vehicle.drive_on_water) {
Player player = PLAYER::PLAYER_ID();
Ped playerPed = PLAYER::PLAYER_PED_ID();
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(playerPed, 0);
DWORD model = ENTITY::GET_ENTITY_MODEL(veh);
Vector3 pos = ENTITY::GET_ENTITY_COORDS(playerPed, 0);
Hash hash = MISC::GET_HASH_KEY("prop_container_ld2");
float height = 0;
WATER::SET_DEEP_OCEAN_SCALER(height);
if ((!(VEHICLE::IS_THIS_MODEL_A_PLANE(ENTITY::GET_ENTITY_MODEL(veh)))) && WATER::GET_WATER_HEIGHT_NO_WAVES(pos.x, pos.y, pos.z, &height)) {
Object container = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(pos.x, pos.y, pos.z, 4.0, hash, 0, 0, 1);
if (ENTITY::DOES_ENTITY_EXIST(container) && height > -50.0f) {
Vector3 pRot = ENTITY::GET_ENTITY_ROTATION(playerPed, 0);
if (PED::IS_PED_IN_ANY_VEHICLE(playerPed, 1)) pRot = ENTITY::GET_ENTITY_ROTATION(veh, 0);
entity::take_control_of(container);
ENTITY::SET_ENTITY_COORDS(container, pos.x, pos.y, height - 2.5f, 0, 0, 0, 1);
ENTITY::SET_ENTITY_ROTATION(container, 0, 0, pRot.z, 0, 1);
Vector3 containerCoords = ENTITY::GET_ENTITY_COORDS(container, 1);
if (pos.z < containerCoords.z) {
if (!PED::IS_PED_IN_ANY_VEHICLE(playerPed, 0)) {
ENTITY::SET_ENTITY_COORDS(playerPed, pos.x, pos.y, containerCoords.z + 2.0f, 0, 0, 0, 1);
}
else {
entity::take_control_of(veh);
Vector3 vehc = ENTITY::GET_ENTITY_COORDS(veh, 1);
ENTITY::SET_ENTITY_COORDS(veh, vehc.x, vehc.y, containerCoords.z + 2.0f, 0, 0, 0, 1);
}
}
}
else {
Hash model = hash;
STREAMING::REQUEST_MODEL(model);
while (!STREAMING::HAS_MODEL_LOADED(model)) script::get_current()->yield(0ms);
container = OBJECT::CREATE_OBJECT(model, pos.x, pos.y, pos.z, 1, 1, 0);
entity::take_control_of(container);
ENTITY::FREEZE_ENTITY_POSITION(container, 1);
ENTITY::SET_ENTITY_ALPHA(container, 0, 1);
ENTITY::SET_ENTITY_VISIBLE(container, false, 0);
}
}
else {
Object container = OBJECT::GET_CLOSEST_OBJECT_OF_TYPE(pos.x, pos.y, pos.z, 4.0, hash, 0, 0, 1);
if (ENTITY::DOES_ENTITY_EXIST(container)) {
entity::take_control_of(container);
ENTITY::SET_ENTITY_COORDS(container, 0, 0, -1000.0f, 0, 0, 0, 1);
script::get_current()->yield(10ms);
ENTITY::SET_ENTITY_AS_NO_LONGER_NEEDED(&container);
ENTITY::DELETE_ENTITY(&container);
WATER::RESET_DEEP_OCEAN_SCALER();
}
}
}
}
}

27
BigBaseV2/rgb_paint.cpp Normal file
View File

@ -0,0 +1,27 @@
#include "backend/looped/looped.hpp"
#include "natives.hpp"
namespace big
{
void looped::vehicle_rainbow_paint()
{
const Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
if (veh && g->vehicle.rainbow_paint)
{
if (g->vehicle.rainbow_paint == 1)
{
g->rgb.fade = true;
g->rgb.spasm = false;
}
else if (g->vehicle.rainbow_paint == 2)
{
g->rgb.spasm = true;
g->rgb.fade = false;
}
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh, g->rgb.r, g->rgb.g, g->rgb.b);
VEHICLE::SET_VEHICLE_CUSTOM_PRIMARY_COLOUR(veh, g->rgb.r, g->rgb.g, g->rgb.b);
}
}
}

View File

@ -1,5 +1,4 @@
#include "backend/looped/looped.hpp"
#include "gta/enums.hpp"
#include "natives.hpp"
#include "util/math.hpp"
@ -11,12 +10,6 @@ namespace big
void looped::self_super_run()
{
// g_local_player->m_player_info->m_run_speed is bwoke
/*
if (g->self.super_run && PAD::IS_CONTROL_PRESSED(0, 21))
{
if (run_speed < run_cap) run_speed += .5f;
@ -56,8 +49,5 @@ namespace big
}
super_run_state = g->self.super_run;
*/
}
}

View File

@ -226,6 +226,8 @@ namespace big
bool users = true;
bool player = false;
ImU32 color = 3357612055;
ImFont* font_title = nullptr;
ImFont* font_sub_title = nullptr;
ImFont* font_small = nullptr;
@ -446,6 +448,7 @@ namespace big
this->weapons.ammo_special.type = (eAmmoSpecialType)j["weapons"]["ammo_special"]["type"];
this->weapons.ammo_special.toggle = j["weapons"]["ammo_special"]["toggle"];
this->window.color = j["window"]["color"];
this->window.debug = j["window"]["debug"];
this->window.handling = j["window"]["handling"];
this->window.log = j["window"]["log"];
@ -660,6 +663,7 @@ namespace big
},
{
"window", {
{ "color", this->window.color },
{ "debug", this->window.debug },
{ "handling", this->window.handling },
{ "log", this->window.log },

View File

@ -22,14 +22,14 @@ namespace big
{
void gui::dx_init()
{
static ImVec4 bgColor = ImVec4(0.117f, 0.113f, 0.172f, .75f);
static ImVec4 bgColor = ImVec4(0.09f, 0.094f, 0.129f, .9f);
static ImVec4 primary = ImVec4(0.172f, 0.380f, 0.909f, 1.f);
static ImVec4 secondary = ImVec4(0.443f, 0.654f, 0.819f, 1.f);
static ImVec4 whiteBroken = ImVec4(0.792f, 0.784f, 0.827f, 1.f);
auto& style = ImGui::GetStyle();
style.WindowPadding = ImVec2(15, 15);
style.WindowRounding = 0.f;
style.WindowRounding = 10.f;
style.WindowBorderSize = 0.f;
style.FramePadding = ImVec2(5, 5);
style.FrameRounding = 4.0f;
@ -42,10 +42,12 @@ namespace big
style.GrabRounding = 3.0f;
style.ChildRounding = 4.0f;
LOG(INFO) << (int32_t)g->window.color;
auto& colors = style.Colors;
colors[ImGuiCol_Text] = ImVec4(0.80f, 0.80f, 0.83f, 1.00f);
colors[ImGuiCol_TextDisabled] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
colors[ImGuiCol_WindowBg] = ImGui::ColorConvertU32ToFloat4(g->window.color);
colors[ImGuiCol_ChildBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
colors[ImGuiCol_PopupBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
colors[ImGuiCol_Border] = ImVec4(0.80f, 0.80f, 0.83f, 0.88f);
@ -82,7 +84,9 @@ namespace big
void gui::dx_on_tick()
{
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImGui::ColorConvertU32ToFloat4(g->window.color));
view::root();
ImGui::PopStyleColor();
}
void gui::always_draw()

View File

@ -3,6 +3,9 @@
namespace big
{
struct navigation_struct;
enum class tabs;
class components
{
static void custom_text(const std::string_view, ImFont*);
@ -13,6 +16,7 @@ namespace big
static void sub_title(const std::string_view);
static void title(const std::string_view);
static void button(const std::string_view, std::function<void()>);
static void nav_item(std::pair<tabs, navigation_struct>&, int);
static void input_text_with_hint(const std::string_view label, const std::string_view hint, char* buf, size_t buf_size, ImGuiInputTextFlags_ flag = ImGuiInputTextFlags_None, std::function<void()> cb = nullptr);
@ -21,4 +25,4 @@ namespace big
static void selectable(const std::string_view, bool, std::function<void()>);
static void selectable(const std::string_view, bool, ImGuiSelectableFlags, std::function<void()>);
};
}
}

View File

@ -7,11 +7,14 @@ namespace big
{
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.f, 0.f, 0.f, 0.f));
ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(0.f, 0.f, 0.f, 0.f));
ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(0.f, 0.f, 0.f, 0.f));
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, { 0.f, 0.5f });
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, { 0, 5 });
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, { 0, 2 });
ImGui::PushStyleVar(ImGuiStyleVar_ItemInnerSpacing, { 0, 0 });
bool result = ImGui::Button(text.data(), {((float)*g_pointers->m_resolution_x * 0.15f) - 30, 0});
ImGui::PopStyleVar(2);
ImGui::PopStyleColor(2);
ImGui::PopStyleVar(4);
ImGui::PopStyleColor(3);
return result;
}

View File

@ -0,0 +1,31 @@
#include "components.hpp"
#include "services/gui_service.hpp"
namespace big
{
void components::nav_item(std::pair<tabs, navigation_struct>& navItem, int nested)
{
const bool curTab = !g_gui_service->get_selected_tab().empty() && g_gui_service->get_selected_tab().size() > nested && navItem.first == g_gui_service->get_selected_tab().at(nested);
if (curTab)
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.29f, 0.45f, 0.69f, 1.f));
if (components::nav_button(navItem.second.name))
g_gui_service->set_selected(navItem.first);
if (curTab)
ImGui::PopStyleColor();
if (curTab && !navItem.second.sub_nav.empty())
{
ImDrawList* dl = ImGui::GetForegroundDrawList();
for (std::pair<tabs, navigation_struct> item : navItem.second.sub_nav)
{
dl->AddRectFilled({ 10.f, ImGui::GetCursorPosY() + 100.f }, { 10.f + 250.f, ImGui::GetCursorPosY() + 100.f + ImGui::CalcTextSize("A").y + ImGui::GetStyle().ItemInnerSpacing.y * 2 }, ImGui::ColorConvertFloat4ToU32({ 1.f, 1.f, 1.f, .15f + (.075f * nested)}));
nav_item(item, nested + 1);
}
}
g_gui_service->increment_nav_size();
}
}

View File

@ -1,48 +1,52 @@
#include "handling_tabs.hpp"
#include "current_profile/current_profile_tabs.hpp"
#include "services/vehicle_service.hpp"
#include "views/view.hpp"
namespace big
{
void tab_handling::tab_current_profile()
void view::handling_current_profile()
{
if (ImGui::BeginTabItem("Current Profile"))
if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr || g_local_player->m_ped_task_flag & (int)ePedTask::TASK_FOOT)
{
if (g_vehicle_service->get_active_profile(g_local_player->m_vehicle->m_handling->m_model_hash).empty())
{
if (ImGui::Button("Save Profile"))
{
ImGui::OpenPopup("Save Handling");
}
}
else
{
if (ImGui::Button("Update Profile"))
{
ImGui::OpenPopup("Update Handling");
}
}
modal_handling::modal_save_handling();
modal_handling::modal_update_handling();
ImGui::SameLine();
if (ImGui::Button("Restore Handling"))
g_vehicle_service->restore_vehicle();
ImGui::Separator();
ImGui::BeginTabBar("handling_tabbar");
tab_current_profile::tab_general();
tab_current_profile::tab_other();
tab_current_profile::tab_brakes();
tab_current_profile::tab_gearing();
tab_current_profile::tab_traction();
tab_current_profile::tab_transmission();
tab_current_profile::tab_steering();
tab_current_profile::tab_suspension();
tab_current_profile::tab_rollbars();
tab_current_profile::tab_roll_centre_height();
ImGui::EndTabBar();
ImGui::EndTabItem();
ImGui::Text("Please enter a vehicle.");
return;
}
if (g_vehicle_service->get_active_profile(g_local_player->m_vehicle->m_handling->m_model_hash).empty())
{
if (ImGui::Button("Save Profile"))
{
ImGui::OpenPopup("Save Handling");
}
}
else
{
if (ImGui::Button("Update Profile"))
{
ImGui::OpenPopup("Update Handling");
}
}
modal_handling::modal_save_handling();
modal_handling::modal_update_handling();
ImGui::SameLine();
if (ImGui::Button("Restore Handling"))
g_vehicle_service->restore_vehicle();
ImGui::Separator();
ImGui::BeginTabBar("handling_tabbar");
tab_current_profile::tab_general();
tab_current_profile::tab_other();
tab_current_profile::tab_brakes();
tab_current_profile::tab_gearing();
tab_current_profile::tab_traction();
tab_current_profile::tab_transmission();
tab_current_profile::tab_steering();
tab_current_profile::tab_suspension();
tab_current_profile::tab_rollbars();
tab_current_profile::tab_roll_centre_height();
ImGui::EndTabBar();
}
}

View File

@ -1,55 +1,58 @@
#include "handling_tabs.hpp"
#include "services/vehicle_service.hpp"
#include "views/view.hpp"
namespace big
{
void tab_handling::tab_my_profiles()
void view::handling_my_profiles()
{
if (ImGui::BeginTabItem("My Profiles"))
if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr || g_local_player->m_ped_task_flag & (int)ePedTask::TASK_FOOT)
{
if (!g_vehicle_service->update_mine())
ImGui::Text("Loading profiles...");
else
ImGui::Text("Please enter a vehicle.");
return;
}
if (!g_vehicle_service->update_mine())
ImGui::Text("Loading profiles...");
else
{
if (g_vehicle_service->m_my_profiles.size() == 0)
ImGui::Text("You have no profiles available for this vehicle.");
for (auto& key : g_vehicle_service->m_my_profiles)
{
if (g_vehicle_service->m_my_profiles.size() == 0)
ImGui::Text("You have no profiles available for this vehicle.");
for (auto& key : g_vehicle_service->m_my_profiles)
if (auto it = g_vehicle_service->m_handling_profiles.find(key); it != g_vehicle_service->m_handling_profiles.end())
{
if (auto it = g_vehicle_service->m_handling_profiles.find(key); it != g_vehicle_service->m_handling_profiles.end())
{
auto& profile = it->second;
auto& profile = it->second;
if (profile.share_code == g_vehicle_service->get_active_profile(profile.handling_hash))
ImGui::TextColored({ 0.1254f,0.8039f,0.3137f,1.f }, "Active");
if (profile.share_code == g_vehicle_service->get_active_profile(profile.handling_hash))
ImGui::TextColored({ 0.1254f,0.8039f,0.3137f,1.f }, "Active");
ImGui::BeginTable("table", 3, ImGuiTableFlags_SizingStretchProp);
ImGui::BeginTable("table", 3, ImGuiTableFlags_SizingStretchProp);
ImGui::TableNextRow();
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Name:");
ImGui::TableNextColumn();
ImGui::Text(profile.name.c_str());
ImGui::TableNextColumn();
ImGui::Text("Share Code: %s", profile.share_code.c_str());
ImGui::TableNextColumn();
ImGui::Text("Name:");
ImGui::TableNextColumn();
ImGui::Text(profile.name.c_str());
ImGui::TableNextColumn();
ImGui::Text("Share Code: %s", profile.share_code.c_str());
ImGui::TableNextRow();
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Description:");
ImGui::TableNextColumn();
ImGui::TextWrapped(profile.description.c_str());
ImGui::TableNextColumn();
if (ImGui::Button("Load Profile"))
g_vehicle_service->set_handling_profile(profile);
ImGui::TableNextColumn();
ImGui::Text("Description:");
ImGui::TableNextColumn();
ImGui::TextWrapped(profile.description.c_str());
ImGui::TableNextColumn();
if (ImGui::Button("Load Profile"))
g_vehicle_service->set_handling_profile(profile);
ImGui::EndTable();
ImGui::EndTable();
ImGui::Separator();
}
ImGui::Separator();
}
}
ImGui::EndTabItem();
}
}
}
}

View File

@ -1,55 +1,57 @@
#include "handling_tabs.hpp"
#include "services/vehicle_service.hpp"
#include "views/view.hpp"
namespace big
{
void tab_handling::tab_saved_profiles()
void view::handling_saved_profiles()
{
if (ImGui::BeginTabItem("Saved Profiles"))
if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr || g_local_player->m_ped_task_flag & (int)ePedTask::TASK_FOOT)
{
if (!g_vehicle_service->load_saved_profiles())
ImGui::Text("Loading profiles...");
else
ImGui::Text("Please enter a vehicle.");
return;
}
if (!g_vehicle_service->load_saved_profiles())
ImGui::Text("Loading profiles...");
else
{
if (g_vehicle_service->m_saved_profiles.size() == 0)
ImGui::Text("You have no saved profiles available for this vehicle.");
for (auto& key : g_vehicle_service->m_saved_profiles)
{
if (g_vehicle_service->m_saved_profiles.size() == 0)
ImGui::Text("You have no saved profiles available for this vehicle.");
for (auto& key : g_vehicle_service->m_saved_profiles)
if (auto it = g_vehicle_service->m_handling_profiles.find(key); it != g_vehicle_service->m_handling_profiles.end())
{
if (auto it = g_vehicle_service->m_handling_profiles.find(key); it != g_vehicle_service->m_handling_profiles.end())
{
auto& profile = it->second;
auto& profile = it->second;
if (profile.share_code == g_vehicle_service->get_active_profile(profile.handling_hash))
ImGui::TextColored({ 0.1254f,0.8039f,0.3137f,1.f }, "Active");
if (profile.share_code == g_vehicle_service->get_active_profile(profile.handling_hash))
ImGui::TextColored({ 0.1254f,0.8039f,0.3137f,1.f }, "Active");
ImGui::BeginTable("table", 3, ImGuiTableFlags_SizingStretchProp);
ImGui::BeginTable("table", 3, ImGuiTableFlags_SizingStretchProp);
ImGui::TableNextRow();
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Name:");
ImGui::TableNextColumn();
ImGui::Text(profile.name.c_str());
ImGui::TableNextColumn();
ImGui::Text("Share Code: %s", profile.share_code.c_str());
ImGui::TableNextColumn();
ImGui::Text("Name:");
ImGui::TableNextColumn();
ImGui::Text(profile.name.c_str());
ImGui::TableNextColumn();
ImGui::Text("Share Code: %s", profile.share_code.c_str());
ImGui::TableNextRow();
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Description:");
ImGui::TableNextColumn();
ImGui::TextWrapped(profile.description.c_str());
ImGui::TableNextColumn();
if (ImGui::Button("Load Profile"))
g_vehicle_service->set_handling_profile(profile);
ImGui::TableNextColumn();
ImGui::Text("Description:");
ImGui::TableNextColumn();
ImGui::TextWrapped(profile.description.c_str());
ImGui::TableNextColumn();
if (ImGui::Button("Load Profile"))
g_vehicle_service->set_handling_profile(profile);
ImGui::EndTable();
ImGui::EndTable();
ImGui::Separator();
}
ImGui::Separator();
}
}
ImGui::EndTabItem();
}
}
}
}

View File

@ -1,87 +1,87 @@
#include "api/api.hpp"
#include "fiber_pool.hpp"
#include "handling_tabs.hpp"
#include "natives.hpp"
#include "script.hpp"
#include "thread_pool.hpp"
#include "services/vehicle_service.hpp"
#include "views/view.hpp"
namespace big
{
void tab_handling::tab_search()
void view::handling_search()
{
if (ImGui::BeginTabItem("Search"))
if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr || g_local_player->m_ped_task_flag & (int)ePedTask::TASK_FOOT)
{
QUEUE_JOB_BEGIN_CLAUSE()
ImGui::Text("Please enter a vehicle.");
return;
}
static char search[13];
components::input_text_with_hint("##search_share_code", "Search by share code", search, sizeof(search), ImGuiInputTextFlags_EnterReturnsTrue, []
{
g_thread_pool->push([&] { g_vehicle_service->get_by_share_code(search); });
});
ImGui::SameLine();
if (ImGui::Button("Search"))
g_thread_pool->push([&] { g_vehicle_service->get_by_share_code(search); });
switch (g_vehicle_service->m_search_status)
{
case SearchStatus::SEARCHING:
ImGui::Text("Searching...");
break;
case SearchStatus::NO_RESULT:
ImGui::Text("No results found for %s", search);
break;
case SearchStatus::FAILED:
ImGui::Text("Search failed, host is down or response body is invalid...");
break;
case SearchStatus::FOUND:
if (auto it = g_vehicle_service->m_handling_profiles.find(search); it != g_vehicle_service->m_handling_profiles.end())
{
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
}QUEUE_JOB_END_CLAUSE
auto& profile = it->second;
static char search[13];
ImGui::InputTextWithHint("##search_share_code", "Search by share code", search, sizeof(search));
ImGui::SameLine();
if (ImGui::Button("Search"))
g_thread_pool->push([&] { g_vehicle_service->get_by_share_code(search); });
if (profile.share_code == g_vehicle_service->get_active_profile(profile.handling_hash))
ImGui::TextColored({ 0.1254f,0.8039f,0.3137f,1.f }, "Active");
switch (g_vehicle_service->m_search_status)
{
case SearchStatus::SEARCHING:
ImGui::Text("Searching...");
ImGui::BeginTable("table", 3, ImGuiTableFlags_SizingStretchProp);
break;
case SearchStatus::NO_RESULT:
ImGui::Text("No results found for %s", search);
ImGui::TableNextRow();
break;
case SearchStatus::FAILED:
ImGui::Text("Search failed, host is down or response body is invalid...");
ImGui::TableNextColumn();
ImGui::Text("Name:");
ImGui::TableNextColumn();
ImGui::Text(profile.name.c_str());
ImGui::TableNextColumn();
ImGui::Text("Share Code: %s", profile.share_code.c_str());
break;
case SearchStatus::FOUND:
if (auto it = g_vehicle_service->m_handling_profiles.find(search); it != g_vehicle_service->m_handling_profiles.end())
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Description:");
ImGui::TableNextColumn();
ImGui::TextWrapped(profile.description.c_str());
ImGui::TableNextColumn();
if (ImGui::Button("Load Profile"))
g_vehicle_service->set_handling_profile(profile);
ImGui::SameLine();
if (ImGui::Button("Save Profile"))
{
auto& profile = it->second;
g_thread_pool->push([&]
{
api::vehicle::handling::save_profile(profile.share_code);
if (profile.share_code == g_vehicle_service->get_active_profile(profile.handling_hash))
ImGui::TextColored({ 0.1254f,0.8039f,0.3137f,1.f }, "Active");
ImGui::BeginTable("table", 3, ImGuiTableFlags_SizingStretchProp);
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Name:");
ImGui::TableNextColumn();
ImGui::Text(profile.name.c_str());
ImGui::TableNextColumn();
ImGui::Text("Share Code: %s", profile.share_code.c_str());
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::Text("Description:");
ImGui::TableNextColumn();
ImGui::TextWrapped(profile.description.c_str());
ImGui::TableNextColumn();
if (ImGui::Button("Load Profile"))
g_vehicle_service->set_handling_profile(profile);
ImGui::SameLine();
if (ImGui::Button("Save Profile"))
{
g_thread_pool->push([&]
{
api::vehicle::handling::save_profile(profile.share_code);
g_vehicle_service->load_saved_profiles(true);
});
}
ImGui::EndTable();
g_vehicle_service->load_saved_profiles(true);
});
}
break;
ImGui::EndTable();
}
ImGui::EndTabItem();
break;
}
}
}
}

View File

@ -56,7 +56,7 @@ namespace big
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
}QUEUE_JOB_END_CLAUSE
ImGui::BeginGroup();
ImGui::BeginGroup();
ImGui::Text("Name:");
ImGui::Text("Description:");

View File

@ -12,6 +12,7 @@
#include "native_hooks/native_hooks.hpp"
#include "services/globals_service.hpp"
#include "services/gui_service.hpp"
#include "services/player_service.hpp"
#include "services/mobile_service.hpp"
#include "services/notification_service.hpp"
@ -70,6 +71,7 @@ BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID)
auto player_service_instance = std::make_unique<player_service>();
auto vehicle_preview_service_instance = std::make_unique<vehicle_preview_service>();
auto vehicle_service_instance = std::make_unique<vehicle_service>();
auto gui_service_instance = std::make_unique<gui_service>();
LOG(INFO) << "Registered service instances...";
g_script_mgr.add_script(std::make_unique<script>(&features::script_func));
@ -96,6 +98,8 @@ BOOL APIENTRY DllMain(HMODULE hmod, DWORD reason, PVOID)
g_script_mgr.remove_all_scripts();
LOG(INFO) << "Scripts unregistered.";
gui_service_instance.reset();
LOG(INFO) << "Gui Service reset.";
vehicle_service_instance.reset();
LOG(INFO) << "Vehicle Service reset.";
vehicle_preview_service_instance.reset();

View File

@ -0,0 +1,78 @@
#include "gui_service.hpp"
namespace big
{
gui_service::gui_service()
{
g_gui_service = this;
}
gui_service::~gui_service()
{
g_gui_service = nullptr;
}
navigation_struct* gui_service::get_selected()
{
navigation_struct tab_none = { "", nullptr };
if (current_tab.empty() || current_tab.at(0) == tabs::NONE)
return &tab_none;
navigation_struct* current_nav = &nav.at(current_tab.at(0));
if (current_tab.size() > 1)
{
for (const tabs& t : current_tab)
{
if (t == current_tab.at(0)) continue;
current_nav = &current_nav->sub_nav.at(t);
}
}
return current_nav;
}
std::vector<tabs> gui_service::get_selected_tab()
{
return current_tab;
}
bool gui_service::has_switched_view()
{
return switched_view;
}
void gui_service::set_selected(tabs tab)
{
if (current_tab.empty()) return current_tab.push_back(tab);
if (auto it = get_selected()->sub_nav.find(tab); it != get_selected()->sub_nav.end())
current_tab.push_back(tab);
else
{
current_tab.pop_back();
set_selected(tab);
}
}
void gui_service::set_nav_size(int nav_size)
{
nav_ctr = nav_size;
}
void gui_service::increment_nav_size()
{
nav_ctr++;
}
void gui_service::reset_nav_size()
{
nav_ctr = 0;
}
std::unordered_map<tabs, navigation_struct> gui_service::get_navigation()
{
return nav;
}
}

View File

@ -0,0 +1,88 @@
#pragma once
#include "views/view.hpp"
namespace big
{
enum class tabs {
ESP_SETTINGS,
GUI_SETTINGS,
HANDLING_SEARCH,
HANDLING_SAVED_PROFILE,
HANDLING_MY_PROFILES,
HANDLING_CURRENT_PROFILE,
NOTIFICATION_SETTINGS,
PROTECTION_SETTINGS,
DEBUG,
MOBILE,
NONE,
NETWORK,
PLAYER,
SELF,
SESSION,
SETTINGS,
SPAWN,
SPOOFING,
TELEPORT,
VEHICLE,
WEAPONS,
HANDLING,
};
struct navigation_struct
{
const char name[32] = "";
std::function<void()> func = nullptr;
std::unordered_map<tabs, navigation_struct> sub_nav{};
};
class gui_service final
{
std::vector<tabs> current_tab{};
bool switched_view = true;
std::unordered_map<tabs, navigation_struct> nav = {
{tabs::SELF, { "Self",view::self, {
{ tabs::WEAPONS, { "Weapons", view::weapons }},
{ tabs::MOBILE, {"Mobile", view::mobile}},
{ tabs::TELEPORT, {"Teleport", view::teleport}},
}}},
{tabs::VEHICLE, {"Vehicle", view::vehicle, {
{ tabs::HANDLING, {"Handling", view::handling_current_profile, {
{ tabs::HANDLING_CURRENT_PROFILE, {"Current Profile", view::handling_current_profile } },
{ tabs::HANDLING_MY_PROFILES, {"My Profiles", view::handling_my_profiles } },
{ tabs::HANDLING_SAVED_PROFILE, {"Saved Profiles", view::handling_saved_profiles } },
{ tabs::HANDLING_SEARCH, {"Search Handling", view::handling_search } },
}}},
{ tabs::SPAWN, { "Spawn", view::spawn }},
}}},
{tabs::NETWORK, { "Network", nullptr, {
{ tabs::SPOOFING, { "Spoofing", view::spoofing }},
{ tabs::SESSION, { "Session", view::session }},
}}},
{tabs::SETTINGS, { "Settings", view::settings, {
{ tabs::ESP_SETTINGS, { "ESP", view::esp_settings}},
{ tabs::GUI_SETTINGS, { "GUI", view::gui_settings}},
{ tabs::NOTIFICATION_SETTINGS, { "Notifications", view::notification_settings}},
{ tabs::PROTECTION_SETTINGS, { "Protection", view::protection_settings}},
{ tabs::DEBUG, { "Debug", view::debug }},
}}},
{tabs::PLAYER, {"", view::view_player}}
};
public:
gui_service();
virtual ~gui_service();
int nav_ctr = 0;
navigation_struct* get_selected();
std::vector<tabs> get_selected_tab();
bool has_switched_view();
void set_selected(tabs);
void set_nav_size(int);
void increment_nav_size();
void reset_nav_size();
std::unordered_map<tabs, navigation_struct> get_navigation();
};
inline gui_service* g_gui_service{};
}

View File

@ -37,7 +37,7 @@ namespace big::mobile
{
inline void off_radar(bool toggle)
{
*player_global.at(PLAYER::GET_PLAYER_INDEX(), 453).at(209).as<int*>() = toggle;
*player_global.at(PLAYER::GET_PLAYER_INDEX(), 451).at(207).as<int*>() = toggle;
*script_global(2703660).at(56).as<int*>() = NETWORK::GET_NETWORK_TIME() + 1;
}
}

View File

@ -0,0 +1,22 @@
#include "views/view.hpp"
#include "services/gui_service.hpp"
namespace big
{
void view::active_view() {
if (g_gui_service->get_selected()->func == nullptr) return;
static float alpha = 1.f;
ImGui::SetNextWindowPos({ 250.f + 20.f, 100.f }, ImGuiCond_Always);
ImGui::SetNextWindowSize({ 0.f, 0.f });
ImGui::SetNextWindowSizeConstraints({ 250.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);
components::sub_title(g_gui_service->get_selected()->name);
g_gui_service->get_selected()->func();
ImGui::PopStyleVar();
}
}
}

View File

@ -0,0 +1,27 @@
#include "views/view.hpp"
namespace big
{
void view::heading()
{
ImGui::SetNextWindowSize({ 250.f, 80.f });
ImGui::SetNextWindowPos({ 10.f, 10.f });
if (ImGui::Begin("menu_heading", nullptr, window_flags | ImGuiWindowFlags_NoScrollbar))
{
ImGui::BeginGroup();
ImGui::Text("Welcome");
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" : g_local_player->m_player_info->m_net_player_data.m_name);
ImGui::PopStyleColor();
ImGui::EndGroup();
ImGui::SameLine();
ImGui::SetCursorPos({ 250.f - ImGui::CalcTextSize("Unload").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"))
{
g_running = false;
}
ImGui::PopStyleColor();
}
}
}

View File

@ -0,0 +1,42 @@
#include "services/gui_service.hpp"
#include "views/view.hpp"
#include "services/player_service.hpp"
namespace big
{
void view::navigation() {
ImGui::SetNextWindowPos({ 10.f, 100.f }, ImGuiCond_Always);
ImGui::SetNextWindowSize({ 250.f, 0.f }, ImGuiCond_Always);
if (ImGui::Begin("navigation", 0, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav))
{
g_gui_service->reset_nav_size();
for (std::pair<tabs, navigation_struct> navItem : g_gui_service->get_navigation()) {
if (navItem.first == tabs::PLAYER) continue;
components::nav_item(navItem, 0);
}
/*static navigation_struct playerPage = { tabs::PLAYER, "Player", view::view_player };
if (ImGui::BeginListBox("players", {(float)*g_pointers->m_resolution_x * 0.15f - 30, (float)*g_pointers->m_resolution_y * 0.3f})) {
for (auto& item : g_player_service->m_players)
{
std::unique_ptr<player>& plyr = item.second;
if (plyr->is_host())
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.29f, 0.45f, 0.69f, 1.f));
if (ImGui::Button(plyr->get_name(), { ImGui::GetWindowSize().x - 15.f, 0.f }))
{
g_player_service->set_selected(plyr.get());
current_tab = &playerPage;
g->window.switched_view = true;
}
if (plyr->is_host())
ImGui::PopStyleColor();
}
ImGui::EndListBox();
}*/
ImGui::End();
}
}
}

View File

@ -0,0 +1,96 @@
#include "views/view.hpp"
#include "services/notification_service.hpp"
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 fadeBegin = ImGui::ColorConvertFloat4ToU32(color);
color.w = 0.f;
ImColor fadeEnd = ImGui::ColorConvertFloat4ToU32(color);
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);
if (message.substr(i, 1) == " ")
{
prevSpace = i;
}
ImVec2 size = ImGui::CalcTextSize(current_message.c_str());
if (i == message.size())
{
total_size = total_size + size.y;
split_points.push_back(message.substr(j, i));
}
else if (size.x >= 330.f)
{
total_size = total_size + size.y;
split_points.push_back(message.substr(j, prevSpace - j));
j = prevSpace + 1;
i = prevSpace;
}
}
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());
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());
i++;
}
return start_pos + 45.f + total_size;
}
void view::notifications()
{
ImDrawList* draw_list = ImGui::GetBackgroundDrawList();
std::vector<notification> notifications = g_notification_service->get();
float prev_pos = 0.f;
for (int i = 0; i < notifications.size(); i++)
{
notification& n = notifications[i];
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 });
ImGui::SetNextWindowPos({ (float)g->window.x - (float)g->window.x * 0.2f, 0 });
if (ImGui::Begin("notifications", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus))
{
std::vector<notification> notifications = g_notification_service->get();
for (int i = 0; i < notifications.size(); i++)
{
notification& n = notifications[i];
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, n.alpha);
ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.10f, 0.09f, 0.12f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.10f, 0.09f, 0.12f, 1.00f));
ImGui::SetNextWindowBgAlpha(n.alpha);
ImGui::BeginChildFrame(i, ImVec2(0, 75.f + (float)(20 * (int)(n.message.size() / 28) + 20 * (float)std::count(n.message.begin(), n.message.end(), '\n'))), ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoInputs);
ImGui::Text(n.title.c_str());
ImGui::PushStyleColor(ImGuiCol_Text, g_notification_service->notification_colors.at(n.type));
ImGui::TextWrapped(n.message.c_str());
ImGui::PopStyleColor();
ImGui::EndChildFrame();
ImGui::PopStyleColor(2);
ImGui::PopStyleVar();
}
ImGui::End();
} */
}
}

View File

@ -0,0 +1,12 @@
#include "views/view.hpp"
namespace big
{
void view::root()
{
view::heading();
view::navigation();
view::players();
view::active_view();
}
}

View File

@ -0,0 +1,51 @@
#include "fiber_pool.hpp"
#include "util/session.hpp"
#include "views/view.hpp"
namespace big
{
void view::session() {
for (const SessionType& session_type : sessions)
{
components::button(session_type.name, [session_type] {
session::join_type(session_type);
});
}
if (ImGui::TreeNode("Local Time"))
{
ImGui::Checkbox("Override Time", &g->session.override_time);
if (g->session.override_time)
{
ImGui::SliderInt("Hour", &g->session.custom_time.hour, 0, 23);
ImGui::SliderInt("Minute", &g->session.custom_time.minute, 0, 59);
ImGui::SliderInt("Second", &g->session.custom_time.second, 0, 59);
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Local Weather"))
{
if (ImGui::Button("Clear Override"))
{
g_fiber_pool->queue_job([]
{
MISC::CLEAR_OVERRIDE_WEATHER();
});
}
if(ImGui::ListBox("", &g->session.local_weather, session::weathers, 15))
{
g_fiber_pool->queue_job([]
{
session::local_weather();
});
ImGui::ListBoxFooter();
}
ImGui::TreePop();
}
}
}

View File

@ -0,0 +1,54 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "util/teleport.hpp"
namespace big
{
void view::spoofing()
{
components::small_text("To spoof any of the below credentials you need to reconnect with the lobby.");
components::small_text("Username");
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
ImGui::Checkbox("Spoof Username", &g->spoofing.spoof_username);
static char name[20];
strcpy_s(name, sizeof(name), g->spoofing.username.c_str());
ImGui::Text("Username:");
ImGui::InputText("##username_input", name, sizeof(name));
if (name != g->spoofing.username)
g->spoofing.username = std::string(name);
ImGui::Separator();
components::small_text("IP Address");
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
ImGui::Checkbox("Spoof IP", &g->spoofing.spoof_ip);
ImGui::Text("IP Address:");
ImGui::DragInt4("##ip_fields", g->spoofing.ip_address, 0, 255);
ImGui::Separator();
components::small_text("Rockstar ID");
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
ImGui::Checkbox("Spoof Rockstar ID", &g->spoofing.spoof_rockstar_id);
ImGui::Text("Rockstar ID:");
ImGui::InputScalar("##rockstar_id_input", ImGuiDataType_U64, &g->spoofing.rockstar_id);
}
}

View File

@ -0,0 +1,43 @@
#include "views/view.hpp"
#include "services/gui_service.hpp"
namespace big
{
void view::players()
{
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({ 250.f, 0.f });
ImGui::SetNextWindowPos({ 10.f, window_pos });
if (ImGui::Begin("playerlist", nullptr, window_flags))
{
float window_height = g_player_service->m_players.size() * 35.f;
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 });
if (ImGui::BeginListBox("##players", { 250.f - ImGui::GetStyle().WindowPadding.x * 2 , window_height })) {
for (auto& item : g_player_service->m_players)
{
std::unique_ptr<player>& plyr = item.second;
if (plyr->is_host())
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.29f, 0.45f, 0.69f, 1.f));
if (ImGui::Button(plyr->get_name(), { ImGui::GetWindowSize().x - 15.f, 0.f }))
{
g_player_service->set_selected(plyr.get());
g_gui_service->set_selected(tabs::PLAYER);
g->window.switched_view = true;
}
if (plyr->is_host())
ImGui::PopStyleColor();
}
ImGui::EndListBox();
}
ImGui::PopStyleColor(2);
ImGui::End();
}
}
}

View File

@ -0,0 +1,81 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "util/mobile.hpp"
#include "services/mobile_service.hpp"
namespace big
{
void view::mobile() {
components::button("Mors Mutual Fix All Vehicles", [] {
int amount_fixed = mobile::mors_mutual::fix_all();
g_notification_service->push("Mobile",
fmt::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have")
);
});
ImGui::Separator();
components::small_text("Lester");
ImGui::Checkbox("Off Radar", &g->self.off_radar);
ImGui::Separator();
components::small_text("Mechanic - Personal Vehicles");
static char search[64];
static std::string lower_search;
ImGui::BeginGroup();
ImGui::SetNextItemWidth(400.f);
if (ImGui::InputTextWithHint("##search_pv_list", "Search", search, sizeof(search)))
{
lower_search = search;
std::transform(lower_search.begin(), lower_search.end(), lower_search.begin(), tolower);
}
if (ImGui::ListBoxHeader("##personal_veh_list", { 400.f, 500.f }))
{
for (auto& it : g_mobile_service->m_personal_vehicles)
{
std::string label = it.first;
auto& personal_veh = it.second;
std::string lower = label.c_str();
std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
if (lower.find(lower_search) != std::string::npos)
{
if (ImGui::Selectable(
label.c_str(),
personal_veh->get_id() == mobile::util::get_current_personal_vehicle()
))
{
strcpy(search, "");
lower_search = search;
g_fiber_pool->queue_job([&personal_veh] {
personal_veh->summon();
});
}
}
}
ImGui::ListBoxFooter();
}
ImGui::EndGroup();
ImGui::BeginGroup();
if (ImGui::Button("Load/Reload Personal Vehicles"))
{
g_fiber_pool->queue_job([] {
g_mobile_service->register_vehicles();
});
}
ImGui::Checkbox("Spawn in Vehicle", &g->vehicle.pv_teleport_into);
}
}

View File

@ -0,0 +1,100 @@
#include "fiber_pool.hpp"
#include "util/entity.hpp"
#include "views/view.hpp"
namespace big
{
void view::self() {
components::button("Suicide", [] {
ENTITY::SET_ENTITY_HEALTH(PLAYER::PLAYER_PED_ID(), 0, 0);
});
ImGui::SameLine();
components::button("Skip Cutscene", [] {
CUTSCENE::STOP_CUTSCENE_IMMEDIATELY();
});
static char model[32];
components::input_text_with_hint("Model Name###player_ped_model", "Player Model Name", model, sizeof(model), ImGuiInputTextFlags_EnterReturnsTrue, []
{
g_fiber_pool->queue_job([] {
const Hash hash = rage::joaat(model);
for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++)
{
STREAMING::REQUEST_MODEL(hash);
script::get_current()->yield();
}
if (!STREAMING::HAS_MODEL_LOADED(hash))
{
g_notification_service->push_error("Self", "Failed to spawn model, did you give an incorrect model ? ");
return;
}
PLAYER::SET_PLAYER_MODEL(PLAYER::GET_PLAYER_INDEX(), hash);
PED::SET_PED_DEFAULT_COMPONENT_VARIATION(PLAYER::PLAYER_PED_ID());
script::get_current()->yield();
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash);
});
});
ImGui::Separator();
components::small_text("General");
ImGui::BeginGroup();
ImGui::Checkbox("God Mode", &g->self.godmode);
ImGui::Checkbox("Off Radar", &g->self.off_radar);
ImGui::Checkbox("Free Cam", &g->self.free_cam);
ImGui::Checkbox("Disable Phone", &g->tunables.disable_phone);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("No Clip", &g->self.noclip);
ImGui::Checkbox("No Ragdoll", &g->self.no_ragdoll);
ImGui::Checkbox("Super Run", &g->self.super_run);
ImGui::Checkbox("No Idle Kick", &g->tunables.no_idle_kick);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Invisibility", &g->self.invisibility);
if (g->self.invisibility)
{
ImGui::Checkbox("Locally Visible", &g->self.local_visibility);
}
ImGui::Checkbox("Keep Player Clean", &g->self.clean_player);
if (ImGui::Button("Clean Player"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
entity::clean_ped(PLAYER::PLAYER_PED_ID());
}
QUEUE_JOB_END_CLAUSE
}
ImGui::EndGroup();
ImGui::Separator();
components::small_text("Police");
ImGui::Checkbox("Never Wanted", &g->self.never_wanted);
if (!g->self.never_wanted)
{
ImGui::Checkbox("Force Wanted Level", &g->self.force_wanted_level);
ImGui::Text("Wanted Level");
if (ImGui::SliderInt("###wanted_level", &g->self.wanted_level, 0, 5) && !g->self.force_wanted_level)
g_local_player->m_player_info->m_wanted_level = g->self.wanted_level;
}
}
}

View File

@ -0,0 +1,95 @@
#include "core/data/custom_weapons.hpp"
#include "fiber_pool.hpp"
#include "gta/Weapons.h"
#include "script.hpp"
#include "core/data/special_ammo_types.hpp"
#include "views/view.hpp"
namespace big
{
void view::weapons() {
components::small_text("Ammo");
ImGui::Checkbox("Infinite Ammo", &g->weapons.infinite_ammo);
ImGui::SameLine();
ImGui::Checkbox("Infinite Clip", &g->weapons.infinite_mag);
ImGui::Checkbox("Enable Special Ammo", &g->weapons.ammo_special.toggle);
eAmmoSpecialType selected_ammo = g->weapons.ammo_special.type;
if (ImGui::BeginCombo("Ammo Special", SPECIAL_AMMOS[(int)selected_ammo].name))
{
for (const auto& special_ammo : SPECIAL_AMMOS)
{
if (ImGui::Selectable(special_ammo.name, special_ammo.type == selected_ammo))
g->weapons.ammo_special.type = special_ammo.type;
if (special_ammo.type == selected_ammo)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
ImGui::Separator();
components::small_text("Misc");
ImGui::Checkbox("Force Crosshairs", &g->weapons.force_crosshairs);
ImGui::SameLine();
ImGui::Checkbox("No Recoil", &g->weapons.no_recoil);
ImGui::SameLine();
ImGui::Checkbox("No Spread", &g->weapons.no_spread);
if (ImGui::Button("Get All Weapons"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
for (auto const& weapon : weapon_list) {
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), weapon, 9999, false);
}
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), -72657034, 0, true);
}
QUEUE_JOB_END_CLAUSE
}
ImGui::SliderFloat("Damage Multiplier", &g->weapons.increased_damage, 1.f, 10.f, "%.1f");
ImGui::Separator();
components::small_text("Custom Weapons");
CustomWeapon selected = g->weapons.custom_weapon;
if (ImGui::BeginCombo("Weapon", custom_weapons[(int)selected].name))
{
for (const custom_weapon& weapon : custom_weapons)
{
if (ImGui::Selectable(weapon.name, weapon.id == selected))
{
g->weapons.custom_weapon = weapon.id;
}
if (weapon.id == selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
switch (selected)
{
case CustomWeapon::VEHICLE_GUN:
ImGui::Text("Shooting Model:");
ImGui::InputText("##vehicle_gun_model", g->weapons.vehicle_gun_model, 12);
break;
}
}
}

View File

@ -0,0 +1,231 @@
#include "views/view.hpp"
#include "services/globals_service.hpp"
#include "thread_pool.hpp"
#include "fiber_pool.hpp"
#include "pointers.hpp"
#include "script.hpp"
#include "util/system.hpp"
#include "natives.hpp"
namespace big
{
void view::debug() {
components::small_text("Globals");
if (ImGui::Checkbox("Enable Freezing", &g_globals_service->m_running) && g_globals_service->m_running)
g_thread_pool->push([&]() { g_globals_service->loop(); });
if (ImGui::Button("Load"))
g_globals_service->load();
ImGui::SameLine();
if (ImGui::Button("Save"))
g_globals_service->save();
components::button("Network Bail", []
{
NETWORK::NETWORK_BAIL(16, 0, 0);
});
ImGui::SameLine();
if (ImGui::Button("Add Global"))
{
ImGui::OpenPopup("New Global");
}
if (ImGui::BeginPopupModal("New Global"))
{
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;
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
ImGui::Text("Name:");
ImGui::InputText("##modal_global_name", name, sizeof(name));
ImGui::Text("Base Address:");
ImGui::InputInt("##modal_global_base_addr", &base_address);
ImGui::Text("Freeze:");
ImGui::Checkbox("##modal_global_freeze", &freeze);
ImGui::Text("Number of Offsets:");
ImGui::InputInt("##modal_offset_count", &offset_count);
if (offset_count < 0) offset_count;
else if (offset_count > 10) offset_count = 10;
if (offset_count != previous_offset_count)
{
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;
offsets = new_offsets;
previous_offset_count = offset_count;
}
ImGui::PushItemWidth(320.f);
for (int i = 0; i < offset_count; i++)
{
char id[32];
ImGui::Separator();
ImGui::Text("Offset: %d", i + 1);
sprintf(id, "##offset_%d", i);
ImGui::InputInt(id, &offsets[i][0]);
ImGui::Text("Size:");
ImGui::SameLine();
sprintf(id, "##size_%d", i);
ImGui::InputInt(id, &offsets[i][1]);
}
ImGui::PopItemWidth();
if (ImGui::Button("Cancel"))
{
strcpy(name, "");
freeze = false;
delete[] offsets;
offsets = nullptr;
offset_count = 0;
previous_offset_count = 0;
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
if (ImGui::Button("Save"))
{
auto new_global = global(name, base_address, freeze, offsets, offset_count);
new_global.build_cache();
g_globals_service->m_globals.push_back(new_global);
strcpy(name, "");
freeze = false;
delete[] offsets;
offsets = nullptr;
offset_count = 0;
previous_offset_count = 0;
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
}
for (auto& global : g_globals_service->m_globals)
{
char label[64];
ImGui::Separator();
sprintf(label, "Freeze##%d", global.get_id());
ImGui::Checkbox(label, &global.m_freeze);
ImGui::BeginGroup();
ImGui::Text("Name:");
ImGui::Text("Value:");
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Text(global.m_name.c_str());
sprintf(label, "###input_%d", global.get_id());
ImGui::SetNextItemWidth(200.f);
ImGui::InputInt(label, global.get());
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
sprintf(label, "Delete##%d", global.get_id());
if (ImGui::Button(label))
{
for (int i = 0; i < g_globals_service->m_globals.size(); i++)
if (auto& it = g_globals_service->m_globals.at(i); it.get_id() == global.get_id())
g_globals_service->m_globals.erase(g_globals_service->m_globals.begin() + i);
break;
}
sprintf(label, "Write###%d", global.get_id());
if (ImGui::Button(label))
global.write();
ImGui::EndGroup();
}
components::small_text("Scripting Events");
static int64_t* args;
static int event_arg_count = 1;
static int previous_arg_count;
static int event_player_bits;
static bool event_everyone = false;
ImGui::Text("Script Argument Count:");
ImGui::InputInt("###script_event_arg_count", &event_arg_count);
if (event_arg_count > 32)
event_arg_count = 32;
else if (event_arg_count < 1)
event_arg_count = 1;
if (event_arg_count != previous_arg_count)
{
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;
args = temp_args;
previous_arg_count = event_arg_count;
}
ImGui::Separator();
for (int i = 0; i < event_arg_count; i++)
{
ImGui::Text("Arg[%d]", i);
ImGui::SameLine();
char input_arg_name[20];
sprintf(input_arg_name, "###input_dynamic_arg_%d", i);
ImGui::InputScalar(input_arg_name, ImGuiDataType_S64, &args[i]);
}
ImGui::Separator();
ImGui::Checkbox("Send to everyone", &event_everyone);
if (!event_everyone)
{
ImGui::Text("Player ID:");
ImGui::InputInt("###player_bits", &event_player_bits);
}
components::button("Send Event", [] {
g_pointers->m_trigger_script_event(1, args, event_arg_count, event_everyone ? -1 : 1 << event_player_bits);
});
components::small_text("Debug");
ImGui::Checkbox("Script Event Logging", &g->debug.script_event_logging);
if (ImGui::Button("Dump entrypoints"))
{
system::dump_entry_points();
}
}
}

View File

@ -0,0 +1,38 @@
#include "views/view.hpp"
namespace big
{
void view::esp_settings()
{
ImGui::Checkbox("ESP Enabled", &g->esp.enabled);
if (g->esp.enabled)
{
ImGui::SliderFloat2("Global Render Distance", g->esp.global_render_distance, 0.f, 1500.f);
ImGui::Checkbox("Tracer", &g->esp.tracer);
if (g->esp.tracer)
ImGui::SliderFloat2("Tracer Render Distance", g->esp.tracer_render_distance, g->esp.global_render_distance[0], g->esp.global_render_distance[1]);
ImGui::Checkbox("Box ESP", &g->esp.box);
if (g->esp.box)
ImGui::SliderFloat2("Box Render Distance", g->esp.box_render_distance, g->esp.global_render_distance[0], g->esp.global_render_distance[1]);
ImGui::Checkbox("Show Player Distance", &g->esp.distance);
ImGui::Checkbox("Show Player Godmode", &g->esp.god);
ImGui::Checkbox("Show Player Health", &g->esp.health);
ImGui::Checkbox("Show Player Name", &g->esp.name);
static ImVec4 col_esp = ImGui::ColorConvertU32ToFloat4(g->esp.color);
static ImVec4 col_friend = ImGui::ColorConvertU32ToFloat4(g->esp.friend_color);
if (ImGui::ColorEdit4("ESP Color##esp_picker", (float*)&col_esp, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g->esp.color = ImGui::ColorConvertFloat4ToU32(col_esp);
}
if (ImGui::ColorEdit4("Friend ESP Color##friend_picker", (float*)&col_friend, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g->esp.friend_color = ImGui::ColorConvertFloat4ToU32(col_friend);
}
}
}
}

View File

@ -0,0 +1,14 @@
#include "views/view.hpp"
namespace big
{
void view::gui_settings()
{
static ImVec4 col_gui = ImGui::ColorConvertU32ToFloat4(g->window.color);
if (ImGui::ColorEdit4("Gui Color##gui_picker", (float*)&col_gui, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g->window.color = ImGui::ColorConvertFloat4ToU32(col_gui);
}
}
}

View File

@ -0,0 +1,97 @@
#include "views/view.hpp"
namespace big
{
void draw_pair_option(const std::string_view name, decltype(g->notifications.gta_thread_kill)& option)
{
ImGui::Text(name.data());
ImGui::PushID(name.data());
ImGui::Checkbox("Log", &option.log);
ImGui::Checkbox("Notify", &option.notify);
ImGui::PopID();
}
void view::notification_settings()
{
components::small_text("GTA Threads");
draw_pair_option("Terminate", g->notifications.gta_thread_kill);
draw_pair_option("Start", g->notifications.gta_thread_start);
components::small_text("Network Player Manager");
ImGui::Text("Player Join");
ImGui::Checkbox("Above Map", &g->notifications.player_join.above_map);
ImGui::Checkbox("Log", &g->notifications.player_join.log);
ImGui::Checkbox("Notify", &g->notifications.player_join.notify);
ImGui::SameLine();
draw_pair_option("Player Leave", g->notifications.player_leave);
draw_pair_option("Shutdown", g->notifications.network_player_mgr_shutdown);
components::small_text("Received Event");
auto& received_event = g->notifications.received_event;
ImGui::BeginGroup();
draw_pair_option("Clear Ped Tasks", received_event.clear_ped_task);
draw_pair_option("Modder Detection", received_event.modder_detect);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Report Cash Spawn", received_event.report_cash_spawn);
draw_pair_option("Request Control Event", received_event.request_control_event);
ImGui::EndGroup();
components::small_text("Script Event Handler");
auto& script_event_handler = g->notifications.script_event_handler;
ImGui::BeginGroup();
draw_pair_option("Bounty", script_event_handler.bounty);
draw_pair_option("CEO Ban", script_event_handler.ceo_ban);
draw_pair_option("CEO Kick", script_event_handler.ceo_kick);
draw_pair_option("CEO Money", script_event_handler.ceo_money);
draw_pair_option("Wanted Level", script_event_handler.clear_wanted_level);
draw_pair_option("Fake Deposit", script_event_handler.fake_deposit);
draw_pair_option("Force Mission", script_event_handler.force_mission);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Force Teleport", script_event_handler.force_teleport);
draw_pair_option("GTA Banner", script_event_handler.gta_banner);
draw_pair_option("Network Bail", script_event_handler.network_bail);
draw_pair_option("Destroy Personal Vehicle", script_event_handler.personal_vehicle_destroyed);
draw_pair_option("Remote Off Radar", script_event_handler.remote_off_radar);
draw_pair_option("Rotate Cam", script_event_handler.rotate_cam);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Send to Cutscene", script_event_handler.send_to_cutscene);
draw_pair_option("Send to Island", script_event_handler.send_to_island);
draw_pair_option("Sound Spam", script_event_handler.sound_spam);
draw_pair_option("Spectate", script_event_handler.spectate);
draw_pair_option("Transaction Error", script_event_handler.transaction_error);
draw_pair_option("Vehicle Kick", script_event_handler.vehicle_kick);
ImGui::EndGroup();
components::small_text("Other");
draw_pair_option("Net Array Error", g->notifications.net_array_error);
draw_pair_option("Reports", g->notifications.reports);
draw_pair_option("Transaction Error / Rate Limit", g->notifications.transaction_rate_limit);
}
}

View File

@ -0,0 +1,40 @@
#include "views/view.hpp"
namespace big
{
void view::protection_settings()
{
ImGui::BeginGroup();
ImGui::Checkbox("Bounty", &g->protections.script_events.bounty);
ImGui::Checkbox("CEO Ban", &g->protections.script_events.ceo_ban);
ImGui::Checkbox("CEO Kick", &g->protections.script_events.ceo_kick);
ImGui::Checkbox("CEO Money", &g->protections.script_events.ceo_money);
ImGui::Checkbox("Wanted Level", &g->protections.script_events.clear_wanted_level);
ImGui::Checkbox("Fake Deposit", &g->protections.script_events.fake_deposit);
ImGui::Checkbox("Force Mission", &g->protections.script_events.force_mission);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Force Teleport", &g->protections.script_events.force_teleport);
ImGui::Checkbox("GTA Banner", &g->protections.script_events.gta_banner);
ImGui::Checkbox("Network Bail", &g->protections.script_events.network_bail);
ImGui::Checkbox("Personal Vehicle Destroyed", &g->protections.script_events.personal_vehicle_destroyed);
ImGui::Checkbox("Remote Off Radar", &g->protections.script_events.remote_off_radar);
ImGui::Checkbox("Rotate Cam", &g->protections.script_events.rotate_cam);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Send to Cutscene", &g->protections.script_events.send_to_cutscene);
ImGui::Checkbox("Send to Island", &g->protections.script_events.send_to_island);
ImGui::Checkbox("Sound Spam", &g->protections.script_events.sound_spam);
ImGui::Checkbox("Spectate", &g->protections.script_events.spectate);
ImGui::Checkbox("Transaction Error", &g->protections.script_events.transaction_error);
ImGui::Checkbox("Vehicle Kick", &g->protections.script_events.vehicle_kick);
ImGui::EndGroup();
}
}

View File

@ -0,0 +1,19 @@
#include "views/view.hpp"
#include "widgets/imgui_hotkey.hpp"
namespace big
{
void view::settings() {
components::small_text("Hotkeys");
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
ImGui::Text("(Below hotkey is not implemented)");
ImGui::Hotkey("Teleport to waypoint", &g->settings.hotkeys.teleport_waypoint);
ImGui::PopItemWidth();
}
}

View File

@ -16,6 +16,8 @@ namespace big
}
void view::spawn() {
ImGui::SetWindowSize({ 0.f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always);
ImGui::Checkbox("Preview", &g->spawn.preview_vehicle);
ImGui::SameLine();
ImGui::Checkbox("Spawn In", &g->spawn.spawn_inside);
@ -36,7 +38,7 @@ namespace big
}
});
if (ImGui::ListBoxHeader("###vehicles", { ImGui::GetWindowWidth(), ImGui::GetWindowHeight() }))
if (ImGui::ListBoxHeader("###vehicles"))
{
if (!g_vehicle_preview_service->get_vehicle_list().is_null())
{
@ -82,6 +84,7 @@ namespace big
g_vehicle_preview_service->set_preview_vehicle(item);
}
}
ImGui::ListBoxFooter();
}
else ImGui::Text("No vehicles in registry.");
}

View File

@ -0,0 +1,84 @@
#include "views/view.hpp"
#include "core/data/speedo_meters.hpp"
#include "gui/handling/handling_tabs.hpp"
#include "script.hpp"
#include "util/vehicle.hpp"
namespace big
{
void view::vehicle() {
ImGui::BeginGroup();
ImGui::Checkbox("Can Be Targeted", &g->vehicle.is_targetable);
ImGui::Checkbox("God Mode", &g->vehicle.god_mode);
ImGui::Checkbox("Horn Boost", &g->vehicle.horn_boost);
ImGui::Checkbox("Drive On Water", &g->vehicle.drive_on_water);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("Repair", [] {
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
vehicle::repair(veh);
});
if (ImGui::TreeNode("Paint"))
{
ImGui::ListBox("RGB Type", &g->vehicle.rainbow_paint, vehicle::rgb_types, 3);
if (g->vehicle.rainbow_paint)
{
ImGui::SliderInt("RGB Speed", &g->rgb.speed, 1, 10);
}
ImGui::TreePop();
}
ImGui::EndGroup();
ImGui::Separator();
components::small_text("LS Customs");
components::button("Start LS Customs", [] {
g->vehicle.ls_customs = true;
});
ImGui::Separator();
components::small_text("Speedo Meter");
SpeedoMeter selected = g->vehicle.speedo_meter.type;
ImGui::Text("Type:");
if (ImGui::BeginCombo("###speedo_type", speedo_meters[(int)selected].name))
{
for (const speedo_meter& speedo : speedo_meters)
{
if (ImGui::Selectable(speedo.name, speedo.id == selected))
{
g->vehicle.speedo_meter.type = speedo.id;
}
if (speedo.id == selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
ImGui::Text("Position");
float pos[2];
pos[0] = g->vehicle.speedo_meter.x;
pos[1] = g->vehicle.speedo_meter.y;
if (ImGui::SliderFloat2("###speedo_pos", pos, .001f, .999f, "%.3f"))
{
g->vehicle.speedo_meter.x = pos[0];
g->vehicle.speedo_meter.y = pos[1];
}
ImGui::Checkbox("Left Sided", &g->vehicle.speedo_meter.left_side);
}
}

View File

@ -13,33 +13,26 @@ namespace big
{
class view
{
enum class tabs {
DEBUG,
MOBILE,
NONE,
PLAYER,
SELF,
SESSION,
SETTINGS,
SPAWN,
SPOOFING,
TELEPORT,
VEHICLE,
WEAPONS,
};
struct navigation_struct
{
tabs tab = tabs::NONE;
const char name[32] = "";
std::function<void()> func = nullptr;
};
inline static animator window_animator = animator();
inline static ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav;
public:
static void active_view();
static void debug();
static void esp_settings();
static void gui_settings();
static void handling_current_profile();
static void handling_my_profiles();
static void handling_saved_profiles();
static void handling_search();
static void notification_settings();
static void protection_settings();
static void heading();
static void mobile();
static void navigation();
//static void player_navigation();
static void notifications();
static void root();
static void self();
static void session();
static void settings();
@ -48,35 +41,9 @@ namespace big
static void teleport();
static void vehicle();
static void view_player();
static void players();
static void weapons();
inline static animator window_animator = animator();
inline static navigation_struct initial_tab{};
inline static navigation_struct* current_tab = &initial_tab;
inline static navigation_struct nav[] = {
{ tabs::SELF, "Self", view::self },
{ tabs::MOBILE, "Mobile", view::mobile },
{ tabs::SPAWN, "Spawn", view::spawn },
{ tabs::TELEPORT, "Teleport", view::teleport },
{ tabs::VEHICLE, "Vehicle", view::vehicle },
{ tabs::WEAPONS, "Weapons", view::weapons },
{ tabs::SPOOFING, "Spoofing", view::spoofing },
{ tabs::SESSION, "Session", view::session },
{ tabs::SETTINGS, "Settings", view::settings },
{ tabs::DEBUG, "Debug", view::debug },
{ tabs::PLAYER, "Players", view::view_player },
};
public:
static void root()
{
active_view();
navigation();
}
static void always()
{
esp::draw();

View File

@ -1,48 +0,0 @@
#include "views/view.hpp"
namespace big
{
void view::active_view() {
static float tabs_open_animation = -(float)*g_pointers->m_resolution_x * 0.15f;
static float alpha = 0.f;
const float max_position = (float)*g_pointers->m_resolution_x * 0.15f;
if (g->window.switched_view) {
g->window.switched_view = false;
window_animator.reset();
}
window_animator.animate(600, [max_position](const float& progress)
{
alpha = progress;
switch (current_tab->tab)
{
case tabs::NONE:
tabs_open_animation = tabs_open_animation <= -max_position ? -max_position : max_position - (((float)*g_pointers->m_resolution_x * 0.30f) * progress);
break;
default:
tabs_open_animation = tabs_open_animation >= max_position ? max_position : (((float)*g_pointers->m_resolution_x * 0.30f) * progress) - max_position;
break;
}
});
ImGui::SetNextWindowPos({ tabs_open_animation, 0.f }, ImGuiCond_Always);
ImGui::SetNextWindowSize({ (float)*g_pointers->m_resolution_x * 0.3f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always);
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.10f, 0.09f, 0.12f, 1.00f));
if (ImGui::Begin("main", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav))
{
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha);
if (current_tab->tab != tabs::NONE)
{
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.06f, 0.05f, 0.07f, 1.00f));
components::sub_title(current_tab->name);
current_tab->func();
ImGui::PopStyleColor();
}
ImGui::PopStyleVar();
}
ImGui::End();
ImGui::PopStyleColor();
}
}

View File

@ -1,236 +0,0 @@
#include "views/view.hpp"
#include "services/globals_service.hpp"
#include "thread_pool.hpp"
#include "fiber_pool.hpp"
#include "pointers.hpp"
#include "script.hpp"
#include "util/system.hpp"
#include "natives.hpp"
namespace big
{
void view::debug() {
if (ImGui::TreeNode("Globals")) {
if (ImGui::Checkbox("Enable Freezing", &g_globals_service->m_running) && g_globals_service->m_running)
g_thread_pool->push([&]() { g_globals_service->loop(); });
if (ImGui::Button("Load"))
g_globals_service->load();
ImGui::SameLine();
if (ImGui::Button("Save"))
g_globals_service->save();
components::button("Network Bail", []
{
NETWORK::NETWORK_BAIL(16, 0, 0);
});
ImGui::SameLine();
if (ImGui::Button("Add Global"))
{
ImGui::OpenPopup("New Global");
}
if (ImGui::BeginPopupModal("New Global"))
{
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;
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
ImGui::Text("Name:");
ImGui::InputText("##modal_global_name", name, sizeof(name));
ImGui::Text("Base Address:");
ImGui::InputInt("##modal_global_base_addr", &base_address);
ImGui::Text("Freeze:");
ImGui::Checkbox("##modal_global_freeze", &freeze);
ImGui::Text("Number of Offsets:");
ImGui::InputInt("##modal_offset_count", &offset_count);
if (offset_count < 0) offset_count;
else if (offset_count > 10) offset_count = 10;
if (offset_count != previous_offset_count)
{
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;
offsets = new_offsets;
previous_offset_count = offset_count;
}
ImGui::PushItemWidth(320.f);
for (int i = 0; i < offset_count; i++)
{
char id[32];
ImGui::Separator();
ImGui::Text("Offset: %d", i + 1);
sprintf(id, "##offset_%d", i);
ImGui::InputInt(id, &offsets[i][0]);
ImGui::Text("Size:");
ImGui::SameLine();
sprintf(id, "##size_%d", i);
ImGui::InputInt(id, &offsets[i][1]);
}
ImGui::PopItemWidth();
if (ImGui::Button("Cancel"))
{
strcpy(name, "");
freeze = false;
delete[] offsets;
offsets = nullptr;
offset_count = 0;
previous_offset_count = 0;
ImGui::CloseCurrentPopup();
}
ImGui::SameLine();
if (ImGui::Button("Save"))
{
auto new_global = global(name, base_address, freeze, offsets, offset_count);
new_global.build_cache();
g_globals_service->m_globals.push_back(new_global);
strcpy(name, "");
freeze = false;
delete[] offsets;
offsets = nullptr;
offset_count = 0;
previous_offset_count = 0;
ImGui::CloseCurrentPopup();
}
ImGui::EndPopup();
}
for (auto& global : g_globals_service->m_globals)
{
char label[64];
ImGui::Separator();
sprintf(label, "Freeze##%d", global.get_id());
ImGui::Checkbox(label, &global.m_freeze);
ImGui::BeginGroup();
ImGui::Text("Name:");
ImGui::Text("Value:");
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Text(global.m_name.c_str());
sprintf(label, "###input_%d", global.get_id());
ImGui::SetNextItemWidth(200.f);
ImGui::InputInt(label, global.get());
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
sprintf(label, "Delete##%d", global.get_id());
if (ImGui::Button(label))
{
for (int i = 0; i < g_globals_service->m_globals.size(); i++)
if (auto& it = g_globals_service->m_globals.at(i); it.get_id() == global.get_id())
g_globals_service->m_globals.erase(g_globals_service->m_globals.begin() + i);
break;
}
sprintf(label, "Write###%d", global.get_id());
if (ImGui::Button(label))
global.write();
ImGui::EndGroup();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Scripting Events")) {
static int64_t* args;
static int event_arg_count = 1;
static int previous_arg_count;
static int event_player_bits;
static bool event_everyone = false;
ImGui::Text("Script Argument Count:");
ImGui::InputInt("###script_event_arg_count", &event_arg_count);
if (event_arg_count > 32)
event_arg_count = 32;
else if (event_arg_count < 1)
event_arg_count = 1;
if (event_arg_count != previous_arg_count)
{
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;
args = temp_args;
previous_arg_count = event_arg_count;
}
ImGui::Separator();
for (int i = 0; i < event_arg_count; i++)
{
ImGui::Text("Arg[%d]", i);
ImGui::SameLine();
char input_arg_name[20];
sprintf(input_arg_name, "###input_dynamic_arg_%d", i);
ImGui::InputScalar(input_arg_name, ImGuiDataType_S64, &args[i]);
}
ImGui::Separator();
ImGui::Checkbox("Send to everyone", &event_everyone);
if (!event_everyone)
{
ImGui::Text("Player ID:");
ImGui::InputInt("###player_bits", &event_player_bits);
}
components::button("Send Event", [] {
g_pointers->m_trigger_script_event(1, args, event_arg_count, event_everyone ? -1 : 1 << event_player_bits);
});
ImGui::TreePop();
}
if (ImGui::TreeNode("Debug")) {
ImGui::Checkbox("Script Event Logging", &g->debug.script_event_logging);
if (ImGui::Button("Dump entrypoints"))
{
system::dump_entry_points();
}
ImGui::TreePop();
}
}
}

View File

@ -1,87 +0,0 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "script.hpp"
#include "util/mobile.hpp"
#include "services/mobile_service.hpp"
namespace big
{
void view::mobile() {
components::button("Mors Mutual Fix All Vehicles", [] {
int amount_fixed = mobile::mors_mutual::fix_all();
g_notification_service->push("Mobile",
fmt::format("{} vehicle{} been fixed.", amount_fixed, amount_fixed == 1 ? " has" : "s have")
);
});
ImGui::Separator();
if (ImGui::TreeNode("Lester"))
{
ImGui::Checkbox("Off Radar", &g->self.off_radar);
ImGui::TreePop();
}
ImGui::Separator();
if (ImGui::TreeNode("Mechanic - Personal Vehicles"))
{
static char search[64];
static std::string lower_search;
ImGui::BeginGroup();
ImGui::SetNextItemWidth(400.f);
if (ImGui::InputTextWithHint("##search_pv_list", "Search", search, sizeof(search)))
{
lower_search = search;
std::transform(lower_search.begin(), lower_search.end(), lower_search.begin(), tolower);
}
if (ImGui::ListBoxHeader("##personal_veh_list", { 400.f, 500.f }))
{
for (auto& it : g_mobile_service->m_personal_vehicles)
{
std::string label = it.first;
auto& personal_veh = it.second;
std::string lower = label.c_str();
std::transform(lower.begin(), lower.end(), lower.begin(), ::tolower);
if (lower.find(lower_search) != std::string::npos)
{
if (ImGui::Selectable(
label.c_str(),
personal_veh->get_id() == mobile::util::get_current_personal_vehicle()
))
{
strcpy(search, "");
lower_search = search;
g_fiber_pool->queue_job([&personal_veh] {
personal_veh->summon();
});
}
}
}
ImGui::ListBoxFooter();
}
ImGui::EndGroup();
ImGui::BeginGroup();
if (ImGui::Button("Load/Reload Personal Vehicles"))
{
g_fiber_pool->queue_job([] {
g_mobile_service->register_vehicles();
});
}
ImGui::Checkbox("Spawn in Vehicle", &g->vehicle.pv_teleport_into);
ImGui::TreePop();
}
}
}

View File

@ -1,73 +0,0 @@
#include "views/view.hpp"
#include "services/player_service.hpp"
namespace big
{
void view::navigation() {
ImGui::SetNextWindowPos({ 0.f, 0.f }, ImGuiCond_Always);
ImGui::SetNextWindowSize({ (float)*g_pointers->m_resolution_x * 0.15f, (float)*g_pointers->m_resolution_y }, ImGuiCond_Always);
if (ImGui::Begin("navigation", 0, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav))
{
components::title("Yim");
ImGui::SameLine(0, 0);
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.172f, 0.380f, 0.909f, 1.f));
components::title("Menu");
ImGui::PopStyleColor();
components::small_text(fmt::format("Welcome {}", g_local_player == nullptr || g_local_player->m_player_info == nullptr ? "unknown" : g_local_player->m_player_info->m_net_player_data.m_name).c_str());
for (auto& navItem : nav) {
const bool curTab = navItem.tab == current_tab->tab;
if (curTab)
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.29f, 0.45f, 0.69f, 1.f));
if (components::nav_button(navItem.name)) {
current_tab = &navItem;
g->window.switched_view = true;
}
if (curTab)
ImGui::PopStyleColor();
}
static navigation_struct playerPage = { tabs::PLAYER, "Player", view::view_player };
if (ImGui::BeginListBox("players", {(float)*g_pointers->m_resolution_x * 0.15f - 30, (float)*g_pointers->m_resolution_y * 0.3f})) {
for (auto& item : g_player_service->m_players)
{
std::unique_ptr<player>& plyr = item.second;
if (plyr->is_host())
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0.29f, 0.45f, 0.69f, 1.f));
if (ImGui::Button(plyr->get_name(), { ImGui::GetWindowSize().x - 15.f, 0.f }))
{
g_player_service->set_selected(plyr.get());
current_tab = &playerPage;
g->window.switched_view = true;
}
if (plyr->is_host())
ImGui::PopStyleColor();
}
ImGui::EndListBox();
}
ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.69f, 0.29f, 0.29f, 1.00f));
if (components::nav_button("Unload"))
{
g_running = false;
}
if (components::nav_button("Rage Quit (hard crash)"))
{
g_running = false;
TerminateProcess(GetCurrentProcess(), 0);
}
ImGui::PopStyleColor();
}
ImGui::End();
}
}

View File

@ -1,33 +0,0 @@
#include "view.hpp"
#include "services/notification_service.hpp"
namespace big
{
void view::notifications()
{
ImGui::SetNextWindowSize({ (float)*g_pointers->m_resolution_x * 0.2f, (float)*g_pointers->m_resolution_y });
ImGui::SetNextWindowPos({ (float)*g_pointers->m_resolution_x - (float)*g_pointers->m_resolution_x * 0.2f, 0 });
if (ImGui::Begin("notifications", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus))
{
std::vector<notification> notifications = g_notification_service->get();
for (int i = 0; i < notifications.size(); i++)
{
notification& n = notifications[i];
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, n.alpha);
ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.10f, 0.09f, 0.12f, 1.00f));
ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.10f, 0.09f, 0.12f, 1.00f));
ImGui::SetNextWindowBgAlpha(n.alpha);
ImGui::BeginChildFrame(i, ImVec2(0, 75.f + (float)(20 * (int)(n.message.size() / 28) + 20 * (float)std::count(n.message.begin(), n.message.end(), '\n'))), ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoInputs);
ImGui::Text(n.title.c_str());
ImGui::PushStyleColor(ImGuiCol_Text, g_notification_service->notification_colors.at(n.type));
ImGui::TextWrapped(n.message.c_str());
ImGui::PopStyleColor();
ImGui::EndChildFrame();
ImGui::PopStyleColor(2);
ImGui::PopStyleVar();
}
}
ImGui::End();
}
}

View File

@ -1,115 +0,0 @@
#include "fiber_pool.hpp"
#include "util/entity.hpp"
#include "views/view.hpp"
namespace big
{
void view::self() {
components::button("Suicide", [] {
ENTITY::SET_ENTITY_HEALTH(PLAYER::PLAYER_PED_ID(), 0, 0);
});
if (ImGui::TreeNode("General"))
{
ImGui::BeginGroup();
ImGui::Checkbox("God Mode", &g->self.godmode);
ImGui::Checkbox("Off Radar", &g->self.off_radar);
ImGui::Checkbox("Free Cam", &g->self.free_cam);
ImGui::Checkbox("Disable Phone", &g->tunables.disable_phone);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("No Clip", &g->self.noclip);
ImGui::Checkbox("No Ragdoll", &g->self.no_ragdoll);
ImGui::Checkbox("Super Run", &g->self.super_run);
ImGui::Checkbox("No Idle Kick", &g->tunables.no_idle_kick);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Invisibility", &g->self.invisibility);
if (g->self.invisibility)
{
ImGui::Checkbox("Locally Visible", &g->self.local_visibility);
}
ImGui::Checkbox("Keep Player Clean", &g->self.clean_player);
if (ImGui::Button("Clean Player"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
entity::clean_ped(PLAYER::PLAYER_PED_ID());
}
QUEUE_JOB_END_CLAUSE
}
ImGui::EndGroup();
ImGui::TreePop();
}
if (ImGui::TreeNode("Player Model"))
{
static char model[32];
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
if (
ImGui::InputText("Model Name###player_ped_model", model, sizeof(model), ImGuiInputTextFlags_EnterReturnsTrue) ||
components::button("Set Player Model###spawn_player_ped_model")
)
{
g_fiber_pool->queue_job([] {Hash hash = rage::joaat(model);
for (uint8_t i = 0; !STREAMING::HAS_MODEL_LOADED(hash) && i < 100; i++)
{
STREAMING::REQUEST_MODEL(hash);
script::get_current()->yield();
}
if (!STREAMING::HAS_MODEL_LOADED(hash))
{
g_notification_service->push_error("Self", "Failed to spawn model, did you give an incorrect model ? ");
return;
}
PLAYER::SET_PLAYER_MODEL(PLAYER::GET_PLAYER_INDEX(), hash);
PED::SET_PED_DEFAULT_COMPONENT_VARIATION(PLAYER::PLAYER_PED_ID());
script::get_current()->yield();
STREAMING::SET_MODEL_AS_NO_LONGER_NEEDED(hash);
});
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Police"))
{
ImGui::Checkbox("Never Wanted", &g->self.never_wanted);
if (!g->self.never_wanted)
{
ImGui::Checkbox("Force Wanted Level", &g->self.force_wanted_level);
ImGui::Text("Wanted Level");
if (ImGui::SliderInt("###wanted_level", &g->self.wanted_level, 0, 5) && !g->self.force_wanted_level)
g_local_player->m_player_info->m_wanted_level = g->self.wanted_level;
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Extra's")) {
components::button("Skip Cutscene", [] {
CUTSCENE::STOP_CUTSCENE_IMMEDIATELY();
});
}
}
}

View File

@ -1,91 +0,0 @@
#include "fiber_pool.hpp"
#include "util/session.hpp"
#include "views/view.hpp"
namespace big
{
void view::session() {
if (ImGui::TreeNode("Session Switcher"))
{
for (const SessionType& session_type : sessions)
{
components::button(session_type.name, [session_type] {
session::join_type(session_type);
});
}
ImGui::TreePop();
}
if (ImGui::TreeNode("ESP Settings"))
{
ImGui::Checkbox("ESP Enabled", &g->esp.enabled);
if (g->esp.enabled)
{
ImGui::SliderFloat2("Global Render Distance", g->esp.global_render_distance, 0.f, 1500.f);
ImGui::Checkbox("Tracer", &g->esp.tracer);
if (g->esp.tracer)
ImGui::SliderFloat2("Tracer Render Distance", g->esp.tracer_render_distance, g->esp.global_render_distance[0], g->esp.global_render_distance[1]);
ImGui::Checkbox("Box ESP", &g->esp.box);
if (g->esp.box)
ImGui::SliderFloat2("Box Render Distance", g->esp.box_render_distance, g->esp.global_render_distance[0], g->esp.global_render_distance[1]);
ImGui::Checkbox("Show Player Distance", &g->esp.distance);
ImGui::Checkbox("Show Player Godmode", &g->esp.god);
ImGui::Checkbox("Show Player Health", &g->esp.health);
ImGui::Checkbox("Show Player Name", &g->esp.name);
static ImVec4 col_esp = ImGui::ColorConvertU32ToFloat4(g->esp.color);
static ImVec4 col_friend = ImGui::ColorConvertU32ToFloat4(g->esp.friend_color);
if (ImGui::ColorEdit4("ESP Color##esp_picker", (float*)&col_esp, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g->esp.color = ImGui::ColorConvertFloat4ToU32(col_esp);
}
if (ImGui::ColorEdit4("Friend ESP Color##friend_picker", (float*)&col_friend, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g->esp.friend_color = ImGui::ColorConvertFloat4ToU32(col_friend);
}
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Local Time"))
{
ImGui::Checkbox("Override Time", &g->session.override_time);
if (g->session.override_time)
{
ImGui::SliderInt("Hour", &g->session.custom_time.hour, 0, 23);
ImGui::SliderInt("Minute", &g->session.custom_time.minute, 0, 59);
ImGui::SliderInt("Second", &g->session.custom_time.second, 0, 59);
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Local Weather"))
{
if (ImGui::Button("Clear Override"))
{
g_fiber_pool->queue_job([]
{
MISC::CLEAR_OVERRIDE_WEATHER();
});
}
if (ImGui::ListBox("", &g->session.local_weather, session::weathers, 15))
{
g_fiber_pool->queue_job([]
{
session::local_weather();
});
}
ImGui::TreePop();
}
}
}

View File

@ -1,162 +0,0 @@
#include "views/view.hpp"
#include "widgets/imgui_hotkey.hpp"
namespace big
{
void draw_pair_option(const std::string_view name, decltype(g->notifications.gta_thread_kill)& option)
{
ImGui::Text(name.data());
ImGui::PushID(name.data());
ImGui::Checkbox("Log", &option.log);
ImGui::Checkbox("Notify", &option.notify);
ImGui::PopID();
}
void view::settings() {
if (ImGui::TreeNode("Hotkeys"))
{
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
ImGui::Text("(Below hotkey is not implemented)");
ImGui::Hotkey("Teleport to waypoint", &g->settings.hotkeys.teleport_waypoint);
ImGui::PopItemWidth();
ImGui::TreePop();
}
if (ImGui::TreeNode("Protections"))
{
ImGui::BeginGroup();
ImGui::Checkbox("Bounty", &g->protections.script_events.bounty);
ImGui::Checkbox("CEO Ban", &g->protections.script_events.ceo_ban);
ImGui::Checkbox("CEO Kick", &g->protections.script_events.ceo_kick);
ImGui::Checkbox("CEO Money", &g->protections.script_events.ceo_money);
ImGui::Checkbox("Wanted Level", &g->protections.script_events.clear_wanted_level);
ImGui::Checkbox("Fake Deposit", &g->protections.script_events.fake_deposit);
ImGui::Checkbox("Force Mission", &g->protections.script_events.force_mission);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Force Teleport", &g->protections.script_events.force_teleport);
ImGui::Checkbox("GTA Banner", &g->protections.script_events.gta_banner);
ImGui::Checkbox("Network Bail", &g->protections.script_events.network_bail);
ImGui::Checkbox("Personal Vehicle Destroyed", &g->protections.script_events.personal_vehicle_destroyed);
ImGui::Checkbox("Remote Off Radar", &g->protections.script_events.remote_off_radar);
ImGui::Checkbox("Rotate Cam", &g->protections.script_events.rotate_cam);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Send to Cutscene", &g->protections.script_events.send_to_cutscene);
ImGui::Checkbox("Send to Island", &g->protections.script_events.send_to_island);
ImGui::Checkbox("Sound Spam", &g->protections.script_events.sound_spam);
ImGui::Checkbox("Spectate", &g->protections.script_events.spectate);
ImGui::Checkbox("Transaction Error", &g->protections.script_events.transaction_error);
ImGui::Checkbox("Vehicle Kick", &g->protections.script_events.vehicle_kick);
ImGui::EndGroup();
ImGui::TreePop();
}
if (ImGui::TreeNode("Notifications"))
{
if (ImGui::TreeNode("GTA Threads"))
{
draw_pair_option("Terminate", g->notifications.gta_thread_kill);
draw_pair_option("Start", g->notifications.gta_thread_start);
ImGui::TreePop();
}
if (ImGui::TreeNode("Network Player Manager"))
{
ImGui::Text("Player Join");
ImGui::Checkbox("Above Map", &g->notifications.player_join.above_map);
ImGui::Checkbox("Log", &g->notifications.player_join.log);
ImGui::Checkbox("Notify", &g->notifications.player_join.notify);
draw_pair_option("Player Leave", g->notifications.player_leave);
draw_pair_option("Shutdown", g->notifications.network_player_mgr_shutdown);
ImGui::TreePop();
}
if (ImGui::TreeNode("Received Event"))
{
auto& received_event = g->notifications.received_event;
ImGui::BeginGroup();
draw_pair_option("Clear Ped Tasks", received_event.clear_ped_task);
draw_pair_option("Modder Detection", received_event.modder_detect);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Report Cash Spawn", received_event.report_cash_spawn);
draw_pair_option("Request Control Event", received_event.request_control_event);
ImGui::EndGroup();
ImGui::TreePop();
}
if (ImGui::TreeNode("Script Event Handler"))
{
auto& script_event_handler = g->notifications.script_event_handler;
ImGui::BeginGroup();
draw_pair_option("Bounty", script_event_handler.bounty);
draw_pair_option("CEO Ban", script_event_handler.ceo_ban);
draw_pair_option("CEO Kick", script_event_handler.ceo_kick);
draw_pair_option("CEO Money", script_event_handler.ceo_money);
draw_pair_option("Wanted Level", script_event_handler.clear_wanted_level);
draw_pair_option("Fake Deposit", script_event_handler.fake_deposit);
draw_pair_option("Force Mission", script_event_handler.force_mission);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Force Teleport", script_event_handler.force_teleport);
draw_pair_option("GTA Banner", script_event_handler.gta_banner);
draw_pair_option("Network Bail", script_event_handler.network_bail);
draw_pair_option("Destroy Personal Vehicle", script_event_handler.personal_vehicle_destroyed);
draw_pair_option("Remote Off Radar", script_event_handler.remote_off_radar);
draw_pair_option("Rotate Cam", script_event_handler.rotate_cam);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Send to Cutscene", script_event_handler.send_to_cutscene);
draw_pair_option("Send to Island", script_event_handler.send_to_island);
draw_pair_option("Sound Spam", script_event_handler.sound_spam);
draw_pair_option("Spectate", script_event_handler.spectate);
draw_pair_option("Transaction Error", script_event_handler.transaction_error);
draw_pair_option("Vehicle Kick", script_event_handler.vehicle_kick);
ImGui::EndGroup();
ImGui::TreePop();
}
if (ImGui::TreeNode("Other"))
{
draw_pair_option("Net Array Error", g->notifications.net_array_error);
draw_pair_option("Reports", g->notifications.reports);
draw_pair_option("Transaction Error / Rate Limit", g->notifications.transaction_rate_limit);
ImGui::TreePop();
}
ImGui::TreePop();
}
}
}

View File

@ -1,59 +0,0 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "util/teleport.hpp"
namespace big
{
void view::spoofing()
{
components::small_text("To spoof any of the below credentials you need to reconnect with the lobby.");
if (ImGui::TreeNode("Username"))
{
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
ImGui::Checkbox("Spoof Username", &g->spoofing.spoof_username);
static char name[20];
strcpy_s(name, sizeof(name), g->spoofing.username.c_str());
ImGui::Text("Username:");
ImGui::InputText("##username_input", name, sizeof(name));
if (name != g->spoofing.username)
g->spoofing.username = std::string(name);
ImGui::TreePop();
}
if (ImGui::TreeNode("IP Address"))
{
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
ImGui::Checkbox("Spoof IP", &g->spoofing.spoof_ip);
ImGui::Text("IP Address:");
ImGui::DragInt4("##ip_fields", g->spoofing.ip_address, 0, 255);
ImGui::TreePop();
}
if (ImGui::TreeNode("Rockstar ID"))
{
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
ImGui::Checkbox("Spoof Rockstar ID", &g->spoofing.spoof_rockstar_id);
ImGui::Text("Rockstar ID:");
ImGui::InputScalar("##rockstar_id_input", ImGuiDataType_U64, &g->spoofing.rockstar_id);
ImGui::TreePop();
}
}
}

View File

@ -1,116 +0,0 @@
#include "views/view.hpp"
#include "core/data/speedo_meters.hpp"
#include "gui/handling/handling_tabs.hpp"
#include "script.hpp"
#include "util/vehicle.hpp"
namespace big
{
void view::vehicle() {
if (ImGui::TreeNode("General"))
{
ImGui::BeginGroup();
ImGui::Checkbox("Can Be Targeted", &g->vehicle.is_targetable);
ImGui::Checkbox("God Mode", &g->vehicle.god_mode);
ImGui::Checkbox("Horn Boost", &g->vehicle.horn_boost);
ImGui::Checkbox("Drive On Water", &g->vehicle.drive_on_water);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
components::button("Repair", [] {
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::PLAYER_PED_ID(), false);
vehicle::repair(veh);
});
if (components::button("Handling")) {
ImGui::OpenPopup("Handling Popup");
}
bool enabled = true;
ImGui::SetNextWindowSize({ (float)*g_pointers->m_resolution_x * 0.5f, (float)*g_pointers->m_resolution_y * 0.5f }, ImGuiCond_FirstUseEver);
if (ImGui::BeginPopupModal("Handling Popup", &enabled, ImGuiWindowFlags_MenuBar))
{
if (g_local_player == nullptr || g_local_player->m_vehicle == nullptr || g_local_player->m_ped_task_flag & (int)ePedTask::TASK_FOOT)
{
ImGui::Text("Please enter a vehicle.");
ImGui::EndPopup();
return;
}
g_vehicle_service->attempt_save();
ImGui::BeginTabBar("handling_profiles");
tab_handling::tab_current_profile();
tab_handling::tab_my_profiles();
tab_handling::tab_saved_profiles();
tab_handling::tab_search();
ImGui::EndTabBar();
ImGui::EndPopup();
}
ImGui::EndGroup();
ImGui::TreePop();
}
if (ImGui::TreeNode("Paint"))
{
ImGui::ListBox("RGB Type", &g->vehicle.rainbow_paint, vehicle::rgb_types, 3);
if (g->vehicle.rainbow_paint)
{
ImGui::SliderInt("RGB Speed", &g->rgb.speed, 1, 10);
}
ImGui::TreePop();
}
if (ImGui::TreeNode("LS Customs"))
{
components::button("Start LS Customs", [] {
g->vehicle.ls_customs = true;
});
ImGui::TreePop();
}
if (ImGui::TreeNode("Speedo Meter"))
{
SpeedoMeter selected = g->vehicle.speedo_meter.type;
ImGui::Text("Type:");
if (ImGui::BeginCombo("###speedo_type", speedo_meters[(int)selected].name))
{
for (const speedo_meter& speedo : speedo_meters)
{
if (ImGui::Selectable(speedo.name, speedo.id == selected))
{
g->vehicle.speedo_meter.type = speedo.id;
}
if (speedo.id == selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
ImGui::Text("Position");
float pos[2];
pos[0] = g->vehicle.speedo_meter.x;
pos[1] = g->vehicle.speedo_meter.y;
if (ImGui::SliderFloat2("###speedo_pos", pos, .001f, .999f, "%.3f"))
{
g->vehicle.speedo_meter.x = pos[0];
g->vehicle.speedo_meter.y = pos[1];
}
ImGui::Checkbox("Left Sided", &g->vehicle.speedo_meter.left_side);
ImGui::TreePop();
}
}
}

View File

@ -1,106 +0,0 @@
#include "core/data/custom_weapons.hpp"
#include "fiber_pool.hpp"
#include "gta/Weapons.h"
#include "script.hpp"
#include "core/data/special_ammo_types.hpp"
#include "views/view.hpp"
namespace big
{
void view::weapons() {
if (ImGui::TreeNode("Ammo Options"))
{
ImGui::Checkbox("Infinite Ammo", &g->weapons.infinite_ammo);
ImGui::SameLine();
ImGui::Checkbox("Infinite Clip", &g->weapons.infinite_mag);
ImGui::TreePop();
}
if (ImGui::TreeNode("Misc"))
{
ImGui::Checkbox("Force Crosshairs", &g->weapons.force_crosshairs);
ImGui::SameLine();
ImGui::Checkbox("No Recoil", &g->weapons.no_recoil);
ImGui::SameLine();
ImGui::Checkbox("No Spread", &g->weapons.no_spread);
if (ImGui::Button("Get All Weapons"))
{
QUEUE_JOB_BEGIN_CLAUSE()
{
for (auto const& weapon : weapon_list) {
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), weapon, 9999, false);
}
WEAPON::GIVE_DELAYED_WEAPON_TO_PED(PLAYER::PLAYER_PED_ID(), -72657034, 0, true);
}
QUEUE_JOB_END_CLAUSE
}
ImGui::SliderFloat("Damage Multiplier", &g->weapons.increased_damage, 1.f, 10.f, "%.1f");
ImGui::TreePop();
}
if (ImGui::TreeNode("Ammo Special"))
{
ImGui::Checkbox("Enable Special Ammo", &g->weapons.ammo_special.toggle);
eAmmoSpecialType selected = g->weapons.ammo_special.type;
if (ImGui::BeginCombo("Ammo Special", SPECIAL_AMMOS[(int)selected].name))
{
for (const auto& special_ammo : SPECIAL_AMMOS)
{
if (ImGui::Selectable(special_ammo.name, special_ammo.type == selected))
g->weapons.ammo_special.type = special_ammo.type;
if (special_ammo.type == selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Custom Weapons"))
{
CustomWeapon selected = g->weapons.custom_weapon;
if (ImGui::BeginCombo("Weapon", custom_weapons[(int)selected].name))
{
for (const custom_weapon& weapon : custom_weapons)
{
if (ImGui::Selectable(weapon.name, weapon.id == selected))
{
g->weapons.custom_weapon = weapon.id;
}
if (weapon.id == selected)
ImGui::SetItemDefaultFocus();
}
ImGui::EndCombo();
}
switch (selected)
{
case CustomWeapon::VEHICLE_GUN:
ImGui::Text("Shooting Model:");
ImGui::InputText("##vehicle_gun_model", g->weapons.vehicle_gun_model, 12);
break;
}
ImGui::TreePop();
}
}
}