Hello, i will write it again 馃憤
im making an gui for an cheat for csgo, its working but when i pess the toggle key to toggle the menu the menu will stay and duplicate the buttons etc pic:

toggle code in hooks.cpp :
void Menu::Toggle()
{
_visible = !_visible;
cl_mouseenable->SetValue(!_visible);
}
in the main.cpp
`
InputSys::Get().Initialize();
InputSys::Get().RegisterHotkey(VK_MULTIPLY, base {
Menu::Get().Toggle();
});
`
how can i fix it so it will dissapear when i press the multiply key and shows when i press it again?
thanks!
Please:
1) Only post Minimal, Complete and Verifiable example code https://stackoverflow.com/help/mcve
2) State your problem and questions clearly and concisely.
3) Use github attachment system for pictures and not imgur,gyazo etc. so the issues are useful for future readers long after those hosting websites remove their files.
You have one attempt left!
Hello,
It is best practice to not make multiple posts and delete them right after as other people answers lose their meaning, but thanks for cleaning up.
Your screenshot suggest that you are calling your imgui functions more than once. If there are two sliders called "FOV" it means you called SliderFloat("FOV" ...) multiple times within a same imgui frame. This has nothing to do with the toggle logic you posted and it's probably another problem in your code.
ImGui frames runs from the call to ImGui::NewFrame() to the call ImGui::Render(). Anything you submit in there will display somewhere. If you call ImGui::Begin() multiple times with the same window name it will append to the existing window.
You just most likely have faulty logic that calls your GUI code multiple time. You can use a debugger to track it down.
Good luck.
Most helpful comment
Please:
1) Only post Minimal, Complete and Verifiable example code https://stackoverflow.com/help/mcve
2) State your problem and questions clearly and concisely.
3) Use github attachment system for pictures and not imgur,gyazo etc. so the issues are useful for future readers long after those hosting websites remove their files.
You have one attempt left!