UFO: Alien Invasion
|
#include "../../cl_shared.h"
#include "cp_campaign.h"
#include "cp_popup.h"
#include "cp_messages.h"
#include "cp_time.h"
#include "save/save_messages.h"
Go to the source code of this file.
Functions | |
static void | MS_TimestampedText (char *text, uiMessageListNodeMessage_t *message, size_t textsize) |
Returns formatted text of a message timestamp. More... | |
uiMessageListNodeMessage_t * | MS_AddNewMessage (const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup, bool playSound) |
Adds a new message to message stack. More... | |
static void | MS_MessageSaveXML (xmlNode_t *p, uiMessageListNodeMessage_t *message) |
Save a list of messages to xml. More... | |
bool | MS_SaveXML (xmlNode_t *p) |
Save callback for messages. More... | |
bool | MS_LoadXML (xmlNode_t *p) |
Load callback for messages. More... | |
void | MS_MessageInit (void) |
Variables | |
char | cp_messageBuffer [MAX_MESSAGE_TEXT] |
uiMessageListNodeMessage_t* MS_AddNewMessage | ( | const char * | title, |
const char * | text, | ||
messageType_t | type, | ||
technology_t * | pedia, | ||
bool | popup, | ||
bool | playSound | ||
) |
Adds a new message to message stack.
[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) |
[in] | playSound | Whether the sound associated with the message type should be played |
MS_AddNewMessageSound
with < only save them in debug mode
< don't save these messages
Definition at line 61 of file cp_messages.cpp.
References ccs, cgi, cp_campaignPool, CP_GameTimeStop(), CP_Popup(), uiMessageListNodeMessage_s::date, ccs_s::date, f, uiMessageListNodeMessage_s::iconName, Mem_PoolAllocType, MS_TimestampedText(), MSG_BASEATTACK, MSG_CONSTRUCTION, MSG_CRASHSITE, MSG_DEATH, MSG_DEBUG, MSG_EVENT, MSG_INFO, MSG_MAX, MSG_NEWS, MSG_PRODUCTION, MSG_PROMOTION, MSG_RESEARCH_FINISHED, MSG_RESEARCH_HALTED, MSG_RESEARCH_PROPOSAL, MSG_STANDARD, MSG_TERRORSITE, MSG_TRANSFERFINISHED, MSG_UFOLOST, MSG_UFOSPOTTED, ccs_s::numUnreadMails, uiMessageListNodeMessage_s::pedia, cgame_import_s::PoolStrDup(), Q_strncpyz(), uiMessageListNodeMessage_s::text, uiMessageListNodeMessage_s::timestamp, uiMessageListNodeMessage_s::title, uiMessageListNodeMessage_s::type, and type.
Referenced by AIM_AircraftStart_f(), AIR_CampaignRun(), AIR_NewAircraft(), AIR_SendAircraftPursuingUFO(), AIR_SendAircraftToMission(), AIRFIGHT_ActionsAfterAirfight(), AIRFIGHT_ExecuteActions(), AL_AddAliens(), AM_AlienCollect(), AM_DisplayResults(), AM_Go_f(), B_BuildBase_f(), B_Destroy_AntimaterStorage_f(), B_SellOrAddItems(), B_SetBaseTitle_f(), CHAR_UpdateStats(), CL_EventAddMail(), CP_BaseAttackMissionDestroyBase(), CP_MissionAddToGeoscape(), CP_MissionEndActions(), MS_LoadXML(), MSO_CheckAddNewMessage(), NAT_HandleBudget(), SAV_GameQuickLoad_f(), SAV_GameQuickSave_f(), UR_DialogStartSell_f(), and UR_DialogStartStore_f().
bool MS_LoadXML | ( | xmlNode_t * | p | ) |
Load callback for messages.
[in] | p | XML Node structure, where we get the information from |
No tech found drop message.
Definition at line 251 of file cp_messages.cpp.
References _, cgi, CL_GetEventMail(), Com_sprintf(), cp_campaignPool, CP_DateConvertLong(), eventMail_s::date, uiMessageListNodeMessage_s::date, Date_GetMonthName(), dateLong_s::day, date_s::day, uiMessageListNodeMessage_s::eventMail, i, MAX_MESSAGE_TEXT, MAX_VAR, dateLong_s::month, MS_AddNewMessage(), MS_TimestampedText(), MSG_DEBUG, MSG_EVENT, MSG_RESEARCH_FINISHED, MSG_RESEARCH_PROPOSAL, cgame_import_s::PoolStrDup(), Q_strncpyz(), eventMail_s::read, RS_GetTechByID(), SAVE_MESSAGES_DATE, SAVE_MESSAGES_EVENTMAILID, SAVE_MESSAGES_EVENTMAILREAD, SAVE_MESSAGES_MESSAGE, SAVE_MESSAGES_MESSAGES, SAVE_MESSAGES_PEDIAID, SAVE_MESSAGES_TEXT, SAVE_MESSAGES_TITLE, SAVE_MESSAGES_TYPE, SAVE_MESSAGETYPE_NAMESPACE, saveMessageConstants, date_s::sec, uiMessageListNodeMessage_s::timestamp, type, cgame_import_s::XML_GetDate(), cgame_import_s::XML_GetNextNode(), cgame_import_s::XML_GetNode(), cgame_import_s::XML_GetString(), xmlNode_t, and dateLong_s::year.
Referenced by SAV_Init().
Definition at line 329 of file cp_messages.cpp.
References MSO_Init().
Referenced by CP_InitStartup().
|
static |
Save a list of messages to xml.
[out] | p | XML Node structure, where we write the information to |
[in] | message | The first message to save |
Definition at line 201 of file cp_messages.cpp.
References cgi, cgame_import_s::Com_GetConstVariable(), uiMessageListNodeMessage_s::date, date_s::day, uiMessageListNodeMessage_s::eventMail, eventMail_s::id, technology_s::id, MSG_EVENT, MSG_INFO, uiMessageListNodeMessage_s::next, uiMessageListNodeMessage_s::pedia, eventMail_s::read, SAVE_MESSAGES_DATE, SAVE_MESSAGES_EVENTMAILID, SAVE_MESSAGES_EVENTMAILREAD, SAVE_MESSAGES_MESSAGE, SAVE_MESSAGES_PEDIAID, SAVE_MESSAGES_TEXT, SAVE_MESSAGES_TITLE, SAVE_MESSAGES_TYPE, SAVE_MESSAGETYPE_NAMESPACE, saveMessageConstants, date_s::sec, uiMessageListNodeMessage_s::text, uiMessageListNodeMessage_s::title, uiMessageListNodeMessage_s::type, cgame_import_s::XML_AddNode(), and xmlNode_t.
Referenced by MS_SaveXML().
bool MS_SaveXML | ( | xmlNode_t * | p | ) |
Save callback for messages.
[out] | p | XML Node structure, where we write the information to |
Definition at line 236 of file cp_messages.cpp.
References cgi, MS_MessageSaveXML(), SAVE_MESSAGES_MESSAGES, cgame_import_s::UI_MessageGetStack(), cgame_import_s::XML_AddNode(), and xmlNode_t.
Referenced by SAV_Init().
|
static |
Returns formatted text of a message timestamp.
[in] | text | Buffer to hold the final result |
[in] | message | The message to convert into text |
[in] | textsize | The maximum length for text |
Definition at line 39 of file cp_messages.cpp.
References _, Com_sprintf(), CP_DateConvertLong(), uiMessageListNodeMessage_s::date, Date_GetMonthName(), dateLong_s::day, dateLong_s::hour, dateLong_s::min, dateLong_s::month, and dateLong_s::year.
Referenced by MS_AddNewMessage(), and MS_LoadXML().
char cp_messageBuffer[MAX_MESSAGE_TEXT] |
Definition at line 31 of file cp_messages.cpp.
Referenced by AII_UpdateOneInstallationDelay(), AIR_Move(), AIR_NewAircraft(), AIR_Refuel(), B_BuildBase_f(), B_SellOrAddItems(), B_UpdateBuildingConstructions(), CHAR_UpdateStats(), CP_BaseAttackMissionDestroyBase(), CP_MissionEndActions(), CP_MissionGetMessage(), 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(), UR_DialogStartSell_f(), UR_DialogStartStore_f(), UR_ProcessActive(), and US_TransferUFO().