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}
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...
int numMsgCategoryEntries
msgCategoryEntry_t msgCategoryEntries[NT_NUM_NOTIFYTYPE+MAX_MESSAGECATEGORIES]
uiNode_t *IMPORT * UI_InitOptionIteratorAtIndex(int index, uiNode_t *option, uiOptionIterator_t *iterator)
uiNode_t *IMPORT * UI_OptionIteratorNextOption(uiOptionIterator_t *iterator)
const char *IMPORT * Cmd_Argv(int n)
uiNode_t *IMPORT * UI_GetOption(int dataId)
const char uiNode_t *IMPORT * UI_AddOption(uiNode_t **tree, const char *name, const char *label, const char *value)
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.
#define OPTIONEXTRADATA(node)
#define OPTIONEXTRADATACONST(node)