Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Pre and PostDraw functions for DModelPanel #932

Merged
merged 3 commits into from
Jan 11, 2016

Conversation

Exho1
Copy link
Contributor

@Exho1 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
Copy link
Contributor

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

@Exho1
Copy link
Contributor Author

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 Added Pre and PostDraw hook for DModelPanel Added Pre and PostDraw functions for DModelPanel Apr 23, 2015
@robotboy655
Copy link
Collaborator

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

@Exho1
Copy link
Contributor Author

Exho1 commented Apr 23, 2015

Alright, done

robotboy655 added a commit that referenced this pull request Jan 11, 2016
Added Pre and PostDraw functions for DModelPanel
@robotboy655 robotboy655 merged commit f467268 into Facepunch:master Jan 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants