UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_messageoptions.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#pragma once
26
27#include "cp_messages.h"
28
63
65typedef enum ntmask_s {
66 NTMASK_NOTIFY = 1 << 0,
67 NTMASK_PAUSE = 1 << 1,
68 NTMASK_SOUND = 1 << 2
70
72typedef enum msgcategorymask_s {
75
77#define MSO_PAUSE (NTMASK_PAUSE | NTMASK_NOTIFY)
79#define MSO_NOTIFY (NTMASK_NOTIFY)
81#define MSO_SOUND (NTMASK_SOUND | NTMASK_NOTIFY)
82
86typedef struct messageSettings_s {
87 bool doPause;
88 bool doNotify;
89 bool doSound;
91
92#define MAX_MESSAGECATEGORIES 16
93typedef struct msgCategoryEntry_s {
94 const char* notifyType;
95 struct msgCategory_s* category;
96 struct msgCategoryEntry_s* next;
97 struct msgCategoryEntry_s* previous;
101
102typedef struct msgCategory_s {
103 int idx;
104 const char* name;
108
110extern char const* const nt_strings[NT_NUM_NOTIFYTYPE];
111
112uiMessageListNodeMessage_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);
113void MSO_ParseMessageSettings(const char* name, const char** text);
114void MSO_Set(const int listIndex, const notify_t type, const int optionType, const bool activate, const bool sendCommands);
115void MSO_Init(void);
116void MSO_Shutdown(void);
messageSettings_t messageSettings[NT_NUM_NOTIFYTYPE]
char const *const nt_strings[NT_NUM_NOTIFYTYPE]
valid notification types that may cause pause / notice
notify_t
Notify types.
@ NT_PRODUCTION_QUEUE_EMPTY
@ NT_RESEARCH_HALTED
@ NT_HAPPINESS_PLEASED
@ NT_AIRCRAFT_CANNOTREFUEL
@ NT_NUM_NOTIFYTYPE
@ NT_BUILDING_FINISHED
@ NT_TRANSFER_STARTED
@ NT_RESEARCH_PROPOSED
@ NT_TRANSFER_UFORECOVERY_FINISHED
@ NT_INSTALLATION_DESTROY
@ NT_PRODUCTION_STARTED
@ NT_HAPPINESS_CHANGED
@ NT_TRANSFER_LOST
@ NT_PRODUCTION_FAILED
@ NT_AIRCRAFT_ARRIVEDHOME
@ NT_INSTALLATION_INSTALLED
@ NT_UFO_SPOTTED
@ NT_TRANSFER_COMPLETED_SUCCESS
@ NT_PRODUCTION_FINISHED
@ NT_INSTALLATION_REPLACE
@ NT_INSTALLATION_BUILDFINISH
@ NT_INSTALLATION_REMOVED
@ NT_UFO_SIGNAL_LOST
@ NT_INSTALLATION_BUILDSTART
@ NT_HAPPINESS_MIN
@ NT_AIRCRAFT_REFUELED
@ NT_RESEARCH_COMPLETED
@ NT_BASE_ATTACK
@ NT_UFO_ATTACKING
@ NT_TRANSFER_ALIENBODIES_DEFERED
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.
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...
void MSO_Init(void)
notifyMask_t
bitmask values for storing msgoptions
@ NTMASK_NOTIFY
@ NTMASK_SOUND
@ NTMASK_PAUSE
msgCategoryMask_t
bitmask values for storing msgcategory state
@ MSGCATMASK_FOLDED
void MSO_Shutdown(void)
void MSO_ParseMessageSettings(const char *name, const char **text)
parses message options settings from file.
messageType_t
Definition cp_messages.h:32
@ MSG_STANDARD
Definition cp_messages.h:35
QGL_EXTERN GLint GLenum type
Definition r_gl.h:94
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition r_gl.h:110
structure holding pause and notify settings for a notify type.
msgCategoryEntry_t * first
msgCategoryEntry_t * last
const char * name
const char * notifyType
bool isCategory
struct msgCategoryEntry_s * previous
struct msgCategoryEntry_s * next
struct msgCategory_s * category
messageSettings_t * settings
This is the technology parsed from research.ufo.