Header file for messageoptions related stuff. More...
#include "cp_messages.h"
Go to the source code of this file.
Data Structures | |
struct | messageSettings_s |
structure holding pause and notify settings for a notify type. More... | |
struct | msgCategoryEntry_s |
struct | msgCategory_s |
Defines | |
#define | MSO_PAUSE (NTMASK_PAUSE | NTMASK_NOTIFY) |
notification type: pause game | |
#define | MSO_NOTIFY (NTMASK_NOTIFY) |
notification type: add notification message | |
#define | MSO_SOUND (NTMASK_SOUND | NTMASK_NOTIFY) |
notification type: play notification sound | |
#define | MAX_MESSAGECATEGORIES 16 |
Typedefs | |
typedef enum nt_s | notify_t |
Notify types. | |
typedef enum ntmask_s | notifyMask_t |
bitmask values for storing msgoptions | |
typedef enum msgcategorymask_s | msgCategoryMask_t |
bitmask values for storing msgcategory state | |
typedef struct messageSettings_s | messageSettings_t |
structure holding pause and notify settings for a notify type. | |
typedef struct msgCategoryEntry_s | msgCategoryEntry_t |
typedef struct msgCategory_s | msgCategory_t |
Enumerations | |
enum | nt_s { NT_INSTALLATION_INSTALLED, NT_INSTALLATION_REMOVED, NT_INSTALLATION_REPLACE, NT_AIRCRAFT_REFUELED, NT_AIRCRAFT_CANNOTREFUEL, NT_INSTALLATION_BUILDSTART, NT_INSTALLATION_BUILDFINISH, NT_INSTALLATION_DESTROY, NT_RESEARCH_PROPOSED, NT_RESEARCH_HALTED, NT_RESEARCH_COMPLETED, NT_PRODUCTION_STARTED, NT_PRODUCTION_FINISHED, NT_PRODUCTION_FAILED, NT_PRODUCTION_QUEUE_EMPTY, NT_HAPPINESS_CHANGED, NT_HAPPINESS_MIN, NT_HAPPINESS_PLEASED, NT_TRANSFER_STARTED, NT_TRANSFER_COMPLETED_SUCCESS, NT_TRANSFER_LOST, NT_TRANSFER_ALIENBODIES_DEFERED, NT_TRANSFER_UFORECOVERY_FINISHED, NT_UFO_SPOTTED, NT_UFO_SIGNAL_LOST, NT_UFO_ATTACKING, NT_NUM_NOTIFYTYPE } |
Notify types. More... | |
enum | ntmask_s { NTMASK_NOTIFY = 1 << 0, NTMASK_PAUSE = 1 << 1, NTMASK_SOUND = 1 << 2 } |
bitmask values for storing msgoptions More... | |
enum | msgcategorymask_s { MSGCATMASK_FOLDED = 1 << 0 } |
bitmask values for storing msgcategory state More... | |
Functions | |
message_t * | MSO_CheckAddNewMessage (const notify_t messagecategory, const char *title, const char *text, qboolean popup, messageType_t type, void *pedia) |
Adds a new message to message stack. It uses message settings to verify whether sound should be played and whether game should stop. | |
void | MSO_ParseSettings (const char *name, const char **text) |
parses message options settings from file. | |
void | MSO_ParseCategories (const char *name, const char **text) |
Parses a messagecategory script section. These categories are used to group notification types. | |
void | MSO_Set (const int listIndex, const notify_t type, const int optionType, const qboolean activate, const qboolean sendCommands) |
Function updates pause or notification settings. | |
void | MSO_Init (void) |
void | MSO_Shutdown (void) |
Variables | |
messageSettings_t | messageSettings [NT_NUM_NOTIFYTYPE] |
const char * | nt_strings [NT_NUM_NOTIFYTYPE] |
valid notification types that may cause pause / notice |
Header file for messageoptions related stuff.
Definition in file cp_messageoptions.h.
#define MAX_MESSAGECATEGORIES 16 |
Definition at line 91 of file cp_messageoptions.h.
Referenced by MSO_ParseCategories().
#define MSO_NOTIFY (NTMASK_NOTIFY) |
notification type: add notification message
Definition at line 78 of file cp_messageoptions.h.
Referenced by MSO_LoadXML(), MSO_Set(), MSO_Set_f(), MSO_SetAll_f(), and MSO_Toggle_f().
#define MSO_PAUSE (NTMASK_PAUSE | NTMASK_NOTIFY) |
notification type: pause game
Definition at line 76 of file cp_messageoptions.h.
Referenced by MSO_LoadXML(), MSO_Set_f(), MSO_SetAll_f(), and MSO_Toggle_f().
#define MSO_SOUND (NTMASK_SOUND | NTMASK_NOTIFY) |
notification type: play notification sound
Definition at line 80 of file cp_messageoptions.h.
Referenced by MSO_LoadXML(), MSO_Set_f(), MSO_SetAll_f(), and MSO_Toggle_f().
typedef struct messageSettings_s messageSettings_t |
structure holding pause and notify settings for a notify type.
typedef struct msgCategory_s msgCategory_t |
typedef struct msgCategoryEntry_s msgCategoryEntry_t |
typedef enum msgcategorymask_s msgCategoryMask_t |
bitmask values for storing msgcategory state
typedef enum ntmask_s notifyMask_t |
bitmask values for storing msgoptions
enum msgcategorymask_s |
bitmask values for storing msgcategory state
Definition at line 71 of file cp_messageoptions.h.
enum nt_s |
Notify types.
Definition at line 32 of file cp_messageoptions.h.
enum ntmask_s |
bitmask values for storing msgoptions
Definition at line 64 of file cp_messageoptions.h.
message_t* MSO_CheckAddNewMessage | ( | const notify_t | messagecategory, | |
const char * | title, | |||
const char * | text, | |||
qboolean | popup, | |||
messageType_t | type, | |||
void * | pedia | |||
) |
Adds a new message to message stack. It uses message settings to verify whether sound should be played and whether game should stop.
messagecategory | category for notification | |
[in] | title | Already translated message/mail title |
[in] | text | Already translated message/mail body |
[in] | popup | Show this as a popup, too? |
[in] | type | The message type |
[in] | pedia | Pointer to technology (only if needed) |
Definition at line 190 of file cp_messageoptions.c.
References CL_GameTimeStop(), and MS_AddNewMessageSound().
Referenced by AII_UpdateOneInstallationDelay(), AIR_Refuel(), AIRFIGHT_ExecuteActions(), INS_BuildInstallation_f(), INS_DestroyInstallation(), INS_UpdateInstallationData(), NAT_SetHappiness(), PR_DisassemblingFrame(), PR_ProductionFrame(), PR_ProductionIncrease_f(), PR_QueueNext(), RS_MarkCollected(), RS_MarkOneResearchable(), RS_ResearchFinish(), RS_ResearchRun(), TR_EmptyTransferCargo(), TR_TransferAlienAfterMissionStart(), TR_TransferEnd(), TR_TransferStart_f(), UFO_CampaignCheckEvents(), UFO_SearchAircraftTarget(), and UR_ProcessActive().
void MSO_Init | ( | void | ) |
Definition at line 381 of file cp_messageoptions.c.
References Cmd_AddCommand(), MSO_InitCallbacks(), MSO_Set_f(), and MSO_SetAll_f().
Referenced by MS_MessageInit().
void MSO_ParseCategories | ( | const char * | name, | |
const char ** | text | |||
) |
Parses a messagecategory script section. These categories are used to group notification types.
name | ||
text |
Definition at line 304 of file cp_messageoptions.c.
References msgCategoryEntry_s::category, ccs, Com_EParse(), Com_Parse(), Com_Printf(), cp_campaignPool, msgCategory_s::first, msgCategory_s::id, msgCategory_s::idx, msgCategoryEntry_s::isCategory, msgCategory_s::last, MAX_MESSAGECATEGORIES, MAX_VAR, Mem_PoolStrDup, ccs_s::messageCategories, ccs_s::msgCategoryEntries, MSO_MSTATE_REINIT, MSO_SetMenuState(), msgCategoryEntry_s::next, msgCategoryEntry_s::notifyType, NT_NUM_NOTIFYTYPE, nt_strings, ccs_s::numMsgCategories, ccs_s::numMsgCategoryEntries, msgCategoryEntry_s::previous, qfalse, qtrue, and msgCategoryEntry_s::settings.
Referenced by CL_ParseScriptFirst().
void MSO_ParseSettings | ( | const char * | name, | |
const char ** | text | |||
) |
parses message options settings from file.
name | ||
text |
Definition at line 266 of file cp_messageoptions.c.
References Cmd_ExecuteString(), Com_EParse(), Com_Parse(), Com_Printf(), MSO_MSTATE_REINIT, MSO_SetMenuState(), qfalse, and va().
Referenced by CL_ParseScriptFirst().
void MSO_Set | ( | const int | listIndex, | |
const notify_t | type, | |||
const int | optionType, | |||
const qboolean | activate, | |||
const qboolean | sendCommands | |||
) |
Function updates pause or notification settings.
listIndex | listIndex in menu to update via confunc | |
type | notification type to update | |
optionType | option type that should be updated | |
activate | flag indicating whether setting should be activated (qtrue) or deactivated | |
sendCommands | flag indicating whether confunc command to update menu button should be sent |
Definition at line 79 of file cp_messageoptions.c.
References messageSettings_s::doNotify, messageSettings_s::doPause, messageSettings_s::doSound, MSO_MSTATE_PREPARED, MSO_NOTIFY, MSO_SetMenuState(), NTMASK_PAUSE, NTMASK_SOUND, qfalse, and UI_ExecuteConfunc().
Referenced by MSO_LoadXML(), MSO_Set_f(), MSO_SetAll_f(), and MSO_Toggle_f().
void MSO_Shutdown | ( | void | ) |
Definition at line 388 of file cp_messageoptions.c.
References Cmd_RemoveCommand(), and MSO_ShutdownCallbacks().
Referenced by CP_RemoveCampaignCallbackCommands().
messageSettings_t messageSettings[NT_NUM_NOTIFYTYPE] |
array holding actual message settings for every notify type
Definition at line 66 of file cp_messageoptions.c.
Referenced by MSO_BackupSettings_f(), and MSO_RestoreSettings_f().
const char* nt_strings[NT_NUM_NOTIFYTYPE] |
valid notification types that may cause pause / notice
Definition at line 35 of file cp_messageoptions.c.
Referenced by MSO_LoadXML(), MSO_ParseCategories(), MSO_SaveXML(), MSO_Set_f(), and MSO_Toggle_f().