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.
Which component should be improved?
Entity
Describe your suggestion
Add a
GetButtons()
function which can be called on player entities and will return them_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 ongame_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.