feat(Settings): Added rebinding of menu toggle
This commit is contained in:
parent
1ad337492a
commit
c922f4d498
@ -70,6 +70,17 @@ struct globals {
|
||||
frame_flags frame_flags{};
|
||||
};
|
||||
|
||||
struct settings {
|
||||
struct hotkeys
|
||||
{
|
||||
bool editing_menu_toggle = false;
|
||||
int menu_toggle = VK_INSERT;
|
||||
int teleport_waypoint = 0;
|
||||
};
|
||||
|
||||
hotkeys hotkeys{};
|
||||
};
|
||||
|
||||
struct spoofing
|
||||
{
|
||||
bool spoof_username = false;
|
||||
@ -126,6 +137,7 @@ struct globals {
|
||||
player player{};
|
||||
protections protections{};
|
||||
self self{};
|
||||
settings settings{};
|
||||
spoofing spoofing{};
|
||||
vehicle vehicle{};
|
||||
weapons weapons{};
|
||||
@ -167,6 +179,8 @@ struct globals {
|
||||
this->self.frame_flags.fire_ammo = j["self"]["frame_flags"]["fire_ammo"];
|
||||
this->self.frame_flags.super_jump = j["self"]["frame_flags"]["super_jump"];
|
||||
|
||||
this->settings.hotkeys.menu_toggle = j["settings"]["hotkeys"]["menu_toggle"];
|
||||
|
||||
this->spoofing.spoof_ip = j["spoofing"]["spoof_ip"];
|
||||
this->spoofing.spoof_rockstar_id = j["spoofing"]["spoof_rockstar_id"];
|
||||
this->spoofing.spoof_username = j["spoofing"]["spoof_username"];
|
||||
@ -253,6 +267,14 @@ struct globals {
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"settings", {
|
||||
{ "hotkeys", {
|
||||
{ "menu_toggle", this->settings.hotkeys.menu_toggle }
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"spoofing", {
|
||||
{ "spoof_ip", this->spoofing.spoof_ip },
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "main_tabs.hpp"
|
||||
#include "widgets/imgui_hotkey.hpp"
|
||||
|
||||
namespace big
|
||||
{
|
||||
@ -6,6 +7,27 @@ namespace big
|
||||
{
|
||||
if (ImGui::BeginTabItem("Settings"))
|
||||
{
|
||||
if (ImGui::TreeNode("Hotkeys"))
|
||||
{
|
||||
ImGui::PushItemWidth(350.f);
|
||||
ImGui::BeginGroup();
|
||||
|
||||
if (ImGui::Hotkey("Menu Toggle", &g.settings.hotkeys.menu_toggle))
|
||||
g.settings.hotkeys.editing_menu_toggle = true; // make our menu reappear
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::SameLine();
|
||||
ImGui::BeginGroup();
|
||||
|
||||
ImGui::Text("(Below hotkey is not implemented)");
|
||||
ImGui::Hotkey("Teleport to waypoint", &g.settings.hotkeys.teleport_waypoint);
|
||||
|
||||
ImGui::EndGroup();
|
||||
ImGui::PopItemWidth();
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
||||
if (ImGui::TreeNode("Protections"))
|
||||
{
|
||||
ImGui::Checkbox("Bounty", &g.protections.script_events.bounty);
|
||||
|
@ -107,7 +107,7 @@ namespace big
|
||||
|
||||
void renderer::wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
{
|
||||
if (msg == WM_KEYUP && wparam == VK_INSERT)
|
||||
if (msg == WM_KEYUP && wparam == g.settings.hotkeys.menu_toggle)
|
||||
{
|
||||
//Persist and restore the cursor position between menu instances.
|
||||
static POINT cursor_coords{};
|
||||
@ -120,10 +120,11 @@ namespace big
|
||||
SetCursorPos(cursor_coords.x, cursor_coords.y);
|
||||
}
|
||||
|
||||
g_gui.m_opened ^= true;
|
||||
g_gui.m_opened = g.settings.hotkeys.editing_menu_toggle || !g_gui.m_opened;
|
||||
if (g.settings.hotkeys.editing_menu_toggle)
|
||||
g.settings.hotkeys.editing_menu_toggle = false;
|
||||
}
|
||||
|
||||
|
||||
if (g_gui.m_opened)
|
||||
{
|
||||
ImGui_ImplWin32_WndProcHandler(hwnd, msg, wparam, lparam);
|
||||
|
Reference in New Issue
Block a user