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

Tip of the day code. More...

#include "cl_tip.h"
#include "client.h"
#include "ui/ui_main.h"
#include "../shared/parse.h"

Go to the source code of this file.

Data Structures

struct  tipOfTheDay_s
 

Typedefs

typedef struct tipOfTheDay_s tipOfTheDay_t
 

Functions

static void CL_GetTipOfTheDay_f (void)
 Popup with tip of the day messages. More...
 
void CL_ParseTipOfTheDay (const char *name, const char **text)
 Parse all tip definitions from the script files. More...
 
void TOTD_InitStartup (void)
 Init function for cvars and console command bindings. More...
 
void TOTD_Shutdown (void)
 

Variables

static tipOfTheDay_ttipList
 
static int tipCount
 
static cvar_tcl_showTipOfTheDay
 

Detailed Description

Tip of the day code.

Definition in file cl_tip.cpp.

Typedef Documentation

typedef struct tipOfTheDay_s tipOfTheDay_t

Function Documentation

static void CL_GetTipOfTheDay_f ( void  )
static

Popup with tip of the day messages.

Note
Only call this from the menu definition (click action or init node) because this function calls also UI_PopWindow if no tips are parsed.
Todo:
not his role, remove it when its possible

Definition at line 48 of file cl_tip.cpp.

References Cmd_Argc(), Com_Printf(), tipOfTheDay_s::next, TEXT_TIPOFTHEDAY, tipCount, tipList, tipOfTheDay_s::tipString, UI_CloseWindow(), and UI_RegisterText().

Referenced by TOTD_InitStartup().

void CL_ParseTipOfTheDay ( const char *  name,
const char **  text 
)

Parse all tip definitions from the script files.

Definition at line 80 of file cl_tip.cpp.

References cl_genericPool, Com_Printf(), Mem_PoolAllocType, Mem_PoolStrDup, tipOfTheDay_s::next, tipCount, tipList, and tipOfTheDay_s::tipString.

Referenced by CL_ParseClientData().

void TOTD_InitStartup ( void  )

Init function for cvars and console command bindings.

Definition at line 96 of file cl_tip.cpp.

References CL_GetTipOfTheDay_f(), Cmd_AddCommand(), CVAR_ARCHIVE, and Cvar_Get().

Referenced by CL_InitLocal().

void TOTD_Shutdown ( void  )

Definition at line 104 of file cl_tip.cpp.

References tipCount.

Referenced by CL_Shutdown().

Variable Documentation

cvar_t* cl_showTipOfTheDay
static

tip of the day can be deactivated

Definition at line 41 of file cl_tip.cpp.

int tipCount
static

how many tips do we have

Definition at line 39 of file cl_tip.cpp.

Referenced by CL_GetTipOfTheDay_f(), CL_ParseTipOfTheDay(), and TOTD_Shutdown().

tipOfTheDay_t* tipList
static

linked list of all parsed tips

Definition at line 38 of file cl_tip.cpp.

Referenced by CL_GetTipOfTheDay_f(), and CL_ParseTipOfTheDay().