2008-08-27 15:48:50 +00:00
|
|
|
#include <game/client/component.hpp>
|
|
|
|
|
|
|
|
class BINDS : public COMPONENT
|
|
|
|
{
|
|
|
|
char keybindings[KEY_LAST][128];
|
2008-08-30 21:01:57 +00:00
|
|
|
|
|
|
|
int get_key_id(const char *key_name);
|
|
|
|
|
|
|
|
static void con_bind(void *result, void *user_data);
|
|
|
|
static void con_unbind(void *result, void *user_data);
|
|
|
|
static void con_unbindall(void *result, void *user_data);
|
|
|
|
static void con_dump_binds(void *result, void *user_data);
|
|
|
|
|
2008-08-27 15:48:50 +00:00
|
|
|
public:
|
|
|
|
BINDS();
|
|
|
|
|
2008-08-30 09:34:55 +00:00
|
|
|
class BINDS_SPECIAL : public COMPONENT
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BINDS *binds;
|
|
|
|
virtual bool on_input(INPUT_EVENT e);
|
|
|
|
};
|
|
|
|
|
|
|
|
BINDS_SPECIAL special_binds;
|
|
|
|
|
2008-08-27 15:48:50 +00:00
|
|
|
void bind(int keyid, const char *str);
|
|
|
|
void set_defaults();
|
|
|
|
void unbindall();
|
|
|
|
const char *get(int keyid);
|
2008-09-25 14:04:02 +00:00
|
|
|
const char *get_key(const char *bindstr);
|
2008-08-27 15:48:50 +00:00
|
|
|
|
2008-09-04 21:36:44 +00:00
|
|
|
virtual void on_save();
|
|
|
|
virtual void on_console_init();
|
2008-08-27 15:48:50 +00:00
|
|
|
virtual bool on_input(INPUT_EVENT e);
|
|
|
|
};
|