Reload a custom derma control?

Is there any way to reload a custom derma control other than using the reload console command? Takes forever to test small changes.

You could always use lua_openscript_cl and put the script you’re reloading in your lua folder :slight_smile:

Or use luapad, etc.

That doesn’t reload the control though.

I think I read somewhere in the gmod 13 subforum that it currently wasn’t possible and someone wanted it fixed. I might be wrong. Maybe it was just vgui for tools or something.

Oh, sorry. I see what you mean now.
Hmm, are you doing this on Garry’s Mod 13 or 12?

13, I don’t think there’s a way on either though.

The functions in the registered tabled are hardcopied to the created controls, so your only way would be to route each function to a global variable, and reload that global instead.


function PANEL:Paint(w, h)
    PANEL_Paint(self, w, h)
end

function PANEL_Paint(self, w, h)
    --  Draw here.
end

I recommend using this for development only, and moving the code inside the globals into their respective Panel functions when you are done.

You sir, are a freaking saint. Thank you!