blob: b95b3040679e50b1883bf046a064cdf8551ca0fd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#include "pch_serverbrowser.h"
//-----------------------------------------------------------------------------
// Purpose: Singleton accessor
//-----------------------------------------------------------------------------
CModList &ModList()
{
static CModList s_ModList;
return s_ModList;
}
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CModList::CModList()
{
ParseSteamMods();
}
//-----------------------------------------------------------------------------
// Purpose: returns number of mods
//-----------------------------------------------------------------------------
int CModList::ModCount()
{
return m_ModList.Count();
}
//-----------------------------------------------------------------------------
// Purpose: data accessor
//-----------------------------------------------------------------------------
const char *CModList::GetModName(int index)
{
return m_ModList[index].description;
}
//-----------------------------------------------------------------------------
// Purpose: data accessor
//-----------------------------------------------------------------------------
const char *CModList::GetModDir(int index)
{
return m_ModList[index].gamedir;
}
//-----------------------------------------------------------------------------
// Purpose: data accessor
//-----------------------------------------------------------------------------
const CGameID &CModList::GetAppID(int index) const
{
return m_ModList[index].m_GameID;
}
//-----------------------------------------------------------------------------
// Purpose: get the modlist index for this app id
//-----------------------------------------------------------------------------
int CModList::GetIndex( const CGameID &iAppID ) const
{
mod_t mod;
mod.m_GameID = iAppID;
return m_ModList.Find( mod );
}
//-----------------------------------------------------------------------------
// Purpose: returns the mod name for the associated gamedir
//-----------------------------------------------------------------------------
const char *CModList::GetModNameForModDir( const CGameID &gameID )
{
int iApp = GetIndex( gameID );
if ( iApp != m_ModList.InvalidIndex() )
{
return m_ModList[iApp].description;
}
if ( ServerBrowserDialog().GetActiveModName() )
{
return ServerBrowserDialog().GetActiveGameName();
}
return "";
}
//-----------------------------------------------------------------------------
// Purpose: sort the mod list in alphabetical order
//-----------------------------------------------------------------------------
int CModList::ModNameCompare( const mod_t *pLeft, const mod_t *pRight )
{
return ( Q_stricmp( pLeft->description, pRight->description ) );
}
//-----------------------------------------------------------------------------
// Purpose: gets list of steam games we can filter for
//-----------------------------------------------------------------------------
void CModList::ParseSteamMods()
{
}
//-----------------------------------------------------------------------------
// Purpose: load settings for an app
//-----------------------------------------------------------------------------
int CModList::LoadAppConfiguration( uint32 nAppID )
{
return -1;
}
//-----------------------------------------------------------------------------
// Purpose: add a vgui panel to message when the app list changes
//-----------------------------------------------------------------------------
void CModList::AddVGUIListener( vgui::VPANEL panel )
{
m_VGUIListeners.AddToTail( panel );
}
|