2015-01-16 22:27:24 +01:00
|
|
|
// vim: set ts=4 sw=4 tw=99 noet:
|
|
|
|
//
|
|
|
|
// AMX Mod X, based on AMX Mod by Aleksander Naszko ("OLO").
|
|
|
|
// Copyright (C) The AMX Mod X Development Team.
|
|
|
|
//
|
|
|
|
// This software is licensed under the GNU General Public License, version 3 or higher.
|
|
|
|
// Additional exceptions apply. For full license details, see LICENSE.txt or visit:
|
|
|
|
// https://alliedmods.net/amxmodx-license
|
|
|
|
|
|
|
|
#ifndef CVARS_H
|
|
|
|
#define CVARS_H
|
|
|
|
|
2015-01-17 00:32:08 +01:00
|
|
|
#include "cvardef.h"
|
2015-01-17 00:40:25 +01:00
|
|
|
#include <am-string.h>
|
2015-01-17 00:32:08 +01:00
|
|
|
|
2015-01-16 22:27:24 +01:00
|
|
|
class CDetour;
|
|
|
|
|
2015-01-17 00:32:08 +01:00
|
|
|
class CCVar
|
|
|
|
{
|
|
|
|
cvar_t cvar;
|
2015-01-17 00:40:25 +01:00
|
|
|
ke::AString name;
|
|
|
|
ke::AString plugin;
|
2015-01-17 00:32:08 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
CCVar(const char* pname, const char* pplugin, int pflags, float pvalue) : name(pname), plugin(pplugin)
|
|
|
|
{
|
2015-01-17 00:40:25 +01:00
|
|
|
cvar.name = name.chars();
|
|
|
|
cvar.flags = pflags;
|
2015-01-17 00:32:08 +01:00
|
|
|
cvar.string = "";
|
2015-01-17 00:40:25 +01:00
|
|
|
cvar.value = pvalue;
|
2015-01-17 00:32:08 +01:00
|
|
|
}
|
|
|
|
|
2015-01-17 00:40:25 +01:00
|
|
|
inline cvar_t* getCvar()
|
|
|
|
{
|
2015-01-17 00:32:08 +01:00
|
|
|
return &cvar;
|
|
|
|
}
|
2015-01-17 00:40:25 +01:00
|
|
|
|
|
|
|
inline const char* getPluginName()
|
|
|
|
{
|
|
|
|
return plugin.chars();
|
2015-01-17 00:32:08 +01:00
|
|
|
}
|
2015-01-17 00:40:25 +01:00
|
|
|
|
|
|
|
inline const char* getName()
|
|
|
|
{
|
|
|
|
return name.chars();
|
2015-01-17 00:32:08 +01:00
|
|
|
}
|
2015-01-17 00:40:25 +01:00
|
|
|
|
|
|
|
inline bool operator == (const char* string)
|
|
|
|
{
|
|
|
|
return name.compare(string) == 0;
|
2015-01-17 00:32:08 +01:00
|
|
|
}
|
2015-01-17 00:40:25 +01:00
|
|
|
|
2015-01-17 00:32:08 +01:00
|
|
|
int plugin_id;
|
|
|
|
};
|
|
|
|
|
2015-01-16 22:27:24 +01:00
|
|
|
void CreateCvarHook(void);
|
|
|
|
|
|
|
|
extern CDetour *Cvar_DirectSetDetour;
|
|
|
|
|
|
|
|
#endif // CVARS_H
|