|
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. | |
| static int | MSO_ParseNotifyType (const char *name) |
| Parse notify type. | |
| static int | MSO_ParseOptionType (const char *type) |
| Parse option type. | |
| static void | MSO_Set_f (void) |
| Function callback used to initialize values for messageoptions and for manual setting changes. | |
| static void | MSO_SetAll_f (void) |
| Function callback that sets all message options settings for one option type to given value. | |
| 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. | |
| bool | MSO_SaveXML (xmlNode_t *p) |
| saves current notification and pause settings | |
| bool | MSO_LoadXML (xmlNode_t *p) |
| Restores the notification and pause settings from savegame. | |
| static int | MSO_ParseOption (const char *blockName, const char **text) |
| parses message options settings from file. | |
| static bool | MSO_ParseCategory (const char *blockName, const char **text) |
| Parses a messagecategory script section. These categories are used to group notification types. | |
| void | MSO_ParseMessageSettings (const char *name, const char **text) |
| parses message options settings from file. | |
| 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 | |
| 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 | ) |
References NT_NUM_NOTIFYTYPE, and nt_strings.
| 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_t::doNotify, messageSettings_t::doPause, messageSettings_t::doSound, messageSettings, MS_AddNewMessage(), and type.
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, msgOptionsCmds, 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, 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_t::category, ccs, cgi, Com_Parse(), cp_campaignPool, ERR_DROP, msgCategory_t::first, msgCategory_t::idx, msgCategoryEntry_t::isCategory, msgCategory_t::last, MAX_MESSAGECATEGORIES, messageSettings, MSO_MSTATE_REINIT, MSO_ParseOption(), MSO_SetMenuState(), msgCategory_t::name, msgCategoryEntry_t::next, msgCategoryEntry_t::notifyType, nt_strings, OBJZERO, msgCategoryEntry_t::previous, Q_streq, and msgCategoryEntry_t::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, Com_Parse(), ERR_DROP, messageSettings, MSO_ParseCategory(), name, OBJZERO, and Q_streq.
Referenced by CP_ParseScriptFirst().
|
static |
Parse notify type.
Definition at line 115 of file cp_messageoptions.cpp.
References name, 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, Com_Parse(), 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, Q_strcaseeq, and type.
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_t::doNotify, messageSettings_t::doPause, messageSettings_t::doSound, messageSettings, NT_NUM_NOTIFYTYPE, nt_strings, SAVE_MESSAGEOPTIONS_MESSAGEOPTIONS, SAVE_MESSAGEOPTIONS_NAME, SAVE_MESSAGEOPTIONS_NOTIFY, SAVE_MESSAGEOPTIONS_PAUSE, SAVE_MESSAGEOPTIONS_SOUND, SAVE_MESSAGEOPTIONS_TYPE, type, 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_t::doNotify, messageSettings_t::doPause, messageSettings_t::doSound, messageSettings, 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, 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, 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, msgOptionsCmds, 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(), MSO_CheckAddNewMessage(), MSO_ParseCategory(), MSO_ParseMessageSettings(), MSO_RestoreSettings_f(), MSO_SaveXML(), and MSO_Set().
|
static |
Definition at line 479 of file cp_messageoptions.cpp.
Referenced by MSO_Init(), and MSO_Shutdown().
| 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 CASSERT(), MSO_LoadXML(), MSO_ParseCategory(), MSO_ParseNotifyType(), MSO_SaveXML(), MSO_Set_f(), and MSO_Toggle_f().