With SBARINFO and using DrawSelectedInventory instead of the other bar, etc. options, you can set it up so that your select buttons just cycle through the items and whatever is selected is used instantly the moment you hit use.
As far as I can tell, this functionality cannot be replicated in ZScript - DrawInventoryIcon still requires you to hit the use key once to "select" the already-selected thing, then hit use again to actually use it. A grossly suboptimal setup when you might need to use something quickly (while avoiding double-tapping by mistake and, e.g., using 2 25-point healing flasks to go from 74hp to 100hp).
ZSript status bar equivalent to DrawSelectedInventory
Moderator: GZDoom Developers
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZSript status bar equivalent to DrawSelectedInventory
Do you have an example of a statusbar that can do it?
Because from the look at the code it cannot be done. The decision making is outside the statusbar in the 'invuse' CCMD and solely depends on player.inventorytics.
It is possible to have this variable always 0 and then always draw the inventory bar, like Strife and the alternative HUD do. In that case the quick selection method will work.
Otherwise you need to code your status bar to not depend on this variable for visibility.
Because from the look at the code it cannot be done. The decision making is outside the statusbar in the 'invuse' CCMD and solely depends on player.inventorytics.
It is possible to have this variable always 0 and then always draw the inventory bar, like Strife and the alternative HUD do. In that case the quick selection method will work.
Otherwise you need to code your status bar to not depend on this variable for visibility.
- Matt
- Posts: 9696
- Joined: Sun Jan 04, 2004 5:37 pm
- Preferred Pronouns: They/Them
- Operating System Version (Optional): Debian Bullseye
- Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
- Contact:
Re: ZSript status bar equivalent to DrawSelectedInventory
Right here.
Spawn as custom (or pretty much anything other than doomguy or naturist), scroll to the medikit, hit use once, medikit "weapon" is raised immediately.
How does this inventorytics thing work? I think I see it... thanks!
EDIT: Confirmed it works: added "cplayer.inventorytics=0;" to Draw() and it does exactly what I need.
Spawn as custom (or pretty much anything other than doomguy or naturist), scroll to the medikit, hit use once, medikit "weapon" is raised immediately.
How does this inventorytics thing work? I think I see it... thanks!
EDIT: Confirmed it works: added "cplayer.inventorytics=0;" to Draw() and it does exactly what I need.