UFO: Alien Invasion
Doxygen documentation generating
cp_event.h
Go to the documentation of this file.
1 
6 /*
7 Copyright (C) 2002-2023 UFO: Alien Invasion.
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License
11 as published by the Free Software Foundation; either version 2
12 of the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17 
18 See the GNU General Public License for more details.
19 
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 
24 */
25 
26 #pragma once
27 
28 #define MAX_EVENTMAILS 64
29 #define MAX_CAMPAIGNEVENTS 128
30 
38 typedef struct eventMail_s {
39  char* id;
40  char* from;
41  char* to;
42  char* cc;
43  char* subject;
46  char* date;
47  char* body;
48  char* icon;
49  char* model;
50  bool read;
51  bool sent;
52  bool skipMessage;
53 } eventMail_t;
54 
55 void CL_EventAddMail_f(void);
56 void CL_ParseEventMails(const char* name, const char** text);
57 eventMail_t* CL_GetEventMail(const char* id);
58 void CP_FreeDynamicEventMail(void);
59 void CL_EventAddMail(const char* eventMailId);
60 
64 typedef struct campaignEvent_s {
65  char* tech;
66  int interest;
68 
69 typedef struct campaignEvents_s {
72  char* id;
74 
78 typedef enum {
85 
86 typedef struct {
88  char* id;
89  char* require;
90  char* reactivate;
91  char* command;
92  bool once;
93  bool active;
95 
96 #define MAX_CAMPAIGN_TRIGGER_EVENTS 32
97 
98 void CP_CheckCampaignEvents(struct campaign_s* campaign);
99 void CL_ParseCampaignEvents(const char* name, const char** text);
100 void CP_ParseEventTrigger(const char* name, const char** text);
103 void CP_TriggerEvent(campaignTriggerEventType_t type, const void* userdata = nullptr);
104 const campaignEvents_t* CP_GetEventsByID(const char* name);
void CP_FreeDynamicEventMail(void)
Make sure, that the linked list is freed with every new game.
Definition: cp_event.cpp:67
char * subject
Definition: cp_event.h:43
QGL_EXTERN GLint GLenum type
Definition: r_gl.h:94
char * date
Definition: cp_event.h:46
void CP_CheckCampaignEvents(struct campaign_s *campaign)
void CL_EventAddMail(const char *eventMailId)
Adds the event mail to the message stack. This message is going to be added to the savegame...
Definition: cp_event.cpp:507
char * icon
Definition: cp_event.h:48
void CL_EventAddMail_f(void)
Definition: cp_event.cpp:553
void CP_ParseEventTrigger(const char *name, const char **text)
Definition: cp_event.cpp:359
char * cc
Definition: cp_event.h:42
char * model
Definition: cp_event.h:49
const campaignEvents_t * CP_GetEventsByID(const char *name)
Definition: cp_event.cpp:139
char * to
Definition: cp_event.h:41
void CP_TriggerEvent(campaignTriggerEventType_t type, const void *userdata=nullptr)
Triggers a campaign event with a special type.
Definition: cp_event.cpp:310
void CL_ParseCampaignEvents(const char *name, const char **text)
Definition: cp_event.cpp:448
char * body
Definition: cp_event.h:47
bool CP_TriggerEventSaveXML(xmlNode_t *p)
Definition: cp_event.cpp:401
#define MAX_CAMPAIGNEVENTS
Definition: cp_event.h:29
char * tech
Definition: cp_event.h:65
bool sent
Definition: cp_event.h:51
campaignTriggerEventType_t type
Definition: cp_event.h:87
#define xmlNode_t
Definition: xml.h:24
bool skipMessage
Definition: cp_event.h:52
char * from
Definition: cp_event.h:40
char * id
Definition: cp_event.h:39
void CL_ParseEventMails(const char *name, const char **text)
Definition: cp_event.cpp:93
Defines campaign events when story related technologies should be researched.
Definition: cp_event.h:64
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
bool CP_TriggerEventLoadXML(xmlNode_t *p)
Definition: cp_event.cpp:419
bool read
Definition: cp_event.h:50
eventMail_t * CL_GetEventMail(const char *id)
Searches all event mails for a given id.
Definition: cp_event.cpp:45
campaignTriggerEventType_t
events that are triggered by the campaign
Definition: cp_event.h:78
available mails for a tech - mail and mail_pre in script files
Definition: cp_event.h:38
int numCampaignEvents
Definition: cp_event.h:71