55 for (idx = 0; idx <
ccs.numMsgCategoryEntries; idx++) {
57 const char*
id =
va(
"%d", idx);
60 lastCategory =
cgi->UI_AddOption(&messageSetting,
id,
va(
"_%s", entry->
notifyType),
id);
63 Sys_Error(
"MSO_InitList: The first entry must be a category");
94 entry = &
ccs.msgCategoryEntries[idx];
99 cgi->UI_ExecuteConfunc(
"ms_disable %i", visible);
103 cgi->UI_ExecuteConfunc(
"ms_enable %i", visible);
108 cgi->UI_OptionIteratorNextOption(&iterator);
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));
159 const int listIndex = atoi(
cgi->Cmd_Argv(1));
172 selectedEntry = &
ccs.msgCategoryEntries[idx];
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);
191 }
else if (
Q_streq(
cgi->Cmd_Argv(2),
"notify")) {
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}
Share stuff between the different cgame implementations.
Header file for single player campaign control.
const cgame_import_t * cgi
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.
messageSettings_t messageSettings[NT_NUM_NOTIFYTYPE]
char const *const nt_strings[NT_NUM_NOTIFYTYPE]
valid notification types that may cause pause / notice
Header file for messageoptions related stuff.
#define MSO_PAUSE
notification type: pause game
#define MSO_NOTIFY
notification type: add notification message
#define MSO_SOUND
notification type: play notification sound
static const cmdList_t msgOptionsCallbacks[]
static msoMenuState_t msoMenuState
static int visibleMSOEntries
void MSO_InitCallbacks(void)
void MSO_ShutdownCallbacks(void)
void MSO_SetMenuState(const msoMenuState_t newState, const bool callInit, const bool preserveIndex)
static void MSO_Init_f(void)
initializes message options menu by showing as much button lines as needed.
messageSettings_t backupMessageSettings[NT_NUM_NOTIFYTYPE]
static int messageList_scroll
static void MSO_Toggle_f(void)
Function for menu buttons to update message settings.
static void MSO_BackupSettings_f(void)
Saves actual settings into backup settings variable.
static void MSO_UpdateVisibleButtons(void)
Executes confuncs to update visible message options lines.
static void MSO_Scroll_f(void)
Function to update message options menu after scrolling. Updates all visible button lines based on co...
static void MSOCB_Init(void)
initializes message options menu by showing as much button lines as needed.
static void MSO_InitList(void)
Initializes menu texts for scrollable area.
static int messageList_size
static void MSO_RestoreSettings_f(void)
Restores actual settings from backup settings variable.
Header file for menu related console command callbacks.
void Sys_Error(const char *error,...)
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...
structure holding pause and notify settings for a notify type.
struct msgCategory_s * category
messageSettings_t * settings
Atomic structure used to define most of the UI.
Data and interface to share data.
#define OPTIONEXTRADATA(node)
#define OPTIONEXTRADATACONST(node)