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
52 changed files with 1766 additions and 1368 deletions

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