Merge: rework_gui > master

This commit is contained in:
LiamD-Flop
2022-02-28 23:04:56 +01:00
parent b2a305027f
commit 94c5710abb
71 changed files with 1279 additions and 1447 deletions

View File

@ -0,0 +1,71 @@
#pragma once
#include "imgui.h"
#include "natives.hpp"
#include "util/animator.hpp"
#include "gui/components/components.hpp"
namespace big
{
class view
{
enum class tabs {
NONE,
SELF,
MOBILE,
SPAWN,
WEAPONS,
SPOOFING,
SETTINGS,
TELEPORT,
VEHICLE,
PLAYER,
DEBUG,
};
struct navigation_struct
{
tabs tab = tabs::NONE;
const char name[32] = "";
std::function<void()> func = nullptr;
};
static void self();
static void vehicle();
static void debug();
static void view_player();
static void weapons();
static void mobile();
static void teleport();
static void spawn();
static void settings();
static void spoofing();
static void navigation();
static void active_view();
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::SETTINGS, "Settings", view::settings },
{ tabs::DEBUG, "Debug", view::debug },
{ tabs::PLAYER, "Players", view::view_player },
};
public:
static void root()
{
active_view();
navigation();
}
};
}

View File

@ -0,0 +1,48 @@
#include "views/view.hpp"
namespace big
{
void view::active_view() {
static float tabs_open_animation = -(float)g->window.x * 0.15f;
static float alpha = 0.f;
const float max_position = (float)g->window.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->window.x * 0.30f) * progress);
break;
default:
tabs_open_animation = tabs_open_animation >= max_position ? max_position : (((float)g->window.x * 0.30f) * progress) - max_position;
break;
}
});
ImGui::SetNextWindowPos({ tabs_open_animation, 0.f }, ImGuiCond_Always);
ImGui::SetNextWindowSize({ (float)g->window.x * 0.3f, (float)g->window.y }, ImGuiCond_Always);
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.10f, 0.09f, 0.12f, 1.00f));
if (ImGui::Begin("main", 0, 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

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

@ -0,0 +1,88 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "script.hpp"
#include "util/mobile.hpp"
#include "util/notify.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();
notify::above_map(
fmt::format("<C>{}</C> 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

@ -0,0 +1,73 @@
#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->window.x * 0.15f, (float)g->window.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->window.x * 0.15f - 30, (float)g->window.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

@ -0,0 +1,98 @@
#include "views/view.hpp"
#include "util/toxic.hpp"
#include "services/player_service.hpp"
#include "gta_util.hpp"
#include "util/misc.hpp"
#include "util/teleport.hpp"
namespace big
{
void view::view_player() {
std::string title = fmt::format("Player Options: {}", g_player_service->get_selected()->get_name());
ImGui::Text(title.c_str());
ImGui::Checkbox("Spectate", &g->player.spectating);
if (g_player_service->get_selected()->is_valid())
{
if (ImGui::TreeNode("Info")) {
ImGui::Text("Player ID: %d", g_player_service->get_selected()->id());
ImGui::Text("Session Host: %s", g_player_service->get_selected()->is_host() ? "Yes" : "No");
ImGui::Separator();
if (CPlayerInfo* player_info = g_player_service->get_selected()->get_player_info(); player_info != nullptr)
{
ImGui::Text("Wanted Level: %d", player_info->m_wanted_level);
}
if (CPed* ped = g_player_service->get_selected()->get_ped(); ped != nullptr)
{
ImGui::Text("Player God Mode: %s",
misc::has_bit_set((int*)&ped->m_damage_bits, 8) ? "Yes" : "No"
);
}
CAutomobile* vehicle = g_player_service->get_selected()->get_current_vehicle();
ImGui::Text("Vehicle God Mode: %s",
vehicle == nullptr ? "No vehicle detected" :
misc::has_bit_set((int*)&vehicle->m_damage_bits, 8) ? "Yes" : "No"
);
ImGui::Separator();
if (rage::netPlayerData* net_player_data = g_player_service->get_selected()->get_net_data(); net_player_data != nullptr)
{
ImGui::Text("Rockstar ID: %d", net_player_data->m_rockstar_id);
ImGui::Text(
"IP Address: %d.%d.%d.%d:%d",
net_player_data->m_external_ip.m_field1,
net_player_data->m_external_ip.m_field2,
net_player_data->m_external_ip.m_field3,
net_player_data->m_external_ip.m_field4,
net_player_data->m_external_port
);
}
ImGui::TreePop();
}
if (ImGui::TreeNode("Teleport")) {
components::button("Teleport", [] {
teleport::to_player(g_player_service->get_selected()->id());
});
ImGui::SameLine();
components::button("Bring", [] {
teleport::bring_player(g_player_service->get_selected()->id());
});
components::button("Teleport into Vehicle", [] {
Vehicle veh = PED::GET_VEHICLE_PED_IS_IN(PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(g_player_service->get_selected()->id()), false);
teleport::into_vehicle(veh);
});
ImGui::TreePop();
}
if (ImGui::TreeNode("Toxic")) {
components::button("Explode Self", [] {
toxic::blame_explode_player(
g_player_service->get_selected()->id(),
g_player_service->get_selected()->id(),
eExplosionType::PLANE, 1000, false, true, 0.f
);
});
}
}
}
}

View File

@ -0,0 +1,128 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "script.hpp"
#include "script_global.hpp"
#include "util/entity.hpp"
#include "util/player.hpp"
#include "util/notify.hpp"
#include "util/session.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::TreePop();
}
if (ImGui::TreeNode("Frame Flags"))
{
ImGui::BeginGroup();
ImGui::Checkbox("Explosive Ammo", &g->self.frame_flags.explosive_ammo);
ImGui::Checkbox("Fire Ammo", &g->self.frame_flags.fire_ammo);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Explosive Melee", &g->self.frame_flags.explosive_melee);
ImGui::Checkbox("Super Jump", &g->self.frame_flags.super_jump);
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))
{
notify::above_map("~r~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();
});
ImGui::Text("Session");
for (const SessionType& session_type : sessions)
{
components::button(session_type.name, [session_type] {
session::join_type(session_type);
});
}
}
}
}

View File

@ -0,0 +1,47 @@
#include "views/view.hpp"
#include "widgets/imgui_hotkey.hpp"
namespace big
{
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::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::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("Destroy Personal Vehicle", &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::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::TreePop();
}
}
}

View File

@ -0,0 +1,29 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "natives.hpp"
#include "script.hpp"
#include "util/vehicle.hpp"
namespace big
{
static char model[12];
void view::spawn() {
g_fiber_pool->queue_job([] {
PAD::DISABLE_ALL_CONTROL_ACTIONS(0);
});
if (
ImGui::InputText("Model Name", model, sizeof(model), ImGuiInputTextFlags_EnterReturnsTrue) ||
ImGui::Button("Spawn")
)
{
g_fiber_pool->queue_job([] {
Ped player = PLAYER::GET_PLAYER_PED_SCRIPT_INDEX(PLAYER::GET_PLAYER_INDEX());
Vector3 location = ENTITY::GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(player, .0, 8.0, .5);
vehicle::spawn((const char*)model, location, ENTITY::GET_ENTITY_HEADING(player) + 90.f);
});
}
}
}

View File

@ -0,0 +1,59 @@
#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

@ -0,0 +1,47 @@
#include "views/view.hpp"
#include "fiber_pool.hpp"
#include "util/globals.hpp"
#include "util/teleport.hpp"
#include "util/vehicle.hpp"
namespace big
{
void view::teleport() {
ImGui::Text("Blips:");
components::button("Waypoint", [] {
teleport::to_waypoint();
});
components::button("Objective", [] {
static const int blips[] = { 1, 57, 128, 129, 130, 143, 144, 145, 146, 271, 286, 287, 288 };
for (int i = 0; i < (sizeof(blips) / sizeof(*blips)); i++) {
if (teleport::to_blip(blips[i], 5)) {
break;
}
}
});
ImGui::Text("Vehicles:");
components::button("Bring Personal Vehicle", [] {
Vehicle veh = globals::get_personal_vehicle();
if (ENTITY::IS_ENTITY_DEAD(veh, false)) return notify::above_map("Invalid vehicle handle...");
Vector3 location = ENTITY::GET_ENTITY_COORDS(PLAYER::PLAYER_PED_ID(), true);
vehicle::bring(veh, location);
});
components::button("Teleport to Personal Vehicle", [] {
Vehicle veh = globals::get_personal_vehicle();
if (ENTITY::IS_ENTITY_DEAD(veh, false)) return notify::above_map("Invalid vehicle handle...");
teleport::to_coords(
ENTITY::GET_ENTITY_COORDS(veh, true)
);
});
}
}

View File

@ -0,0 +1,105 @@
#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::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->window.x * 0.5f, (float)g->window.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("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

@ -0,0 +1,60 @@
#include "core/data/custom_weapons.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("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::NONE:
break;
case CustomWeapon::CAGE_GUN:
break;
case CustomWeapon::DELETE_GUN:
break;
case CustomWeapon::GRAVITY_GUN:
break;
case CustomWeapon::REPAIR_GUN:
break;
case CustomWeapon::VEHICLE_GUN:
ImGui::Text("Shooting Model:");
ImGui::InputText("##vehicle_gun_model", g->weapons.vehicle_gun_model, 12);
break;
}
ImGui::TreePop();
}
}
}