diff --git a/releases/3.2.0/gfx/vgui/640_scoreboardgl.tga b/releases/3.2.0/gfx/vgui/640_scoreboardgl.tga new file mode 100644 index 00000000..4b030a48 Binary files /dev/null and b/releases/3.2.0/gfx/vgui/640_scoreboardgl.tga differ diff --git a/releases/3.2.0/gfx/vgui/640_scoreboardhmg.tga b/releases/3.2.0/gfx/vgui/640_scoreboardhmg.tga new file mode 100644 index 00000000..4b030a48 Binary files /dev/null and b/releases/3.2.0/gfx/vgui/640_scoreboardhmg.tga differ diff --git a/releases/3.2.0/gfx/vgui/640_scoreboardlmg.tga b/releases/3.2.0/gfx/vgui/640_scoreboardlmg.tga new file mode 100644 index 00000000..4b030a48 Binary files /dev/null and b/releases/3.2.0/gfx/vgui/640_scoreboardlmg.tga differ diff --git a/releases/3.2.0/gfx/vgui/640_scoreboardsg.tga b/releases/3.2.0/gfx/vgui/640_scoreboardsg.tga new file mode 100644 index 00000000..4b030a48 Binary files /dev/null and b/releases/3.2.0/gfx/vgui/640_scoreboardsg.tga differ diff --git a/releases/3.2.0/source/cl_dll/chudmisc.h b/releases/3.2.0/source/cl_dll/chudmisc.h index 5948e1ed..d7e42cde 100644 --- a/releases/3.2.0/source/cl_dll/chudmisc.h +++ b/releases/3.2.0/source/cl_dll/chudmisc.h @@ -228,10 +228,10 @@ struct extra_player_info_t short score; short lastScore; float timeOfLastScoreChange; - short frags; short deaths; short playerclass; + short extra; short auth; short teamnumber; char teamname[MAX_TEAM_NAME]; diff --git a/releases/3.2.0/source/cl_dll/vgui_ScorePanel.cpp b/releases/3.2.0/source/cl_dll/vgui_ScorePanel.cpp index d474004a..4f74b590 100644 --- a/releases/3.2.0/source/cl_dll/vgui_ScorePanel.cpp +++ b/releases/3.2.0/source/cl_dll/vgui_ScorePanel.cpp @@ -75,6 +75,7 @@ #include "..\game_shared\vgui_loadtga.h" #include "mod/AvHConstants.h" #include "mod/AvHTitles.h" +#include "mod/AvHBasePlayerWeaponConstants.h" #include "vgui_SpectatorPanel.h" #include "cl_dll/demo.h" #include "mod/AvHServerVariables.h" @@ -144,9 +145,10 @@ SBColumnInfo g_ColumnInfo[NUM_COLUMNS] = { {NULL, 24, Label::a_east}, // tracker column {NULL, 24, Label::a_east}, // status icons - {NULL, 150, Label::a_east}, // name + {NULL, 110, Label::a_east}, // name {NULL, 56, Label::a_east}, // class {"#SCORE", 40, Label::a_east}, // score + {"#EXTRA", 40, Label::a_east}, // resources {"#KILLS", 40, Label::a_east}, // kills {"#DEATHS", 40, Label::a_east}, // deaths {"#LATENCY", 40, Label::a_east}, // ping @@ -206,6 +208,12 @@ ScorePanel::ScorePanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) m_pCheatingDeathIcon = NULL; m_pVeteranIcon = NULL; + m_pHMG = NULL; + m_pLMG = NULL; + m_pGL = NULL; + m_pSG = NULL; + + m_pTrackerIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardtracker.tga"); m_pDevIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboarddev.tga"); m_pPTIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardpt.tga"); @@ -215,6 +223,13 @@ ScorePanel::ScorePanel(int x,int y,int wide,int tall) : Panel(x,y,wide,tall) m_pCheatingDeathIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardcd.tga"); m_pVeteranIcon = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardveteran.tga"); + + + m_pHMG = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardhmg.tga"); + m_pLMG = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardlmg.tga"); + m_pGL = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardgl.tga"); + m_pSG = vgui_LoadTGANoInvertAlpha("gfx/vgui/640_scoreboardsg.tga"); + m_iIconFrame = 0; m_iLastFrameIncrementTime = gHUD.GetTimeOfLastUpdate(); @@ -896,7 +911,8 @@ void ScorePanel::FillGrid() case COLUMN_SCORE: case COLUMN_KILLS: - case COLUMN_DEATHS: + case COLUMN_EXTRA: + case COLUMN_DEATHS: case COLUMN_LATENCY: default: pLabel->setContentAlignment( vgui::Label::a_east ); @@ -951,6 +967,8 @@ void ScorePanel::FillGrid() if ((m_iIsATeam[row] == TEAM_YES) && team_info && ((theLocalPlayerTeam == 0) || (theLocalPlayerTeam == team_info->teamnumber))) sprintf(sz, "%d", team_info->score); break; + case COLUMN_EXTRA: + break; case COLUMN_KILLS: if ((m_iIsATeam[row] == TEAM_YES) && team_info) sprintf(sz, "%d", team_info->frags ); @@ -1202,6 +1220,40 @@ void ScorePanel::FillGrid() } break; + case COLUMN_EXTRA: + if(!theIsForEnemy && theExtraPlayerInfo->teamnumber != TEAM_IND && theExtraPlayerInfo->teamnumber != TEAM_SPECT ) + { + if ( gHUD.GetIsMarine() && !gHUD.GetIsCombatMode() ) { + switch(theExtraPlayerInfo->extra) { + case AVH_WEAPON_HMG: + pLabel->setFgColorAsImageColor(false); + pLabel->setImage(m_pHMG); + m_pHMG->setColor(BuildColor(248, 252, 0, gHUD.GetGammaSlope())); + break; + case AVH_WEAPON_MG: + pLabel->setFgColorAsImageColor(false); + pLabel->setImage(m_pLMG); + m_pLMG->setColor(BuildColor(208, 16, 190, gHUD.GetGammaSlope())); + break; + case AVH_WEAPON_SONIC: + pLabel->setFgColorAsImageColor(false); + pLabel->setImage(m_pSG); + m_pSG->setColor(BuildColor(117, 214, 241, gHUD.GetGammaSlope())); + break; + case AVH_WEAPON_GRENADE_GUN: + pLabel->setFgColorAsImageColor(false); + pLabel->setImage(m_pGL); + m_pGL->setColor(BuildColor(255, 69, 9, gHUD.GetGammaSlope())); + break; + default: + break; + } + } + else { + sprintf(sz, "%d", theExtraPlayerInfo->extra); + } + } + break; case COLUMN_KILLS: sprintf(sz, "%d", theExtraPlayerInfo->frags); break; diff --git a/releases/3.2.0/source/cl_dll/vgui_ScorePanel.h b/releases/3.2.0/source/cl_dll/vgui_ScorePanel.h index 3b74bc3f..eebeac0f 100644 --- a/releases/3.2.0/source/cl_dll/vgui_ScorePanel.h +++ b/releases/3.2.0/source/cl_dll/vgui_ScorePanel.h @@ -21,12 +21,13 @@ #define COLUMN_NAME 2 #define COLUMN_CLASS 3 #define COLUMN_SCORE 4 -#define COLUMN_KILLS 5 -#define COLUMN_DEATHS 6 -#define COLUMN_LATENCY 7 -#define COLUMN_VOICE 8 -#define COLUMN_BLANK 9 -#define NUM_COLUMNS 10 +#define COLUMN_EXTRA 5 +#define COLUMN_KILLS 6 +#define COLUMN_DEATHS 7 +#define COLUMN_LATENCY 8 +#define COLUMN_VOICE 9 +#define COLUMN_BLANK 10 +#define NUM_COLUMNS 11 #define NUM_ROWS (MAX_PLAYERS + (MAX_SCOREBOARD_TEAMS * 2)) using namespace vgui; @@ -86,6 +87,12 @@ private: vgui::BitmapTGA *m_pContribIcon; vgui::BitmapTGA *m_pCheatingDeathIcon; vgui::BitmapTGA *m_pVeteranIcon; + + vgui::BitmapTGA *m_pHMG; + vgui::BitmapTGA *m_pLMG; + vgui::BitmapTGA *m_pGL; + vgui::BitmapTGA *m_pSG; + vector< pair > m_CustomIconList; unsigned int m_iIconFrame; diff --git a/releases/3.2.0/source/cl_dll/vgui_TeamFortressViewport.cpp b/releases/3.2.0/source/cl_dll/vgui_TeamFortressViewport.cpp index c4665c50..dd3f7f37 100644 --- a/releases/3.2.0/source/cl_dll/vgui_TeamFortressViewport.cpp +++ b/releases/3.2.0/source/cl_dll/vgui_TeamFortressViewport.cpp @@ -2557,6 +2557,7 @@ int TeamFortressViewport::MsgFunc_ScoreInfo( const char *pszName, int iSize, voi // Update other info g_PlayerExtraInfo[info.player_index].frags = info.frags; g_PlayerExtraInfo[info.player_index].deaths = info.deaths; + g_PlayerExtraInfo[info.player_index].extra = info.extra; g_PlayerExtraInfo[info.player_index].playerclass = info.player_class; // puzl: 0001073 g_PlayerExtraInfo[info.player_index].auth = info.auth; diff --git a/releases/3.2.0/source/dlls/player.cpp b/releases/3.2.0/source/dlls/player.cpp index 1f990b53..f3878a00 100644 --- a/releases/3.2.0/source/dlls/player.cpp +++ b/releases/3.2.0/source/dlls/player.cpp @@ -3838,7 +3838,9 @@ int CBasePlayer::AddPlayerItem( CBasePlayerItem *pItem ) CBasePlayerItem *pInsert; pInsert = m_rgpPlayerItems[pItem->iItemSlot()]; - + if ( pItem->iItemSlot() == 1 ) { + this->EffectivePlayerClassChanged(); + } while (pInsert) { if (FClassnameIs( pInsert->pev, STRING( pItem->pev->classname) )) diff --git a/releases/3.2.0/source/mod/AvHCombat.cpp b/releases/3.2.0/source/mod/AvHCombat.cpp index 6aa3dbfc..2510dbec 100644 --- a/releases/3.2.0/source/mod/AvHCombat.cpp +++ b/releases/3.2.0/source/mod/AvHCombat.cpp @@ -44,7 +44,8 @@ bool AvHPlayer::GiveCombatModeUpgrade(AvHMessageID inMessageID, bool inInstantan ASSERT(theCreatedItem); - if((inMessageID == BUILD_JETPACK) || (inMessageID == BUILD_HEAVY)) + if((inMessageID == BUILD_JETPACK) || (inMessageID == BUILD_HEAVY) || (inMessageID == BUILD_HMG) || + (inMessageID == BUILD_SHOTGUN) || (inMessageID == BUILD_GRENADE_GUN)) { theEffectivePlayerClassChanged = true; } @@ -215,7 +216,9 @@ void AvHPlayer::SetExperience(float inExperience) { int theIsMarine = this->GetIsMarine(); PLAYBACK_EVENT_FULL(0, this->edict(), gLevelUpEventID, 0, this->pev->origin, (float *)&g_vecZero, 0.0, 0.0, theIsMarine, 0, 0, 0 ); - + + this->EffectivePlayerClassChanged(); + // Give player health and armor back on level-up, to allow more soloing, heroics, and reduce dependence on hives/resupply AvHUser3 theUser3 = AvHUser3(this->pev->iuser3); float theMaxHealth = AvHPlayerUpgrade::GetMaxHealth(this->pev->iuser4, theUser3, theCurrentLevel); diff --git a/releases/3.2.0/source/mod/AvHNetworkMessages.cpp b/releases/3.2.0/source/mod/AvHNetworkMessages.cpp index d15f213a..7ec8e6f3 100644 --- a/releases/3.2.0/source/mod/AvHNetworkMessages.cpp +++ b/releases/3.2.0/source/mod/AvHNetworkMessages.cpp @@ -485,6 +485,7 @@ void Net_InitializeMessages(void) info.score = READ_SHORT(); info.frags = READ_SHORT(); info.deaths = READ_SHORT(); + info.extra = READ_SHORT(); info.player_class = READ_BYTE(); info.auth = READ_SHORT(); info.team = READ_SHORT(); @@ -513,6 +514,7 @@ void Net_InitializeMessages(void) WRITE_SHORT( info.score ); WRITE_SHORT( info.frags ); WRITE_SHORT( info.deaths ); + WRITE_SHORT( info.extra ); WRITE_BYTE( info.player_class ); WRITE_SHORT( info.auth ); WRITE_SHORT( info.team ); diff --git a/releases/3.2.0/source/mod/AvHPlayer.cpp b/releases/3.2.0/source/mod/AvHPlayer.cpp index 98164393..7515ac83 100644 --- a/releases/3.2.0/source/mod/AvHPlayer.cpp +++ b/releases/3.2.0/source/mod/AvHPlayer.cpp @@ -970,6 +970,8 @@ bool AvHPlayer::DropItem(const char* inItemName) if(theOriginalDroppedWeapon->GetItemInfo(&theItemInfo) != 0) { int iAmmoIndex = GetAmmoIndex ( (char *) theItemInfo.pszAmmo1 ); + if ( theItemInfo.iSlot == 0 ) + this->EffectivePlayerClassChanged(); if ( iAmmoIndex != -1 && m_rgAmmo[ iAmmoIndex ] > 0) this->DropAmmo((char *)theItemInfo.pszAmmo1, m_rgAmmo[ iAmmoIndex ], theItemInfo.iMaxAmmo1, theItemInfo.iId, theNewlyDroppedWeapon->pev->angles); @@ -7952,6 +7954,8 @@ void AvHPlayer::SetResources(float inResources, bool inPlaySound) { this->PlayHUDSound(HUD_SOUND_ALIEN_POINTS_RECEIVED); } + if ( this->mResources != inResources ) + this->EffectivePlayerClassChanged(); this->mResources = inResources; } @@ -9215,7 +9219,7 @@ void AvHPlayer::UpdateClientData( void ) void AvHPlayer::UpdateEffectiveClassAndTeam() { // Don't send too many messages when these get updated really quickly. Too many messages are being sent on a game reset, and it's not needed. We only need the most recent message. - const float kClassAndTeamUpdateRate = .4f; + const float kClassAndTeamUpdateRate = .6f; if((this->mTimeOfLastClassAndTeamUpdate == -1) || (gpGlobals->time > (this->mTimeOfLastClassAndTeamUpdate + kClassAndTeamUpdateRate))) { if(this->mEffectivePlayerClassChanged) @@ -9236,6 +9240,27 @@ void AvHPlayer::UpdateEffectiveClassAndTeam() info.player_class = this->GetEffectivePlayerClass(); info.auth = this->GetAuthenticationMask(); info.team = GetGameRules()->GetTeamIndex(this->TeamID()); + + if ( GetGameRules()->GetIsCombatMode()) { + info.extra=this->GetExperienceLevel(); + } + else { + if ( this->GetIsAlien() ) { + info.extra=(int)this->GetResources(); + } + else { + info.extra=0; + if ( this->m_rgpPlayerItems ) { + CBasePlayerWeapon* thePrimaryWeapon = (CBasePlayerWeapon *)this->m_rgpPlayerItems[1]; + if ( thePrimaryWeapon ) { + ItemInfo ii; + thePrimaryWeapon->GetItemInfo(&ii); + info.extra=ii.iId; + } + } + } + } + NetMsg_ScoreInfo( info ); this->mEffectivePlayerClassChanged = false; } diff --git a/releases/3.2.0/source/mod/AvHSharedTypes.h b/releases/3.2.0/source/mod/AvHSharedTypes.h index f31447a8..8faa29a8 100644 --- a/releases/3.2.0/source/mod/AvHSharedTypes.h +++ b/releases/3.2.0/source/mod/AvHSharedTypes.h @@ -58,6 +58,7 @@ typedef struct ScoreInfo_s int player_index; int score; int frags; + int extra; int deaths; int player_class; int auth; diff --git a/releases/3.2.0/titles.txt b/releases/3.2.0/titles.txt index 53e7575d..898de213 100644 --- a/releases/3.2.0/titles.txt +++ b/releases/3.2.0/titles.txt @@ -371,6 +371,11 @@ KILLS Kills } +EXTRA +{ +Info +} + DEATHS { Deaths