| 1 | /* |
| 2 | * LegacyClonk |
| 3 | * |
| 4 | * Copyright (c) 1998-2000, Matthes Bender (RedWolf Design) |
| 5 | * Copyright (c) 2017-2019, The LegacyClonk Team and contributors |
| 6 | * |
| 7 | * Distributed under the terms of the ISC license; see accompanying file |
| 8 | * "COPYING" for details. |
| 9 | * |
| 10 | * "Clonk" is a registered trademark of Matthes Bender, used with permission. |
| 11 | * See accompanying file "TRADEMARK" for details. |
| 12 | * |
| 13 | * To redistribute this file separately, substitute the full license texts |
| 14 | * for the above references. |
| 15 | */ |
| 16 | |
| 17 | /* Fullscreen startup log and chat type-in */ |
| 18 | |
| 19 | #pragma once |
| 20 | |
| 21 | const int C4MSGB_MaxMsgFading = 6; |
| 22 | |
| 23 | #include <C4Facet.h> |
| 24 | #include <C4LogBuf.h> |
| 25 | #include "C4Player.h" |
| 26 | |
| 27 | class C4MessageBoard |
| 28 | { |
| 29 | public: |
| 30 | C4MessageBoard(); |
| 31 | ~C4MessageBoard(); |
| 32 | |
| 33 | public: |
| 34 | C4Facet Output; |
| 35 | |
| 36 | bool Active; |
| 37 | |
| 38 | protected: |
| 39 | int ScreenFader; |
| 40 | bool Startup; |
| 41 | int iMode; // 0 = one line (std), 1 = > 1 lines, 2 = invisible |
| 42 | // mode 0: |
| 43 | int Delay; // how long the curr msg will stay |
| 44 | int Fader; // =0: hold curr msg until Delay == 0 |
| 45 | // <0: fade curr msg out |
| 46 | // >0: fade curr msg in |
| 47 | int Speed; // fade/delay speed |
| 48 | bool Empty; // msgboard empty? |
| 49 | // mode 1: |
| 50 | int iLines; // how many lines are visible? (+ one line for typin! ) |
| 51 | int iBackScroll; // how many lines scrolled back? |
| 52 | // all modes: |
| 53 | int iLineHgt; // line height |
| 54 | |
| 55 | C4LogBuffer LogBuffer; // backbuffer for log |
| 56 | |
| 57 | public: |
| 58 | void Default(); |
| 59 | void Clear(); |
| 60 | void Init(C4Facet &cgo, bool fStartup); |
| 61 | void Execute(); |
| 62 | void Draw(C4Facet &cgo); |
| 63 | void AddLog(const char *szMessage); |
| 64 | void ClearLog(); |
| 65 | void LogNotify(); |
| 66 | void EnsureLastMessage(); |
| 67 | bool ControlScrollUp(); |
| 68 | bool ControlScrollDown(); |
| 69 | C4Player *GetMessagePlayer(const char *szMessage); |
| 70 | void ChangeMode(int inMode); |
| 71 | |
| 72 | friend class C4MessageInput; |
| 73 | }; |
| 74 | |