[SBARINFO] Separating Mugshots from Inventory

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
XLightningStormL
Posts: 394
Joined: Mon May 09, 2016 1:38 am
Location: Anywhere but here
Contact:

[SBARINFO] Separating Mugshots from Inventory

Post by XLightningStormL »

The title is pretty much self explanatory.

My project needs a new HUD, and so by extension I wanna separate drawing of the inventory from the mugshot, so they are both rendered, rather than having one or the other.
User avatar
Enjay
 
 
Posts: 26993
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: [SBARINFO] Separating Mugshots from Inventory

Post by Enjay »

If you look at the status bar definition in GZDoom.pk3, it looks like this:

Code: Select all

drawselectedinventory alternateonempty, INDEXFONT, 143, 168
{
	drawmugshot "STF", 5, 143, 168;
}
So, the mugshot is drawn when there is nothing in the inventory. To separate them, use a drawmugshot command on its own, not in braces following the inventory stuff.

e.g. here's one of mine:

Code: Select all

//Animated status icon thingy
drawmugshot "STF", 5, xdeathface, animatedgodmode, 11, -66;
and elsewhere in the definition

Code: Select all

//Inventory
//readied inventory item
drawselectedinventory alwaysshowcounter, ENJAYBARFONT, -40, -99;
Obviously, those positions and some other things will be of no use to you but the point is, make the inventory and status bar commands independent of each other and draw them in different locations on the screen from each other.
Post Reply

Return to “Scripting”