summaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
Diffstat (limited to 'setup')
-rw-r--r--setup/configfile.c6
-rw-r--r--setup/joystick.c4
-rw-r--r--setup/joystick.h2
-rw-r--r--setup/keyboard.c7
-rw-r--r--setup/keyboard.h2
-rw-r--r--setup/mouse.c6
-rw-r--r--setup/mouse.h2
-rw-r--r--setup/txt_keyinput.c2
8 files changed, 29 insertions, 2 deletions
diff --git a/setup/configfile.c b/setup/configfile.c
index 5fe1d958..2a3cb845 100644
--- a/setup/configfile.c
+++ b/setup/configfile.c
@@ -286,11 +286,15 @@ static default_t extra_defaults_list[] =
{"joystick_y_invert", &joystick_y_invert, DEFAULT_INT, 0, 0},
{"joyb_strafeleft", &joybstrafeleft, DEFAULT_INT, 0, 0},
{"joyb_straferight", &joybstraferight, DEFAULT_INT, 0, 0},
+ {"joyb_prevweapon", &joybprevweapon, DEFAULT_INT, 0, 0},
+ {"joyb_nextweapon", &joybnextweapon, DEFAULT_INT, 0, 0},
{"dclick_use", &dclick_use, DEFAULT_INT, 0, 0},
{"mouseb_strafeleft", &mousebstrafeleft, DEFAULT_INT, 0, 0},
{"mouseb_straferight", &mousebstraferight, DEFAULT_INT, 0, 0},
{"mouseb_use", &mousebuse, DEFAULT_INT, 0, 0},
{"mouseb_backward", &mousebbackward, DEFAULT_INT, 0, 0},
+ {"mouseb_prevweapon", &mousebprevweapon, DEFAULT_INT, 0, 0},
+ {"mouseb_nextweapon", &mousebnextweapon, DEFAULT_INT, 0, 0},
{"use_libsamplerate", &use_libsamplerate, DEFAULT_INT, 0, 0},
{"key_pause", &key_pause, DEFAULT_KEY, 0, 0},
@@ -338,6 +342,8 @@ static default_t extra_defaults_list[] =
{"key_weapon6", &key_weapon6, DEFAULT_KEY, 0, 0},
{"key_weapon7", &key_weapon7, DEFAULT_KEY, 0, 0},
{"key_weapon8", &key_weapon8, DEFAULT_KEY, 0, 0},
+ {"key_prevweapon", &key_prevweapon, DEFAULT_KEY, 0, 0},
+ {"key_nextweapon", &key_nextweapon, DEFAULT_KEY, 0, 0},
{"key_message_refresh", &key_message_refresh, DEFAULT_KEY, 0, 0},
{"key_demo_quit", &key_demo_quit, DEFAULT_KEY, 0, 0},
{"key_multi_msg", &key_multi_msg, DEFAULT_KEY, 0, 0},
diff --git a/setup/joystick.c b/setup/joystick.c
index 867fa5c2..825cd8b5 100644
--- a/setup/joystick.c
+++ b/setup/joystick.c
@@ -50,6 +50,8 @@ int joybuse = 2;
int joybspeed = 3;
int joybstrafeleft = -1;
int joybstraferight = -1;
+int joybprevweapon = -1;
+int joybnextweapon = -1;
// Joystick to use, as an SDL joystick index:
@@ -430,6 +432,8 @@ void ConfigJoystick(void)
AddJoystickControl(button_table, "Strafe Left", &joybstrafeleft);
AddJoystickControl(button_table, "Strafe Right", &joybstraferight);
+ AddJoystickControl(button_table, "Previous weapon", &joybprevweapon);
+ AddJoystickControl(button_table, "Next weapon", &joybnextweapon);
TXT_SignalConnect(joystick_button, "pressed", CalibrateJoystick, NULL);
TXT_SignalConnect(window, "closed", JoystickWindowClosed, NULL);
diff --git a/setup/joystick.h b/setup/joystick.h
index 39cf0bf4..5d3973c5 100644
--- a/setup/joystick.h
+++ b/setup/joystick.h
@@ -29,6 +29,8 @@ extern int joybuse;
extern int joybspeed;
extern int joybstrafeleft;
extern int joybstraferight;
+extern int joybprevweapon;
+extern int joybnextweapon;
extern int joystick_index;
extern int joystick_x_axis;
diff --git a/setup/keyboard.c b/setup/keyboard.c
index bcf5ec7a..81976f85 100644
--- a/setup/keyboard.c
+++ b/setup/keyboard.c
@@ -90,6 +90,8 @@ int key_weapon5 = '5';
int key_weapon6 = '6';
int key_weapon7 = '7';
int key_weapon8 = '8';
+int key_prevweapon = 0;
+int key_nextweapon = 0;
int key_message_refresh = KEY_ENTER;
int key_demo_quit = 'q';
@@ -109,7 +111,8 @@ static int *controls[] = { &key_left, &key_right, &key_up, &key_down,
&key_pause,
&key_weapon1, &key_weapon2, &key_weapon3,
&key_weapon4, &key_weapon5, &key_weapon6,
- &key_weapon7, &key_weapon8, NULL };
+ &key_weapon7, &key_weapon8,
+ &key_prevweapon, &key_nextweapon, NULL };
static int *menu_nav[] = { &key_menu_activate, &key_menu_up, &key_menu_down,
&key_menu_left, &key_menu_right, &key_menu_back,
@@ -240,6 +243,8 @@ static void OtherKeysDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
AddKeyControl(table, "Weapon 6", &key_weapon6);
AddKeyControl(table, "Weapon 7", &key_weapon7);
AddKeyControl(table, "Weapon 8", &key_weapon8);
+ AddKeyControl(table, "Previous weapon", &key_prevweapon);
+ AddKeyControl(table, "Next weapon", &key_nextweapon);
TXT_AddWidgets(table, TXT_NewStrut(0, 1),
TXT_NewStrut(0, 1),
diff --git a/setup/keyboard.h b/setup/keyboard.h
index f934116f..73510861 100644
--- a/setup/keyboard.h
+++ b/setup/keyboard.h
@@ -95,6 +95,8 @@ extern int key_weapon5;
extern int key_weapon6;
extern int key_weapon7;
extern int key_weapon8;
+extern int key_prevweapon;
+extern int key_nextweapon;
extern int key_message_refresh;
extern int key_demo_quit;
diff --git a/setup/mouse.c b/setup/mouse.c
index 49266d48..559231b0 100644
--- a/setup/mouse.c
+++ b/setup/mouse.c
@@ -44,6 +44,8 @@ int mousebstrafeleft = -1;
int mousebstraferight = -1;
int mousebbackward = -1;
int mousebuse = -1;
+int mousebprevweapon = -1;
+int mousebnextweapon = -1;
int dclick_use = 1;
@@ -55,6 +57,8 @@ static int *all_mouse_buttons[] = {
&mousebstraferight,
&mousebbackward,
&mousebuse,
+ &mousebprevweapon,
+ &mousebnextweapon
};
static void MouseSetCallback(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(variable))
@@ -104,6 +108,8 @@ static void ConfigExtraButtons(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
AddMouseControl(buttons_table, "Use", &mousebuse);
AddMouseControl(buttons_table, "Strafe left", &mousebstrafeleft);
AddMouseControl(buttons_table, "Strafe right", &mousebstraferight);
+ AddMouseControl(buttons_table, "Previous weapon", &mousebprevweapon);
+ AddMouseControl(buttons_table, "Next weapon", &mousebnextweapon);
}
void ConfigMouse(void)
diff --git a/setup/mouse.h b/setup/mouse.h
index f0a39ade..48270caa 100644
--- a/setup/mouse.h
+++ b/setup/mouse.h
@@ -37,6 +37,8 @@ extern int mousebstraferight;
extern int mousebbackward;
extern int mousebuse;
extern int dclick_use;
+extern int mousebprevweapon;
+extern int mousebnextweapon;
void ConfigMouse(void);
diff --git a/setup/txt_keyinput.c b/setup/txt_keyinput.c
index e385cc59..483c325f 100644
--- a/setup/txt_keyinput.c
+++ b/setup/txt_keyinput.c
@@ -111,7 +111,7 @@ static void TXT_KeyInputDrawer(TXT_UNCAST_ARG(key_input), int selected)
if (*key_input->variable == 0)
{
- strcpy(buf, "");
+ strcpy(buf, "(none)");
}
else
{