Closed joshcancode closed 5 years ago
Dont check if(menuOpened) before drawing. zgui has its own checks in zgui.cpp at the top of the file in global_config struct.
debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug debug
Closing the issue as the OP is not providing any helpful information.
For some reason, injecting the cheat I'm working on causes my game to immediately crash. Here is my code for the menu.
`Color ToZGUI(zgui::color c) { Color col = Color(c.r, c.g, c.b, c.a); return col; }
void line(int x, int y, int x2, int y2, zgui::color c) noexcept { g_pSurface->Line(x, y, x2, y2, ToZGUI(c)); }
void rect(int x, int y, int x2, int y2, zgui::color c) noexcept { g_pSurface->OutlinedRect(x, y, x2, y2, ToZGUI(c)); }
void filled_rect(int x, int y, int x2, int y2, zgui::color c) noexcept { g_pSurface->FilledRect(x, y, x2, y2, ToZGUI(c)); }
void text(int x, int y, zgui::color c, int font, bool center, const char text) noexcept { g_pSurface->DrawSetTextColor(ToZGUI(c)); g_pSurface->DrawSetTextPos(x, y); g_pSurface->DrawSetTextFont(font); const char _input = text; size_t length = strlen(_input); wchar_t text_wchar[30]; mbstowcs_s(&length, text_wchar, _input, length); g_pSurface->DrawPrintText(text_wchar, strlen(text)); }
void get_text_size(unsigned long font, const char text, int& wide, int& tall) noexcept { g_pSurface->GetTextSize(font, (wchar_t)text, wide, tall); }
float get_frametime() noexcept { return g_pGlobalVars->frametime; }
void Menu::Initialize() { zgui::functions.draw_line = line; zgui::functions.draw_rect = rect; zgui::functions.draw_filled_rect = filled_rect; zgui::functions.draw_text = text; zgui::functions.get_text_size = get_text_size; }
void Menu::Render() { const unsigned long _font = Globals::CourierNew;
}`
Any ideas would be amazing.