blob: 4553f8016d17d28e32203e13a39ad746ef9d1462 (
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
|
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#ifndef VARLISTPROPERTYPAGE_H
#define VARLISTPROPERTYPAGE_H
#ifdef _WIN32
#pragma once
#endif
#include <KeyValues.h>
#include <vgui_controls/PropertyPage.h>
#include "utlvector.h"
#include "RemoteServer.h"
//-----------------------------------------------------------------------------
// Purpose: Property page for use in the server admin tool
// holds a list of variables and manages the editing of them
//-----------------------------------------------------------------------------
class CVarListPropertyPage : public vgui::PropertyPage, public IServerDataResponse
{
DECLARE_CLASS_SIMPLE( CVarListPropertyPage, vgui::PropertyPage );
public:
CVarListPropertyPage(vgui::Panel *parent, const char *name);
~CVarListPropertyPage();
// loads the var list description from the specified file
bool LoadVarList(const char *varfile);
// sets the value of a variable
void SetVarString(const char *varName, const char *value);
// gets back the value of a variable
const char *GetVarString(const char *varName);
// refreshes all the values of cvars in the list
virtual void RefreshVarList();
// sets a custom string list for a combobox edit
// stringList is a newline-delimited set of strings
void SetCustomStringList(const char *varName, const char *stringList);
protected:
// override to change how a variable is edited
virtual void OnEditVariable(KeyValues *rule);
// handles responses from the server
virtual void OnServerDataResponse(const char *value, const char *response);
// vgui overrides
virtual void PerformLayout();
virtual void OnKeyCodeTyped(vgui::KeyCode code);
MESSAGE_FUNC_CHARPTR( OnVarChanged, "VarChanged", var );
private:
MESSAGE_FUNC( EditVariable, "EditVariable" );
MESSAGE_FUNC( OnItemSelected, "ItemSelected" );
vgui::ListPanel *m_pRulesList;
vgui::Button *m_pEditButton;
};
#endif // VARLISTPROPERTYPAGE_H
|