diff options
Diffstat (limited to 'src/setup')
-rw-r--r-- | src/setup/joystick.c | 2 | ||||
-rw-r--r-- | src/setup/keyboard.c | 27 | ||||
-rw-r--r-- | src/setup/keyboard.h | 53 | ||||
-rw-r--r-- | src/setup/mainmenu.c | 60 | ||||
-rw-r--r-- | src/setup/mouse.c | 9 | ||||
-rw-r--r-- | src/setup/multiplayer.c | 35 | ||||
-rw-r--r-- | src/setup/sound.c | 1 | ||||
-rw-r--r-- | src/setup/txt_keyinput.c | 2 | ||||
-rw-r--r-- | src/setup/txt_mouseinput.c | 4 |
9 files changed, 131 insertions, 62 deletions
diff --git a/src/setup/joystick.c b/src/setup/joystick.c index 0094dd81..fbe3a3f3 100644 --- a/src/setup/joystick.c +++ b/src/setup/joystick.c @@ -425,6 +425,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); if (gamemission == hexen) { diff --git a/src/setup/keyboard.c b/src/setup/keyboard.c index 6e746ee9..3d9f9977 100644 --- a/src/setup/keyboard.c +++ b/src/setup/keyboard.c @@ -47,7 +47,7 @@ static int *controls[] = { &key_left, &key_right, &key_up, &key_down, &key_weapon1, &key_weapon2, &key_weapon3, &key_weapon4, &key_weapon5, &key_weapon6, &key_weapon7, &key_weapon8, - NULL }; + &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, @@ -55,10 +55,12 @@ static int *menu_nav[] = { &key_menu_activate, &key_menu_up, &key_menu_down, static int *shortcuts[] = { &key_menu_help, &key_menu_save, &key_menu_load, &key_menu_volume, &key_menu_detail, &key_menu_qsave, - &key_menu_endgame, &key_menu_messages, + &key_menu_endgame, &key_menu_messages, &key_spy, &key_menu_qload, &key_menu_quit, &key_menu_gamma, &key_menu_incscreen, &key_menu_decscreen, - &key_message_refresh, NULL }; + &key_message_refresh, &key_multi_msg, + &key_multi_msgplayer[0], &key_multi_msgplayer[1], + &key_multi_msgplayer[2], &key_multi_msgplayer[3] }; static int *map_keys[] = { &key_map_north, &key_map_south, &key_map_east, &key_map_west, &key_map_zoomin, &key_map_zoomout, @@ -220,6 +222,8 @@ static void ConfigExtraKeys(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); } static void OtherKeysDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused)) @@ -260,14 +264,15 @@ static void OtherKeysDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused)) AddKeyControl(table, "Quick load", &key_menu_qload); AddKeyControl(table, "Quit game", &key_menu_quit); AddKeyControl(table, "Toggle gamma", &key_menu_gamma); + AddKeyControl(table, "Multiplayer spy", &key_spy); AddKeyControl(table, "Increase screen size", &key_menu_incscreen); AddKeyControl(table, "Decrease screen size", &key_menu_decscreen); AddKeyControl(table, "Display last message", &key_message_refresh); + AddKeyControl(table, "Finish recording demo", &key_demo_quit); AddSectionLabel(table, "Map", true); - AddKeyControl(table, "Toggle map", &key_map_toggle); AddKeyControl(table, "Zoom in", &key_map_zoomin); AddKeyControl(table, "Zoom out", &key_map_zoomout); @@ -281,6 +286,20 @@ static void OtherKeysDialog(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused)) AddKeyControl(table, "Mark location", &key_map_mark); AddKeyControl(table, "Clear all marks", &key_map_clearmark); + AddSectionLabel(table, "Multiplayer", true); + + AddKeyControl(table, "Send message", &key_multi_msg); + AddKeyControl(table, "- to green", &key_multi_msgplayer[0]); + AddKeyControl(table, "- to indigo", &key_multi_msgplayer[1]); + AddKeyControl(table, "- to brown", &key_multi_msgplayer[2]); + AddKeyControl(table, "- to red", &key_multi_msgplayer[3]); + + TXT_AddWidgets(table, TXT_NewStrut(0, 1), + TXT_NewStrut(0, 1), + TXT_NewLabel(" - Map - "), + TXT_NewStrut(0, 0), + NULL); + scrollpane = TXT_NewScrollPane(0, 13, table); TXT_AddWidget(window, scrollpane); diff --git a/src/setup/keyboard.h b/src/setup/keyboard.h index 2797ba8f..12059bf8 100644 --- a/src/setup/keyboard.h +++ b/src/setup/keyboard.h @@ -22,59 +22,6 @@ #ifndef SETUP_KEYBOARD_H #define SETUP_KEYBOARD_H -// Menu keys: - -extern int key_menu_activate; -extern int key_menu_up; -extern int key_menu_down; -extern int key_menu_left; -extern int key_menu_right; -extern int key_menu_back; -extern int key_menu_forward; -extern int key_menu_confirm; -extern int key_menu_abort; - -extern int key_menu_help; -extern int key_menu_save; -extern int key_menu_load; -extern int key_menu_volume; -extern int key_menu_detail; -extern int key_menu_qsave; -extern int key_menu_endgame; -extern int key_menu_messages; -extern int key_menu_qload; -extern int key_menu_quit; -extern int key_menu_gamma; - -extern int key_menu_incscreen; -extern int key_menu_decscreen; - -// Automap keys: - -extern int key_map_north; -extern int key_map_south; -extern int key_map_east; -extern int key_map_west; -extern int key_map_zoomin; -extern int key_map_zoomout; -extern int key_map_toggle; -extern int key_map_maxzoom; -extern int key_map_follow; -extern int key_map_grid; -extern int key_map_mark; -extern int key_map_clearmark; - -// Weapon keys: - -extern int key_weapon1; -extern int key_weapon2; -extern int key_weapon3; -extern int key_weapon4; -extern int key_weapon5; -extern int key_weapon6; -extern int key_weapon7; -extern int key_weapon8; - void ConfigKeyboard(void); void BindKeyboardVariables(void); diff --git a/src/setup/mainmenu.c b/src/setup/mainmenu.c index 46e4b4e6..c3cb7db5 100644 --- a/src/setup/mainmenu.c +++ b/src/setup/mainmenu.c @@ -46,6 +46,64 @@ #include "multiplayer.h" #include "sound.h" +static const int cheat_sequence[] = +{ + KEY_UPARROW, KEY_UPARROW, KEY_DOWNARROW, KEY_DOWNARROW, + KEY_LEFTARROW, KEY_RIGHTARROW, KEY_LEFTARROW, KEY_RIGHTARROW, + 'b', 'a', KEY_ENTER, 0 +}; + +static unsigned int cheat_sequence_index = 0; + +// I think these are good "sensible" defaults: + +static void SensibleDefaults(void) +{ +#if 0 + // TODO for raven-branch + key_up = 'w'; + key_down = 's'; + key_strafeleft = 'a'; + key_straferight = 'd'; + mousebprevweapon = 4; + mousebnextweapon = 3; + snd_musicdevice = 3; + joybspeed = 29; + vanilla_savegame_limit = 0; + vanilla_keyboard_mapping = 0; + vanilla_demo_limit = 0; + show_endoom = 0; + dclick_use = 0; + novert = 1; +#endif +} + +static int MainMenuKeyPress(txt_window_t *window, int key, void *user_data) +{ + if (key == cheat_sequence[cheat_sequence_index]) + { + ++cheat_sequence_index; + + if (cheat_sequence[cheat_sequence_index] == 0) + { + SensibleDefaults(); + cheat_sequence_index = 0; + + window = TXT_NewWindow(NULL); + TXT_AddWidget(window, TXT_NewLabel(" \x01 ")); + TXT_SetWindowAction(window, TXT_HORIZ_RIGHT, NULL); + + return 1; + } + } + else + { + cheat_sequence_index = 0; + } + + return 0; +} + static void DoQuit(void *widget, void *dosave) { if (dosave != NULL) @@ -174,6 +232,8 @@ void MainMenu(void) quit_action = TXT_NewWindowAction(KEY_ESCAPE, "Quit"); TXT_SignalConnect(quit_action, "pressed", QuitConfirm, NULL); TXT_SetWindowAction(window, TXT_HORIZ_LEFT, quit_action); + + TXT_SetKeyListener(window, MainMenuKeyPress, NULL); } // diff --git a/src/setup/mouse.c b/src/setup/mouse.c index d464261f..5b555f88 100644 --- a/src/setup/mouse.c +++ b/src/setup/mouse.c @@ -36,7 +36,7 @@ static int usemouse = 1; static int novert = 0; static int mouseSensitivity = 5; -static float mouse_acceleration = 1.0; +static float mouse_acceleration = 2.0; static int mouse_threshold = 10; static int grabmouse = 1; @@ -48,7 +48,9 @@ static int *all_mouse_buttons[] = { &mousebstraferight, &mousebbackward, &mousebuse, - &mousebjump + &mousebjump, + &mousebprevweapon, + &mousebnextweapon }; static void MouseSetCallback(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(variable)) @@ -103,6 +105,9 @@ static void ConfigExtraButtons(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused)) { AddMouseControl(buttons_table, "Jump", &mousebjump); } + + AddMouseControl(buttons_table, "Previous weapon", &mousebprevweapon); + AddMouseControl(buttons_table, "Next weapon", &mousebnextweapon); } void ConfigMouse(void) diff --git a/src/setup/multiplayer.c b/src/setup/multiplayer.c index f3b3221d..24cd0670 100644 --- a/src/setup/multiplayer.c +++ b/src/setup/multiplayer.c @@ -29,6 +29,7 @@ #include "d_iwad.h" #include "m_config.h" #include "doom/d_englsh.h" +#include "m_controls.h" #include "multiplayer.h" #include "mode.h" @@ -863,5 +864,39 @@ void BindMultiplayerVariables(void) sprintf(buf, "chatmacro%i", i); M_BindVariable(buf, &chat_macros[i]); } + + switch (gamemission) + { + case doom: + M_BindChatControls(4); + key_multi_msgplayer[0] = 'g'; + key_multi_msgplayer[1] = 'i'; + key_multi_msgplayer[2] = 'b'; + key_multi_msgplayer[3] = 'r'; + break; + + case heretic: + M_BindChatControls(4); + key_multi_msgplayer[0] = 'g'; + key_multi_msgplayer[1] = 'y'; + key_multi_msgplayer[2] = 'r'; + key_multi_msgplayer[3] = 'b'; + break; + + case hexen: + M_BindChatControls(8); + key_multi_msgplayer[0] = 'b'; + key_multi_msgplayer[1] = 'r'; + key_multi_msgplayer[2] = 'y'; + key_multi_msgplayer[3] = 'g'; + key_multi_msgplayer[4] = 'j'; + key_multi_msgplayer[5] = 'w'; + key_multi_msgplayer[6] = 'h'; + key_multi_msgplayer[7] = 'p'; + break; + + default: + break; + } } diff --git a/src/setup/sound.c b/src/setup/sound.c index 61182753..627549b5 100644 --- a/src/setup/sound.c +++ b/src/setup/sound.c @@ -69,6 +69,7 @@ static char *musicmode_strings[] = int snd_sfxdevice = SNDDEVICE_SB; int snd_musicdevice = SNDDEVICE_GENMIDI; int snd_samplerate = 22050; +int opl_io_port = 0x388; static int numChannels = 8; static int sfxVolume = 15; diff --git a/src/setup/txt_keyinput.c b/src/setup/txt_keyinput.c index e385cc59..483c325f 100644 --- a/src/setup/txt_keyinput.c +++ b/src/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 { diff --git a/src/setup/txt_mouseinput.c b/src/setup/txt_mouseinput.c index 05c89b39..8b87e651 100644 --- a/src/setup/txt_mouseinput.c +++ b/src/setup/txt_mouseinput.c @@ -91,7 +91,7 @@ static void GetMouseButtonDescription(int button, char *buf) strcpy(buf, "MID"); break; default: - sprintf(buf, "BUTTON #%i", button); + sprintf(buf, "BUTTON #%i", button + 1); break; } } @@ -153,7 +153,7 @@ static int TXT_MouseInputKeyPress(TXT_UNCAST_ARG(mouse_input), int mouse) static void TXT_MouseInputMousePress(TXT_UNCAST_ARG(widget), int x, int y, int b) { TXT_CAST_ARG(txt_mouse_input_t, widget); - + // Clicking is like pressing enter if (b == TXT_MOUSE_LEFT) |