2010-11-20 10:37:14 +00:00
|
|
|
/* (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. */
|
2010-05-29 07:25:38 +00:00
|
|
|
#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];
|
|
|
|
|
2011-02-12 10:40:36 +00:00
|
|
|
int GetKeyID(const char *pKeyName);
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
static void ConBind(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void ConUnbind(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void ConUnbindAll(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void ConDumpBinds(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
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;
|
|
|
|
|
2011-02-12 10:40:36 +00:00
|
|
|
void Bind(int KeyID, const char *pStr);
|
2010-05-29 07:25:38 +00:00
|
|
|
void SetDefaults();
|
|
|
|
void UnbindAll();
|
2011-02-12 10:40:36 +00:00
|
|
|
const char *Get(int KeyID);
|
2010-05-29 07:25:38 +00:00
|
|
|
const char *GetKey(const char *pBindStr);
|
|
|
|
|
|
|
|
virtual void OnConsoleInit();
|
|
|
|
virtual bool OnInput(IInput::CEvent Event);
|
|
|
|
};
|
|
|
|
#endif
|