Browse Source

Show new HUD elements.

dmc
Night Owl 7 years ago
parent
commit
8ad4fa6937
  1. 12
      cl_dll/3wave/CTF_FlagStatus.cpp
  2. 7
      cl_dll/3wave/CTF_HudMessage.cpp
  3. 2
      cl_dll/CMakeLists.txt
  4. 4
      cl_dll/hud.cpp
  5. 71
      cl_dll/hud.h

12
cl_dll/3wave/CTF_FlagStatus.cpp

@ -26,8 +26,8 @@
#include "pm_materials.h" #include "pm_materials.h"
#include "ref_params.h" #include "ref_params.h"
#include <string.h> #include <string.h>
#include "vgui_viewport.h" //#include "vgui_viewport.h"
#include "vgui_ScorePanel.h" //#include "vgui_ScorePanel.h"
#define RED_FLAG_STOLE 1 #define RED_FLAG_STOLE 1
#define BLUE_FLAG_STOLE 2 #define BLUE_FLAG_STOLE 2
@ -247,10 +247,10 @@ int CHudFlagStatus::MsgFunc_FlagCarrier(const char *pszName, int iSize, void *pb
} }
} }
if ( !bRedFlag ) if ( !bRedFlag );
gViewPort->m_pScoreBoard->m_pImages[ 5 ]->setVisible( false ); //gViewPort->m_pScoreBoard->m_pImages[ 5 ]->setVisible( false );
if ( !bBlueFlag ) if ( !bBlueFlag );
gViewPort->m_pScoreBoard->m_pImages[ 4 ]->setVisible( false ); //gViewPort->m_pScoreBoard->m_pImages[ 4 ]->setVisible( false );
return 1; return 1;
} }

7
cl_dll/3wave/CTF_HudMessage.cpp

@ -60,14 +60,14 @@ char *sBonusStrings[] =
DECLARE_MESSAGE(m_Bonus, Bonus) DECLARE_MESSAGE(m_Bonus, Bonus)
struct bonus_info_t typedef struct bonus_info_s
{ {
int iSlot; int iSlot;
int iType; int iType;
bool bActive; bool bActive;
float flBonusTime; float flBonusTime;
char sPlayerName[64]; char sPlayerName[64];
}; } bonus_info_t;
bonus_info_t g_PlayerBonus[MAX_BONUS+1]; bonus_info_t g_PlayerBonus[MAX_BONUS+1];
@ -159,9 +159,10 @@ int CHudBonus ::Draw(float flTime )
int CHudBonus::MsgFunc_Bonus(const char *pszName, int iSize, void *pbuf) int CHudBonus::MsgFunc_Bonus(const char *pszName, int iSize, void *pbuf)
{ {
int index;
BEGIN_READ( pbuf, iSize ); BEGIN_READ( pbuf, iSize );
for ( int index = 1; index < MAX_BONUS + 1; index++) for ( index = 1; index < MAX_BONUS + 1; index++)
{ {
//Find wich one is not used //Find wich one is not used
if ( g_PlayerBonus[ index ].bActive == false ) if ( g_PlayerBonus[ index ].bActive == false )

2
cl_dll/CMakeLists.txt

@ -45,6 +45,8 @@ endif()
set (CLDLL_SOURCES set (CLDLL_SOURCES
3wave/CTF_FlagStatus.cpp
3wave/CTF_HudMessage.cpp
dmc/DMC_Teleporters.cpp dmc/DMC_Teleporters.cpp
ev_hldm.cpp ev_hldm.cpp
../dlls/dmc/quake_gun.cpp ../dlls/dmc/quake_gun.cpp

4
cl_dll/hud.cpp

@ -179,6 +179,8 @@ void CHud::Init( void )
m_StatusIcons.Init(); m_StatusIcons.Init();
m_MOTD.Init(); m_MOTD.Init();
m_Scoreboard.Init(); m_Scoreboard.Init();
m_FlagStat.Init();
m_Bonus.Init();
m_Menu.Init(); m_Menu.Init();
@ -361,6 +363,8 @@ void CHud::VidInit( void )
m_Spectator.VidInit(); m_Spectator.VidInit();
m_Scoreboard.VidInit(); m_Scoreboard.VidInit();
m_MOTD.VidInit(); m_MOTD.VidInit();
m_FlagStat.VidInit();
m_Bonus.VidInit();
} }
int CHud::MsgFunc_Logo( const char *pszName, int iSize, void *pbuf ) int CHud::MsgFunc_Logo( const char *pszName, int iSize, void *pbuf )

71
cl_dll/hud.h

@ -343,6 +343,7 @@ struct extra_player_info_t
short playerclass; short playerclass;
short teamnumber; short teamnumber;
char teamname[MAX_TEAM_NAME]; char teamname[MAX_TEAM_NAME];
int iHasFlag;
}; };
struct team_info_t struct team_info_t
@ -577,6 +578,74 @@ private:
icon_sprite_t m_IconList[MAX_ICONSPRITES]; icon_sprite_t m_IconList[MAX_ICONSPRITES];
}; };
//
//-----------------------------------------------------
//
class CHudFlagStatus : public CHudBase
{
public:
int Init();
int VidInit();
void Reset();
int Draw( float flTime );
int MsgFunc_FlagStat( const char *pszName, int iSize, void *pbuf );
int MsgFunc_RuneStat( const char *pszName, int iSize, void *pbuf );
int MsgFunc_FlagCarrier( const char *pszName, int iSize, void *pbuf );
int iDrawStatus;
int iRedFlagStatus;
int iBlueFlagStatus;
int iRedTeamScore;
int iBlueTeamScore;
private:
int m_iBlueAtBaseIndex;
int m_iBlueFlagIndex;
int m_iBlueLostIndex;
int m_iBlueStolenIndex;
int m_iRedAtBaseIndex;
int m_iRedFlagIndex;
int m_iRedLostIndex;
int m_iRedStolenIndex;
int m_iRune1Index;
int m_iRune2Index;
int m_iRune3Index;
int m_iRune4Index;
int m_iRuneStat;
HSPRITE m_hBlueFlag;
HSPRITE m_hBlueAtBase;
HSPRITE m_hBlueLost;
HSPRITE m_hBlueStolen;
HSPRITE m_hRedFlag;
HSPRITE m_hRedAtBase;
HSPRITE m_hRedLost;
HSPRITE m_hRedStolen;
HSPRITE m_hRune1;
HSPRITE m_hRune2;
HSPRITE m_hRune3;
HSPRITE m_hRune4;
};
//
//-----------------------------------------------------
//
class CHudBonus : public CHudBase
{
public:
int Init();
int VidInit();
void Reset();
int Draw( float flTime );
int MsgFunc_Bonus( const char *pszName, int iSize, void *pbuf );
private:
bool m_bUsedSlot[32];
};
// //
//----------------------------------------------------- //-----------------------------------------------------
// //
@ -658,6 +727,8 @@ public:
CHudStatusIcons m_StatusIcons; CHudStatusIcons m_StatusIcons;
CHudScoreboard m_Scoreboard; CHudScoreboard m_Scoreboard;
CHudMOTD m_MOTD; CHudMOTD m_MOTD;
CHudFlagStatus m_FlagStat;
CHudBonus m_Bonus;
void Init( void ); void Init( void );
void VidInit( void ); void VidInit( void );

Loading…
Cancel
Save