feat: Vehicle control & Summon (#1175)

This commit is contained in:
DayibBaba
2023-04-05 19:54:29 +02:00
committed by GitHub
parent 24955f9019
commit 96d1c26242
21 changed files with 2106 additions and 49 deletions

View File

@ -12,7 +12,8 @@
namespace big
{
gui::gui() :
m_is_open(false)
m_is_open(false),
m_override_mouse(false)
{
g_renderer->add_dx_callback(view::gta_data, -1);
g_renderer->add_dx_callback(view::notifications, -2);
@ -28,9 +29,11 @@ namespace big
wndproc(hwnd, msg, wparam, lparam);
});
g_renderer->add_dx_callback(view::vehicle_control, 3);
g_renderer->add_dx_callback(esp::draw, 2); // TODO: move to ESP service
g_renderer->add_dx_callback(view::context_menu, 1);
dx_init();
g_gui = this;
@ -54,6 +57,13 @@ namespace big
toggle_mouse();
}
void gui::override_mouse(bool override)
{
m_override_mouse = override;
toggle_mouse();
}
void gui::dx_init()
{
static auto bgColor = ImVec4(0.09f, 0.094f, 0.129f, .9f);
@ -133,7 +143,7 @@ namespace big
void gui::script_on_tick()
{
if (g_gui->m_is_open)
if (g_gui->m_is_open || g_gui->m_override_mouse)
{
for (uint8_t i = 0; i <= 6; i++)
PAD::DISABLE_CONTROL_ACTION(2, i, true);
@ -212,7 +222,7 @@ namespace big
void gui::toggle_mouse()
{
if (m_is_open)
if (m_is_open || g_gui->m_override_mouse)
{
ImGui::GetIO().MouseDrawCursor = true;
ImGui::GetIO().ConfigFlags &= ~ImGuiConfigFlags_NoMouse;