When making a ZScript status bar, how do you query what the currently-selected inventory hotbar is?
Posted: Sun Nov 06, 2022 5:19 pm
So, I'm working on an update for Shotgunnery mod, and I've rigged an item that's toggled on an off instead of being consumed like a normal invbar powerup. I wanted to have it so, when this toggleable powerup is the one currently selected, its icon changes either depending on if it's on, or possibly depending on if you have any charges of it available. Either way, I figured the logical way to do that, since I don't see any way to modify Inventory.Icon mid-game, would be for the part of the statusbar that shows the current inventory item to only display its normal item if some other item is currently selected.
Then, if the toggleable powerup is the one currently selected, have it then display one of two different images depending on the chosen criteria. I'd also be able to use this if statement so that it shows the amount of charges where the powerup's quantity would normally go.
I see this in the status bar I'm using:
CPlayer.mo.InvSel != null
However, I have yet to figure out how to use this to ask if the current selection is a specific item. What would I need to do to actually get a check for whether CPlayer.mo.InvSel it a specifc desired item?
Then, if the toggleable powerup is the one currently selected, have it then display one of two different images depending on the chosen criteria. I'd also be able to use this if statement so that it shows the amount of charges where the powerup's quantity would normally go.
I see this in the status bar I'm using:
CPlayer.mo.InvSel != null
However, I have yet to figure out how to use this to ask if the current selection is a specific item. What would I need to do to actually get a check for whether CPlayer.mo.InvSel it a specifc desired item?