diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /mp/src/game/client/game_controls/NavProgress.cpp | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'mp/src/game/client/game_controls/NavProgress.cpp')
| -rw-r--r-- | mp/src/game/client/game_controls/NavProgress.cpp | 274 |
1 files changed, 137 insertions, 137 deletions
diff --git a/mp/src/game/client/game_controls/NavProgress.cpp b/mp/src/game/client/game_controls/NavProgress.cpp index 7b7e9767..8aef8c4e 100644 --- a/mp/src/game/client/game_controls/NavProgress.cpp +++ b/mp/src/game/client/game_controls/NavProgress.cpp @@ -1,137 +1,137 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//
-// Purpose:
-//
-// $NoKeywords: $
-//=============================================================================//
-
-#include "cbase.h"
-#include "NavProgress.h"
-
-#include <vgui/IScheme.h>
-#include <vgui/ILocalize.h>
-#include <vgui/ISurface.h>
-#include <filesystem.h>
-#include <KeyValues.h>
-#include <convar.h>
-
-#include <vgui_controls/Label.h>
-
-#include <game/client/iviewport.h>
-
-// memdbgon must be the last include file in a .cpp file!!!
-#include "tier0/memdbgon.h"
-
-using namespace vgui;
-
-//--------------------------------------------------------------------------------------------------------------
-CNavProgress::CNavProgress( IViewPort *pViewPort ) : Frame( NULL, PANEL_NAV_PROGRESS )
-{
- // initialize dialog
- m_pViewPort = pViewPort;
-
- // load the new scheme early!!
- SetScheme("ClientScheme");
- SetMoveable(false);
- SetSizeable(false);
- SetProportional(true);
-
- // hide the system buttons
- SetTitleBarVisible( false );
-
- m_pTitle = new Label( this, "TitleLabel", "" );
- m_pText = new Label( this, "TextLabel", "" );
-
- m_pProgressBarBorder = new Panel( this, "ProgressBarBorder" );
- m_pProgressBar = new Panel( this, "ProgressBar" );
- m_pProgressBarSizer = new Panel( this, "ProgressBarSizer" );
-
- LoadControlSettings("Resource/UI/NavProgress.res");
-
- Reset();
-}
-
-//--------------------------------------------------------------------------------------------------------------
-CNavProgress::~CNavProgress()
-{
-}
-
-//--------------------------------------------------------------------------------------------------------------
-void CNavProgress::ApplySchemeSettings(IScheme *pScheme)
-{
- BaseClass::ApplySchemeSettings( pScheme );
-
- SetPaintBackgroundType( 2 );
-
- m_pProgressBarSizer->SetVisible( false );
-
- m_pProgressBarBorder->SetBorder( pScheme->GetBorder( "ButtonDepressedBorder" ) );
- m_pProgressBarBorder->SetBgColor( Color( 0, 0, 0, 0 ) );
-
- m_pProgressBar->SetBorder( pScheme->GetBorder( "ButtonBorder" ) );
- m_pProgressBar->SetBgColor( pScheme->GetColor( "ProgressBar.FgColor", Color( 0, 0, 0, 0 ) ) );
-}
-
-//--------------------------------------------------------------------------------------------------------------
-void CNavProgress::PerformLayout()
-{
- BaseClass::PerformLayout();
-
- if ( m_numTicks )
- {
- int w = m_pProgressBarSizer->GetWide();
- w = w * m_currentTick / m_numTicks;
- m_pProgressBar->SetWide( w );
- }
-}
-
-//--------------------------------------------------------------------------------------------------------------
-void CNavProgress::Init( const char *title, int numTicks, int startTick )
-{
- m_pText->SetText( title );
-
- m_numTicks = MAX( 1, numTicks ); // non-zero, since we'll divide by this
- m_currentTick = MAX( 0, MIN( m_numTicks, startTick ) );
-
- InvalidateLayout();
-}
-
-//--------------------------------------------------------------------------------------------------------------
-void CNavProgress::SetData(KeyValues *data)
-{
- Init( data->GetString( "msg" ),
- data->GetInt( "total" ),
- data->GetInt( "current" ) );
-}
-
-//--------------------------------------------------------------------------------------------------------------
-void CNavProgress::ShowPanel( bool bShow )
-{
- if ( BaseClass::IsVisible() == bShow )
- return;
-
- m_pViewPort->ShowBackGround( bShow );
-
- if ( bShow )
- {
- Activate();
- SetMouseInputEnabled( true );
- }
- else
- {
- SetVisible( false );
- SetMouseInputEnabled( false );
- }
-}
-
-//--------------------------------------------------------------------------------------------------------------
-void CNavProgress::Reset( void )
-{
-}
-
-//--------------------------------------------------------------------------------------------------------------
-void CNavProgress::Update( void )
-{
-}
-
-//--------------------------------------------------------------------------------------------------------------
+//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//=============================================================================// + +#include "cbase.h" +#include "NavProgress.h" + +#include <vgui/IScheme.h> +#include <vgui/ILocalize.h> +#include <vgui/ISurface.h> +#include <filesystem.h> +#include <KeyValues.h> +#include <convar.h> + +#include <vgui_controls/Label.h> + +#include <game/client/iviewport.h> + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +using namespace vgui; + +//-------------------------------------------------------------------------------------------------------------- +CNavProgress::CNavProgress( IViewPort *pViewPort ) : Frame( NULL, PANEL_NAV_PROGRESS ) +{ + // initialize dialog + m_pViewPort = pViewPort; + + // load the new scheme early!! + SetScheme("ClientScheme"); + SetMoveable(false); + SetSizeable(false); + SetProportional(true); + + // hide the system buttons + SetTitleBarVisible( false ); + + m_pTitle = new Label( this, "TitleLabel", "" ); + m_pText = new Label( this, "TextLabel", "" ); + + m_pProgressBarBorder = new Panel( this, "ProgressBarBorder" ); + m_pProgressBar = new Panel( this, "ProgressBar" ); + m_pProgressBarSizer = new Panel( this, "ProgressBarSizer" ); + + LoadControlSettings("Resource/UI/NavProgress.res"); + + Reset(); +} + +//-------------------------------------------------------------------------------------------------------------- +CNavProgress::~CNavProgress() +{ +} + +//-------------------------------------------------------------------------------------------------------------- +void CNavProgress::ApplySchemeSettings(IScheme *pScheme) +{ + BaseClass::ApplySchemeSettings( pScheme ); + + SetPaintBackgroundType( 2 ); + + m_pProgressBarSizer->SetVisible( false ); + + m_pProgressBarBorder->SetBorder( pScheme->GetBorder( "ButtonDepressedBorder" ) ); + m_pProgressBarBorder->SetBgColor( Color( 0, 0, 0, 0 ) ); + + m_pProgressBar->SetBorder( pScheme->GetBorder( "ButtonBorder" ) ); + m_pProgressBar->SetBgColor( pScheme->GetColor( "ProgressBar.FgColor", Color( 0, 0, 0, 0 ) ) ); +} + +//-------------------------------------------------------------------------------------------------------------- +void CNavProgress::PerformLayout() +{ + BaseClass::PerformLayout(); + + if ( m_numTicks ) + { + int w = m_pProgressBarSizer->GetWide(); + w = w * m_currentTick / m_numTicks; + m_pProgressBar->SetWide( w ); + } +} + +//-------------------------------------------------------------------------------------------------------------- +void CNavProgress::Init( const char *title, int numTicks, int startTick ) +{ + m_pText->SetText( title ); + + m_numTicks = MAX( 1, numTicks ); // non-zero, since we'll divide by this + m_currentTick = MAX( 0, MIN( m_numTicks, startTick ) ); + + InvalidateLayout(); +} + +//-------------------------------------------------------------------------------------------------------------- +void CNavProgress::SetData(KeyValues *data) +{ + Init( data->GetString( "msg" ), + data->GetInt( "total" ), + data->GetInt( "current" ) ); +} + +//-------------------------------------------------------------------------------------------------------------- +void CNavProgress::ShowPanel( bool bShow ) +{ + if ( BaseClass::IsVisible() == bShow ) + return; + + m_pViewPort->ShowBackGround( bShow ); + + if ( bShow ) + { + Activate(); + SetMouseInputEnabled( true ); + } + else + { + SetVisible( false ); + SetMouseInputEnabled( false ); + } +} + +//-------------------------------------------------------------------------------------------------------------- +void CNavProgress::Reset( void ) +{ +} + +//-------------------------------------------------------------------------------------------------------------- +void CNavProgress::Update( void ) +{ +} + +//-------------------------------------------------------------------------------------------------------------- |