Geoscape event implementation. More...
#include "../cl_shared.h"
#include "../../shared/parse.h"
#include "cp_campaign.h"
#include "cp_time.h"
Go to the source code of this file.
Functions | |
eventMail_t * | CL_GetEventMail (const char *id, qboolean createCopy) |
Searches all event mails for a given id. | |
void | CL_FreeDynamicEventMail (void) |
Make sure, that the linked list is freed with every new game. | |
eventMail_t * | CL_NewEventMail (const char *id, const char *newID, const char *body) |
Use this function to create new eventmails with dynamic body content. | |
void | CL_ParseEventMails (const char *name, const char **text) |
void | CP_CheckCampaignEvents (void) |
const campaignEvents_t * | CP_GetEventsByID (const char *name) |
void | CL_ParseCampaignEvents (const char *name, const char **text) |
void | CL_EventAddMail_f (void) |
Variables | |
static linkedList_t * | eventMails = NULL |
static const value_t | eventMail_vals [] |
Valid event mail parameters. |
Geoscape event implementation.
Definition in file cp_event.c.
void CL_EventAddMail_f | ( | void | ) |
Definition at line 331 of file cp_event.c.
References _, eventMail_s::body, ccs, CL_DateConvertLong(), CL_GetEventMail(), Cmd_Argc(), Cmd_Argv(), Com_Printf(), Com_sprintf(), cp_campaignPool, ccs_s::date, eventMail_s::date, Date_GetMonthName(), dateLong_s::day, message_s::eventMail, eventMail_s::from, m, MAX_VAR, Mem_PoolStrDup, dateLong_s::month, MS_AddNewMessage(), MSG_EVENT, qfalse, eventMail_s::subject, eventMail_s::to, va(), and dateLong_s::year.
void CL_FreeDynamicEventMail | ( | void | ) |
Make sure, that the linked list is freed with every new game.
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.
[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 |
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.
[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 | |||
) |
Definition at line 269 of file cp_event.c.
References campaignEvents_s::campaignEvents, ccs_s::campaignEvents, ccs, Com_DPrintf(), Com_EParse(), Com_EParseValue(), Com_Printf(), cp_campaignPool, DEBUG_CLIENT, events, campaignEvents_s::id, campaignEvent_s::interest, MAX_CAMPAIGNEVENTS, MAX_CAMPAIGNS, Mem_PoolStrDup, Mem_PoolStrDupTo, ccs_s::numCampaignEventDefinitions, campaignEvents_s::numCampaignEvents, Sys_Error(), campaignEvent_s::tech, and V_INT.
Referenced by CL_ParseScriptFirst().
void CL_ParseEventMails | ( | const char * | name, | |
const char ** | text | |||
) |
Definition at line 153 of file cp_event.c.
References ccs, Com_DPrintf(), Com_EParse(), Com_EParseValue(), Com_Parse(), Com_Printf(), cp_campaignPool, DEBUG_CLIENT, ccs_s::eventMails, eventMail_s::id, MAX_EVENTMAILS, Mem_PoolStrDup, Mem_PoolStrDupTo, ccs_s::numEventMails, value_s::ofs, value_s::size, value_s::string, value_s::type, V_CLIENT_HUNK_STRING, and V_TRANSLATION_STRING.
Referenced by CL_ParseScriptFirst().
void CP_CheckCampaignEvents | ( | void | ) |
Definition at line 216 of file cp_event.c.
References campaignEvents_s::campaignEvents, ccs, ccs_s::curCampaign, campaign_s::events, events, i, campaignEvents_s::numCampaignEvents, ccs_s::overallInterest, and RS_MarkStoryLineEventResearched().
Referenced by CL_CampaignRun().
const campaignEvents_t* CP_GetEventsByID | ( | const char * | name | ) |
Will return the campaign related events
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().
const value_t eventMail_vals[] [static] |
{ {"subject", V_TRANSLATION_STRING, offsetof(eventMail_t, subject), 0}, {"from", V_TRANSLATION_STRING, offsetof(eventMail_t, from), 0}, {"to", V_TRANSLATION_STRING, offsetof(eventMail_t, to), 0}, {"cc", V_TRANSLATION_STRING, offsetof(eventMail_t, cc), 0}, {"date", V_TRANSLATION_STRING, offsetof(eventMail_t, date), 0}, {"body", V_TRANSLATION_STRING, offsetof(eventMail_t, body), 0}, {"icon", V_CLIENT_HUNK_STRING, offsetof(eventMail_t, icon), 0}, {"model", V_CLIENT_HUNK_STRING, offsetof(eventMail_t, model), 0}, {NULL, 0, 0, 0} }
Valid event mail parameters.
Definition at line 136 of file cp_event.c.
linkedList_t* eventMails = NULL [static] |
Definition at line 31 of file cp_event.c.