UFO: Alien Invasion
Loading...
Searching...
No Matches
cp_messages.cpp File Reference
#include "../../DateTime.h"
#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"
Include dependency graph for cp_messages.cpp:

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.
uiMessageListNodeMessage_tMS_AddNewMessage (const char *title, const char *text, messageType_t type, technology_t *pedia, bool popup, bool playSound)
 Adds a new message to message stack.
static void MS_MessageSaveXML (xmlNode_t *p, uiMessageListNodeMessage_t *message)
 Save a list of messages to xml.
bool MS_SaveXML (xmlNode_t *p)
 Save callback for messages.
bool MS_LoadXML (xmlNode_t *p)
 Load callback for messages.
void MS_MessageInit (void)

Variables

char cp_messageBuffer [MAX_MESSAGE_TEXT]

Function Documentation

◆ MS_AddNewMessage()

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.

Note
These are the messages that are displayed at geoscape
Parameters
[in]titleAlready translated message/mail title
[in]textAlready translated message/mail body
[in]popupShow this as a popup, too?
[in]typeThe message type
[in]pediaPointer to technology (only if needed)
[in]playSoundWhether the sound associated with the message type should be played
Returns
message_t pointer
See also
UP_OpenMail_f
CL_EventAddMail_f
Note
this method forwards to MS_AddNewMessageSound with
playSound = true

< only save them in debug mode

< don't save these messages

Definition at line 63 of file cp_messages.cpp.

References ccs, cgi, cp_campaignPool, CP_GameTimeStop(), CP_Popup(), uiMessageListNodeMessage_t::date, uiMessageListNodeMessage_t::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, Q_strncpyz(), uiMessageListNodeMessage_t::text, uiMessageListNodeMessage_t::timestamp, uiMessageListNodeMessage_t::title, 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().

◆ MS_LoadXML()

◆ MS_MessageInit()

void MS_MessageInit ( void )

Definition at line 334 of file cp_messages.cpp.

References MSO_Init().

Referenced by CP_InitStartup().

◆ MS_MessageSaveXML()

◆ MS_SaveXML()

bool MS_SaveXML ( xmlNode_t * p)

Save callback for messages.

Parameters
[out]pXML Node structure, where we write the information to
See also
MS_MessageSaveXML

Definition at line 238 of file cp_messages.cpp.

References cgi, MS_MessageSaveXML(), SAVE_MESSAGES_MESSAGES, and xmlNode_t.

Referenced by SAV_Init().

◆ MS_TimestampedText()

void MS_TimestampedText ( char * text,
uiMessageListNodeMessage_t * message,
size_t textsize )
static

Returns formatted text of a message timestamp.

Parameters
[in]textBuffer to hold the final result
[in]messageThe message to convert into text
[in]textsizeThe maximum length for text

Definition at line 41 of file cp_messages.cpp.

References _, Com_sprintf(), CP_DateConvertLong(), uiMessageListNodeMessage_t::date, Date_GetMonthName(), dateLong_t::day, dateLong_t::hour, dateLong_t::min, dateLong_t::month, and dateLong_t::year.

Referenced by MS_AddNewMessage(), and MS_LoadXML().

Variable Documentation

◆ cp_messageBuffer