Hi there.
I'm looking for a way to enable the mugshot for the (default) minimal HUD without changing anything else.
I know is something simple, but I am no programmer, therefore I lack the knowledge to do so. I know it's related to the SBARINFO file though. So, if someone could spare me a few lines of code and tell me how to do it, I'd appreciate it.
*I'm using GZDoom by the way.
Mugshot on the minimal HUD (DOOM)
Moderators: GZDoom Developers, Raze 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.
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.
Re: Mugshot on the minimal HUD (DOOM)
Not quite. GZDoom has the old SBARINFO files for compatibility reasons (so I'm told that's the reason), but it actually uses ZScript nowadays for the HUD. In this case, the magic on the fullscreen HUD happens on the aptly named DrawFullScreenStuff function. All that really need to do to draw the mugshot is add the lineCP95 wrote:I know it's related to the SBARINFO file though
Code: Select all
DrawTexture(GetMugShot(5), (x, y), DI_ITEM_OFFSETS);
To explain this, DrawTexture is just a function to, well, draw a texture, that takes a few inputs. The first input, GetMugShot(5), is the texture to draw; GetMugShot is a function that gives you what the texture that represent the current mugshot is (5 is how many "bleeding" levels it has). (x,y) is where exactly to draw it on the screen, relative to the "center" (by default, this is the top left corner iirc). DI_ITEM_OFFSETS is a flag that says respect any image offsets on the texture.
As for actually including this, there are a couple ways to do so. One is to directly edit the file in GZDoom.pk3 (strongly recommended to NOT do this, the changes will be lost when you update GZDoom, among other problems), the other is to make yourself a mod that implements this. To do this, first include a MAPINFO file with the following information
Code: Select all
gameinfo
{
StatusbarClass = "MyCustomStatusbar"
}
Code: Select all
Version "4.3.3"
// The version of ZScript to use (usually the latest version at the time of writing this mod is fine)
class MyCustomStatusbar : DoomStatusBar
{
// We're gonna replace GZDoom's Fullscreen Key Drawing with our own
override void DrawFullscreenKeys ()
{
// Draw our custom texture
DrawTexture(GetMugShot(5), (90, 168), DI_ITEM_OFFSETS);
// Draw everything else the Doom Statusbar would normally do
Super.DrawFullscreenKeys();
}
}
- Attachments
-
- MyStatusBar.pk3
- The fullscreen HUD with the mugshot on it. You can add this to your autoload if you always want to use it.
- (648 Bytes) Downloaded 167 times
Re: Mugshot on the minimal HUD (DOOM)
Thank you for taking the time to help me. It works great!
- arnaldocsf
- Posts: 4
- Joined: Thu Apr 30, 2020 7:54 am
- Graphics Processor: Intel (Modern GZDoom)
Re: Mugshot on the minimal HUD (DOOM)
Strangely the pk3 don't work for me...
I tried to use the same code in my WAD too and nothing.
I tried to use the same code in my WAD too and nothing.
Re: Mugshot on the minimal HUD (DOOM)
I love this. It not only shows you the mugshot, but it also shows you when you have a berserk powerup active, which is very nice.