OpenClonk
C4MessageBoard.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 1998-2000, Matthes Bender
5  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
6  * Copyright (c) 2013-2016, The OpenClonk Team and contributors
7  *
8  * Distributed under the terms of the ISC license; see accompanying file
9  * "COPYING" for details.
10  *
11  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
12  * See accompanying file "TRADEMARK" for details.
13  *
14  * To redistribute this file separately, substitute the full license texts
15  * for the above references.
16  */
17 
18 /* Fullscreen startup log and chat type-in */
19 
20 #ifndef INC_C4MessageBoard
21 #define INC_C4MessageBoard
22 
23 const int C4MSGB_MaxMsgFading = 6;
24 
25 #include "graphics/C4Facet.h"
26 #include "lib/C4LogBuf.h"
27 
28 class C4CustomKey;
30 {
31 public:
34 
36 private:
37  float ScreenFader;
38  bool Startup;
39  // mode 0:
40  int Delay; // how long the curr msg will stay
41  int Fader; // =0: hold curr msg until Delay == 0
42  // >0: fade curr msg in
43  int Speed; // fade/delay speed
44  int iBackScroll; // how many lines scrolled back?
45  int iLineHgt; // line height
46 
47  std::unique_ptr<C4KeyBinding> ScrollUpBinding, ScrollDownBinding;
48 
49  C4LogBuffer LogBuffer; // backbuffer for log
50 public:
51  void Init(C4Facet &cgo, bool fStartup);
52  void Execute();
53  void Draw(C4Facet &cgo);
54  void AddLog(const char *szMessage);
55  void ClearLog();
56  void LogNotify();
57  void EnsureLastMessage();
58  bool ControlScrollUp();
59  bool ControlScrollDown();
60  C4Player* GetMessagePlayer(const char *szMessage);
61 
62  friend class C4MessageInput;
63 };
64 
65 
66 #endif
const int C4MSGB_MaxMsgFading
C4Player * GetMessagePlayer(const char *szMessage)
void Draw(C4Facet &cgo)
void Init(C4Facet &cgo, bool fStartup)
void AddLog(const char *szMessage)