Override draw of vgui DPropertySheet

I want to override the draw code of the DPropertySheet vgui element, but I can’t find any code to use as an override where it draws anything. I want to get rid of the rounded corners to make it fit in with the rest of my stuff.

Take a look at https://github.com/garrynewman/garrysmod/blob/master/garrysmod/lua/vgui/dpropertysheet.lua

I checked there, and it might just be me being stupid, but I couldn’t find any actual draw code. I looked through the DTab section, and it seems there’s no actual draw code.

PropertySheet and Tab use Derma_Hook() to draw.

You’ll have to look up the hook they use, which you can then search by name in the source code, which you can then implement as a paint hook.

It’s a pain in the ass.

So, the hook it’s on is “Button”, which is bound to get me waay too many results. Is there some way I can manually find it?

Take a look at derma/init.lua and derma/derma.lua. They contain how derma_hook works.

Are you wanting to implement this as a skin or just for a particular panel? It’s possible to just set



panel.Paint = function( panel, w, h ) 

end


I know I can do this, but I’m trying to find out what the default code is for drawing the stuff, so I don’t have to custom code one and miss something.

Now, I BELIEVE you can do self.BaseClass on this one and it MIGHT return the correct original paint function. If you’re planning to just add on to the panel’s drawing then this would work just fine.

Or if you don’t believe in thy holy BaseClass you can just store the original paint function as a local and overwrite it, adding it to the bottom.

[lua]
local p = propsheet.Paint
function propsheet:Paint(w,h)
–Your paint function
p(self,w,h)
end
[/lua]

This is all assuming you’re trying to just ADD onto the Derma_Hook rather than overwrite it.
If you’re overwriting it then you’ll have to see derma.lua

I’m trying to overwrite completely. I want to change the background to something that doesn’t look so shitty with the rounded corners and such.