I’ve been trying, unsuccessfully, to get the vgui::Panel from Lua.
I’ve seen in gmcl_extras that you could obtain a vgui::VPANEL, which is a simple unsigned int, available to all modules, since there can be differences in the vtables (that’s what vgui::IPanel::GetPanel says).
I need to know how to do this, because I wanted to add some methods to DTextEntry, like SetWrap or SetFont.
Casting the user data to vgui::Panel from the Lua Panel object and using any of its methods crashes the game.
Casting it to vgui::VPANEL and then introducing it in vgui::IPanel::GetPanel works but it doesn’t return a TextEntry. It’s either the base GMod panel or an editable panel. Trying to get any of their children through vgui::IPanel::GetChild crashes the game.
Using the vgui::Panel returned by vgui::IPanel::GetPanel and obtaining it’s children through it doesn’t crash the game but the values are NULL.
I have even tried using the sigscanned function Get_Panel which should receive a integer for the stack position. Crashes as well.
I have extracted the classes Garry is using for his panels. They have slight differences but they have the same effect. Crashes the game.
Any help is appreciated.