From 1b52f4ee7ca779fd4083310a6bc2aa97a87c0b2d Mon Sep 17 00:00:00 2001 From: TheGreenBandit <106003542+TheGreenBandit@users.noreply.github.com> Date: Fri, 14 Jul 2023 18:57:30 -0400 Subject: [PATCH] Add more requests and reorganize network tab (#1709) --- .../commands/self/request_services.cpp | 77 +++++++++++++++++++ src/backend/looped/self/off_radar.cpp | 6 ++ src/core/settings.hpp | 1 + src/gui/components/options_modal.cpp | 2 +- src/util/mobile.hpp | 43 ++++++++++- src/views/network/view_network.cpp | 74 +++++++++--------- src/views/self/view_mobile.cpp | 34 +++++--- src/views/self/view_self.cpp | 6 +- 8 files changed, 193 insertions(+), 50 deletions(-) diff --git a/src/backend/commands/self/request_services.cpp b/src/backend/commands/self/request_services.cpp index 3797ccde..1d37f23b 100644 --- a/src/backend/commands/self/request_services.cpp +++ b/src/backend/commands/self/request_services.cpp @@ -24,6 +24,83 @@ namespace big } }; + class request_avenger : command + { + using command::command; + + virtual void execute(const std::vector&, const std::shared_ptr ctx) + { + mobile::services::request_avenger(); + } + }; + + class request_kosatka : command + { + using command::command; + + virtual void execute(const std::vector&, const std::shared_ptr ctx) + { + mobile::services::request_kosatka(); + } + }; + + class request_moc : command + { + using command::command; + + virtual void execute(const std::vector&, const std::shared_ptr ctx) + { + mobile::services::request_mobile_operations_center(); + } + }; + + class request_terrorbyte : command + { + using command::command; + + virtual void execute(const std::vector&, const std::shared_ptr ctx) + { + mobile::services::request_terrorbyte(); + } + }; + + class request_acidlab : command + { + using command::command; + + virtual void execute(const std::vector&, const std::shared_ptr ctx) + { + mobile::services::request_acidlab(); + } + }; + + class request_acidlab_bike : command + { + using command::command; + + virtual void execute(const std::vector&, const std::shared_ptr ctx) + { + mobile::services::request_acidlab_bike(); + } + }; + + class request_taxi : command + { + using command::command; + + virtual void execute(const std::vector&, const std::shared_ptr ctx) + { + mobile::mobile_misc::request_taxi(); + } + }; + boat_pickup g_boat_pickup("boatpickup", "Request Boat Pickup", "Request a boat pickup", 0); ballistic_armor g_ballistic_armor("ballisticarmor", "Request Ballistic Equipment", "Requests ballistic equipment which includes ballistic armor and an minigun", 0); + request_avenger g_request_avenger("avenger", "Request Avenger", "Requests the Avenger", 0); + request_kosatka g_request_kosatka("kosatka", "Request Kosatka", "Requests the Kosatka", 0); + request_moc g_request_moc("moc", "Request M.O.C", "Requests the Mobile Operations Center", 0); + request_terrorbyte g_request_terrorbyte("terrorbyte", "Request Terrorbyte", "Requests the terrorbyte", 0); + request_acidlab g_request_acidlab("acidlab", "Request Acid Lab", "Requests the Acid Lab", 0); + request_acidlab_bike g_request_acidlab_bike("acidbike", "Request Acid Bike", "Requests the Acid Lab Delivery Bike", 0); + request_taxi g_request_taxi("taxi", "Request Taxi", "Requests a taxi to give you a ride", 0); } \ No newline at end of file diff --git a/src/backend/looped/self/off_radar.cpp b/src/backend/looped/self/off_radar.cpp index 247a5d8e..947d32d5 100644 --- a/src/backend/looped/self/off_radar.cpp +++ b/src/backend/looped/self/off_radar.cpp @@ -1,4 +1,5 @@ #include "backend/looped_command.hpp" +#include "backend/bool_command.hpp" #include "core/scr_globals.hpp" #include "natives.hpp" @@ -12,15 +13,20 @@ namespace big virtual void on_tick() override { + if (g.self.ghost_org) + MISC::SET_BIT(script_global(2794162).at(4667).as(), 2); scr_globals::globalplayer_bd.as()->Entries[self::id].OffRadarActive = true; *scr_globals::offradar_time.at(57).as() = NETWORK::GET_NETWORK_TIME() + 1; } virtual void on_disable() override { + if (!g.self.ghost_org) + MISC::CLEAR_BIT(script_global(2794162).at(4667).as(), 2); scr_globals::globalplayer_bd.as()->Entries[self::id].OffRadarActive = false; } }; off_radar g_off_radar("otr", "OFF_RADAR", "OFF_RADAR_DESC", g.self.off_radar); + bool_command ghost_org("ghostorg", "Ghost Org", "Use Ghost Organization instead of standard off radar.", g.self.ghost_org); } diff --git a/src/core/settings.hpp b/src/core/settings.hpp index 19d82d62..b298e1a5 100644 --- a/src/core/settings.hpp +++ b/src/core/settings.hpp @@ -304,6 +304,7 @@ namespace big bool no_ragdoll = false; bool noclip = false; bool off_radar = false; + bool ghost_org = false; bool super_run = false; bool no_collision = false; bool unlimited_oxygen = false; diff --git a/src/gui/components/options_modal.cpp b/src/gui/components/options_modal.cpp index 4c3aa8b2..abc5bfa2 100644 --- a/src/gui/components/options_modal.cpp +++ b/src/gui/components/options_modal.cpp @@ -10,7 +10,7 @@ namespace big if (sameline) ImGui::SameLine(); - if (ImGui::SmallButton(std::string(custom_button_name + "##" + element_name).data())) + if (ImGui::Button(std::string(custom_button_name + "##" + element_name).data())) ImGui::OpenPopup(element_name.data()); ImGui::SetNextWindowPos(ImVec2(ImGui::GetIO().DisplaySize.x * 0.5f, ImGui::GetIO().DisplaySize.y * 0.5f), ImGuiCond_Always, ImVec2(0.5f, 0.5f)); diff --git a/src/util/mobile.hpp b/src/util/mobile.hpp index 332176cf..18c5378c 100644 --- a/src/util/mobile.hpp +++ b/src/util/mobile.hpp @@ -55,8 +55,6 @@ namespace big::mobile { *script_global(scr_globals::mechanic_global).at(4492).as() = 1; } - - } namespace mors_mutual @@ -103,6 +101,39 @@ namespace big::mobile } } + namespace services + { + inline void request_avenger() + { + *script_global(scr_globals::mechanic_global).at(938).as() = 1; + } + + inline void request_kosatka() + { + *script_global(scr_globals::mechanic_global).at(960).as() = 1; + } + + inline void request_mobile_operations_center() + { + *script_global(scr_globals::mechanic_global).at(930).as() = 1; + } + + inline void request_terrorbyte() + { + *script_global(scr_globals::mechanic_global).at(943).as() = 1; + } + + inline void request_acidlab() + { + *script_global(scr_globals::mechanic_global).at(944).as() = 1; + } + + inline void request_acidlab_bike() + { + *script_global(scr_globals::mechanic_global).at(994).as() = 1; + } + } + namespace mechanic { inline Vehicle get_personal_vehicle() @@ -154,4 +185,12 @@ namespace big::mobile } } } + + namespace mobile_misc + { + inline void request_taxi() + { + *script_global(scr_globals::mechanic_global).at(853).as() = 1; + } + } } diff --git a/src/views/network/view_network.cpp b/src/views/network/view_network.cpp index 0c5b9cc2..569e1c90 100644 --- a/src/views/network/view_network.cpp +++ b/src/views/network/view_network.cpp @@ -125,6 +125,10 @@ namespace big components::script_patch_checkbox("REVEAL_OTR_PLAYERS"_T, &g.session.decloak_players, "Reveals players that are off the radar"); components::script_patch_checkbox("Reveal Hidden Players", &g.session.unhide_players_from_player_list, "Reveals players that have hidden themselves from the player list"); + components::command_button<"sextall">({}, "Send Sexts"); + ImGui::SameLine(); + components::command_button<"fakebanall">({}, "Send Fake Ban Messages"); + ImGui::EndListBox(); } @@ -223,6 +227,34 @@ namespace big ImGui::EndListBox(); } + components::small_text("WARP_TIME"_T.data()); + + components::button("PLUS_1_MINUTE"_T, [] { + toxic::warp_time_forward_all(60 * 1000); + }); + ImGui::SameLine(); + components::button("PLUS_5_MINUTES"_T, [] { + toxic::warp_time_forward_all(5 * 60 * 1000); + }); + ImGui::SameLine(); + components::button("PLUS_48_MINUTES"_T, [] { + toxic::warp_time_forward_all(48 * 60 * 1000); + }); + + components::button("PLUS_96_MINUTES"_T, [] { + toxic::warp_time_forward_all(96 * 60 * 1000); + }); + ImGui::SameLine(); + components::button("PLUS_200_MINUTES"_T, [] { + toxic::warp_time_forward_all(200 * 60 * 1000); + }); + ImGui::SameLine(); + components::button("STOP_TIME"_T, [] { + toxic::set_time_all(INT_MAX - 3000); + }); + if (ImGui::IsItemHovered()) + ImGui::SetTooltip("STOP_TIME_DESC"_T.data()); + ImGui::EndGroup(); } @@ -441,53 +473,21 @@ namespace big true, "Teleport"); - ImGui::EndGroup(); - - - components::command_button<"sextall">({}, "Send Sexts"); - ImGui::SameLine(); - components::command_button<"fakebanall">({}, "Send Fake Ban Messages"); - - components::small_text("WARP_TIME"_T.data()); - - components::button("PLUS_1_MINUTE"_T, [] { - toxic::warp_time_forward_all(60 * 1000); - }); - ImGui::SameLine(); - components::button("PLUS_5_MINUTES"_T, [] { - toxic::warp_time_forward_all(5 * 60 * 1000); - }); - ImGui::SameLine(); - components::button("PLUS_48_MINUTES"_T, [] { - toxic::warp_time_forward_all(48 * 60 * 1000); - }); - ImGui::SameLine(); - components::button("PLUS_96_MINUTES"_T, [] { - toxic::warp_time_forward_all(96 * 60 * 1000); - }); - ImGui::SameLine(); - components::button("PLUS_200_MINUTES"_T, [] { - toxic::warp_time_forward_all(200 * 60 * 1000); - }); - ImGui::SameLine(); - components::button("STOP_TIME"_T, [] { - toxic::set_time_all(INT_MAX - 3000); - }); - if (ImGui::IsItemHovered()) - ImGui::SetTooltip("STOP_TIME_DESC"_T.data()); - components::sub_title("SCRIPT_HOST_FEATURES"_T); ImGui::Checkbox("DISABLE_CEO_MONEY"_T.data(), &g.session.block_ceo_money); if (ImGui::IsItemHovered()) ImGui::SetTooltip("DISABLE_CEO_MONEY_DESC"_T.data()); ImGui::SameLine(); - ImGui::Checkbox("RANDOMIZE_CEO_COLORS"_T.data(), &g.session.randomize_ceo_colors); ImGui::Checkbox("Block Jobs", &g.session.block_jobs); if (ImGui::IsItemHovered()) ImGui::SetTooltip("Prevents remote players from starting jobs while in your session"); + + ImGui::Checkbox("RANDOMIZE_CEO_COLORS"_T.data(), &g.session.randomize_ceo_colors); ImGui::SameLine(); components::script_patch_checkbox("Block Muggers", &g.session.block_muggers, "For the entire session"); - ImGui::SameLine(); + components::script_patch_checkbox("Block CEO Raids", &g.session.block_ceo_raids, "For the entire session"); + + ImGui::EndGroup(); } } diff --git a/src/views/self/view_mobile.cpp b/src/views/self/view_mobile.cpp index 04c83184..5037f518 100644 --- a/src/views/self/view_mobile.cpp +++ b/src/views/self/view_mobile.cpp @@ -9,6 +9,7 @@ namespace big { ImGui::SetWindowSize({0.f, (float)*g_pointers->m_gta.m_resolution_y}, ImGuiCond_Always); + ImGui::SeparatorText("MERRYWEATHER"_T.data()); components::button("MW_AMMO_DROP"_T, [] { @@ -29,7 +30,30 @@ namespace big mobile::merry_weather::request_airstrike(); }); - + + ImGui::SeparatorText("CEO_ABILITIES"_T.data()); + + components::button("CEO_BULLSHARK"_T, [] { + mobile::ceo_abilities::request_bullshark_testosterone(); + }); + + components::command_button<"ballisticarmor">(); + + + ImGui::SeparatorText("Services"); + + components::command_button<"avenger">(); + components::command_button<"kosatka">(); + components::command_button<"moc">(); + components::command_button<"terrorbyte">(); + components::command_button<"acidlab">(); + components::command_button<"acidbike">(); + + ImGui::SeparatorText("Miscellaneous"); + + components::command_button<"taxi">(); + + ImGui::SeparatorText("MORS_MUTUAL"_T.data()); components::button("MORS_FIX_ALL"_T, [] { @@ -39,13 +63,5 @@ namespace big std::make_format_args(amount_fixed, amount_fixed == 1 ? "VEHICLE_FIX_HAS"_T.data() : "VEHICLE_FIX_HAVE"_T.data()))); }); - - ImGui::SeparatorText("CEO_ABILITIES"_T.data()); - - components::button("CEO_BULLSHARK"_T, [] { - mobile::ceo_abilities::request_bullshark_testosterone(); - }); - - components::command_button<"ballisticarmor">(); } } \ No newline at end of file diff --git a/src/views/self/view_self.cpp b/src/views/self/view_self.cpp index 6d98d1d0..d82178f2 100644 --- a/src/views/self/view_self.cpp +++ b/src/views/self/view_self.cpp @@ -7,6 +7,8 @@ #include "util/scripts.hpp" #include "views/view.hpp" +#include