cp_messageoptions_callbacks.c File Reference

#include "../cl_shared.h"
#include "../ui/ui_main.h"
#include "../ui/ui_data.h"
#include "cp_campaign.h"
#include "cp_messageoptions.h"
#include "cp_messageoptions_callbacks.h"
Include dependency graph for cp_messageoptions_callbacks.c:

Go to the source code of this file.

Functions

static void MSO_InitList (void)
 Initializes menu texts for scrollable area.
static void MSO_UpdateVisibleButtons (void)
 Executes confuncs to update visible message options lines.
static void MSOCB_Init (void)
 initializes message options menu by showing as much button lines as needed.
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_Scroll_f (void)
 Function to update message options menu after scrolling. Updates all visible button lines based on configuration.
static void MSO_BackupSettings_f (void)
 Saves actual settings into backup settings variable.
static void MSO_RestoreSettings_f (void)
 Restores actual settings from backup settings variable.
void MSO_SetMenuState (const msoMenuState_t newState, const qboolean callInit, const qboolean 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]

Detailed Description

Todo:
Remove direct access to nodes

Definition in file cp_messageoptions_callbacks.c.


Function Documentation

static void MSO_BackupSettings_f ( void   )  [static]

Saves actual settings into backup settings variable.

Definition at line 217 of file cp_messageoptions_callbacks.c.

References messageSettings.

Referenced by MSO_InitCallbacks().

static void MSO_Init_f ( void   )  [static]

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

Note:
First facultative param (from Cmd_Arg) init messageList_size (the number of rows of button)

Definition at line 137 of file cp_messageoptions_callbacks.c.

References Cmd_Argc(), Cmd_Argv(), messageList_size, and MSOCB_Init().

Referenced by MSO_InitCallbacks().

void MSO_InitCallbacks ( void   ) 
static void MSO_InitList ( void   )  [static]
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 227 of file cp_messageoptions_callbacks.c.

References messageSettings, MSO_MSTATE_REINIT, MSO_SetMenuState(), qfalse, and qtrue.

Referenced by MSO_InitCallbacks().

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 203 of file cp_messageoptions_callbacks.c.

References Cmd_Argc(), Cmd_Argv(), messageList_scroll, and MSO_UpdateVisibleButtons().

Referenced by MSO_InitCallbacks().

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

Definition at line 256 of file cp_messageoptions_callbacks.c.

References Cmd_RemoveCommand(), TEXT_MESSAGEOPTIONS, and UI_ResetData().

Referenced by MSO_Shutdown().

static void MSO_Toggle_f ( void   )  [static]
static void MSO_UpdateVisibleButtons ( void   )  [static]
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 120 of file cp_messageoptions_callbacks.c.

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

Referenced by MSO_Init_f(), and MSO_SetMenuState().


Variable Documentation

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

Definition at line 37 of file cp_messageoptions_callbacks.c.

int messageList_scroll = 0 [static]

actual messageSettings list begin index due to scrolling

Definition at line 35 of file cp_messageoptions_callbacks.c.

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 34 of file cp_messageoptions_callbacks.c.

Referenced by MSO_Init_f(), and MSO_UpdateVisibleButtons().

msoMenuState_t msoMenuState = MSO_MSTATE_REINIT [static]

Definition at line 33 of file cp_messageoptions_callbacks.c.

Referenced by MSO_SetMenuState(), and MSOCB_Init().

int visibleMSOEntries = 0 [static]

actual visible entry count

Definition at line 36 of file cp_messageoptions_callbacks.c.

Referenced by MSO_SetMenuState().


Generated by  doxygen 1.6.2