ddnet/src/game/client/components/binds.h
GreYFoXGTi 5d9ee1736e made the code so it would have less conflicts in the future and Merged branch 'master' of http://github.com/oy/teeworlds
Conflicts:
	data/languages/dutch.txt
	data/languages/french.txt
	data/languages/german.txt
	data/languages/russian.txt
	src/game/server/entities/flag.cpp
	src/game/server/entities/flag.h
	src/game/server/gamecontext.cpp
	src/game/server/gamemodes/ctf.cpp
	src/game/server/gamemodes/ctf.h
	src/game/server/gamemodes/dm.cpp
	src/game/server/gamemodes/dm.h
	src/game/server/gamemodes/mod.cpp
	src/game/server/gamemodes/tdm.cpp
	src/game/server/gamemodes/tdm.h
2010-11-22 00:26:00 +02:00

44 lines
1.3 KiB
C++

/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
/* If you are missing that file, acquire a complete release at teeworlds.com. */
#ifndef GAME_CLIENT_COMPONENTS_BINDS_H
#define GAME_CLIENT_COMPONENTS_BINDS_H
#include <game/client/component.h>
#include <engine/keys.h>
class CBinds : public CComponent
{
char m_aaKeyBindings[KEY_LAST][128];
int GetKeyId(const char *pKeyName);
static void ConBind(IConsole::IResult *pResult, void *pUserData, int ClientID);
static void ConUnbind(IConsole::IResult *pResult, void *pUserData, int ClientID);
static void ConUnbindAll(IConsole::IResult *pResult, void *pUserData, int ClientID);
static void ConDumpBinds(IConsole::IResult *pResult, void *pUserData, int ClientID);
class IConsole *GetConsole() const { return Console(); }
static void ConfigSaveCallback(class IConfig *pConfig, void *pUserData);
public:
CBinds();
class CBindsSpecial : public CComponent
{
public:
CBinds *m_pBinds;
virtual bool OnInput(IInput::CEvent Event);
};
CBindsSpecial m_SpecialBinds;
void Bind(int KeyId, const char *pStr);
void SetDefaults();
void UnbindAll();
const char *Get(int KeyId);
const char *GetKey(const char *pBindStr);
virtual void OnConsoleInit();
virtual bool OnInput(IInput::CEvent Event);
};
#endif