feat: add ragequit option + hotkey (#925)
This commit is contained in:
parent
0214d85edd
commit
c25e7d3fad
16
src/backend/commands/system/fast_quit.cpp
Normal file
16
src/backend/commands/system/fast_quit.cpp
Normal 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);
|
||||
}
|
@ -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;
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user