Client: support game title fade-in
This commit is contained in:
parent
9ab028abd7
commit
b1365cce22
|
@ -58,6 +58,7 @@ struct
|
||||||
int m_iItemsOld;
|
int m_iItemsOld;
|
||||||
|
|
||||||
float m_flDamageIndicator;
|
float m_flDamageIndicator;
|
||||||
|
float m_flTitleAlpha;
|
||||||
} g_seatslocal[4], *pSeatLocal;
|
} g_seatslocal[4], *pSeatLocal;
|
||||||
|
|
||||||
void HUD_DrawAmmo1(void);
|
void HUD_DrawAmmo1(void);
|
||||||
|
|
|
@ -23,5 +23,39 @@ ClientGame_PreDraw(void)
|
||||||
void
|
void
|
||||||
ClientGame_PostDraw(void)
|
ClientGame_PostDraw(void)
|
||||||
{
|
{
|
||||||
|
if (pSeatLocal->m_flTitleAlpha > 0.0) {
|
||||||
|
vector title1Pos = g_hudmins + (g_hudres / 2) + [-238,-15];
|
||||||
|
vector title2Pos = g_hudmins + (g_hudres / 2) + [18,-15];
|
||||||
|
float titleAlpha = pSeatLocal->m_flTitleAlpha;
|
||||||
|
|
||||||
|
if (titleAlpha > 3.0)
|
||||||
|
titleAlpha = 4.0 - titleAlpha;
|
||||||
|
|
||||||
|
if (titleAlpha > 1.0)
|
||||||
|
titleAlpha = 1.0f;
|
||||||
|
|
||||||
|
drawsubpic(
|
||||||
|
title1Pos,
|
||||||
|
[256, 30],
|
||||||
|
g_hud4_spr,
|
||||||
|
[0, 226/256],
|
||||||
|
[1, 30/256],
|
||||||
|
[1,1,1] * titleAlpha,
|
||||||
|
1.0,
|
||||||
|
DRAWFLAG_ADDITIVE
|
||||||
|
);
|
||||||
|
|
||||||
|
drawsubpic(
|
||||||
|
title2Pos,
|
||||||
|
[220, 30],
|
||||||
|
g_hud5_spr,
|
||||||
|
[0, 226/256],
|
||||||
|
[220/256, 30/256],
|
||||||
|
[1,1,1] * titleAlpha,
|
||||||
|
1.0f,
|
||||||
|
DRAWFLAG_ADDITIVE
|
||||||
|
);
|
||||||
|
|
||||||
|
pSeatLocal->m_flTitleAlpha -= frametime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,12 @@ void
|
||||||
ClientGame_InitDone(void)
|
ClientGame_InitDone(void)
|
||||||
{
|
{
|
||||||
VGUI_ShowMOTD();
|
VGUI_ShowMOTD();
|
||||||
|
|
||||||
|
bool gameTitle = serverkeyfloat("gametitle");
|
||||||
|
|
||||||
|
if (gameTitle == true) {
|
||||||
|
pSeatLocal->m_flTitleAlpha = 4.0f;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -23,7 +23,7 @@ draw.qc
|
||||||
|
|
||||||
damage.qc
|
damage.qc
|
||||||
init.qc
|
init.qc
|
||||||
flashlight.qc
|
../../../valve/src/client/flashlight.qc
|
||||||
entities.qc
|
entities.qc
|
||||||
cmds.qc
|
cmds.qc
|
||||||
game_event.qc
|
game_event.qc
|
||||||
|
|
Loading…
Reference in New Issue