diff options
Diffstat (limited to 'src/setup')
-rw-r--r-- | src/setup/.gitignore | 3 | ||||
-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 | 37 | ||||
-rw-r--r-- | src/setup/txt_keyinput.c | 2 | ||||
-rw-r--r-- | src/setup/txt_mouseinput.c | 4 |
10 files changed, 155 insertions, 77 deletions
diff --git a/src/setup/.gitignore b/src/setup/.gitignore index 37c8e4c1..f41d11c7 100644 --- a/src/setup/.gitignore +++ b/src/setup/.gitignore @@ -1,8 +1,7 @@ Makefile.in Makefile .deps -chocolate-setup +setup-manifest.xml *.rc -*.exe tags TAGS 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 ce3865b3..7ee523bb 100644 --- a/src/setup/keyboard.c +++ b/src/setup/keyboard.c @@ -49,7 +49,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, @@ -57,10 +57,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, @@ -240,6 +242,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)) @@ -280,14 +284,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); @@ -301,6 +306,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 45787eba..d8dc129e 100644 --- a/src/setup/sound.c +++ b/src/setup/sound.c @@ -40,17 +40,18 @@ typedef enum NUM_SFXMODES } sfxmode_t; -static char *sfxmode_strings[] = +static char *sfxmode_strings[] = { "Disabled", "Digital", "PC speaker" }; -typedef enum +typedef enum { MUSICMODE_DISABLED, - MUSICMODE_MIDI, + MUSICMODE_OPL, + MUSICMODE_NATIVE, MUSICMODE_CD, NUM_MUSICMODES } musicmode_t; @@ -58,15 +59,17 @@ typedef enum static char *musicmode_strings[] = { "Disabled", - "MIDI", + "OPL (Adlib/SB)", + "Native MIDI", "CD audio" }; // Config file variables: int snd_sfxdevice = SNDDEVICE_SB; -int snd_musicdevice = SNDDEVICE_SB; +int snd_musicdevice = SNDDEVICE_GENMIDI; int snd_samplerate = 22050; +int opl_io_port = 0x388; static int numChannels = 8; static int sfxVolume = 15; @@ -108,7 +111,10 @@ static void UpdateSndDevices(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(data)) case MUSICMODE_DISABLED: snd_musicdevice = SNDDEVICE_NONE; break; - case MUSICMODE_MIDI: + case MUSICMODE_NATIVE: + snd_musicdevice = SNDDEVICE_GENMIDI; + break; + case MUSICMODE_OPL: snd_musicdevice = SNDDEVICE_SB; break; case MUSICMODE_CD: @@ -139,20 +145,26 @@ void ConfigSound(void) { snd_sfxmode = SFXMODE_DISABLED; } - + // Is music enabled? - if (snd_musicdevice == SNDDEVICE_NONE) + if (snd_musicdevice == SNDDEVICE_GENMIDI) { - snd_musicmode = MUSICMODE_DISABLED; + snd_musicmode = MUSICMODE_NATIVE; } else if (snd_musicmode == SNDDEVICE_CD) { snd_musicmode = MUSICMODE_CD; } + else if (snd_musicdevice == SNDDEVICE_SB + || snd_musicdevice == SNDDEVICE_ADLIB + || snd_musicdevice == SNDDEVICE_AWE32) + { + snd_musicmode = MUSICMODE_OPL; + } else { - snd_musicmode = MUSICMODE_MIDI; + snd_musicmode = MUSICMODE_DISABLED; } // Doom has PC speaker sound effects, but others do not: @@ -188,7 +200,7 @@ void ConfigSound(void) music_table = TXT_NewTable(2), NULL); - TXT_SetColumnWidths(sfx_table, 20, 5); + TXT_SetColumnWidths(sfx_table, 20, 14); TXT_AddWidgets(sfx_table, TXT_NewLabel("Sound effects"), @@ -209,7 +221,7 @@ void ConfigSound(void) NULL); } - TXT_SetColumnWidths(music_table, 20, 5); + TXT_SetColumnWidths(music_table, 20, 14); TXT_AddWidgets(music_table, TXT_NewLabel("Music"), @@ -222,7 +234,6 @@ void ConfigSound(void) TXT_SignalConnect(sfx_mode_control, "changed", UpdateSndDevices, NULL); TXT_SignalConnect(music_mode_control, "changed", UpdateSndDevices, NULL); - } void BindSoundVariables(void) 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) |