cl_dll/game_controls/baseviewport.cpp
3536373839404142434445
#include "clientscoreboarddialog.h"
#include "spectatorgui.h"
#include "teammenu.h"
#include "vguitextwindow.h"
#include "IGameUIFuncs.h"
#include "mapoverview.h"
#include "hud.h"
#include "NavProgress.h"
// our definition
#include "baseviewport.h"
3536373839404142434445464748
#include "clientscoreboarddialog.h"
#include "spectatorgui.h"
#include "teammenu.h"
#include "mapscreen.h"
#include "vguitextwindow.h"
#include "IGameUIFuncs.h"
#include "mapoverview.h"
#include "hud.h"
#include "NavProgress.h"
#include "classmenu.h"
#include "mapguidemenu.h"
// our definition
#include "baseviewport.h"
118119120121122123124
#endif
m_bHasParent = false;
m_pActivePanel = NULL;
m_pLastActivePanel = NULL;
vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFileEx( enginevgui->GetPanel( PANEL_CLIENTDLL ), "resource/ClientScheme.res", "ClientScheme");
SetScheme(scheme);
121122123124125126127
#endif
m_bHasParent = false;
m_pActivePanel = NULL;
m_LastActivePanelStack.Clear();
vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFileEx( enginevgui->GetPanel( PANEL_CLIENTDLL ), "resource/ClientScheme.res", "ClientScheme");
SetScheme(scheme);
165166167168169170171172173174
AddNewPanel( CreatePanelByName( PANEL_INFO ) );
AddNewPanel( CreatePanelByName( PANEL_SPECGUI ) );
AddNewPanel( CreatePanelByName( PANEL_SPECMENU ) );
AddNewPanel( CreatePanelByName( PANEL_NAV_PROGRESS ) );
// AddNewPanel( CreatePanelByName( PANEL_TEAM ) );
// AddNewPanel( CreatePanelByName( PANEL_CLASS ) );
// AddNewPanel( CreatePanelByName( PANEL_BUY ) );
#endif
}
168169170171172173174175176177178179180181182183184
AddNewPanel( CreatePanelByName( PANEL_INFO ) );
AddNewPanel( CreatePanelByName( PANEL_SPECGUI ) );
AddNewPanel( CreatePanelByName( PANEL_SPECMENU ) );
//AddNewPanel( CreatePanelByName( PANEL_NAV_PROGRESS ) );
// AddNewPanel( CreatePanelByName( PANEL_TEAM ) );
// AddNewPanel( CreatePanelByName( PANEL_CLASS ) );
// AddNewPanel( CreatePanelByName( PANEL_BUY ) );
// --> Mirv: FF panels
AddNewPanel(CreatePanelByName(PANEL_TEAM));
AddNewPanel(CreatePanelByName(PANEL_CLASS));
AddNewPanel(CreatePanelByName(PANEL_MAPGUIDE));
AddNewPanel(CreatePanelByName(PANEL_MAP));
// <--
#endif
}
221222223224225226
{
newpanel = new CNavProgress( this );
}
#endif
return newpanel;
231232233234235236237238239240241242243244245246247248249250251252253254255
{
newpanel = new CNavProgress( this );
}
// --> Mirv: Pick up new panels
else if (Q_strcmp(PANEL_TEAM, szPanelName) == 0)
{
newpanel = new CTeamMenu(this);
}
else if (Q_strcmp(PANEL_CLASS, szPanelName) == 0)
{
newpanel = new CClassMenu(this);
}
else if (Q_strcmp(PANEL_MAPGUIDE, szPanelName) == 0)
{
newpanel = new CMapGuideMenu(this);
}
else if (Q_strcmp(PANEL_MAP, szPanelName) == 0)
{
newpanel = new CMapScreen(this);
}
// <--
#endif
return newpanel;
305306307308309310311312313314315
{
// store a pointer to the currently active panel
// so we can restore it later
m_pLastActivePanel = m_pActivePanel;
m_pActivePanel->ShowPanel( false );
}
m_pActivePanel = pPanel;
}
}
else
334335336337338339340341342343344345346
{
// store a pointer to the currently active panel
// so we can restore it later
m_LastActivePanelStack.Push( m_pActivePanel );
m_pActivePanel = pPanel;
if (GetLastActivePanel())
GetLastActivePanel()->ShowPanel( false );
}
else
m_pActivePanel = pPanel;
}
}
else
322323324325326327328329330331
}
// restore the previous active panel if it exists
if( m_pLastActivePanel )
{
m_pActivePanel = m_pLastActivePanel;
m_pLastActivePanel = NULL;
m_pActivePanel->ShowPanel( true );
}
353354355356357358359360361
}
// restore the previous active panel if it exists
if( m_LastActivePanelStack.Count() > 0 )
{
m_LastActivePanelStack.Pop( m_pActivePanel );
m_pActivePanel->ShowPanel( true );
}
342343344345346347
return m_pActivePanel;
}
void CBaseViewport::RemoveAllPanels( void)
{
for ( int i=0; i < m_Panels.Count(); i++ )
372373374375376377378379380381382
return m_pActivePanel;
}
IViewPortPanel* CBaseViewport::GetLastActivePanel( void )
{
return (m_LastActivePanelStack.Count() > 0 ? m_LastActivePanelStack.Top() : NULL);
}
void CBaseViewport::RemoveAllPanels( void)
{
for ( int i=0; i < m_Panels.Count(); i++ )
358359360361362363364
#endif
m_Panels.Purge();
m_pActivePanel = NULL;
m_pLastActivePanel = NULL;
}
CBaseViewport::~CBaseViewport()
393394395396397398399
#endif
m_Panels.Purge();
m_pActivePanel = NULL;
m_LastActivePanelStack.Clear();
}
CBaseViewport::~CBaseViewport()
452453454455456457458459460461462
// if they are stored as the last active panel
if( m_pActivePanel && !m_pActivePanel->IsVisible() )
{
if( m_pLastActivePanel )
{
m_pActivePanel = m_pLastActivePanel;
ShowPanel( m_pActivePanel, true );
m_pLastActivePanel = NULL;
}
else
m_pActivePanel = NULL;
487488489490491492493494495496
// if they are stored as the last active panel
if( m_pActivePanel && !m_pActivePanel->IsVisible() )
{
if( m_LastActivePanelStack.Count() > 0 )
{
m_LastActivePanelStack.Pop( m_pActivePanel );
ShowPanel( m_pActivePanel, true );
}
else
m_pActivePanel = NULL;