zxvnme / zgui Goto Github PK
View Code? Open in Web Editor NEWzxvnme's graphical user interface
License: MIT License
zxvnme's graphical user interface
License: MIT License
title relatively says it all, just wanted to point this out.
Jak dodac te menu mozesz jakoś bardziej to wytłumaczyc?
Czy byłbyś wstanie dodać takie menu do stickrpghooka? byłbym bardzo wdzięczny
its trying to reference a file thats not used or referenced saying cannot open source file zgui-master\zgui.cc
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))
i'm trying to add some gradients from xy0, but when i'm trying to make them into "context.window.render" functions rater then "render::" (so i can draw over stuff), i don't get the output i'm looking for...
not wanted output, but draws over stuff:
https://i.imgur.com/HNbvpKz.png
void GradientH(float x, float y, float w, float h, color c1, color c2)
{
context.window.render.emplace_back(zgui::zgui_control_render_t{ {x, y}, zgui::zgui_render_type::zgui_filled_rect, c1, "", {w, h} });
BYTE first = c2.r;
BYTE second = c2.g;
BYTE third = c2.b;
for (float i = 0; i < w; i++)
{
float fi = i, fw = w;
float a = fi / fw;
/*DWORD*/float ia = a * 255;
context.window.render.emplace_back(zgui::zgui_control_render_t{ {x + i, y}, zgui::zgui_render_type::zgui_filled_rect, color(first, second, third, ia), "", {1, h} });
}
}
wanted output, but not drawing over stuff:
https://i.imgur.com/NCdyjgD.png
void GradientH(float x, float y, float w, float h, color c1, color c2)
{
render::filled_rect(x, y, w, h, c1);
BYTE first = c2.r;
BYTE second = c2.g;
BYTE third = c2.b;
for (float i = 0; i < w; i++)
{
float fi = i, fw = w;
float a = fi / fw;
/*DWORD*/float ia = a * 255;
render::filled_rect(x + i, y, 1, h, color(first, second, third, ia));
}
}
any help is greatly appreciated, ive looked over this about 10 times, and cant seem to understand why it doesn't work.
so im tryna make 2 groupboxes, one on the left and one on the right.
i tried using sameline after the end of the first groupbox and its not working.
is there a special thingy that i can use?
`
zgui::begin_groupbox("chams", zgui::vec2{ 235,311 });
zgui::checkbox("enemy chams", variables.visuals.chams.bool_enemy);
zgui::slider_int("enemy red", 0, 255, variables.visuals.chams.color_enemy[0]);
zgui::slider_int("enemy green", 0, 255, variables.visuals.chams.color_enemy[1]);
zgui::slider_int("enemy blue", 0, 255, variables.visuals.chams.color_enemy[2]);
zgui::slider_int("enemy alpha", 0, 255, variables.visuals.chams.color_enemy[3]);
zgui::end_groupbox();
zgui::same_line();
zgui::begin_groupbox("fakelag", zgui::vec2{ 235,311 });
zgui::checkbox("fakelag", variables.misc.bool_fakelag);
zgui::slider_int("fakelag value", 0, 14, variables.misc.int_fakelag);
zgui::end_groupbox();
`
https://imgur.com/a/Aq2w1xt
zxvnmeToday at 10:48 PM
u can make issue on github with idea of adding something like function for rendering tabs so i wont forget about implementing it when i will continue zgui
very detailed request
Menu doesn't resize on move or the menu elements.
I'm calling this in present btw.
The text moves accordingly but nothing else also I will post a fix if I find one.
Setting up like this:
`
void line(int x, int y, int x2, int y2, zgui::color c) noexcept
{
g_render.Line(x, y, x2, y2, { c.r, c.g, c.b, c.a });
}
void rect(int x, int y, int x2, int y2, zgui::color c) noexcept
{ /* draw outlined rectangle using your renderer /
g_render.Rect(x, y, x2, y2, { c.r, c.g, c.b, c.a });
}
void filled_rect(int x, int y, int x2, int y2, zgui::color c) noexcept
{ / draw filled rectangle using your renderer /
g_render.RectFilled(x, y, x2, y2, { c.r, c.g, c.b, c.a });
}
void text(int x, int y, zgui::color color, int font, bool center, const char text) noexcept
{ /* draw text using your renderer /
g_render.String(x, y, center ? FONT_CENTERED_X | FONT_DROPSHADOW : FONT_DROPSHADOW, { color.r, color.g, color.b, color.a }, g_fonts.fonts[font], text);
}
void get_text_size(unsigned long font, const char text, int& wide, int& tall) noexcept
{ /* calculate text size here /
auto p = get_text_dimensions(g_fonts.fonts[font], true, text); wide = p.x; tall = p.y;
}
float get_frametime() noexcept
{ / return frametime */
return g_globals->absoluteframetime;
}
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;
zgui::functions.get_frametime = get_frametime;
`
Rendering:
`
void zgui_menu::render()
{
zgui::poll_input("Counter-Strike: Global Offensive");
static bool example = false;
static int example_int = 10;
if (zgui::begin_window("zgui example window", { 500, 350 }, FONT_ESP, zgui::zgui_window_flags_none))
{
zgui::checkbox("sample checkbox #example", example);
// value before hash is visible ^
zgui::slider_int("#sample_slider", 0, 40, example_int);
// ^ value after hash is hidden"
//
// Hashing is demystified in zgui.hh
// Search for [hashing controls names] to get more details.
zgui::end_window();
}
}
`
quick question, after looking at the documentation I don't really understand how where supposed to import or add fonts? If someone who knows how to import fonts or the storage type of fonts that we can import that would be a appreciated!
As in the title of this topic I have suggestions to add a ready-made source with this menu, because many people can't add it to their cheats and such a ready-made source will help a lot ;)
Describe the bug
Sliders, Comboboxes, Keybind, every zgui's elements (except the checkbox) don't get triggered if you didn't trigger a tab or checkbox before. GIF : https://i.imgur.com/CqSEziy.gifv
Also bug when you first open the menu.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The selected element should get triggered.
menu input works completely fine on fullscreen, but not in windowed mode.
calling in painttraverse:
auto panel_to_draw = fnv::hash(interfaces::panel->get_panel_name(panel));
switch (panel_to_draw) {
case fnv::hash("MatSystemTopPanel"):
g_Menu.Render();
break;
case fnv::hash("FocusOverlayPanel"):
interfaces::panel->set_keyboard_input_enabled(panel, g_Menu.menuOpened);
interfaces::panel->set_mouse_input_enabled(panel, g_Menu.menuOpened);
break;
}
any help?
I know it may have nothing to do with the framework, but std::string_view doesn't work, even when included in the same file.
"namespace 'std' has no member 'string_view'"
I am using Visual Studio 2019, with 2013 and 2017 redistributables installed.
Describe the bug
When clicking on a listbox, combobox, multicombobox, the thing under the list appearing get triggered too, here is a gif to understand me better.
https://i.imgur.com/9ECDCqa.gifv
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Only the opened element should get triggered.
Screenshots
See the gif ^
Describe the bug
draw_filled_rectangle is crashing on menu open, not sure why.
Expected behavior
Open and draw a rectangle
Screenshots
https://i.imgur.com/sCEXOoL.png
Additional context
First implementation of zgui
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;
static bool _pressed = true;
if (!_pressed && GetAsyncKeyState(VK_INSERT))
_pressed = true;
else if (_pressed && !GetAsyncKeyState(VK_INSERT))
{
_pressed = false;
menuOpened = !menuOpened;
}
g_InputSystem->EnableInput(!menuOpened);
if (menuOpened)
{
zgui::poll_input("Counter-Strike: Global Offensive");
if (zgui::begin_window("zgui example window", { 500, 350 }, _font, zgui::zgui_window_flags_none))
{
zgui::text("sample checkbox #example");
zgui::end_window();
}
}
}`
Any ideas would be amazing.
I want to change the font code of other languages. How can I change it, such as Chinese, Turkish, Russian?
hey guys im new to this stuff and not really good at c++ but my menu isnt rendering onto my canvas and its just blocking all input until I toggle it using insert here's my code:
void renderMenu()
{
zgui::poll_input("Counter-Strike: Global Offensive");
if (zgui::begin_window("test", { 380, 520 }, zgui::zgui_window_flags_none)) {
zgui::begin_groupbox("test", { 375, 515 }, zgui::zgui_window_flags_none);
bool esp = false;
zgui::checkbox("esp toggle", esp);
zgui::end_groupbox();
}
zgui::end_window();
}
any help is appreciated
Line 19 in 4bb9bbc
Hello, I'm no. 1 fan of you, your project and C++17. I just don't understand why did you leave our FunnyBucket 💔
Just implemented zgui, went fairly well. Running into issues with:
const int fade_factor = static_cast<int>(1.0f / 0.15f * functions.get_frametime() * 255); //crashing here
inside of the:
bool zgui::begin_window
Just rendering a test window, everything is implemented.
I have a mistake in the csgo game in the title.
when I don't have the console turned on, I can't choose anything from the menu and if I have it turned on, yes.
I'm using designer1337's csgo cheat base(propably not relevant, but mentioning it incase it is) with zgui, and when I'm using a text input field, the number 2 (above W, not the numpad 2) gets detected 3 times per keystroke. first two times it writes a 2, and a third time it writes a whitespace character or something like that.
Not sure if this is a reproducible issue, but I've fixed it by isolating the qwerty numbers into another else-if:
else if (i > 47 && i <= 57) {
if (utils::input::key_pressed(i)) {
for (int j = 0; j < 10; j++) {
if(special_characters[j].vk == i)
value += utils::input::key_down(VK_SHIFT) ? special_characters[j].shift : special_characters[j].regular;
}
}
}
When my menu is open I can still shoot my weapon
Gif: https://gyazo.com/6a641474a6578ff4d3e6c9209af4677c
I have LockCursor hooked
Describe the bug
Checkboxes are not working for me.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would think the checkbox would check but it doesn't.
Screenshots
No screenshot to add.
Desktop (please complete the following information):
Describe the solution you'd like
Scrolling for group boxes.
Describe alternatives you've considered
Pagination, drawing buttons with numbers to switch pages.
Additional context
No additional context.
Is your feature request related to a problem? Please describe.
Font Override could be related to a problem if you're somewhat lazy, or if you're new to using said framework and rendering methods. It would make life easier for the developer using ZGUI by allowing them to change fonts in their menu on the fly.
Describe the solution you'd like
A solution to said "issue" is to make a font override function in the source code similar to the "same_line" or "next_column" functions. You would call it before the controls you want the function to apply to and afterwards it will take effect on the controls.
example:
zgui::override_font(menufont_2); zgui::checkbox("Checkbox with menufont_2 #Checkbox", bool);
Describe alternatives you've considered
You can obviously go ahead and manually change all fonts for controls in the source of the framework, however that takes quite a bit of time and fiddling around with code, or looking at things. I think this function will be beneficial to most people as some people might want to have a big flashy font for their window header, and a subtle but clean font for their controls inside of their window.
add no move window flag, it can be useful in desktop apps.
https://gyazo.com/198be1718da767d768b6760798a514a4
Im hooking on paint traverse as scene end isnt working, whenever i drag the menu it just resizes?
Hello... if anyone could help that would be awesome. im new to coding and i followed the steps till i got to the embedding process. then i got stuck. can this be made into a dll or exe even? if anyone could get back to me that would be great!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.