26 #include "../../cl_shared.h" 28 #include "../../ui/ui_main.h" 29 #include "../../ui/ui_data.h" 57 const char*
id =
va(
"%d", idx);
63 Sys_Error(
"MSO_InitList: The first entry must be a category");
99 cgi->UI_ExecuteConfunc(
"ms_disable %i", visible);
103 cgi->UI_ExecuteConfunc(
"ms_enable %i", visible);
112 cgi->UI_ExecuteConfunc(
"ms_disable %i", visible);
141 if (
cgi->Cmd_Argc() == 2) {
155 if (
cgi->Cmd_Argc() != 3)
156 cgi->Com_Printf(
"Usage: %s <listId> <pause|notify|sound>\n",
cgi->
Cmd_Argv(0));
176 cgi->Com_Printf(
"Toggle command with selected category entry ignored.\n");
184 cgi->Com_Printf(
"Unrecognized messagetype during toggle '%s' ignored\n", selectedEntry->
notifyType);
208 if (
cgi->Cmd_Argc() < 2)
248 {
"msgoptions_toggle",
MSO_Toggle_f,
"Toggles pause, notification or sound setting for a message category"},
249 {
"msgoptions_scroll",
MSO_Scroll_f,
"Scroll callback function for message options menu text"},
250 {
"msgoptions_init",
MSO_Init_f,
"Initializes message options menu"},
253 {
nullptr,
nullptr,
nullptr}
struct msgCategory_s * category
uiNode_t *IMPORT * UI_OptionIteratorNextOption(uiOptionIterator_t *iterator)
void Sys_Error(const char *error,...)
static int messageList_scroll
static void MSOCB_Init(void)
initializes message options menu by showing as much button lines as needed.
QGL_EXTERN GLint GLenum type
const char * va(const char *format,...)
does a varargs printf into a temp buffer, so I don't need to have varargs versions of all text functi...
static void MSO_UpdateVisibleButtons(void)
Executes confuncs to update visible message options lines.
static msoMenuState_t msoMenuState
#define MSO_SOUND
notification type: play notification sound
char const *const nt_strings[NT_NUM_NOTIFYTYPE]
valid notification types that may cause pause / notice
void MSO_InitCallbacks(void)
const char *IMPORT * Cmd_Argv(int n)
void MSO_SetMenuState(const msoMenuState_t newState, const bool callInit, const bool preserveIndex)
Header file for messageoptions related stuff.
#define MSO_PAUSE
notification type: pause game
static void MSO_Scroll_f(void)
Function to update message options menu after scrolling. Updates all visible button lines based on co...
#define OPTIONEXTRADATACONST(node)
static const cmdList_t msgOptionsCallbacks[]
Atomic structure used to define most of the UI.
#define OPTIONEXTRADATA(node)
messageSettings_t messageSettings[NT_NUM_NOTIFYTYPE]
int numMsgCategoryEntries
const cgame_import_t * cgi
const char uiNode_t *IMPORT * UI_AddOption(uiNode_t **tree, const char *name, const char *label, const char *value)
uiNode_t *IMPORT * UI_InitOptionIteratorAtIndex(int index, uiNode_t *option, uiOptionIterator_t *iterator)
messageSettings_t * settings
msgCategoryEntry_t msgCategoryEntries[NT_NUM_NOTIFYTYPE+MAX_MESSAGECATEGORIES]
static void MSO_Init_f(void)
initializes message options menu by showing as much button lines as needed.
static void MSO_Toggle_f(void)
Function for menu buttons to update message settings.
static int visibleMSOEntries
uiNode_t *IMPORT * UI_GetOption(int dataId)
static void MSO_InitList(void)
Initializes menu texts for scrollable area.
static int messageList_size
void MSO_Set(const int listIndex, const notify_t type, const int optionType, const bool activate, const bool sendCommands)
Function updates pause or notification settings.
Header file for single player campaign control.
structure holding pause and notify settings for a notify type.
static void MSO_RestoreSettings_f(void)
Restores actual settings from backup settings variable.
void MSO_ShutdownCallbacks(void)
messageSettings_t backupMessageSettings[NT_NUM_NOTIFYTYPE]
#define MSO_NOTIFY
notification type: add notification message
Header file for menu related console command callbacks.
static void MSO_BackupSettings_f(void)
Saves actual settings into backup settings variable.