StrataSource / Portal-2-Community-Edition

Task tracker for Portal 2: Community Edition
https://www.portal2communityedition.com
148 stars 3 forks source link

`CBasePlayer::GetButtons()` VScript function #1483

Closed vrad-exe closed 2 months ago

vrad-exe commented 1 year ago

Which component should be improved?

Entity

Describe your suggestion

Add a GetButtons() function which can be called on player entities and will return the m_nButtons field from code, which holds bit flags representing the various remappable inputs the player currently has pressed. This would allow for an easy way to read player inputs through VScript without having to rely on game_ui or other entities.

The bit fields from in_buttons.h should also be exposed to VScript as constants, so you don't have to work with the raw values.

JJL772 commented 2 months ago

Will be in next update