UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
cp_messageoptions_callbacks.cpp File Reference

Go to the source code of this file.

Functions

static void MSO_InitList (void)
 Initializes menu texts for scrollable area. More...
 
static void MSO_UpdateVisibleButtons (void)
 Executes confuncs to update visible message options lines. More...
 
static void MSOCB_Init (void)
 initializes message options menu by showing as much button lines as needed. More...
 
static void MSO_Init_f (void)
 initializes message options menu by showing as much button lines as needed. More...
 
static void MSO_Toggle_f (void)
 Function for menu buttons to update message settings. More...
 
static void MSO_Scroll_f (void)
 Function to update message options menu after scrolling. Updates all visible button lines based on configuration. More...
 
static void MSO_BackupSettings_f (void)
 Saves actual settings into backup settings variable. More...
 
static void MSO_RestoreSettings_f (void)
 Restores actual settings from backup settings variable. More...
 
void MSO_SetMenuState (const msoMenuState_t newState, const bool callInit, const bool preserveIndex)
 
void MSO_InitCallbacks (void)
 
void MSO_ShutdownCallbacks (void)
 

Variables

static msoMenuState_t msoMenuState = MSO_MSTATE_REINIT
 
static int messageList_size = 0
 
static int messageList_scroll = 0
 
static int visibleMSOEntries = 0
 
messageSettings_t backupMessageSettings [NT_NUM_NOTIFYTYPE]
 
static const cmdList_t msgOptionsCallbacks []
 

Detailed Description

Todo:
Remove direct access to nodes

Definition in file cp_messageoptions_callbacks.cpp.

Function Documentation

static void MSO_BackupSettings_f ( void  )
static

Saves actual settings into backup settings variable.

Definition at line 220 of file cp_messageoptions_callbacks.cpp.

References messageSettings.

static void MSO_Init_f ( void  )
static

initializes message options menu by showing as much button lines as needed.

Note
First facultative param (from cgi->Cmd_Arg) init messageList_size (the number of rows of button)

Definition at line 139 of file cp_messageoptions_callbacks.cpp.

References cgi, cgame_import_s::Cmd_Argv(), messageList_size, and MSOCB_Init().

void MSO_InitCallbacks ( void  )

Definition at line 255 of file cp_messageoptions_callbacks.cpp.

References cgi, and OBJSET.

Referenced by MSO_Init().

static void MSO_RestoreSettings_f ( void  )
static

Restores actual settings from backup settings variable.

Note
message options are caused to be re-initialized (for menu display)
See also
MSO_Init_f

Definition at line 230 of file cp_messageoptions_callbacks.cpp.

References messageSettings, MSO_MSTATE_REINIT, and MSO_SetMenuState().

static void MSO_Scroll_f ( void  )
static

Function to update message options menu after scrolling. Updates all visible button lines based on configuration.

Definition at line 206 of file cp_messageoptions_callbacks.cpp.

References cgi, cgame_import_s::Cmd_Argv(), messageList_scroll, and MSO_UpdateVisibleButtons().

void MSO_SetMenuState ( const msoMenuState_t  newState,
const bool  callInit,
const bool  preserveIndex 
)
void MSO_ShutdownCallbacks ( void  )

Definition at line 262 of file cp_messageoptions_callbacks.cpp.

References cgi, and TEXT_MESSAGEOPTIONS.

Referenced by MSO_Shutdown().

static void MSOCB_Init ( void  )
static

initializes message options menu by showing as much button lines as needed.

Note
This must only be done once as long as settings are changed in menu, so messageOptionsInitialized is checked whether this is done yet. This function will be reenabled if settings are changed via MSO_Set_f. If text list is not initialized after parsing, MSO_InitTextList will be called first.

Definition at line 122 of file cp_messageoptions_callbacks.cpp.

References MSO_InitList(), MSO_MSTATE_INITIALIZED, MSO_MSTATE_PREPARED, MSO_UpdateVisibleButtons(), and msoMenuState.

Referenced by MSO_Init_f(), and MSO_SetMenuState().

Variable Documentation

messageSettings_t backupMessageSettings[NT_NUM_NOTIFYTYPE]

array holding backup message settings (used for restore function in options popup)

Definition at line 38 of file cp_messageoptions_callbacks.cpp.

int messageList_scroll = 0
static

actual messageSettings list begin index due to scrolling

Definition at line 36 of file cp_messageoptions_callbacks.cpp.

Referenced by MSO_Scroll_f(), MSO_SetMenuState(), MSO_Toggle_f(), and MSO_UpdateVisibleButtons().

int messageList_size = 0
static

actual messageSettings list size

Definition at line 35 of file cp_messageoptions_callbacks.cpp.

Referenced by MSO_Init_f(), and MSO_UpdateVisibleButtons().

const cmdList_t msgOptionsCallbacks[]
static
Initial value:
= {
{"msgoptions_toggle", MSO_Toggle_f, "Toggles pause, notification or sound setting for a message category"},
{"msgoptions_scroll", MSO_Scroll_f, "Scroll callback function for message options menu text"},
{"msgoptions_init", MSO_Init_f, "Initializes message options menu"},
{"msgoptions_backup", MSO_BackupSettings_f, "Backup message settings"},
{"msgoptions_restore",MSO_RestoreSettings_f, "Restore message settings from backup"},
{nullptr, nullptr, nullptr}
}
static void MSO_Scroll_f(void)
Function to update message options menu after scrolling. Updates all visible button lines based on co...
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 void MSO_RestoreSettings_f(void)
Restores actual settings from backup settings variable.
static void MSO_BackupSettings_f(void)
Saves actual settings into backup settings variable.

Definition at line 247 of file cp_messageoptions_callbacks.cpp.

msoMenuState_t msoMenuState = MSO_MSTATE_REINIT
static

Definition at line 34 of file cp_messageoptions_callbacks.cpp.

Referenced by MSO_SetMenuState(), and MSOCB_Init().

int visibleMSOEntries = 0
static

actual visible entry count

Definition at line 37 of file cp_messageoptions_callbacks.cpp.

Referenced by MSO_SetMenuState().