UFO: Alien Invasion
Toggle main menu visibility
Loading...
Searching...
No Matches
cp_messageoptions.h
Go to the documentation of this file.
1
5
6
/*
7
Copyright (C) 2002-2025 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
#pragma once
26
27
#include "
cp_messages.h
"
28
30
typedef
enum
nt_s {
31
NT_INSTALLATION_INSTALLED
,
32
NT_INSTALLATION_REMOVED
,
33
NT_INSTALLATION_REPLACE
,
34
NT_AIRCRAFT_REFUELED
,
35
NT_AIRCRAFT_CANNOTREFUEL
,
36
NT_AIRCRAFT_ARRIVEDHOME
,
37
NT_INSTALLATION_BUILDSTART
,
38
NT_INSTALLATION_BUILDFINISH
,
39
NT_INSTALLATION_DESTROY
,
40
NT_RESEARCH_PROPOSED
,
41
NT_RESEARCH_HALTED
,
42
NT_RESEARCH_COMPLETED
,
43
NT_PRODUCTION_STARTED
,
44
NT_PRODUCTION_FINISHED
,
45
NT_PRODUCTION_FAILED
,
46
NT_PRODUCTION_QUEUE_EMPTY
,
47
NT_HAPPINESS_CHANGED
,
48
NT_HAPPINESS_MIN
,
49
NT_HAPPINESS_PLEASED
,
50
NT_TRANSFER_STARTED
,
51
NT_TRANSFER_COMPLETED_SUCCESS
,
52
NT_TRANSFER_LOST
,
53
NT_TRANSFER_ALIENBODIES_DEFERED
,
54
NT_TRANSFER_UFORECOVERY_FINISHED
,
55
NT_UFO_SPOTTED
,
56
NT_UFO_SIGNAL_LOST
,
57
NT_UFO_ATTACKING
,
58
NT_BASE_ATTACK
,
59
NT_BUILDING_FINISHED
,
60
61
NT_NUM_NOTIFYTYPE
62
}
notify_t
;
63
65
typedef
enum
ntmask_s {
66
NTMASK_NOTIFY
= 1 << 0,
67
NTMASK_PAUSE
= 1 << 1,
68
NTMASK_SOUND
= 1 << 2
69
}
notifyMask_t
;
70
72
typedef
enum
msgcategorymask_s {
73
MSGCATMASK_FOLDED
= 1 << 0
74
}
msgCategoryMask_t
;
75
77
#define MSO_PAUSE (NTMASK_PAUSE | NTMASK_NOTIFY)
79
#define MSO_NOTIFY (NTMASK_NOTIFY)
81
#define MSO_SOUND (NTMASK_SOUND | NTMASK_NOTIFY)
82
86
typedef
struct
messageSettings_s {
87
bool
doPause
;
88
bool
doNotify
;
89
bool
doSound
;
90
}
messageSettings_t
;
91
92
#define MAX_MESSAGECATEGORIES 16
93
typedef
struct
msgCategoryEntry_s {
94
const
char
*
notifyType
;
95
struct
msgCategory_s*
category
;
96
struct
msgCategoryEntry_s*
next
;
97
struct
msgCategoryEntry_s*
previous
;
98
messageSettings_t
*
settings
;
99
bool
isCategory
;
100
}
msgCategoryEntry_t
;
101
102
typedef
struct
msgCategory_s {
103
int
idx
;
104
const
char
*
name
;
105
msgCategoryEntry_t
*
first
;
106
msgCategoryEntry_t
*
last
;
107
}
msgCategory_t
;
108
109
extern
messageSettings_t
messageSettings
[
NT_NUM_NOTIFYTYPE
];
110
extern
char
const
*
const
nt_strings
[
NT_NUM_NOTIFYTYPE
];
111
112
uiMessageListNodeMessage_t
*
MSO_CheckAddNewMessage
(
const
notify_t
messagecategory,
const
char
* title,
const
char
* text,
messageType_t
type
=
MSG_STANDARD
,
technology_t
* pedia =
nullptr
,
bool
popup =
false
);
113
void
MSO_ParseMessageSettings
(
const
char
*
name
,
const
char
** text);
114
void
MSO_Set
(
const
int
listIndex,
const
notify_t
type
,
const
int
optionType,
const
bool
activate,
const
bool
sendCommands);
115
void
MSO_Init
(
void
);
116
void
MSO_Shutdown
(
void
);
messageSettings
messageSettings_t messageSettings[NT_NUM_NOTIFYTYPE]
Definition
cp_messageoptions.cpp:67
nt_strings
char const *const nt_strings[NT_NUM_NOTIFYTYPE]
valid notification types that may cause pause / notice
Definition
cp_messageoptions.cpp:34
notify_t
notify_t
Notify types.
Definition
cp_messageoptions.h:30
NT_PRODUCTION_QUEUE_EMPTY
@ NT_PRODUCTION_QUEUE_EMPTY
Definition
cp_messageoptions.h:46
NT_RESEARCH_HALTED
@ NT_RESEARCH_HALTED
Definition
cp_messageoptions.h:41
NT_HAPPINESS_PLEASED
@ NT_HAPPINESS_PLEASED
Definition
cp_messageoptions.h:49
NT_AIRCRAFT_CANNOTREFUEL
@ NT_AIRCRAFT_CANNOTREFUEL
Definition
cp_messageoptions.h:35
NT_NUM_NOTIFYTYPE
@ NT_NUM_NOTIFYTYPE
Definition
cp_messageoptions.h:61
NT_BUILDING_FINISHED
@ NT_BUILDING_FINISHED
Definition
cp_messageoptions.h:59
NT_TRANSFER_STARTED
@ NT_TRANSFER_STARTED
Definition
cp_messageoptions.h:50
NT_RESEARCH_PROPOSED
@ NT_RESEARCH_PROPOSED
Definition
cp_messageoptions.h:40
NT_TRANSFER_UFORECOVERY_FINISHED
@ NT_TRANSFER_UFORECOVERY_FINISHED
Definition
cp_messageoptions.h:54
NT_INSTALLATION_DESTROY
@ NT_INSTALLATION_DESTROY
Definition
cp_messageoptions.h:39
NT_PRODUCTION_STARTED
@ NT_PRODUCTION_STARTED
Definition
cp_messageoptions.h:43
NT_HAPPINESS_CHANGED
@ NT_HAPPINESS_CHANGED
Definition
cp_messageoptions.h:47
NT_TRANSFER_LOST
@ NT_TRANSFER_LOST
Definition
cp_messageoptions.h:52
NT_PRODUCTION_FAILED
@ NT_PRODUCTION_FAILED
Definition
cp_messageoptions.h:45
NT_AIRCRAFT_ARRIVEDHOME
@ NT_AIRCRAFT_ARRIVEDHOME
Definition
cp_messageoptions.h:36
NT_INSTALLATION_INSTALLED
@ NT_INSTALLATION_INSTALLED
Definition
cp_messageoptions.h:31
NT_UFO_SPOTTED
@ NT_UFO_SPOTTED
Definition
cp_messageoptions.h:55
NT_TRANSFER_COMPLETED_SUCCESS
@ NT_TRANSFER_COMPLETED_SUCCESS
Definition
cp_messageoptions.h:51
NT_PRODUCTION_FINISHED
@ NT_PRODUCTION_FINISHED
Definition
cp_messageoptions.h:44
NT_INSTALLATION_REPLACE
@ NT_INSTALLATION_REPLACE
Definition
cp_messageoptions.h:33
NT_INSTALLATION_BUILDFINISH
@ NT_INSTALLATION_BUILDFINISH
Definition
cp_messageoptions.h:38
NT_INSTALLATION_REMOVED
@ NT_INSTALLATION_REMOVED
Definition
cp_messageoptions.h:32
NT_UFO_SIGNAL_LOST
@ NT_UFO_SIGNAL_LOST
Definition
cp_messageoptions.h:56
NT_INSTALLATION_BUILDSTART
@ NT_INSTALLATION_BUILDSTART
Definition
cp_messageoptions.h:37
NT_HAPPINESS_MIN
@ NT_HAPPINESS_MIN
Definition
cp_messageoptions.h:48
NT_AIRCRAFT_REFUELED
@ NT_AIRCRAFT_REFUELED
Definition
cp_messageoptions.h:34
NT_RESEARCH_COMPLETED
@ NT_RESEARCH_COMPLETED
Definition
cp_messageoptions.h:42
NT_BASE_ATTACK
@ NT_BASE_ATTACK
Definition
cp_messageoptions.h:58
NT_UFO_ATTACKING
@ NT_UFO_ATTACKING
Definition
cp_messageoptions.h:57
NT_TRANSFER_ALIENBODIES_DEFERED
@ NT_TRANSFER_ALIENBODIES_DEFERED
Definition
cp_messageoptions.h:53
MSO_Set
void MSO_Set(const int listIndex, const notify_t type, const int optionType, const bool activate, const bool sendCommands)
Function updates pause or notification settings.
Definition
cp_messageoptions.cpp:80
MSO_CheckAddNewMessage
uiMessageListNodeMessage_t * MSO_CheckAddNewMessage(const notify_t messagecategory, const char *title, const char *text, messageType_t type=MSG_STANDARD, technology_t *pedia=nullptr, bool popup=false)
Adds a new message to message stack. It uses message settings to verify whether sound should be playe...
Definition
cp_messageoptions.cpp:208
MSO_Init
void MSO_Init(void)
Definition
cp_messageoptions.cpp:484
notifyMask_t
notifyMask_t
bitmask values for storing msgoptions
Definition
cp_messageoptions.h:65
NTMASK_NOTIFY
@ NTMASK_NOTIFY
Definition
cp_messageoptions.h:66
NTMASK_SOUND
@ NTMASK_SOUND
Definition
cp_messageoptions.h:68
NTMASK_PAUSE
@ NTMASK_PAUSE
Definition
cp_messageoptions.h:67
msgCategoryMask_t
msgCategoryMask_t
bitmask values for storing msgcategory state
Definition
cp_messageoptions.h:72
MSGCATMASK_FOLDED
@ MSGCATMASK_FOLDED
Definition
cp_messageoptions.h:73
MSO_Shutdown
void MSO_Shutdown(void)
Definition
cp_messageoptions.cpp:490
MSO_ParseMessageSettings
void MSO_ParseMessageSettings(const char *name, const char **text)
parses message options settings from file.
Definition
cp_messageoptions.cpp:444
cp_messages.h
messageType_t
messageType_t
Definition
cp_messages.h:32
MSG_STANDARD
@ MSG_STANDARD
Definition
cp_messages.h:35
type
QGL_EXTERN GLint GLenum type
Definition
r_gl.h:94
name
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition
r_gl.h:110
messageSettings_t
structure holding pause and notify settings for a notify type.
Definition
cp_messageoptions.h:86
messageSettings_t::doNotify
bool doNotify
Definition
cp_messageoptions.h:88
messageSettings_t::doSound
bool doSound
Definition
cp_messageoptions.h:89
messageSettings_t::doPause
bool doPause
Definition
cp_messageoptions.h:87
msgCategory_t
Definition
cp_messageoptions.h:102
msgCategory_t::first
msgCategoryEntry_t * first
Definition
cp_messageoptions.h:105
msgCategory_t::last
msgCategoryEntry_t * last
Definition
cp_messageoptions.h:106
msgCategory_t::name
const char * name
Definition
cp_messageoptions.h:104
msgCategory_t::idx
int idx
Definition
cp_messageoptions.h:103
msgCategoryEntry_t
Definition
cp_messageoptions.h:93
msgCategoryEntry_t::notifyType
const char * notifyType
Definition
cp_messageoptions.h:94
msgCategoryEntry_t::isCategory
bool isCategory
Definition
cp_messageoptions.h:99
msgCategoryEntry_t::previous
struct msgCategoryEntry_s * previous
Definition
cp_messageoptions.h:97
msgCategoryEntry_t::next
struct msgCategoryEntry_s * next
Definition
cp_messageoptions.h:96
msgCategoryEntry_t::category
struct msgCategory_s * category
Definition
cp_messageoptions.h:95
msgCategoryEntry_t::settings
messageSettings_t * settings
Definition
cp_messageoptions.h:98
technology_t
This is the technology parsed from research.ufo.
Definition
cp_research.h:139
uiMessageListNodeMessage_t
Definition
ui_node_messagelist.cpp:57
src
client
cgame
campaign
cp_messageoptions.h
Generated on __DATE__ __TIME__ for UFO: Alien Invasion by
1.17.0