UFO: Alien Invasion
|
In-game message settings. More...
#include "../../cl_shared.h"
#include "../../../shared/parse.h"
#include "cp_campaign.h"
#include "cp_messageoptions.h"
#include "cp_messageoptions_callbacks.h"
#include "cp_time.h"
#include "save/save_messageoptions.h"
Go to the source code of this file.
Functions | |
CASSERT (lengthof(nt_strings)==NT_NUM_NOTIFYTYPE) | |
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. More... | |
static int | MSO_ParseNotifyType (const char *name) |
Parse notify type. More... | |
static int | MSO_ParseOptionType (const char *type) |
Parse option type. More... | |
static void | MSO_Set_f (void) |
Function callback used to initialize values for messageoptions and for manual setting changes. More... | |
static void | MSO_SetAll_f (void) |
Function callback that sets all message options settings for one option type to given value. More... | |
uiMessageListNodeMessage_t * | MSO_CheckAddNewMessage (const notify_t messagecategory, const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup) |
Adds a new message to message stack. It uses message settings to verify whether sound should be played and whether game should stop. More... | |
bool | MSO_SaveXML (xmlNode_t *p) |
saves current notification and pause settings More... | |
bool | MSO_LoadXML (xmlNode_t *p) |
Restores the notification and pause settings from savegame. More... | |
static int | MSO_ParseOption (const char *blockName, const char **text) |
parses message options settings from file. More... | |
static bool | MSO_ParseCategory (const char *blockName, const char **text) |
Parses a messagecategory script section. These categories are used to group notification types. More... | |
void | MSO_ParseMessageSettings (const char *name, const char **text) |
parses message options settings from file. More... | |
void | MSO_Init (void) |
void | MSO_Shutdown (void) |
Variables | |
char const *const | nt_strings [NT_NUM_NOTIFYTYPE] |
valid notification types that may cause pause / notice More... | |
messageSettings_t | messageSettings [NT_NUM_NOTIFYTYPE] |
static const cmdList_t | msgOptionsCmds [] |
In-game message settings.
Definition in file cp_messageoptions.cpp.
CASSERT | ( | lengthof(nt_strings) | = =NT_NUM_NOTIFYTYPE | ) |
uiMessageListNodeMessage_t* MSO_CheckAddNewMessage | ( | const notify_t | messagecategory, |
const char * | title, | ||
const char * | text, | ||
messageType_t | type, | ||
technology_t * | pedia, | ||
bool | popup | ||
) |
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 208 of file cp_messageoptions.cpp.
References CP_GameTimeStop(), messageSettings_s::doNotify, messageSettings_s::doPause, messageSettings_s::doSound, and MS_AddNewMessage().
Referenced by AII_UpdateOneInstallationDelay(), AIR_Move(), AIR_Refuel(), AIRFIGHT_ExecuteActions(), B_UpdateBuildingConstructions(), CP_BaseAttackStartMission(), INS_BuildInstallation_f(), INS_DestroyInstallation(), INS_UpdateInstallationData(), NAT_SetHappiness(), PR_CheckFrame(), PR_FinishDisassembly(), PR_FinishProduction(), PR_ProductionIncrease_f(), PR_QueueNext(), RS_CheckRequirements(), RS_MarkCollected(), RS_MarkOneResearchable(), RS_ResearchFinish(), RS_ResearchRun(), TR_EmptyTransferCargo(), TR_TransferEnd(), TR_TransferStart_f(), UFO_CampaignCheckEvents(), UFO_SearchAircraftTarget(), UR_ProcessActive(), and US_TransferUFO().
Definition at line 484 of file cp_messageoptions.cpp.
References cgi, and MSO_InitCallbacks().
Referenced by MS_MessageInit().
bool MSO_LoadXML | ( | xmlNode_t * | p | ) |
Restores the notification and pause settings from savegame.
Definition at line 246 of file cp_messageoptions.cpp.
References cgi, MSO_MSTATE_REINIT, MSO_NOTIFY, MSO_PAUSE, MSO_Set(), MSO_SetMenuState(), MSO_SOUND, NT_NUM_NOTIFYTYPE, nt_strings, Q_streq, SAVE_MESSAGEOPTIONS_MESSAGEOPTIONS, SAVE_MESSAGEOPTIONS_NAME, SAVE_MESSAGEOPTIONS_NOTIFY, SAVE_MESSAGEOPTIONS_PAUSE, SAVE_MESSAGEOPTIONS_SOUND, SAVE_MESSAGEOPTIONS_TYPE, type, cgame_import_s::XML_GetNextNode(), cgame_import_s::XML_GetNode(), cgame_import_s::XML_GetString(), and xmlNode_t.
Referenced by SAV_Init().
|
static |
Parses a messagecategory script section. These categories are used to group notification types.
Definition at line 348 of file cp_messageoptions.cpp.
References msgCategoryEntry_s::category, ccs, cgi, cgame_import_s::Com_EParse(), Com_Parse(), cp_campaignPool, ERR_DROP, msgCategory_s::first, msgCategory_s::idx, msgCategoryEntry_s::isCategory, msgCategory_s::last, MAX_MESSAGECATEGORIES, ccs_s::messageCategories, ccs_s::msgCategoryEntries, MSO_MSTATE_REINIT, MSO_ParseOption(), MSO_SetMenuState(), msgCategory_s::name, msgCategoryEntry_s::next, msgCategoryEntry_s::notifyType, nt_strings, ccs_s::numMsgCategories, ccs_s::numMsgCategoryEntries, OBJZERO, cgame_import_s::PoolStrDup(), msgCategoryEntry_s::previous, Q_streq, and msgCategoryEntry_s::settings.
Referenced by MSO_ParseMessageSettings().
void MSO_ParseMessageSettings | ( | const char * | name, |
const char ** | text | ||
) |
parses message options settings from file.
Definition at line 444 of file cp_messageoptions.cpp.
References cgi, cgame_import_s::Com_EParse(), Com_Parse(), ERR_DROP, MSO_ParseCategory(), OBJZERO, and Q_streq.
Referenced by CP_ParseScriptFirst().
|
static |
Parse notify type.
Definition at line 115 of file cp_messageoptions.cpp.
References NT_NUM_NOTIFYTYPE, nt_strings, and Q_streq.
Referenced by MSO_ParseOption().
|
static |
parses message options settings from file.
Definition at line 280 of file cp_messageoptions.cpp.
References cgi, cgame_import_s::Com_EParse(), Com_Parse(), cgame_import_s::data, MSO_MSTATE_REINIT, MSO_ParseNotifyType(), MSO_ParseOptionType(), MSO_Set(), MSO_SetMenuState(), linkedList_t::next, and Q_streq.
Referenced by MSO_ParseCategory().
|
static |
Parse option type.
Definition at line 129 of file cp_messageoptions.cpp.
References cgi, MSO_NOTIFY, MSO_PAUSE, MSO_SOUND, and Q_strcaseeq.
Referenced by MSO_ParseOption(), MSO_Set_f(), and MSO_SetAll_f().
bool MSO_SaveXML | ( | xmlNode_t * | p | ) |
saves current notification and pause settings
Definition at line 224 of file cp_messageoptions.cpp.
References cgi, messageSettings_s::doNotify, messageSettings_s::doPause, messageSettings_s::doSound, NT_NUM_NOTIFYTYPE, nt_strings, SAVE_MESSAGEOPTIONS_MESSAGEOPTIONS, SAVE_MESSAGEOPTIONS_NAME, SAVE_MESSAGEOPTIONS_NOTIFY, SAVE_MESSAGEOPTIONS_PAUSE, SAVE_MESSAGEOPTIONS_SOUND, SAVE_MESSAGEOPTIONS_TYPE, type, cgame_import_s::XML_AddNode(), and xmlNode_t.
Referenced by SAV_Init().
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.
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 (true) or deactivated |
sendCommands | flag indicating whether confunc command to update menu button should be sent |
Definition at line 80 of file cp_messageoptions.cpp.
References cgi, messageSettings_s::doNotify, messageSettings_s::doPause, messageSettings_s::doSound, MSO_MSTATE_PREPARED, MSO_NOTIFY, MSO_SetMenuState(), NTMASK_PAUSE, NTMASK_SOUND, and type.
Referenced by MSO_LoadXML(), MSO_ParseOption(), MSO_Set_f(), MSO_SetAll_f(), and MSO_Toggle_f().
Function callback used to initialize values for messageoptions and for manual setting changes.
Definition at line 146 of file cp_messageoptions.cpp.
References cgi, cgame_import_s::Cmd_Argv(), MSO_ParseOptionType(), MSO_Set(), NT_NUM_NOTIFYTYPE, nt_strings, Q_streq, and type.
Function callback that sets all message options settings for one option type to given value.
Definition at line 176 of file cp_messageoptions.cpp.
References cgi, cgame_import_s::Cmd_Argv(), MSO_MSTATE_PREPARED, MSO_ParseOptionType(), MSO_Set(), MSO_SetMenuState(), NT_NUM_NOTIFYTYPE, and type.
Definition at line 490 of file cp_messageoptions.cpp.
References cgi, 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 67 of file cp_messageoptions.cpp.
Referenced by MSO_BackupSettings_f(), and MSO_RestoreSettings_f().
|
static |
Definition at line 479 of file cp_messageoptions.cpp.
char const* const nt_strings[NT_NUM_NOTIFYTYPE] |
valid notification types that may cause pause / notice
Definition at line 34 of file cp_messageoptions.cpp.
Referenced by MSO_LoadXML(), MSO_ParseCategory(), MSO_ParseNotifyType(), MSO_SaveXML(), MSO_Set_f(), and MSO_Toggle_f().