Added Pre and PostDraw functions for DModelPanel #932

Merged
merged 3 commits into from Jan 11, 2016

Projects

None yet

3 participants

@Exho1
Contributor
Exho1 commented Apr 22, 2015

Used just like Pre/PostPlayerDraw except for the DModelPanel entity. Return false on the Pre function to stop the rendering of the model and then you can modify the entity after its drawn in the Post function without having to override the DrawModel function. This can be used to set the material of the entity or take a pointshop-esque approach and render clientside models around the entity

I use this to draw clientside models onto a DModelPanel with pretty much the same code I have in PostPlayerDraw to draw the models onto the player.
https://github.com/Exho1/ScrapCombat/blob/master/lua/scraparmor/cl_inventory.lua#L130

@bmwalters
Contributor

Why not make it a PANEL hook (function for overriding on panel's table)? That seems more appropriate.

@Exho1
Contributor
Exho1 commented Apr 23, 2015

Good idea, I changed it. That way you could override those functions instead of having to override DrawModel itself

@Exho1 Exho1 changed the title from Added Pre and PostDraw hook for DModelPanel to Added Pre and PostDraw functions for DModelPanel Apr 23, 2015
@robotboy655
Collaborator

I seems to me that these should be called inside the scissor rect.

@Exho1
Contributor
Exho1 commented Apr 23, 2015

Alright, done

@robotboy655 robotboy655 merged commit f467268 into garrynewman:master Jan 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment