Added/modified HUD message wrappers.

This commit is contained in:
hlstriker 2013-11-04 04:11:22 +00:00 committed by squeek
parent 67c8b23b93
commit f77368db62
2 changed files with 26 additions and 31 deletions

View file

@ -2,7 +2,13 @@
#include "util.h"
#include "ff_sv_util.h"
void FF_UTIL_HudMessageAll(float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszFormat, ...)
void FF_UTIL_HudMessageAll(float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszMessage)
{
FF_UTIL_HudMessage(NULL, x, y, effect, color1, color2, fadeInTime, fadeOutTime, holdTime, fxTime, channel, pszMessage);
}
void FF_UTIL_HudMessageAllFormat(float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszFormat, ...)
{
char szMessage[512];
va_list argptr;
@ -10,6 +16,22 @@ void FF_UTIL_HudMessageAll(float x, float y, HUD_MSG_EFFECT effect, color32 colo
Q_vsnprintf(szMessage, sizeof(szMessage), pszFormat, argptr);
va_end(argptr);
FF_UTIL_HudMessage(NULL, x, y, effect, color1, color2, fadeInTime, fadeOutTime, holdTime, fxTime, channel, szMessage);
}
void FF_UTIL_HudMessageFormat(CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszFormat, ...)
{
char szMessage[512];
va_list argptr;
va_start(argptr, pszFormat);
Q_vsnprintf(szMessage, sizeof(szMessage), pszFormat, argptr);
va_end(argptr);
FF_UTIL_HudMessage(pToPlayer, x, y, effect, color1, color2, fadeInTime, fadeOutTime, holdTime, fxTime, channel, szMessage);
}
void FF_UTIL_HudMessage(CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszMessage)
{
hudtextparms_s params;
params.x = x;
params.y = y;
@ -28,34 +50,5 @@ void FF_UTIL_HudMessageAll(float x, float y, HUD_MSG_EFFECT effect, color32 colo
params.fxTime = fxTime;
params.channel = channel;
UTIL_HudMessageAll(params, szMessage);
}
void FF_UTIL_HudMessage(CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszFormat, ...)
{
char szMessage[512];
va_list argptr;
va_start(argptr, pszFormat);
Q_vsnprintf(szMessage, sizeof(szMessage), pszFormat, argptr);
va_end(argptr);
hudtextparms_s params;
params.x = x;
params.y = y;
params.effect = effect;
params.r1 = color1.r;
params.g1 = color1.g;
params.b1 = color1.b;
params.a1 = color1.a;
params.r2 = color2.r;
params.g2 = color2.g;
params.b2 = color2.b;
params.a2 = color2.a;
params.fadeinTime = fadeInTime;
params.fadeoutTime = fadeOutTime;
params.holdTime = holdTime;
params.fxTime = fxTime;
params.channel = channel;
UTIL_HudMessage(pToPlayer, params, szMessage);
UTIL_HudMessage(pToPlayer, params, pszMessage);
}

View file

@ -11,8 +11,10 @@ typedef enum
HUD_EFFECT_WRITE_OUT
} HUD_MSG_EFFECT;
void FF_UTIL_HudMessageAll( float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszFormat, ... );
void FF_UTIL_HudMessage( CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszFormat, ... );
void FF_UTIL_HudMessage( CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszMessage );
void FF_UTIL_HudMessageFormat( CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszFormat, ... );
void FF_UTIL_HudMessageAll( float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszMessage );
void FF_UTIL_HudMessageAllFormat( float x, float y, HUD_MSG_EFFECT effect, color32 color1, color32 color2, float fadeInTime, float fadeOutTime, float holdTime, float fxTime, int channel, const char *pszFormat, ... );
#endif //FF_SV_UTIL_H