UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_event.h
Go to the documentation of this file.
1
5
6/*
7Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9This program is free software; you can redistribute it and/or
10modify it under the terms of the GNU General Public License
11as published by the Free Software Foundation; either version 2
12of the License, or (at your option) any later version.
13
14This program is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
18See the GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with this program; if not, write to the Free Software
22Foundation, 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
38typedef 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;
54
55void CL_EventAddMail_f(void);
56void CL_ParseEventMails(const char* name, const char** text);
57eventMail_t* CL_GetEventMail(const char* id);
59void CL_EventAddMail(const char* eventMailId);
60
64typedef struct campaignEvent_s {
65 char* tech;
68
74
85
95
96#define MAX_CAMPAIGN_TRIGGER_EVENTS 32
97
98void CP_CheckCampaignEvents(struct campaign_s* campaign);
99void CL_ParseCampaignEvents(const char* name, const char** text);
100void CP_ParseEventTrigger(const char* name, const char** text);
103void CP_TriggerEvent(campaignTriggerEventType_t type, const void* userdata = nullptr);
104const campaignEvents_t* CP_GetEventsByID(const char* name);
const campaignEvents_t * CP_GetEventsByID(const char *name)
Definition cp_event.cpp:139
bool CP_TriggerEventLoadXML(xmlNode_t *p)
Definition cp_event.cpp:419
eventMail_t * CL_GetEventMail(const char *id)
Searches all event mails for a given id.
Definition cp_event.cpp:45
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
campaignTriggerEventType_t
events that are triggered by the campaign
Definition cp_event.h:78
@ UFO_DETECTION
Definition cp_event.h:80
@ ALIENBASE_DISCOVERED
Definition cp_event.h:83
@ CAPTURED_ALIENS
Definition cp_event.h:82
@ NEW_DAY
Definition cp_event.h:79
@ CAPTURED_ALIENS_DIED
Definition cp_event.h:81
void CP_CheckCampaignEvents(struct campaign_s *campaign)
void CL_ParseEventMails(const char *name, const char **text)
Definition cp_event.cpp:93
void CL_ParseCampaignEvents(const char *name, const char **text)
Definition cp_event.cpp:448
void CP_TriggerEvent(campaignTriggerEventType_t type, const void *userdata=nullptr)
Triggers a campaign event with a special type.
Definition cp_event.cpp:310
#define MAX_CAMPAIGNEVENTS
Definition cp_event.h:29
void CL_EventAddMail_f(void)
Definition cp_event.cpp:553
void CP_ParseEventTrigger(const char *name, const char **text)
Definition cp_event.cpp:359
void CP_FreeDynamicEventMail(void)
Make sure, that the linked list is freed with every new game.
Definition cp_event.cpp:67
bool CP_TriggerEventSaveXML(xmlNode_t *p)
Definition cp_event.cpp:401
QGL_EXTERN GLint GLenum type
Definition r_gl.h:94
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition r_gl.h:110
Defines campaign events when story related technologies should be researched.
Definition cp_event.h:64
int numCampaignEvents
Definition cp_event.h:71
campaignEvent_t campaignEvents[MAX_CAMPAIGNEVENTS]
Definition cp_event.h:70
campaignTriggerEventType_t type
Definition cp_event.h:87
available mails for a tech - mail and mail_pre in script files
Definition cp_event.h:38
bool skipMessage
Definition cp_event.h:52
char * model
Definition cp_event.h:49
char * cc
Definition cp_event.h:42
char * to
Definition cp_event.h:41
char * date
Definition cp_event.h:46
char * from
Definition cp_event.h:40
char * subject
Definition cp_event.h:43
char * id
Definition cp_event.h:39
bool sent
Definition cp_event.h:51
bool read
Definition cp_event.h:50
char * body
Definition cp_event.h:47
char * icon
Definition cp_event.h:48
#define xmlNode_t
Definition xml.h:24