diff options
| author | Joe Ludwig <[email protected]> | 2013-12-03 08:54:16 -0800 |
|---|---|---|
| committer | Joe Ludwig <[email protected]> | 2013-12-03 08:54:16 -0800 |
| commit | beaae8ac45a2f322a792404092d4482065bef7ef (patch) | |
| tree | 747f35193ba235f0f0b070c05b53468a54559c8e /mp/src/game/client/hud_basedeathnotice.cpp | |
| parent | Make .xcconfigs text files too. (diff) | |
| download | source-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.tar.xz source-sdk-2013-beaae8ac45a2f322a792404092d4482065bef7ef.zip | |
Updated the SDK with the latest code from the TF and HL2 branches
* Adds support for Visual Studio 2012 and 2013
* VR Mode:
. Switches from headtrack.dll to sourcevr.dll
. Improved readability of the UI in VR
. Removed the IPD calibration tool. TF2 will now obey the Oculus
configuration file. Use the Oculus calibration tool in your SDK or
install and run "OpenVR" under Tools in Steam to calibrate your IPD.
. Added dropdown to enable VR mode in the Video options. Removed the -vr
command line option.
. Added the ability to switch in and out of VR mode without quitting the
game
. By default VR mode will run full screen. To switch back to a
borderless window set the vr_force_windowed convar.
. Added support for VR mode on Linux
* Many assorted bug fixes and other changes from Team Fortress in
various shared files
Diffstat (limited to 'mp/src/game/client/hud_basedeathnotice.cpp')
| -rw-r--r-- | mp/src/game/client/hud_basedeathnotice.cpp | 63 |
1 files changed, 57 insertions, 6 deletions
diff --git a/mp/src/game/client/hud_basedeathnotice.cpp b/mp/src/game/client/hud_basedeathnotice.cpp index b3f494b6..d732bd05 100644 --- a/mp/src/game/client/hud_basedeathnotice.cpp +++ b/mp/src/game/client/hud_basedeathnotice.cpp @@ -114,7 +114,8 @@ void CHudBaseDeathNotice::Paint() DeathNoticeItem &msg = m_DeathNotices[i]; CHudTexture *icon = msg.iconDeath; - + CHudTexture *iconPrekiller = msg.iconPreKiller; + wchar_t victim[256]=L""; wchar_t killer[256]=L""; @@ -125,10 +126,15 @@ void CHudBaseDeathNotice::Paint() int iVictimTextWide = UTIL_ComputeStringWidth( m_hTextFont, victim ) + xSpacing; int iDeathInfoTextWide= msg.wzInfoText[0] ? UTIL_ComputeStringWidth( m_hTextFont, msg.wzInfoText ) + xSpacing : 0; + int iDeathInfoEndTextWide= msg.wzInfoTextEnd[0] ? UTIL_ComputeStringWidth( m_hTextFont, msg.wzInfoTextEnd ) + xSpacing : 0; + int iKillerTextWide = killer[0] ? UTIL_ComputeStringWidth( m_hTextFont, killer ) + xSpacing : 0; int iLineTall = m_flLineHeight; int iTextTall = surface()->GetFontTall( m_hTextFont ); int iconWide = 0, iconTall = 0, iDeathInfoOffset = 0, iVictimTextOffset = 0, iconActualWide = 0; + + int iPreKillerTextWide = msg.wzPreKillerText[0] ? UTIL_ComputeStringWidth( m_hTextFont, msg.wzPreKillerText ) - xSpacing : 0; + int iconPrekillerWide = 0, iconPrekillerActualWide = 0, iconPreKillerTall = 0; // Get the local position for this notice if ( icon ) @@ -145,7 +151,25 @@ void CHudBaseDeathNotice::Paint() iconTall *= flScale; iconWide *= flScale; } - int iTotalWide = iKillerTextWide + iconWide + iVictimTextWide + iDeathInfoTextWide + ( xMargin * 2 ); + + if ( iconPrekiller ) + { + iconPrekillerActualWide = iconPrekiller->EffectiveWidth( 1.0f ); + iconPrekillerWide = iconPrekillerActualWide; + iconPreKillerTall = iconPrekiller->EffectiveHeight( 1.0f ); + + int iconTallDesired = iLineTall-YRES(2); + Assert( 0 != iconTallDesired ); + float flScale = (float) iconTallDesired / (float) iconPreKillerTall; + + iconPrekillerActualWide *= flScale; + iconPreKillerTall *= flScale; + iconPrekillerWide *= flScale; + } + + int iTotalWide = iKillerTextWide + iconWide + iVictimTextWide + iDeathInfoTextWide + iDeathInfoEndTextWide + ( xMargin * 2 ); + iTotalWide += iconPrekillerWide + iPreKillerTextWide; + int y = yStart + ( ( iLineTall + m_flLineSpacing ) * i ); int yText = y + ( ( iLineTall - iTextTall ) / 2 ); int yIcon = y + ( ( iLineTall - iconTall ) / 2 ); @@ -160,11 +184,11 @@ void CHudBaseDeathNotice::Paint() Vertex_t vert[NUM_BACKGROUND_COORD]; GetBackgroundPolygonVerts( x, y+1, x+iTotalWide, y+iLineTall-1, ARRAYSIZE( vert ), vert ); surface()->DrawSetTexture( -1 ); - surface()->DrawSetColor( msg.bLocalPlayerInvolved ? m_clrLocalBGColor : m_clrBaseBGColor ); + surface()->DrawSetColor( GetBackgroundColor ( i ) ); surface()->DrawTexturedPolygon( ARRAYSIZE( vert ), vert ); x += xMargin; - + if ( killer[0] ) { // Draw killer's name @@ -172,6 +196,22 @@ void CHudBaseDeathNotice::Paint() x += iKillerTextWide; } + // prekiller text + if ( msg.wzPreKillerText[0] ) + { + x += xSpacing; + DrawText( x + iDeathInfoOffset, yText, m_hTextFont, GetInfoTextColor( i ), msg.wzPreKillerText ); + x += iPreKillerTextWide; + } + + // Prekiller icon + if ( iconPrekiller ) + { + int yPreIconTall = y + ( ( iLineTall - iconPreKillerTall ) / 2 ); + iconPrekiller->DrawSelf( x, yPreIconTall, iconPrekillerActualWide, iconPreKillerTall, m_clrIcon ); + x += iconPrekillerWide + xSpacing; + } + // Draw glow behind weapon icon to show it was a crit death if ( msg.bCrit && msg.iconCritDeath ) { @@ -194,13 +234,19 @@ void CHudBaseDeathNotice::Paint() iVictimTextOffset -= iDeathInfoTextWide; } - DrawText( x + iDeathInfoOffset, yText, m_hTextFont, GetInfoTextColor( msg.bLocalPlayerInvolved ), msg.wzInfoText ); + DrawText( x + iDeathInfoOffset, yText, m_hTextFont, GetInfoTextColor( i ), msg.wzInfoText ); x += iDeathInfoTextWide; } // Draw victims name DrawText( x + iVictimTextOffset, yText, m_hTextFont, GetTeamColor( msg.Victim.iTeam, msg.bLocalPlayerInvolved ), victim ); x += iVictimTextWide; + + // Draw Additional Text on the end of the victims name + if ( msg.wzInfoTextEnd[0] ) + { + DrawText( x , yText, m_hTextFont, GetInfoTextColor( i ), msg.wzInfoTextEnd ); + } } } @@ -358,7 +404,12 @@ void CHudBaseDeathNotice::FireGameEvent( IGameEvent *event ) bLocalPlayerInvolved = true; } - if ( event->GetInt( "damagebits" ) & DMG_CRITICAL ) + if ( event->GetInt( "death_flags" ) & TF_DEATH_AUSTRALIUM ) + { + m_DeathNotices[iMsg].bCrit= true; + m_DeathNotices[iMsg].iconCritDeath = GetIcon( "d_australium", bLocalPlayerInvolved ? kDeathNoticeIcon_Inverted : kDeathNoticeIcon_Standard ); + } + else if ( event->GetInt( "damagebits" ) & DMG_CRITICAL ) { m_DeathNotices[iMsg].bCrit= true; m_DeathNotices[iMsg].iconCritDeath = GetIcon( "d_crit", bLocalPlayerInvolved ? kDeathNoticeIcon_Inverted : kDeathNoticeIcon_Standard ); |