refactor!: Replace premake5 with CMake. (#551)

Co-authored-by: tupoy-ya <tupoy-ya@users.noreply.github.com>
This commit is contained in:
tupoy-ya
2022-11-08 21:08:58 +00:00
committed by GitHub
parent d9d8aa30c1
commit bc05ecd78c
340 changed files with 19298 additions and 19449 deletions

View File

@ -0,0 +1,41 @@
#include "views/view.hpp"
#include "services/context_menu/context_menu_service.hpp"
namespace big
{
void view::context_menu_settings()
{
ImGui::Checkbox("Context Menu Enabled", &g->context_menu.enabled);
if (g->context_menu.enabled)
{
ImGui::Text("Allowed Entity Types:");
ImGui::CheckboxFlags("Object", reinterpret_cast<int*>(&g->context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::OBJECT));
ImGui::SameLine();
ImGui::CheckboxFlags("Ped", reinterpret_cast<int*>(&g->context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::PED));
ImGui::SameLine();
ImGui::CheckboxFlags("Player", reinterpret_cast<int*>(&g->context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::PLAYER));
ImGui::SameLine();
ImGui::CheckboxFlags("Vehicle", reinterpret_cast<int*>(&g->context_menu.allowed_entity_types), static_cast<int>(ContextEntityType::VEHICLE));
static ImVec4 selected_option_color = ImGui::ColorConvertU32ToFloat4(g->context_menu.selected_option_color);
ImGui::Text("Selected Option Color:");
if (ImGui::ColorEdit4("###BSelected Option Color##cm_picker", (float*)&selected_option_color, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g->context_menu.selected_option_color = ImGui::ColorConvertFloat4ToU32(selected_option_color);
}
ImGui::Checkbox("Bounding Box Enabled", &g->context_menu.bounding_box_enabled);
if (g->context_menu.bounding_box_enabled)
{
static ImVec4 bounding_box_color = ImGui::ColorConvertU32ToFloat4(g->context_menu.bounding_box_color);
ImGui::Text("Bounding Box Color:");
if (ImGui::ColorEdit4("###Bounding Box Color##cm_picker", (float*)&bounding_box_color, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g->context_menu.bounding_box_color = ImGui::ColorConvertFloat4ToU32(bounding_box_color);
}
}
}
}
}

View File

@ -0,0 +1,81 @@
#include "views/view.hpp"
namespace big
{
void view::esp_settings()
{
ImGui::Checkbox("ESP Enabled", &g->esp.enabled);
if (g->esp.enabled)
{
ImGui::Checkbox("Hide Self", &g->esp.hide_self);
ImGui::Text("Global Render Distance (min, max)");
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::Text("Tracer Draw Position (x, y)");
ImGui::SliderFloat2("###Draw Position", g->esp.tracer_draw_position, 0.f, 1.f);
ImGui::Text("Tracer Render Distance (min, max)");
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::Text("Box Render Distance (min, max)");
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 Name", &g->esp.name);
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 Armor", &g->esp.armor);
ImGui::Checkbox("Should ESP Color Change with Distance", &g->esp.change_esp_color_from_dist);
if (g->esp.health)
ImGui::Checkbox("Should Healthbar Scale with Distance", &g->esp.scale_health_from_dist);
if (g->esp.armor)
ImGui::Checkbox("Should Armorbar Scale with Distance", &g->esp.scale_armor_from_dist);
static ImVec4 col_enemy = ImGui::ColorConvertU32ToFloat4(g->esp.enemy_color);
static ImVec4 col_enemy_near = ImGui::ColorConvertU32ToFloat4(g->esp.enemy_near_color);
static ImVec4 col_default = ImGui::ColorConvertU32ToFloat4(g->esp.default_color);
static ImVec4 col_friend = ImGui::ColorConvertU32ToFloat4(g->esp.friend_color);
ImGui::Text("Distance threshold (min, max)");
ImGui::SliderFloat2("###Distance threshold", g->esp.distance_threshold, g->esp.global_render_distance[0], g->esp.global_render_distance[1]);
if (ImGui::TreeNode("ESP Colors (RGBA)"))
{
if (g->esp.change_esp_color_from_dist) {
ImGui::Text("Enemy Close Color:");
if (ImGui::ColorEdit4("###Enemy ESP Color##esp_picker", (float*)&col_enemy, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g->esp.enemy_color = ImGui::ColorConvertFloat4ToU32(col_enemy);
}
ImGui::Text("Enemy Near Color:");
if (ImGui::ColorEdit4("###Enemy Near ESP Color##esp_picker", (float*)&col_enemy_near, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g->esp.enemy_near_color = ImGui::ColorConvertFloat4ToU32(col_enemy_near);
}
}
ImGui::Text("Default Color:");
if (ImGui::ColorEdit4("###Default ESP Color##esp_picker", (float*)&col_default, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g->esp.default_color = ImGui::ColorConvertFloat4ToU32(col_default);
}
ImGui::Text("Friendly Color:");
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,109 @@
#include "views/view.hpp"
namespace big
{
void draw_pair_option(const std::string_view name, decltype(g->notifications.gta_thread_kill)& option)
{
ImGui::Text("%s", name.data());
ImGui::PushID(name.data());
ImGui::Checkbox("Log", &option.log);
ImGui::Checkbox("Notify", &option.notify);
ImGui::PopID();
}
void view::notification_settings()
{
components::sub_title("GTA Threads");
draw_pair_option("Terminate", g->notifications.gta_thread_kill);
draw_pair_option("Start", g->notifications.gta_thread_start);
components::sub_title("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("Init", g->notifications.network_player_mgr_init);
draw_pair_option("Shutdown", g->notifications.network_player_mgr_shutdown);
components::sub_title("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("Kick Votes Notification", received_event.kick_vote);
draw_pair_option("Detect Modder Events", 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);
draw_pair_option("Vehicle Temp Action", received_event.vehicle_temp_action);
ImGui::EndGroup();
components::sub_title("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("Destroy Personal Vehicle", script_event_handler.personal_vehicle_destroyed);
draw_pair_option("Fake Deposit", script_event_handler.fake_deposit);
draw_pair_option("Force Mission", script_event_handler.force_mission);
draw_pair_option("Force Teleport", script_event_handler.force_teleport);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("GTA Banner", script_event_handler.gta_banner);
draw_pair_option("MC Teleport", script_event_handler.mc_teleport);
draw_pair_option("Network Bail", script_event_handler.network_bail);
draw_pair_option("Remote Off Radar", script_event_handler.remote_off_radar);
draw_pair_option("Rotate Cam", script_event_handler.rotate_cam);
draw_pair_option("Send to Cutscene", script_event_handler.send_to_cutscene);
draw_pair_option("Send to Location", script_event_handler.send_to_location);
draw_pair_option("Sound Spam", script_event_handler.sound_spam);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Spectate", script_event_handler.spectate);
draw_pair_option("Transaction Error", script_event_handler.transaction_error);
draw_pair_option("TSE Crash", script_event_handler.crash);
draw_pair_option("TSE Freeze", script_event_handler.tse_freeze);
draw_pair_option("TSE Sender Mismatch", script_event_handler.tse_sender_mismatch);
draw_pair_option("Vehicle Kick", script_event_handler.vehicle_kick);
draw_pair_option("Wanted Level", script_event_handler.clear_wanted_level);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
draw_pair_option("Teleport To Warehouse", script_event_handler.teleport_to_warehouse);
draw_pair_option("Start Activity", script_event_handler.start_activity);
ImGui::EndGroup();
components::sub_title("Other");
draw_pair_option("Reports", g->notifications.reports);
draw_pair_option("Transaction Error / Rate Limit", g->notifications.transaction_rate_limit);
draw_pair_option("Mismatch sync type", g->notifications.mismatch_sync_type);
draw_pair_option("Out of allowed range sync type", g->notifications.out_of_allowed_range_sync_type);
draw_pair_option("Invalid sync", g->notifications.invalid_sync);
}
}

View File

@ -0,0 +1,49 @@
#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("TSE Crash", &g->protections.script_events.crash);
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("MC Teleport", &g->protections.script_events.mc_teleport);
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 Location", &g->protections.script_events.send_to_location);
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::Checkbox("Wanted Level", &g->protections.script_events.clear_wanted_level);
ImGui::EndGroup();
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Teleport To Warehouse", &g->protections.script_events.teleport_to_warehouse);
ImGui::Checkbox("Start Activity", &g->protections.script_events.start_activity);
ImGui::EndGroup();
}
}

View File

@ -0,0 +1,58 @@
#include "views/view.hpp"
#include "widgets/imgui_hotkey.hpp"
#include "script_mgr.hpp"
namespace big
{
void scripts_popupmodal()
{
ImGui::BeginGroup();
components::sub_title("Scripts");
ImGui::SameLine(ImGui::GetWindowWidth() - 100);
if (ImGui::Button("Close")) ImGui::CloseCurrentPopup();
ImGui::Spacing();
components::sub_title("These scripts are responsible for all looped features.\nOnly disable if you know what you are doing.");
for (const auto& script : g_script_mgr.scripts())
{
if (script->is_toggleable())
if (ImGui::Checkbox(script->name(), script->toggle_ptr()))
g_notification_service->push(std::string(script->name()).append(" script"), script->is_enabled() ? "Resumed" : "Halted");
}
ImGui::EndGroup();
}
void view::settings()
{
components::sub_title("Misc");
ImGui::Checkbox("Enable Dev DLC", &g->settings.dev_dlc);
ImGui::Separator();
components::sub_title("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::Separator();
if (ImGui::Button("Manage scripts"))
ImGui::OpenPopup("Scripts");
ImGui::SetNextWindowPos({ 780,228 }, ImGuiCond_FirstUseEver);
if (ImGui::BeginPopupModal("Scripts", nullptr, ImGuiWindowFlags_AlwaysAutoResize))
{
scripts_popupmodal();
ImGui::EndPopup();
}
}
}