feat: add ragequit option + hotkey (#925)

This commit is contained in:
Johann 2023-02-01 19:48:50 +01:00 committed by GitHub
parent 0214d85edd
commit c25e7d3fad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,16 @@
#include "backend/command.hpp"
namespace big
{
class fast_quit : command
{
using command::command;
virtual void execute(const std::vector<std::uint64_t>&, const std::shared_ptr<command_context> ctx)
{
exit(0);
}
};
fast_quit g_fast_quit("fastquit", "Rage Quit", "We all have bad times sometimes. Close your GTA instant.", 0);
}

View File

@ -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;

View File

@ -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)
{

View File

@ -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();
}
}

View File

@ -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();
}