diff --git a/mp/src/game/server/ff/ff_sv_util.cpp b/mp/src/game/server/ff/ff_sv_util.cpp index 225bf4ad..89fd86ad 100644 --- a/mp/src/game/server/ff/ff_sv_util.cpp +++ b/mp/src/game/server/ff/ff_sv_util.cpp @@ -2,36 +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) { - 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_HudMessageAll(params, szMessage); + FF_UTIL_HudMessage(NULL, x, y, effect, color1, color2, fadeInTime, fadeOutTime, holdTime, fxTime, channel, pszMessage); } -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_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; @@ -39,6 +16,22 @@ void FF_UTIL_HudMessage(CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT 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; @@ -57,5 +50,5 @@ void FF_UTIL_HudMessage(CBasePlayer *pToPlayer, float x, float y, HUD_MSG_EFFECT params.fxTime = fxTime; params.channel = channel; - UTIL_HudMessage(pToPlayer, params, szMessage); -} \ No newline at end of file + UTIL_HudMessage(pToPlayer, params, pszMessage); +} diff --git a/mp/src/game/server/ff/ff_sv_util.h b/mp/src/game/server/ff/ff_sv_util.h index 2ae6e154..e35383b8 100644 --- a/mp/src/game/server/ff/ff_sv_util.h +++ b/mp/src/game/server/ff/ff_sv_util.h @@ -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