You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added new keybinds, keycontrol handlers, hudsquadmsg methods for alternate communication menu control scheme
* .gitignore update. CMake in VStudio places builds in [Oo]ut/ folder by default
* Added support for menu pages
* Small formatting cleanup
* code cleanup
* removed unecessary variable
* Updates after code review
* Updated comments
* XSTR_SIZE correction
int Num_menu_items = -1; // number of items for a message menu
109
109
110
-
int First_menu_item= -1; // index of first item in the menu
110
+
int First_menu_item= -1; // index of first item in the menu. This tracks what element of comms options collection is displayed as first option, and displays the next 9 options. Changes only by +/- MAX_MENU_ITEMS (10)
111
+
int Selected_menu_item = First_menu_item; //!< index of selected item in the menu. Possible index range: 0 - 9, assuming MAX_MENU_ITEMS == 10, and First_menu_item gets initialized
111
112
SCP_string Lua_sqd_msg_cat;
112
113
113
114
#defineMAX_KEYS_NO_SCROLL10
@@ -217,6 +218,7 @@ void hud_squadmsg_start()
217
218
218
219
Num_menu_items = -1; // reset the menu items
219
220
First_menu_item = 0;
221
+
Selected_menu_item = First_menu_item; // make first menu item a selected object
220
222
Squad_msg_mode = SM_MODE_TYPE_SELECT; // start off at the base state
221
223
Msg_mode_timestamp = timestamp(DEFAULT_MSG_TIMEOUT); // initialize our timer to bogus value
222
224
Msg_shortcut_command = -1; // assume no shortcut key being used
@@ -485,6 +487,89 @@ void hud_squadmsg_page_up()
485
487
}
486
488
}
487
489
490
+
//Fuctions that allow selection of specific comms menu items with simple up/down/select buttons
491
+
voidhud_squadmsg_selection_move_down() {
492
+
493
+
//Check if comms menu is up
494
+
if (Player->flags & PLAYER_FLAGS_MSG_MODE)
495
+
{
496
+
//move down
497
+
++Selected_menu_item;
498
+
499
+
//play scrolling sound and reset the comms window timeout timer, so the window doesn't dissapear while we select our item
0 commit comments