cp_event.h File Reference

Header for geoscape event related stuff. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  eventMail_s
 available mails for a tech - mail and mail_pre in script files More...
struct  campaignEvent_s
 Defines campaign events when story related technologies should be researched. More...
struct  campaignEvents_s

Defines

#define MAX_EVENTMAILS   64
#define MAX_CAMPAIGNEVENTS   128

Typedefs

typedef struct eventMail_s eventMail_t
 available mails for a tech - mail and mail_pre in script files
typedef struct campaignEvent_s campaignEvent_t
 Defines campaign events when story related technologies should be researched.
typedef struct campaignEvents_s campaignEvents_t

Functions

void CL_EventAddMail_f (void)
void CL_ParseEventMails (const char *name, const char **text)
eventMail_tCL_GetEventMail (const char *id, qboolean createCopy)
 Searches all event mails for a given id.
eventMail_tCL_NewEventMail (const char *id, const char *newID, const char *body)
 Use this function to create new eventmails with dynamic body content.
void CL_FreeDynamicEventMail (void)
 Make sure, that the linked list is freed with every new game.
void CP_CheckCampaignEvents (void)
void CL_ParseCampaignEvents (const char *name, const char **text)
const campaignEvents_tCP_GetEventsByID (const char *name)

Detailed Description

Header for geoscape event related stuff.

Definition in file cp_event.h.


Define Documentation

#define MAX_CAMPAIGNEVENTS   128

Definition at line 30 of file cp_event.h.

Referenced by CL_ParseCampaignEvents().

#define MAX_EVENTMAILS   64

Definition at line 29 of file cp_event.h.

Referenced by CL_ParseEventMails().


Typedef Documentation

Defines campaign events when story related technologies should be researched.

typedef struct eventMail_s eventMail_t

available mails for a tech - mail and mail_pre in script files

See also:
techMail_t
Note:
Parsed via CL_ParseEventMails
You can add a mail to the message system and mail client by using e.g. the mission triggers with the script command 'addeventmail <id>'

Function Documentation

void CL_EventAddMail_f ( void   ) 
void CL_FreeDynamicEventMail ( void   ) 

Make sure, that the linked list is freed with every new game.

See also:
CL_ResetSinglePlayerData

Definition at line 95 of file cp_event.c.

References LIST_Delete().

Referenced by CL_ResetSinglePlayerData().

eventMail_t* CL_GetEventMail ( const char *  id,
qboolean  createCopy 
)

Searches all event mails for a given id.

Note:
Might also return NULL - always check the return value
If you want to create mails that base on a script defintion but have differnet body messages, set createCopy to true
Parameters:
[in] id The id from the script files
[in] createCopy Don't return the link to ccs.eventMails but allocate memory and copy the gd.eventMail memory over to the newly allocated. Don't use createCopy on dynamic mails
See also:
UP_SetMailHeader
CL_NewEventMail

Definition at line 45 of file cp_event.c.

References ccs, cp_campaignPool, linkedList_s::data, ccs_s::eventMails, i, eventMail_s::id, LIST_AddPointer(), Mem_PoolAlloc, linkedList_s::next, and ccs_s::numEventMails.

Referenced by CL_EventAddMail_f(), CL_NewEventMail(), MS_LoadXML(), and UP_OpenEventMail().

eventMail_t* CL_NewEventMail ( const char *  id,
const char *  newID,
const char *  body 
)

Use this function to create new eventmails with dynamic body content.

See also:
CL_GetEventMail
Note:
The pointers in the original eventmail are not freed - we still need this memory later!!
See also:
CL_ResetSinglePlayerData
UR_SendMail
Parameters:
[in] id eventmail id of the source mail parsed from events.ufo
[in] newID the new id for the dynamic mail (needed to seperate the new mail from the source mail to let CL_GetEventMail be able to find it afterwards)
[in] body The body of the new mail - this may also be NULL if you need the original body of the source mail that was parsed from events.ufo

Definition at line 114 of file cp_event.c.

References eventMail_s::body, CL_GetEventMail(), cp_campaignPool, eventMail_s::id, Mem_PoolStrDup, and qtrue.

void CL_ParseCampaignEvents ( const char *  name,
const char **  text 
)
void CL_ParseEventMails ( const char *  name,
const char **  text 
)
void CP_CheckCampaignEvents ( void   ) 
const campaignEvents_t* CP_GetEventsByID ( const char *  name  ) 

Will return the campaign related events

Note:
Also performs some sanity check
Parameters:
name The events id

Definition at line 245 of file cp_event.c.

References campaignEvents_s::campaignEvents, ccs_s::campaignEvents, ccs, events, i, campaignEvents_s::id, ccs_s::numCampaignEventDefinitions, campaignEvents_s::numCampaignEvents, RS_GetTechByID(), and Sys_Error().

Referenced by CL_ParseCampaign().


Generated by  doxygen 1.6.2