2007-03-01 02:02:47 +01:00
|
|
|
/**
|
|
|
|
* vim: set ts=4 :
|
2007-08-01 04:12:47 +02:00
|
|
|
* ================================================================
|
|
|
|
* SourceMod
|
|
|
|
* Copyright (C) 2004-2007 AlliedModders LLC. All rights reserved.
|
|
|
|
* ================================================================
|
2007-03-01 02:02:47 +01:00
|
|
|
*
|
2007-08-01 04:12:47 +02:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License,
|
|
|
|
* version 3.0, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* As a special exception, AlliedModders LLC gives you permission to
|
|
|
|
* link the code of this program (as well as its derivative works) to
|
|
|
|
* "Half-Life 2," the "Source Engine," the "SourcePawn JIT," and any
|
|
|
|
* Game MODs that run on software by the Valve Corporation. You must
|
|
|
|
* obey the GNU General Public License in all respects for all other
|
|
|
|
* code used. Additionally, AlliedModders LLC grants this exception
|
|
|
|
* to all derivative works. AlliedModders LLC defines further
|
|
|
|
* exceptions, found in LICENSE.txt (as of this writing, version
|
|
|
|
* JULY-31-2007), or <http://www.sourcemod.net/license.php>.
|
2007-03-01 02:02:47 +01:00
|
|
|
*
|
|
|
|
* Version: $Id$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE_SOURCEMOD_CHALFLIFE2_H_
|
|
|
|
#define _INCLUDE_SOURCEMOD_CHALFLIFE2_H_
|
|
|
|
|
|
|
|
#include <sh_list.h>
|
2007-04-12 02:45:53 +02:00
|
|
|
#include <sh_tinyhash.h>
|
2007-03-01 02:02:47 +01:00
|
|
|
#include "sm_trie.h"
|
|
|
|
#include "sm_globals.h"
|
2007-06-17 06:04:17 +02:00
|
|
|
#include <IGameHelpers.h>
|
2007-07-31 01:16:58 +02:00
|
|
|
#include <KeyValues.h>
|
2007-03-01 02:02:47 +01:00
|
|
|
|
|
|
|
using namespace SourceHook;
|
2007-06-17 06:04:17 +02:00
|
|
|
using namespace SourceMod;
|
2007-03-01 02:02:47 +01:00
|
|
|
|
2007-06-07 00:26:40 +02:00
|
|
|
#define HUD_PRINTTALK 3
|
|
|
|
#define HUD_PRINTCENTER 4
|
|
|
|
|
2007-03-01 02:02:47 +01:00
|
|
|
struct DataTableInfo
|
|
|
|
{
|
|
|
|
ServerClass *sc;
|
|
|
|
Trie *lookup;
|
|
|
|
};
|
|
|
|
|
2007-04-12 02:45:53 +02:00
|
|
|
struct DataMapTrie
|
|
|
|
{
|
|
|
|
DataMapTrie() : trie(NULL) {}
|
|
|
|
Trie *trie;
|
|
|
|
};
|
|
|
|
|
2007-06-17 06:04:17 +02:00
|
|
|
class CHalfLife2 :
|
|
|
|
public SMGlobalClass,
|
|
|
|
public IGameHelpers
|
2007-03-01 02:02:47 +01:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
CHalfLife2();
|
|
|
|
~CHalfLife2();
|
|
|
|
public:
|
2007-04-11 17:05:56 +02:00
|
|
|
void OnSourceModStartup(bool late);
|
2007-06-01 08:33:54 +02:00
|
|
|
void OnSourceModAllInitialized();
|
2007-04-11 17:05:56 +02:00
|
|
|
/*void OnSourceModAllShutdown();*/
|
2007-06-17 06:04:17 +02:00
|
|
|
public: //IGameHelpers
|
2007-03-01 02:02:47 +01:00
|
|
|
SendProp *FindInSendTable(const char *classname, const char *offset);
|
2007-06-17 06:04:17 +02:00
|
|
|
datamap_t *GetDataMap(CBaseEntity *pEntity);
|
2007-03-01 05:18:23 +01:00
|
|
|
ServerClass *FindServerClass(const char *classname);
|
2007-04-12 02:45:53 +02:00
|
|
|
typedescription_t *FindInDataMap(datamap_t *pMap, const char *offset);
|
2007-04-12 18:28:29 +02:00
|
|
|
void SetEdictStateChanged(edict_t *pEdict, unsigned short offset);
|
2007-07-19 02:34:44 +02:00
|
|
|
bool TextMsg(int client, int dest, const char *msg);
|
2007-08-06 02:22:38 +02:00
|
|
|
bool HintTextMsg(int client, const char *msg);
|
2007-07-31 01:16:58 +02:00
|
|
|
bool ShowVGUIMenu(int client, const char *name, KeyValues *data, bool show);
|
2007-03-01 05:18:23 +01:00
|
|
|
private:
|
|
|
|
DataTableInfo *_FindServerClass(const char *classname);
|
|
|
|
private:
|
2007-03-01 02:02:47 +01:00
|
|
|
Trie *m_pClasses;
|
|
|
|
List<DataTableInfo *> m_Tables;
|
2007-04-12 02:45:53 +02:00
|
|
|
THash<datamap_t *, DataMapTrie> m_Maps;
|
2007-06-01 08:33:54 +02:00
|
|
|
int m_MsgTextMsg;
|
2007-07-31 01:16:58 +02:00
|
|
|
int m_HinTextMsg;
|
|
|
|
int m_VGUIMenu;
|
2007-03-01 02:02:47 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
extern CHalfLife2 g_HL2;
|
2007-04-12 18:28:29 +02:00
|
|
|
extern bool g_IsOriginalEngine;
|
2007-03-01 02:02:47 +01:00
|
|
|
|
|
|
|
#endif //_INCLUDE_SOURCEMOD_CHALFLIFE2_H_
|