diff --git a/src/backend/commands/system/fast_quit.cpp b/src/backend/commands/system/fast_quit.cpp new file mode 100644 index 00000000..8a6d19bb --- /dev/null +++ b/src/backend/commands/system/fast_quit.cpp @@ -0,0 +1,16 @@ +#include "backend/command.hpp" + +namespace big +{ + class fast_quit : command + { + using command::command; + + virtual void execute(const std::vector&, const std::shared_ptr ctx) + { + exit(0); + } + }; + + fast_quit g_fast_quit("fastquit", "Rage Quit", "We all have bad times sometimes. Close your GTA instant.", 0); +} diff --git a/src/core/globals.hpp b/src/core/globals.hpp index 51dd45ee..82a64432 100644 --- a/src/core/globals.hpp +++ b/src/core/globals.hpp @@ -387,10 +387,11 @@ namespace big int beastjump = 0; int invisveh = 0; int localinvisveh = 0; + int fast_quit = 0; NLOHMANN_DEFINE_TYPE_INTRUSIVE(hotkeys, editing_menu_toggle, menu_toggle, teleport_waypoint, teleport_objective, noclip, bringvehicle, invis, heal, fill_inventory, skip_cutscene, freecam, superrun, superjump, beastjump, - invisveh, localinvisveh) + invisveh, localinvisveh, fast_quit) } hotkeys{}; bool dev_dlc = false; diff --git a/src/services/hotkey/hotkey_service.cpp b/src/services/hotkey/hotkey_service.cpp index 2a8aaaa2..c8d9f69a 100644 --- a/src/services/hotkey/hotkey_service.cpp +++ b/src/services/hotkey/hotkey_service.cpp @@ -23,6 +23,7 @@ namespace big register_hotkey("beastjump", g.settings.hotkeys.beastjump, RAGE_JOAAT("beastjump")); register_hotkey("invisveh", g.settings.hotkeys.invisveh, RAGE_JOAAT("invisveh")); register_hotkey("localinvisveh", g.settings.hotkeys.localinvisveh, RAGE_JOAAT("localinvisveh")); + register_hotkey("fastquit", g.settings.hotkeys.fast_quit, RAGE_JOAAT("fastquit")); g_renderer->add_wndproc_callback([this](HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) { diff --git a/src/views/debug/view_debug_misc.cpp b/src/views/debug/view_debug_misc.cpp index 0f9ce0a2..f210721f 100644 --- a/src/views/debug/view_debug_misc.cpp +++ b/src/views/debug/view_debug_misc.cpp @@ -50,6 +50,8 @@ namespace big if (ImGui::IsItemHovered()) ImGui::SetTooltip("You Will Have To Refresh Again When Exiting Interior.\n SPAMMING WILL CRASH GAME"); + components::command_button<"fastquit">(); + ImGui::EndTabItem(); } } diff --git a/src/views/settings/view_hotkey_settings.cpp b/src/views/settings/view_hotkey_settings.cpp index f6d56deb..9337245f 100644 --- a/src/views/settings/view_hotkey_settings.cpp +++ b/src/views/settings/view_hotkey_settings.cpp @@ -40,6 +40,8 @@ namespace big g_hotkey_service->update_hotkey("invisveh", g.settings.hotkeys.invisveh); if (ImGui::Hotkey("Toggle Local Veh Invisibility", &g.settings.hotkeys.localinvisveh)) g_hotkey_service->update_hotkey("localinvisveh", g.settings.hotkeys.localinvisveh); + if (ImGui::Hotkey("Rage Quit (Like Alt + F4)", &g.settings.hotkeys.fast_quit)) + g_hotkey_service->update_hotkey("fastquit", g.settings.hotkeys.fast_quit); ImGui::PopItemWidth(); }