Coder Social home page Coder Social logo

Comments (10)

otvv avatar otvv commented on June 13, 2024 1

It's crashing everytime if press menu key (default home key), i guess everything with is_button_down is fine cuz it's working now, but it's crashing on draw_colored_text

Yeah, this draw_colored_function doesn't seem to work on Windows on the same way it works on Linux. (Using just the vtable index.) I would suggest to just use the other method of drawing text on surface.

draw_set_text_pos(x, y);
draw_set_text_font(font);
draw_set_text_color(color.r(), color.g(), color.b() color.a( ));
draw_print_text(text.c_str(), string_length(text.c_str());

from fgui.

otvv avatar otvv commented on June 13, 2024 1

Try setting up m_bClippingEnabled, like I do on ruvi

 *csgo::vgui_surface->m_bClippingEnabled() = true;
 fgui::handler::render_window();
 *csgo::vgui_surface->m_bClippingEnabled() = false;

The offset on Windows should be 0x280.

from fgui.

designer1337 avatar designer1337 commented on June 13, 2024 1

Try setting up m_bClippingEnabled, like I do on ruvi

 *csgo::vgui_surface->m_bClippingEnabled() = true;
 fgui::handler::render_window();
 *csgo::vgui_surface->m_bClippingEnabled() = false;

The offset on Windows should be 0x280.

got it working!
https://i.imgur.com/AgJOiDb.png

the problem was

void draw::outline(int x, int y, int w, int h, fgui::color color) {

	interfaces::surface->set_drawing_color(color.m_red, color.m_green, color.m_blue,
		color.m_alpha);
	interfaces::surface->draw_outlined_rect(x, y, w, h);
	//	interfaces::surface->draw_outlined_rect(x, y, x + w, y + h);
}
	void draw_outlined_rect(int x, int y, int w, int h) {
		using original_fn = void(__thiscall*)(i_surface*, int, int, int, int);
		return (*(original_fn * *)this)[18](this, x, y, x + w, y + h); // cuz im doing my math already in surface class, same for filled rect
	}

great framework, thanks for ur help! <3

from fgui.

otvv avatar otvv commented on June 13, 2024 1

got it working!
https://i.imgur.com/AgJOiDb.png

the problem was

void draw::outline(int x, int y, int w, int h, fgui::color color) {

	interfaces::surface->set_drawing_color(color.m_red, color.m_green, color.m_blue,
		color.m_alpha);
	interfaces::surface->draw_outlined_rect(x, y, w, h);
	//	interfaces::surface->draw_outlined_rect(x, y, x + w, y + h);
}
	void draw_outlined_rect(int x, int y, int w, int h) {
		using original_fn = void(__thiscall*)(i_surface*, int, int, int, int);
		return (*(original_fn * *)this)[18](this, x, y, x + w, y + h); // cuz im doing my math already in surface class, same for filled rect
	}

great framework, thanks for ur help! <3

No problem! Glad I could help.

from fgui.

designer1337 avatar designer1337 commented on June 13, 2024

edit: throws me to this func after pressing home key

	void draw_colored_text(unsigned long font, int x, int y, int red, int green, int blue, int alpha, const char* text) {
		using original_fn = void(__thiscall*)(i_surface*, unsigned long, int, int, int, int, int, int, const char*);
		return (*(original_fn * *)this)[163](this, font, x, y, red, green, blue, alpha, text);
	}

call stack:
https://i.imgur.com/CM0RvxT.png

from fgui.

otvv avatar otvv commented on June 13, 2024

Does it crash whenever you press a key or it crashes when you inject your cheat? The callback wasn't very helpful, since it didn't show me where on the framework is the call for get_key_state coming from.

from fgui.

designer1337 avatar designer1337 commented on June 13, 2024

Does it crash whenever you press a key or it crashes when you inject your cheat? The callback wasn't very helpful, since it didn't show me where on the framework is the call for get_key_state coming from.

It's crashing everytime if press menu key (default home key), i guess everything with is_button_down is fine cuz it's working now, but it's crashing on draw_colored_text

from fgui.

designer1337 avatar designer1337 commented on June 13, 2024

It's crashing everytime if press menu key (default home key), i guess everything with is_button_down is fine cuz it's working now, but it's crashing on draw_colored_text

Yeah, this draw_colored_function doesn't seem to work on Windows on the same way it works on Linux. (Using just the vtable index.) I would suggest to just use the other method of drawing text on surface.

draw_set_text_pos(x, y);
draw_set_text_font(font);
draw_set_text_color(color.r(), color.g(), color.b() color.a( ));
draw_print_text(text.c_str(), string_length(text.c_str());

got it working by replacing draw_text func:

void draw::text(int x, int y, fgui::color color, unsigned long font, std::string_view text) {
	const auto converted_text = std::wstring(text.begin(), text.end());

	interfaces::surface->set_text_color(color.m_red, color.m_green, color.m_blue, color.m_alpha);
	interfaces::surface->draw_text_font(font);
	interfaces::surface->draw_text_pos(x, y);
	interfaces::surface->draw_render_text(converted_text.c_str(), wcslen(converted_text.c_str()));
}

but seems like i have problems with few drawing functions, cuz it looks like this:
https://i.imgur.com/9RUIz2l.png

from fgui.

otvv avatar otvv commented on June 13, 2024

Thats weird.. Can you show me your render manager? Or is it the same as the one from ruvi-sdk?

from fgui.

designer1337 avatar designer1337 commented on June 13, 2024

Thats weird.. Can you show me your render manager? Or is it the same as the one from ruvi-sdk?

it's from ruvi with some changes
https://pastebin.com/Vqf0Jrkp

isurface:
https://pastebin.com/SMwqSRYz

idk if this might be a issue but im not setting m_bClippingEnabled to true/false cuz i can't find actual one for windows

from fgui.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.