Tunables service fix and theme changes (#1507)

This commit is contained in:
maybegreat48
2023-06-23 06:43:44 +00:00
committed by GitHub
parent 74d3e2ac57
commit 1d75981731
43 changed files with 1616 additions and 800 deletions

View File

@ -42,8 +42,13 @@ namespace big
dl->AddRectFilled({(float)*g_pointers->m_gta.m_resolution_x - 360.f, 10.f + start_pos},
{(float)*g_pointers->m_gta.m_resolution_x - 10.f, start_pos + 45.f + total_size},
g.window.color);
dl->AddRectFilledMultiColor({(float)*g_pointers->m_gta.m_resolution_x - 360.f, 10.f + start_pos}, {(float)*g_pointers->m_gta.m_resolution_x - 255.f, start_pos + 45.f + total_size}, fadeBegin, fadeEnd, fadeEnd, fadeBegin);
g.window.background_color);
dl->AddRectFilledMultiColor({(float)*g_pointers->m_gta.m_resolution_x - 360.f, 10.f + start_pos},
{(float)*g_pointers->m_gta.m_resolution_x - 255.f, start_pos + 45.f + total_size},
fadeBegin,
fadeEnd,
fadeEnd,
fadeBegin);
dl->AddText(g.window.font_sub_title,
22.f,

View File

@ -10,6 +10,8 @@ namespace big
if (!g.window.ingame_overlay.opened || (g_gui->is_open() && !g.window.ingame_overlay.show_with_menu_opened))
return;
g_gui->push_theme_colors();
ImGui::SetNextWindowPos(ImVec2(10.0f, 10.0f), ImGuiCond_FirstUseEver, ImVec2(0.0f, 0.0f));
ImGui::SetNextWindowBgAlpha(0.5f);
@ -26,6 +28,15 @@ namespace big
ImGui::Text(std::format("Players: {}/{}", network_player_mgr->m_player_count, network_player_mgr->m_player_limit)
.c_str());
if (g.window.ingame_overlay.show_position && g_local_player)
{
ImGui::Separator();
auto& pos = *g_local_player->get_position();
ImGui::Text("Pos: %.2f, %.2f, %.2f", pos.x, pos.y, pos.z);
}
// can't easily get used item count using pools, so keeping replay interface for now
if (auto replay_interface = *g_pointers->m_gta.m_replay_interface; g.window.ingame_overlay.show_replay_interface)
{
@ -58,5 +69,7 @@ namespace big
}
}
ImGui::End();
g_gui->pop_theme_colors();
}
}

View File

@ -6,10 +6,10 @@
#include "script.hpp"
#include "script_global.hpp"
#include "util/misc.hpp"
#include "util/pathfind.hpp"
#include "util/ped.hpp"
#include "util/system.hpp"
#include "view_debug.hpp"
#include "util/ped.hpp"
#include "util/pathfind.hpp"
namespace big
{
@ -61,7 +61,7 @@ namespace big
INTERIOR::REFRESH_INTERIOR(interior);
});
components::button("NET_SHUTDOWN_AND_LOAD_SP", [] {
components::button("NET_SHUTDOWN_AND_LOAD_SP"_T.data(), [] {
NETWORK::SHUTDOWN_AND_LAUNCH_SINGLE_PLAYER_GAME();
});
@ -80,7 +80,6 @@ namespace big
ENTITY::SET_ENTITY_COORDS(self::ped, safepos.x, safepos.y, safepos.z, 0, 0, 0, false);
else
g_notification_service->push_error("Find safe pos", "Failed to find a safe position");
});
components::command_button<"fastquit">();

View File

@ -9,6 +9,7 @@
#include "script.hpp"
#include "script_global.hpp"
#include "util/misc.hpp"
#include "util/scripts.hpp"
#include "util/system.hpp"
#include "view_debug.hpp"
@ -161,6 +162,21 @@ namespace big
update_free_stacks_count();
});
ImGui::SameLine();
components::button("Start With Launcher", [] {
auto hash = rage::joaat(selected_script);
auto idx = scripts::launcher_index_from_hash(hash);
if (idx == -1)
{
g_notification_service->push_warning("Script Launcher", "This script cannot be started using am_launcher");
return;
}
scripts::start_launcher_script(idx);
});
if (*g_pointers->m_gta.m_game_state != eGameState::Invalid && std::chrono::high_resolution_clock::now() - last_stack_update_time > 100ms)
{
last_stack_update_time = std::chrono::high_resolution_clock::now();

View File

@ -1,486 +1,485 @@
#include "core/data/apartment_names.hpp"
#include "core/data/command_access_levels.hpp"
#include "core/data/region_codes.hpp"
#include "core/data/warehouse_names.hpp"
#include "fiber_pool.hpp"
#include "gta_util.hpp"
#include "hooking.hpp"
#include "util/notify.hpp"
#include "util/scripts.hpp"
#include "util/session.hpp"
#include "util/toxic.hpp"
#include "views/view.hpp"
#include <network/Network.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
void render_rid_joiner()
{
ImGui::BeginGroup();
components::sub_title("Rid joiner");
if (ImGui::ListBoxHeader("##ridjoiner", get_listbox_dimensions()))
{
static uint64_t rid = 0;
static char username[20];
static char base64[500]{};
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5);
ImGui::InputScalar("##inputrid", ImGuiDataType_U64, &rid);
ImGui::SameLine();
components::button("JOIN_BY_RID"_T, [] {
session::join_by_rockstar_id(rid);
});
components::input_text_with_hint("##usernameinput", "INPUT_USERNAME"_T, username, sizeof(username));
ImGui::SameLine();
if (components::button("JOIN_BY_USERNAME"_T))
{
session::join_by_username(username);
};
components::input_text_with_hint("##sessioninfoinput", "SESSION_INFO"_T, base64, sizeof(base64));
ImGui::SameLine();
components::button("JOIN_SESSION_INFO"_T, [] {
rage::rlSessionInfo info;
g_pointers->m_gta.m_decode_session_info(&info, base64, nullptr);
session::join_session(info);
});
components::button("COPY_SESSION_INFO"_T, [] {
char buf[0x100]{};
g_pointers->m_gta.m_encode_session_info(&gta_util::get_network()->m_game_session.m_rline_session.m_session_info, buf, 0xA9, nullptr);
ImGui::SetClipboardText(buf);
});
ImGui::PopItemWidth();
ImGui::ListBoxFooter();
}
ImGui::EndGroup();
}
void render_session_switcher()
{
ImGui::BeginGroup();
components::sub_title("SESSION_SWITCHER"_T);
if (ImGui::ListBoxHeader("###session_switch", get_listbox_dimensions()))
{
if (ImGui::BeginCombo("##regionswitcher", "Regions"))
{
for (const auto& region_type : regions)
{
components::selectable(region_type.name, *g_pointers->m_gta.m_region_code == region_type.id, [&region_type] {
*g_pointers->m_gta.m_region_code = region_type.id;
});
}
ImGui::EndCombo();
}
ImGui::Spacing();
for (const auto& session_type : sessions)
{
components::selectable(session_type.name, false, [&session_type] {
session::join_type(session_type.id);
});
}
ImGui::EndListBox();
}
ImGui::EndGroup();
}
void render_misc()
{
ImGui::BeginGroup();
components::sub_title("Misc");
if (ImGui::ListBoxHeader("##miscsession", get_listbox_dimensions()))
{
ImGui::Checkbox("Join Sctv", &g.session.join_in_sctv_slots); //CHANGE TRANSLATION JOIN_IN_SCTV
if (ImGui::IsItemHovered())
ImGui::SetTooltip("JOIN_IN_SCTV_DESC"_T.data());
ImGui::Checkbox("PLAYER_MAGNET"_T.data(), &g.session.player_magnet_enabled);
if (g.session.player_magnet_enabled)
{
ImGui::Text("PLAYER_COUNT"_T.data());
ImGui::InputInt("##playercount", &g.session.player_magnet_count);
}
ImGui::BeginDisabled(!g_player_service->get_self()->is_host());
ImGui::Checkbox("Lobby Lock", &g.session.lock_session);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Blocks all players from joining. May not work on some modders.");
ImGui::EndDisabled();
components::script_patch_checkbox("REVEAL_OTR_PLAYERS"_T, &g.session.decloak_players);
ImGui::ListBoxFooter();
}
ImGui::EndGroup();
}
void render_chat()
{
ImGui::BeginGroup();
components::sub_title("Chat");
if (ImGui::ListBoxHeader("##chat", get_listbox_dimensions()))
{
static char msg[256];
ImGui::Checkbox("AUTO_KICK_CHAT_SPAMMERS"_T.data(), &g.session.kick_chat_spammers);
ImGui::Checkbox("DISABLE_FILTER"_T.data(), &g.session.chat_force_clean);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Your sent chat messages will not be censored to the receivers"); // TODO: add translation
ImGui::Checkbox("LOG_CHAT_MSG"_T.data(), &g.session.log_chat_messages);
ImGui::Checkbox("LOG_TXT_MSG"_T.data(), &g.session.log_text_messages);
components::input_text_with_hint("##message", "Chat message", msg, sizeof(msg));
ImGui::Checkbox("IS_TEAM"_T.data(), &g.session.is_team);
ImGui::SameLine();
components::button("SEND"_T, [] {
if (const auto net_game_player = gta_util::get_network_player_mgr()->m_local_net_player; net_game_player)
{
if (g_hooking->get_original<hooks::send_chat_message>()(*g_pointers->m_gta.m_send_chat_ptr,
net_game_player->get_net_data(),
msg,
g.session.is_team))
notify::draw_chat(msg, net_game_player->get_name(), g.session.is_team);
}
});
ImGui::Separator();
ImGui::Checkbox("CHAT_COMMANDS"_T.data(), &g.session.chat_commands);
if (g.session.chat_commands)
{
components::small_text("DEFAULT_CMD_PERMISSIONS"_T.data());
if (ImGui::BeginCombo("##defualtchatcommands", COMMAND_ACCESS_LEVELS[g.session.chat_command_default_access_level]))
{
for (const auto& [type, name] : COMMAND_ACCESS_LEVELS)
{
if (ImGui::Selectable(name, type == g.session.chat_command_default_access_level))
{
g.session.chat_command_default_access_level = type;
}
if (type == g.session.chat_command_default_access_level)
{
ImGui::SetItemDefaultFocus();
}
}
ImGui::EndCombo();
}
}
ImGui::ListBoxFooter();
}
ImGui::EndGroup();
}
void render_session_globals()
{
ImGui::BeginGroup();
components::sub_title("Globals");
if (ImGui::ListBoxHeader("##globals", get_listbox_dimensions()))
{
static int global_wanted_level = 0;
ImGui::Checkbox("OFF_THE_RADAR"_T.data(), &g.session.off_radar_all);
ImGui::Checkbox("NEVER_WANTED"_T.data(), &g.session.never_wanted_all);
ImGui::Checkbox("SEMI_GODMODE"_T.data(), &g.session.semi_godmode_all);
ImGui::Checkbox("EXPLOSION_KARMA"_T.data(), &g.session.explosion_karma);
ImGui::Checkbox("DAMAGE_KARMA"_T.data(), &g.session.damage_karma);
ImGui::Checkbox("DISABLE_PEDS"_T.data(), &g.session.disable_peds);
ImGui::Checkbox("DISABLE_TRAFFIC"_T.data(), &g.session.disable_traffic);
ImGui::Checkbox("FORCE_THUNDER"_T.data(), &g.session.force_thunder);
components::small_text("WANTED_LVL"_T.data());
ImGui::SetNextItemWidth(150);
if (ImGui::SliderInt("##wantedlevel", &global_wanted_level, 0, 5))
{
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
ImGui::SameLine();
if (ImGui::Checkbox("FORCE"_T.data(), &g.session.wanted_level_all))
{
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelPlayer = __rdtsc() + 32;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
ImGui::ListBoxFooter();
}
ImGui::EndGroup();
}
void view::session()
{
render_rid_joiner();
ImGui::SameLine();
render_session_switcher();
render_misc();
ImGui::SameLine();
render_chat();
render_session_globals();
ImGui::SameLine();
ImGui::BeginGroup();
components::sub_title("FORCE_HOST"_T);
ImGui::Checkbox("FORCE_SESSION_HOST"_T.data(), &g.session.force_session_host);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("FORCE_SESSION_HOST_DESC"_T.data());
if (g.session.force_session_host)
{
ImGui::SameLine();
ImGui::Checkbox("KICK_HOST_ON_JOIN"_T.data(), &g.session.kick_host_when_forcing_host);
}
if (ImGui::Checkbox("FORCE_SCRIPT_HOST"_T.data(), &g.session.force_script_host))
{
if (g.session.force_script_host)
g_fiber_pool->queue_job([] {
scripts::force_host(RAGE_JOAAT("freemode"));
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("freemode")); script && script->m_net_component)
script->m_net_component->block_host_migration(true);
scripts::force_host(RAGE_JOAAT("fmmc_launcher"));
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("fmmc_launcher")); script && script->m_net_component)
script->m_net_component->block_host_migration(true);
});
}
ImGui::Spacing();
components::sub_title("Players");
components::options_modal(
"Griefing",
[] {
components::command_button<"killall">({}, "KILL_ALL"_T);
ImGui::SameLine();
components::command_button<"explodeall">({}, "EXPLODE_ALL"_T);
ImGui::SameLine();
components::command_button<"beastall">({});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("INCLUDING_YOU"_T.data());
components::command_button<"bringall">({});
ImGui::SameLine();
components::command_button<"giveweapsall">({});
ImGui::SameLine();
components::command_button<"remweapsall">({});
components::command_button<"ceokickall">({});
ImGui::SameLine();
components::command_button<"vehkickall">({});
components::command_button<"ragdollall">({}, "RAGDOLL_PLAYERS"_T);
ImGui::SameLine();
components::command_button<"intkickall">({}, "KICK_ALL_FROM_INTERIORS"_T);
components::command_button<"missionall">({});
ImGui::SameLine();
components::command_button<"errorall">({});
components::command_button<"ceoraidall">({});
ImGui::SameLine();
components::button("Trigger MC Raid", [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::BikerDefend);
});
});
ImGui::SameLine();
components::button("Trigger Bunker Raid", [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::GunrunningDefend);
});
});
},
false,
"Griefing");
components::options_modal(
"Teleport",
[] {
if (ImGui::BeginCombo("##apartment", apartment_names[g.session.send_to_apartment_idx]))
{
for (int i = 1; i < apartment_names.size(); i++)
{
if (ImGui::Selectable(apartment_names[i], i == g.session.send_to_apartment_idx))
{
g.session.send_to_apartment_idx = i;
}
if (i == g.session.send_to_apartment_idx)
{
ImGui::SetItemDefaultFocus();
}
}
ImGui::EndCombo();
}
ImGui::SameLine();
components::command_button<"apartmenttpall">({(uint64_t)g.session.send_to_apartment_idx}, "TP_ALL_TO_APARTMENT"_T);
if (ImGui::BeginCombo("##warehouse", warehouse_names[g.session.send_to_warehouse_idx]))
{
for (int i = 1; i < warehouse_names.size(); i++)
{
if (ImGui::Selectable(warehouse_names[i], i == g.session.send_to_warehouse_idx))
{
g.session.send_to_warehouse_idx = i;
}
if (i == g.session.send_to_warehouse_idx)
{
ImGui::SetItemDefaultFocus();
}
}
ImGui::EndCombo();
}
ImGui::SameLine();
components::command_button<"warehousetpall">({(uint64_t)g.session.send_to_warehouse_idx}, "TP_ALL_TO_WAREHOUSE"_T);
components::button("TP_ALL_TO_DARTS"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::Darts);
});
});
ImGui::SameLine();
components::button("TP_ALL_TO_FLIGHT_SCHOOL"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::PilotSchool);
});
});
ImGui::SameLine();
components::button("TP_ALL_TO_MAP_CENTER"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::ArmWresling);
});
});
components::button("TP_ALL_TO_SKYDIVE"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::Skydive);
});
});
ImGui::SameLine();
components::command_button<"interiortpall">({81}, "TP_ALL_TO_MOC"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({123}, "TP_ALL_TO_CASINO"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({124}, "TP_ALL_TO_PENTHOUSE"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({128}, "TP_ALL_TO_ARCADE"_T);
components::command_button<"interiortpall">({146}, "TP_ALL_TO_MUSIC_LOCKER"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({148}, "TP_ALL_TO_RECORD_A_STUDIOS"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({149}, "TP_ALL_TO_CUSTOM_AUTO_SHOP"_T);
components::command_button<"interiortpall">({155}, "TP_ALL_TO_AGENCY"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({160}, "TP_ALL_TO_FREAKSHOP"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({161}, "TP_ALL_TO_MULTI_FLOOR_GARAGE"_T);
components::command_button<"tutorialall">();
ImGui::SameLine();
components::command_button<"golfall">();
ImGui::SameLine();
components::command_button<"flightschoolall">();
ImGui::SameLine();
components::command_button<"dartsall">();
components::command_button<"badlandsall">();
ImGui::SameLine();
components::command_button<"spacemonkeyall">();
ImGui::SameLine();
components::command_button<"wizardall">();
components::command_button<"qub3dall">();
ImGui::SameLine();
components::command_button<"camhedzall">();
},
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::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");
}
}
#include "core/data/apartment_names.hpp"
#include "core/data/command_access_levels.hpp"
#include "core/data/region_codes.hpp"
#include "core/data/warehouse_names.hpp"
#include "fiber_pool.hpp"
#include "gta_util.hpp"
#include "hooking.hpp"
#include "util/notify.hpp"
#include "util/scripts.hpp"
#include "util/session.hpp"
#include "util/toxic.hpp"
#include "views/view.hpp"
#include <network/Network.hpp>
#include <script/globals/GPBD_FM_3.hpp>
#include <script/globals/GlobalPlayerBD.hpp>
namespace big
{
void render_rid_joiner()
{
ImGui::BeginGroup();
components::sub_title("Rid joiner");
if (ImGui::ListBoxHeader("##ridjoiner", get_listbox_dimensions()))
{
static uint64_t rid = 0;
static char username[20];
static char base64[500]{};
ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5);
ImGui::InputScalar("##inputrid", ImGuiDataType_U64, &rid);
ImGui::SameLine();
components::button("JOIN_BY_RID"_T, [] {
session::join_by_rockstar_id(rid);
});
components::input_text_with_hint("##usernameinput", "INPUT_USERNAME"_T, username, sizeof(username));
ImGui::SameLine();
if (components::button("JOIN_BY_USERNAME"_T))
{
session::join_by_username(username);
};
components::input_text_with_hint("##sessioninfoinput", "SESSION_INFO"_T, base64, sizeof(base64));
ImGui::SameLine();
components::button("JOIN_SESSION_INFO"_T, [] {
rage::rlSessionInfo info;
g_pointers->m_gta.m_decode_session_info(&info, base64, nullptr);
session::join_session(info);
});
components::button("COPY_SESSION_INFO"_T, [] {
char buf[0x100]{};
g_pointers->m_gta.m_encode_session_info(&gta_util::get_network()->m_game_session.m_rline_session.m_session_info, buf, 0xA9, nullptr);
ImGui::SetClipboardText(buf);
});
ImGui::PopItemWidth();
ImGui::ListBoxFooter();
}
ImGui::EndGroup();
}
void render_session_switcher()
{
ImGui::BeginGroup();
components::sub_title("SESSION_SWITCHER"_T);
if (ImGui::ListBoxHeader("###session_switch", get_listbox_dimensions()))
{
if (ImGui::BeginCombo("##regionswitcher", "Regions"))
{
for (const auto& region_type : regions)
{
components::selectable(region_type.name, *g_pointers->m_gta.m_region_code == region_type.id, [&region_type] {
*g_pointers->m_gta.m_region_code = region_type.id;
});
}
ImGui::EndCombo();
}
ImGui::Spacing();
for (const auto& session_type : sessions)
{
components::selectable(session_type.name, false, [&session_type] {
session::join_type(session_type.id);
});
}
ImGui::EndListBox();
}
ImGui::EndGroup();
}
void render_misc()
{
ImGui::BeginGroup();
components::sub_title("Misc");
if (ImGui::ListBoxHeader("##miscsession", get_listbox_dimensions()))
{
ImGui::Checkbox("Join Sctv", &g.session.join_in_sctv_slots); //CHANGE TRANSLATION JOIN_IN_SCTV
if (ImGui::IsItemHovered())
ImGui::SetTooltip("JOIN_IN_SCTV_DESC"_T.data());
ImGui::Checkbox("PLAYER_MAGNET"_T.data(), &g.session.player_magnet_enabled);
if (g.session.player_magnet_enabled)
{
ImGui::Text("PLAYER_COUNT"_T.data());
ImGui::InputInt("##playercount", &g.session.player_magnet_count);
}
ImGui::BeginDisabled(!g_player_service->get_self()->is_host());
ImGui::Checkbox("Lobby Lock", &g.session.lock_session);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Blocks all players from joining. May not work on some modders.");
ImGui::EndDisabled();
components::script_patch_checkbox("REVEAL_OTR_PLAYERS"_T, &g.session.decloak_players);
ImGui::ListBoxFooter();
}
ImGui::EndGroup();
}
void render_chat()
{
ImGui::BeginGroup();
components::sub_title("Chat");
if (ImGui::ListBoxHeader("##chat", get_listbox_dimensions()))
{
static char msg[256];
ImGui::Checkbox("AUTO_KICK_CHAT_SPAMMERS"_T.data(), &g.session.kick_chat_spammers);
ImGui::Checkbox("DISABLE_FILTER"_T.data(), &g.session.chat_force_clean);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Your sent chat messages will not be censored to the receivers"); // TODO: add translation
ImGui::Checkbox("LOG_CHAT_MSG"_T.data(), &g.session.log_chat_messages);
ImGui::Checkbox("LOG_TXT_MSG"_T.data(), &g.session.log_text_messages);
components::input_text_with_hint("##message", "Chat message", msg, sizeof(msg));
ImGui::Checkbox("IS_TEAM"_T.data(), &g.session.is_team);
ImGui::SameLine();
components::button("SEND"_T, [] {
if (const auto net_game_player = gta_util::get_network_player_mgr()->m_local_net_player; net_game_player)
{
if (g_hooking->get_original<hooks::send_chat_message>()(*g_pointers->m_gta.m_send_chat_ptr,
net_game_player->get_net_data(),
msg,
g.session.is_team))
notify::draw_chat(msg, net_game_player->get_name(), g.session.is_team);
}
});
ImGui::Separator();
ImGui::Checkbox("CHAT_COMMANDS"_T.data(), &g.session.chat_commands);
if (g.session.chat_commands)
{
components::small_text("DEFAULT_CMD_PERMISSIONS"_T.data());
if (ImGui::BeginCombo("##defualtchatcommands", COMMAND_ACCESS_LEVELS[g.session.chat_command_default_access_level]))
{
for (const auto& [type, name] : COMMAND_ACCESS_LEVELS)
{
if (ImGui::Selectable(name, type == g.session.chat_command_default_access_level))
{
g.session.chat_command_default_access_level = type;
}
if (type == g.session.chat_command_default_access_level)
{
ImGui::SetItemDefaultFocus();
}
}
ImGui::EndCombo();
}
}
ImGui::ListBoxFooter();
}
ImGui::EndGroup();
}
void render_session_globals()
{
ImGui::BeginGroup();
components::sub_title("Globals");
if (ImGui::ListBoxHeader("##globals", get_listbox_dimensions()))
{
static int global_wanted_level = 0;
ImGui::Checkbox("OFF_THE_RADAR"_T.data(), &g.session.off_radar_all);
ImGui::Checkbox("NEVER_WANTED"_T.data(), &g.session.never_wanted_all);
ImGui::Checkbox("SEMI_GODMODE"_T.data(), &g.session.semi_godmode_all);
ImGui::Checkbox("EXPLOSION_KARMA"_T.data(), &g.session.explosion_karma);
ImGui::Checkbox("DAMAGE_KARMA"_T.data(), &g.session.damage_karma);
ImGui::Checkbox("DISABLE_PEDS"_T.data(), &g.session.disable_peds);
ImGui::Checkbox("DISABLE_TRAFFIC"_T.data(), &g.session.disable_traffic);
ImGui::Checkbox("FORCE_THUNDER"_T.data(), &g.session.force_thunder);
components::small_text("WANTED_LVL"_T.data());
ImGui::SetNextItemWidth(150);
if (ImGui::SliderInt("##wantedlevel", &global_wanted_level, 0, 5))
{
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
ImGui::SameLine();
if (ImGui::Checkbox("FORCE"_T.data(), &g.session.wanted_level_all))
{
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelPlayer = __rdtsc() + 32;
scr_globals::globalplayer_bd.as<GlobalPlayerBD*>()->Entries[self::id].RemoteWantedLevelAmount = global_wanted_level;
}
ImGui::ListBoxFooter();
}
ImGui::EndGroup();
}
void view::network()
{
render_rid_joiner();
ImGui::SameLine();
render_session_switcher();
render_misc();
ImGui::SameLine();
render_chat();
render_session_globals();
ImGui::SameLine();
ImGui::BeginGroup();
components::sub_title("FORCE_HOST"_T);
ImGui::Checkbox("FORCE_SESSION_HOST"_T.data(), &g.session.force_session_host);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("FORCE_SESSION_HOST_DESC"_T.data());
if (g.session.force_session_host)
{
ImGui::SameLine();
ImGui::Checkbox("KICK_HOST_ON_JOIN"_T.data(), &g.session.kick_host_when_forcing_host);
}
if (ImGui::Checkbox("FORCE_SCRIPT_HOST"_T.data(), &g.session.force_script_host))
{
if (g.session.force_script_host)
g_fiber_pool->queue_job([] {
scripts::force_host(RAGE_JOAAT("freemode"));
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("freemode")); script && script->m_net_component)
script->m_net_component->block_host_migration(true);
scripts::force_host(RAGE_JOAAT("fmmc_launcher"));
if (auto script = gta_util::find_script_thread(RAGE_JOAAT("fmmc_launcher")); script && script->m_net_component)
script->m_net_component->block_host_migration(true);
});
}
ImGui::Spacing();
components::sub_title("Players");
components::options_modal(
"Griefing",
[] {
components::command_button<"killall">({}, "KILL_ALL"_T);
ImGui::SameLine();
components::command_button<"explodeall">({}, "EXPLODE_ALL"_T);
ImGui::SameLine();
components::command_button<"beastall">({});
if (ImGui::IsItemHovered())
ImGui::SetTooltip("INCLUDING_YOU"_T.data());
components::command_button<"bringall">({});
ImGui::SameLine();
components::command_button<"giveweapsall">({});
ImGui::SameLine();
components::command_button<"remweapsall">({});
components::command_button<"ceokickall">({});
ImGui::SameLine();
components::command_button<"vehkickall">({});
components::command_button<"ragdollall">({}, "RAGDOLL_PLAYERS"_T);
ImGui::SameLine();
components::command_button<"intkickall">({}, "KICK_ALL_FROM_INTERIORS"_T);
components::command_button<"missionall">({});
ImGui::SameLine();
components::command_button<"errorall">({});
components::command_button<"ceoraidall">({});
ImGui::SameLine();
components::button("Trigger MC Raid", [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::BikerDefend);
});
});
ImGui::SameLine();
components::button("Trigger Bunker Raid", [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::GunrunningDefend);
});
});
},
false,
"Griefing");
components::options_modal(
"Teleport",
[] {
if (ImGui::BeginCombo("##apartment", apartment_names[g.session.send_to_apartment_idx]))
{
for (int i = 1; i < apartment_names.size(); i++)
{
if (ImGui::Selectable(apartment_names[i], i == g.session.send_to_apartment_idx))
{
g.session.send_to_apartment_idx = i;
}
if (i == g.session.send_to_apartment_idx)
{
ImGui::SetItemDefaultFocus();
}
}
ImGui::EndCombo();
}
ImGui::SameLine();
components::command_button<"apartmenttpall">({(uint64_t)g.session.send_to_apartment_idx}, "TP_ALL_TO_APARTMENT"_T);
if (ImGui::BeginCombo("##warehouse", warehouse_names[g.session.send_to_warehouse_idx]))
{
for (int i = 1; i < warehouse_names.size(); i++)
{
if (ImGui::Selectable(warehouse_names[i], i == g.session.send_to_warehouse_idx))
{
g.session.send_to_warehouse_idx = i;
}
if (i == g.session.send_to_warehouse_idx)
{
ImGui::SetItemDefaultFocus();
}
}
ImGui::EndCombo();
}
ImGui::SameLine();
components::command_button<"warehousetpall">({(uint64_t)g.session.send_to_warehouse_idx}, "TP_ALL_TO_WAREHOUSE"_T);
components::button("TP_ALL_TO_DARTS"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::Darts);
});
});
ImGui::SameLine();
components::button("TP_ALL_TO_FLIGHT_SCHOOL"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::PilotSchool);
});
});
ImGui::SameLine();
components::button("TP_ALL_TO_MAP_CENTER"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::ArmWresling);
});
});
components::button("TP_ALL_TO_SKYDIVE"_T, [] {
g_player_service->iterate([](auto& plyr) {
toxic::start_activity(plyr.second, eActivityType::Skydive);
});
});
ImGui::SameLine();
components::command_button<"interiortpall">({81}, "TP_ALL_TO_MOC"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({123}, "TP_ALL_TO_CASINO"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({124}, "TP_ALL_TO_PENTHOUSE"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({128}, "TP_ALL_TO_ARCADE"_T);
components::command_button<"interiortpall">({146}, "TP_ALL_TO_MUSIC_LOCKER"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({148}, "TP_ALL_TO_RECORD_A_STUDIOS"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({149}, "TP_ALL_TO_CUSTOM_AUTO_SHOP"_T);
components::command_button<"interiortpall">({155}, "TP_ALL_TO_AGENCY"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({160}, "TP_ALL_TO_FREAKSHOP"_T);
ImGui::SameLine();
components::command_button<"interiortpall">({161}, "TP_ALL_TO_MULTI_FLOOR_GARAGE"_T);
components::command_button<"tutorialall">();
ImGui::SameLine();
components::command_button<"golfall">();
ImGui::SameLine();
components::command_button<"flightschoolall">();
ImGui::SameLine();
components::command_button<"dartsall">();
components::command_button<"badlandsall">();
ImGui::SameLine();
components::command_button<"spacemonkeyall">();
ImGui::SameLine();
components::command_button<"wizardall">();
components::command_button<"qub3dall">();
ImGui::SameLine();
components::command_button<"camhedzall">();
},
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::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");
}
}

View File

@ -13,6 +13,8 @@ namespace big
{
char name_buf[32];
char search[64];
char note_buffer[1024];
bool notes_dirty = false;
std::shared_ptr<persistent_player> current_player;
void draw_player_db_entry(std::shared_ptr<persistent_player> player, const std::string& lower_search)
@ -42,9 +44,17 @@ namespace big
if (components::selectable(player->name, player == g_player_database_service->get_selected()))
{
if (notes_dirty)
{
// Ensure notes are saved
g_player_database_service->save();
notes_dirty = false;
}
g_player_database_service->set_selected(player);
current_player = player;
strncpy(name_buf, current_player->name.data(), sizeof(name_buf));
strncpy(note_buffer, current_player->notes.data(), sizeof(note_buffer));
}
ImGui::PopID();
@ -97,7 +107,7 @@ namespace big
if (ImGui::InputScalar("RID"_T.data(), ImGuiDataType_S64, &current_player->rockstar_id)
|| ImGui::Checkbox("IS_MODDER"_T.data(), &current_player->is_modder)
|| ImGui::Checkbox("BLOCK_JOIN"_T.data(), &current_player->block_join)
|| ImGui::Checkbox("Notify When Online", &current_player->notify_online))
|| ImGui::Checkbox("Notify When Online", &current_player->notify_online))
{
if (current_player->rockstar_id != selected->rockstar_id)
g_player_database_service->update_rockstar_id(selected->rockstar_id, current_player->rockstar_id);
@ -157,6 +167,12 @@ namespace big
}
}
if (ImGui::InputTextMultiline("Notes", note_buffer, sizeof(note_buffer)))
{
current_player->notes = note_buffer;
notes_dirty = true;
}
components::button("JOIN_SESSION"_T, [] {
session::join_by_rockstar_id(current_player->rockstar_id);
});

View File

@ -147,5 +147,12 @@ namespace big
ImGui::SameLine();
ImGui::InputInt("###player_count", &g.spoofing.session_player_count);
}
ImGui::Checkbox("Spoof Session Bad Sport Status", &g.spoofing.spoof_session_bad_sport_status);
if (g.spoofing.spoof_session_bad_sport_status)
{
ImGui::SameLine();
ImGui::Checkbox("Badsport", &g.spoofing.session_bad_sport);
}
}
}

View File

@ -14,7 +14,9 @@ namespace big
return gta_util::get_network()->m_game_session_ptr->is_host();
};
ImGui::Text("Host/breakup kick require Host");
if (!g_player_service->get_self()->is_host())
ImGui::Text("Host and breakup kick require session host");
ImGui::BeginDisabled(!g_player_service->get_self()->is_host());
components::player_command_button<"hostkick">(g_player_service->get_selected());

View File

@ -1,4 +1,5 @@
#include "script/globals/GPBD_FM_3.hpp"
#include "services/script_connection/script_connection_service.hpp"
#include "util/scripts.hpp"
#include "util/vehicle.hpp"
#include "views/view.hpp"

View File

@ -110,7 +110,7 @@ namespace big
ImGui::EndCombo();
}
auto selected_ipl = ipls[g.self.ipls.select];
const auto& selected_ipl = ipls[g.self.ipls.select];
if (components::button("LOAD_IPL"_T.data()))
{
//unload all previous ipls

View File

@ -25,8 +25,8 @@ namespace big
ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Checkbox("Increased C4 Limit (Max = 50)", &g.weapons.increased_c4_limit);
ImGui::Checkbox("Increased Flare Limit (Max = 50)", &g.weapons.increased_flare_limit);
ImGui::Checkbox("Increase C4 Limit (Max = 50)", &g.weapons.increased_c4_limit);
ImGui::Checkbox("Increase Flare Limit (Max = 50)", &g.weapons.increased_flare_limit);
components::command_checkbox<"rapidfire">();

View File

@ -1,3 +1,4 @@
#include "gui.hpp"
#include "renderer.hpp"
#include "views/view.hpp"
@ -6,20 +7,38 @@ namespace big
void view::gui_settings()
{
components::sub_title("SETTINGS_UI_SCALE"_T);
if (ImGui::SliderFloat("##gui-scale", &g.window.gui_scale, 1.f, 1.5f, "%.2f"))
if (ImGui::SliderFloat("##gui-scale", &g.window.gui_scale, 0.75f, 1.5f, "%.2f"))
g_renderer->rescale(g.window.gui_scale);
components::sub_title("SETTINGS_UI_COLOR"_T);
static ImVec4 col_gui = ImGui::ColorConvertU32ToFloat4(g.window.color);
static ImVec4 col_gui = ImGui::ColorConvertU32ToFloat4(g.window.background_color);
if (ImGui::ColorEdit4("SETTINGS_UI_COLOR_PICKER"_T.data(), (float*)&col_gui, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g.window.color = ImGui::ColorConvertFloat4ToU32(col_gui);
g.window.background_color = ImGui::ColorConvertFloat4ToU32(col_gui);
}
components::sub_title("Ingame Overlay");
static ImVec4 col_text = ImGui::ColorConvertU32ToFloat4(g.window.text_color);
if (ImGui::ColorEdit4("Text Color", (float*)&col_text, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g.window.text_color = ImGui::ColorConvertFloat4ToU32(col_text);
}
static ImVec4 col_button = ImGui::ColorConvertU32ToFloat4(g.window.button_color);
if (ImGui::ColorEdit4("Button Color", (float*)&col_button, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g.window.button_color = ImGui::ColorConvertFloat4ToU32(col_button);
}
static ImVec4 col_frame = ImGui::ColorConvertU32ToFloat4(g.window.frame_color);
if (ImGui::ColorEdit4("Frame Color", (float*)&col_frame, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview))
{
g.window.frame_color = ImGui::ColorConvertFloat4ToU32(col_frame);
}
components::sub_title("In-Game Overlay");
ImGui::Checkbox("Show Overlay", &g.window.ingame_overlay.opened);
ImGui::SameLine();
ImGui::Checkbox("Show when Menu opened", &g.window.ingame_overlay.show_with_menu_opened);
ImGui::Checkbox("Show When Menu Opened", &g.window.ingame_overlay.show_with_menu_opened);
ImGui::BeginGroup();
@ -34,6 +53,7 @@ namespace big
ImGui::BeginGroup();
ImGui::Checkbox("Show Replay Interface", &g.window.ingame_overlay.show_replay_interface);
ImGui::Checkbox("Show Position", &g.window.ingame_overlay.show_position);
ImGui::Checkbox("Show Game Version", &g.window.ingame_overlay.show_game_versions);
ImGui::EndGroup();

View File

@ -42,7 +42,7 @@ namespace big
static void overlay();
static void root();
static void self();
static void session();
static void network();
static void missions();
static void player_database();
static void session_browser();

View File

@ -10,7 +10,7 @@ namespace big
void view::squad_spawner()
{
const char* const spawn_distance_modes[5]{"Custom", "On target", "Closeby", "Moderately distanced", "Far away"};
const char* const spawn_distance_modes[5]{"Custom", "On target", "Nearby", "Moderately distanced", "Far away"};
const char* const combat_ability_levels[3]{"Poor", "Average", "Professional"};
static squad new_template{};
@ -229,13 +229,13 @@ namespace big
new_template.m_vehicle_model.clear();
new_template.m_weapon_model.clear();
new_template.m_persistent_vehicle = "None";
new_template.m_squad_size = 1;
new_template.m_ped_invincibility = 0;
new_template.m_veh_invincibility = 0;
new_template.m_ped_health = 0;
new_template.m_ped_armor = 0;
new_template.m_ped_accuracy = 50;
new_template.m_spawn_distance = 0;
new_template.m_squad_size = 1;
new_template.m_ped_invincibility = 0;
new_template.m_veh_invincibility = 0;
new_template.m_ped_health = 0;
new_template.m_ped_armor = 0;
new_template.m_ped_accuracy = 50;
new_template.m_spawn_distance = 0;
for (int i = 0; i < sizeof(new_template.m_ped_proofs) / sizeof(new_template.m_ped_proofs[0]); i++)
new_template.m_ped_proofs[i] = false;
new_template.m_stay_in_veh = 0;
@ -252,20 +252,20 @@ namespace big
{
ImGui::BeginGroup(); //Toggleables
ImGui::Checkbox("Spawn ahead", &new_template.m_spawn_ahead);
ImGui::Checkbox("Spawn Ahead", &new_template.m_spawn_ahead);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Will use the distance specified and apply it in a forward direction to find a position ahead of the target");
ImGui::Checkbox("Favour roads", &new_template.m_favour_roads);
ImGui::Checkbox("Favour Roads", &new_template.m_favour_roads);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Will try and find a road first");
ImGui::Checkbox("Disperse", &new_template.m_disperse);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("If the squad is on foot, will scatter units within the spawn distance");
ImGui::Checkbox("Vehicle catch up", &new_template.m_spawn_behind_same_velocity);
ImGui::Checkbox("Vehicle Catch Up", &new_template.m_spawn_behind_same_velocity);
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Will spawn the mobile squad behind the target with identical velocity if applicable.\nOnly for squads with a vehicle.");
ImGui::Checkbox("Stay In Vehicle", &new_template.m_stay_in_veh);
ImGui::Checkbox("Vehicle mods maxed", &new_template.m_max_vehicle);
ImGui::Checkbox("Vehicle Mods Maxed", &new_template.m_max_vehicle);
ImGui::EndGroup();
ImGui::SameLine();
@ -285,13 +285,13 @@ namespace big
ImGui::PushItemWidth(200);
ImGui::Text("Ped Health");
ImGui::SliderFloat("##pedhealth", &new_template.m_ped_health, 100, 2000);
ImGui::SliderFloat("##pedhealth", &new_template.m_ped_health, 0, 2000);
ImGui::Text("Ped Armor");
ImGui::SliderFloat("##pedarmor", &new_template.m_ped_armor, 0, 2000);
ImGui::Text("Ped Accuracy");
ImGui::SliderFloat("##pedaccuracy", &new_template.m_ped_accuracy, 0, 100);
ImGui::Text("Custom Spawn Distance");
ImGui::SliderFloat("##customspawndistance", &new_template.m_spawn_distance, 10, 500);
ImGui::SliderFloat("##customspawndistance", &new_template.m_spawn_distance, 0, 500);
ImGui::EndGroup();
if (ImGui::IsItemHovered())
ImGui::SetTooltip("Leave these values at 0 to default, except for accuracy.");
@ -309,7 +309,7 @@ namespace big
ImGui::EndCombo();
}
ImGui::Text("Persistent vehicle");
ImGui::Text("Persistent Vehicle");
if (ImGui::BeginCombo("##persistent_vehicle", new_template.m_persistent_vehicle.data()))
{
if (ImGui::Selectable("None", new_template.m_persistent_vehicle == "None"))
@ -324,9 +324,7 @@ namespace big
ImGui::PopItemWidth();
ImGui::EndGroup();
components::input_text_with_hint("##new_template.m_description",
"Squad new_template.m_description",
&new_template.m_description);
components::input_text_with_hint("##new_template.m_description", "Description", &new_template.m_description);
ImGui::TreePop();
}
@ -362,43 +360,41 @@ namespace big
};
components::button("Spawn Squad", [] {
try{
if (check_validity(false))
g_squad_spawner_service.spawn_squad({
new_template.m_name,
new_template.m_ped_model,
new_template.m_weapon_model,
new_template.m_vehicle_model,
new_template.m_squad_size,
new_template.m_ped_invincibility,
new_template.m_veh_invincibility,
new_template.m_ped_proofs,
new_template.m_ped_health,
new_template.m_ped_armor,
new_template.m_spawn_distance,
new_template.m_ped_accuracy,
new_template.m_spawn_distance_mode,
new_template.m_combat_ability_level,
new_template.m_stay_in_veh,
new_template.m_spawn_behind_same_velocity,
new_template.m_description,
new_template.m_disperse,
new_template.m_spawn_ahead,
new_template.m_favour_roads,
new_template.m_max_vehicle,
new_template.m_persistent_vehicle},
victim,
new_template.m_spawn_distance_mode == eSquadSpawnDistance::CUSTOM,
g_orbital_drone_service.m_ground_pos);
try
{
if (check_validity(false))
g_squad_spawner_service.spawn_squad({new_template.m_name,
new_template.m_ped_model,
new_template.m_weapon_model,
new_template.m_vehicle_model,
new_template.m_squad_size,
new_template.m_ped_invincibility,
new_template.m_veh_invincibility,
new_template.m_ped_proofs,
new_template.m_ped_health,
new_template.m_ped_armor,
new_template.m_spawn_distance,
new_template.m_ped_accuracy,
new_template.m_spawn_distance_mode,
new_template.m_combat_ability_level,
new_template.m_stay_in_veh,
new_template.m_spawn_behind_same_velocity,
new_template.m_description,
new_template.m_disperse,
new_template.m_spawn_ahead,
new_template.m_favour_roads,
new_template.m_max_vehicle,
new_template.m_persistent_vehicle},
victim,
new_template.m_spawn_distance_mode == eSquadSpawnDistance::CUSTOM,
g_orbital_drone_service.m_ground_pos);
}
catch (std::exception e)
{
LOG(WARNING) << "Exception while spawning squad " << e.what();
}
});
ImGui::SameLine();
components::button("Save", [] {
if (check_validity(true) && !check_if_exists(new_template.m_name))