1 /** 2 * @file 3 */ 4 5 /* 6 Copyright (C) 2002-2013 UFO: Alien Invasion. 7 8 This program is free software; you can redistribute it and/or 9 modify it under the terms of the GNU General Public License 10 as published by the Free Software Foundation; either version 2 11 of the License, or (at your option) any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 16 17 See the GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 23 */ 24 25 #pragma once 26 27 #define MAX_MESSAGE_TEXT 256 28 29 /* message systems */ 30 typedef enum { 31 MSG_DEBUG, /**< only save them in debug mode */ 32 MSG_INFO, /**< don't save these messages */ 33 MSG_STANDARD, 34 MSG_RESEARCH_PROPOSAL, 35 MSG_RESEARCH_HALTED, 36 MSG_RESEARCH_FINISHED, 37 MSG_CONSTRUCTION, 38 MSG_UFOSPOTTED, 39 MSG_UFOLOST, 40 MSG_TERRORSITE, 41 MSG_BASEATTACK, 42 MSG_TRANSFERFINISHED, 43 MSG_PROMOTION, 44 MSG_PRODUCTION, 45 MSG_NEWS, 46 MSG_DEATH, 47 MSG_CRASHSITE, 48 49 MSG_EVENT, /**< Eventmail only! used by CL_EventAddMail */ 50 51 MSG_MAX 52 } messageType_t; 53 54 /* Russian timestamp (with UTF-8) is 23 bytes long */ 55 #define TIMESTAMP_TEXT 24 56 struct uiMessageListNodeMessage_s { 57 char title[MAX_VAR]; 58 char timestamp[TIMESTAMP_TEXT]; 59 char* text; 60 date_t date; 61 const char* iconName; 62 int lineUsed; /**< used by the node to cache the number of lines need (often =1) */ 63 struct uiMessageListNodeMessage_s* next; 64 65 /** override some campaign specific stuff */ 66 messageType_t type; 67 struct technology_s* pedia; /**< link to UFOpaedia if a research has finished. */ 68 struct eventMail_s* eventMail; 69 }; 70 71 typedef struct uiMessageListNodeMessage_s uiMessageListNodeMessage_t; 72 73 uiMessageListNodeMessage_t* MS_AddNewMessage(const char* title, const char* text, messageType_t type = MSG_STANDARD, struct technology_s* pedia = nullptr, bool popup = false, bool playSound = true); 74 void MS_MessageInit(void); 75 76 extern char cp_messageBuffer[MAX_MESSAGE_TEXT]; 77