-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCompMessage.h
More file actions
67 lines (54 loc) · 2.13 KB
/
CompMessage.h
File metadata and controls
67 lines (54 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* Copyright (c) 2002-2012 Croteam Ltd.
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as published by
the Free Software Foundation
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
#ifndef SE_INCL_COMPMESSAGE_H
#define SE_INCL_COMPMESSAGE_H
#ifdef PRAGMA_ONCE
#pragma once
#endif
class CCompMessage {
public:
CTFileName cm_fnmFileName; // message identificator
CCompMessageID *cm_pcmiOriginal; // identifier in player's array
BOOL cm_bLoaded; // set if message is loaded
CTString cm_strSubject; // message subject
enum ImageType {
IT_NONE,
IT_MODEL,
IT_PICTURE,
IT_STATISTICS,
} cm_itImage; // accompanying image if any
CTString cm_strModel; // name of model if model
CTFileName cm_fnmPicture; // filename of picture if picture
CTString cm_strText; // original message text
BOOL cm_bRead;
INDEX cm_ctFormattedWidth; // chars per row in formatted text
INDEX cm_ctFormattedLines; // number of lines in formatted text
CTString cm_strFormattedText; // text formatted for given line width
// load the message from file
void Load_t(void); // throw char *
// format message for given line width
void Format(INDEX ctCharsPerLine);
public:
CCompMessage(void);
void Clear(void);
// constructs message from ID
void SetMessage(CCompMessageID *pcmi);
// prepare message for using (load, format, etc.)
void PrepareMessage(INDEX ctCharsPerLine);
// free memory used by message, but keep message filename
void UnprepareMessage(void);
// mark message as read
void MarkRead(void);
// get one formatted line
CTString GetLine(INDEX iLine);
};
#endif /* include-once check. */