Forum posts

Posted 10 months ago2023-06-21 21:37:17 UTC
in Half-Life Decay HUD Problems Post #347641
Hey, thanks for letting me know. I really should of thought of that.
Posted 11 months ago2023-06-07 01:23:39 UTC
in Half-Life Decay HUD Problems Post #347586
Recently I have been attempting to fix the HUD for the 2008 Decay port, as the colors are incorrect and it has the yellow HUD divider issue. I got the custom colors themselves working, but I can't figure out how to get the Health divider to change with it. This is the code used to decide what color the HUD is.

int CHud::MsgFunc_ChangePlayer(const char *pszName, int iSize, void *pbuf )
{
BEGIN_READ( pbuf, iSize );
int m_iDecayId = READ_BYTE();

if (m_iDecayId == 1)
uColor = RGB_SILVERISH;
else
uColor = RGB_ORANGEISH;

return 1;
}

This system is what is used in the hud.cpp file, which changes the color depending on what character you are playing as. (m_iDecayId being 1 = Gina, any other number = Colette), this system works with no flaws and can easily detect what character is being played as, but this is where the problem arises. Not knowing much about C++ causes quite a few issues when trying to make code (obviously) so I hacked together this code which does not fully work.

int m_iDecayId = READ_BYTE();
if (m_iDecayId == 1)
FillRGBA(x, y, iWidth, iHeight, 160, 160, 192, a);
else
FillRGBA(x, y, iWidth, iHeight, 255, 128, 64, a);
}

It never counts "m_iDecayId" as being 1 and is always "255, 128, 64" even though the rest of the HUD is the "160, 160, 192" color, which clearly shows that "m_iDecayId" is at 1. It seems the main issue is the health.cpp file doesn't detect what number "m_iDecayId" is at, meaning there must be a way to cache it into the file, but as shown I have no idea how to do that. Any clue how to?