From 5c8e7e8a15e086fd0acf1dde9c37465cdb5eaf83 Mon Sep 17 00:00:00 2001 From: Aure7138 <100095051+Aure7138@users.noreply.github.com> Date: Mon, 20 Feb 2023 06:04:13 +0800 Subject: [PATCH] debug options (#1002) --- src/core/globals.hpp | 2 ++ .../protections/script_event_handler.cpp | 3 +++ src/views/debug/view_debug_misc.cpp | 24 ++++++++++++------- src/views/debug/views_debug_logs.cpp | 2 ++ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/core/globals.hpp b/src/core/globals.hpp index ababe98c..dce4d544 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -78,6 +78,8 @@ namespace big bool filter_player = true; std::int8_t player_id = -1; + bool block_all = false; //should not save + NLOHMANN_DEFINE_TYPE_INTRUSIVE(script_event, logs, filter_player, player_id) } script_event{}; diff --git a/src/hooks/protections/script_event_handler.cpp b/src/hooks/protections/script_event_handler.cpp index 8018fb14..27c0c653 100644 --- a/src/hooks/protections/script_event_handler.cpp +++ b/src/hooks/protections/script_event_handler.cpp @@ -408,6 +408,9 @@ namespace big << "\tArgs: " << script_args; } + if (g.debug.logs.script_event.block_all) + return true; + return false; } } diff --git a/src/views/debug/view_debug_misc.cpp b/src/views/debug/view_debug_misc.cpp index 8e3d79e0..92417d0e 100644 --- a/src/views/debug/view_debug_misc.cpp +++ b/src/views/debug/view_debug_misc.cpp @@ -42,25 +42,31 @@ namespace big STATS::STAT_SET_BOOL(RAGE_JOAAT("mpply_was_i_bad_sport"), FALSE, TRUE); }); - if (components::button("Load MP Map")) - DLC::ON_ENTER_MP(); + components::button("Load MP Map", [] { DLC::ON_ENTER_MP(); }); ImGui::SameLine(); - if (components::button("Load SP Map")) + components::button("Load SP Map", [] { DLC::ON_ENTER_SP(); }); - DLC::ON_ENTER_SP(); + components::button("Skip Cutscene", [] { CUTSCENE::STOP_CUTSCENE_IMMEDIATELY(); }); - if (components::button("Skip Cutscene")) - CUTSCENE::STOP_CUTSCENE_IMMEDIATELY(); - - if (components::button("Refresh Interior")) + components::button("Refresh Interior", []\ { Interior interior = INTERIOR::GET_INTERIOR_AT_COORDS(self::pos.x, self::pos.y, self::pos.z); INTERIOR::REFRESH_INTERIOR(interior); - } + }); if (ImGui::IsItemHovered()) ImGui::SetTooltip("You Will Have To Refresh Again When Exiting Interior.\n SPAMMING WILL CRASH GAME"); + components::button("Network Shutdown And Launch Single Player Game", []\ + { + NETWORK::SHUTDOWN_AND_LAUNCH_SINGLE_PLAYER_GAME(); + }); + + components::button("Network Shutdown And Load Most Recent Save", []\ + { + NETWORK::SHUTDOWN_AND_LOAD_MOST_RECENT_SAVE(); + }); + components::command_button<"fastquit">(); if (ImGui::TreeNode("Addresses")) diff --git a/src/views/debug/views_debug_logs.cpp b/src/views/debug/views_debug_logs.cpp index 2d4b5f5f..c6e1ef5d 100644 --- a/src/views/debug/views_debug_logs.cpp +++ b/src/views/debug/views_debug_logs.cpp @@ -32,6 +32,8 @@ namespace big ImGui::EndListBox(); } + ImGui::Checkbox("Block All", &g.debug.logs.script_event.block_all); + ImGui::TreePop(); }