zxvnme / zgui

zxvnme's graphical user interface
MIT License
399 stars 53 forks source link

[BUG] menu opened check is not working. #57

Closed designer1337 closed 5 years ago

designer1337 commented 5 years ago

as title says, i can't lock cursor in csgo cuz opened check is not working.

void __stdcall hooks::lockcursor_hk(void* ecx) {
    if (zgui::gui_window_context_t().opened) {
        interfaces::surface->unlock_cursor();
        return;
    }
    else
        return ((void(__thiscall*)(void*)) o_lockcursor)(interfaces::surface);
}

for example, this code won't work: if (zgui::gui_window_context_t().opened)

but ghetto check like this is working fine: if (GetKeyState(VK_INSERT))

NaiJii commented 5 years ago

Dude, just do it the normal way and not the ghetto way while it doesn't work : if (!(flags & zgui_window_flags_always_open)) { if (utils::input::key_pressed(global_config.menu_toggle_key)) { context.window.opened = !context.window.opened; menu::opened = !menu::opened; }

In begin_window

designer1337 commented 5 years ago

begin_window

it's not about ghetto way but about is_open check not working lol, why should i create another bool for checking opened menu if there's already not working zgui one?

NaiJii commented 5 years ago

begin_window

it's not about ghetto way but about is_open check not working lol, why should i create another bool for checking opened menu if there's already not working zgui one?

I'm just saying while there is no fixes yet, you can do this instead of the ghetto thing you did

zxvnme commented 5 years ago

Thanks for reporting that @designer1337 . Fix will be on master branch in about 15 minutes ❤️

designer1337 commented 5 years ago

begin_window

it's not about ghetto way but about is_open check not working lol, why should i create another bool for checking opened menu if there's already not working zgui one?

I'm just saying while there is no fixes yet, you can do this instead of the ghetto thing you did

uhh my bad then, but i already did that in my sdk. GetKeyState is used just to show what i mean.

NaiJii commented 5 years ago

begin_window

it's not about ghetto way but about is_open check not working lol, why should i create another bool for checking opened menu if there's already not working zgui one?

I'm just saying while there is no fixes yet, you can do this instead of the ghetto thing you did

uhh my bad then, but i already did that in my sdk. GetKeyState was just to show what i mean.

Nah, my bad, i'm not actually talking about the bug so i'm off topic. But yeah i can agree it's not working atm

designer1337 commented 5 years ago

Thanks for reporting that @designer1337 . Fix will be on master branch in about 15 minutes ❤️

thanks for quick reply :)

zxvnme commented 5 years ago