ScummVM API documentation
GameMessageHandler.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /*
23  * Copyright (C) 2006-2010 - Frictional Games
24  *
25  * This file is part of Penumbra Overture.
26  */
27 
28 #ifndef GAME_GAME_MESSAGE_HANDLER_H
29 #define GAME_GAME_MESSAGE_HANDLER_H
30 
31 #include "hpl1/engine/engine.h"
32 
33 #include "hpl1/penumbra-overture/GameTypes.h"
34 
35 using namespace hpl;
36 
37 class cInit;
38 
40 class cGameMessage {
41 public:
42  cGameMessage(const tWString &asText, cGameMessageHandler *apMessHandler);
43 
44  void Update(float afTimeStep);
45  void Draw(FontData *apFont);
46 
47  bool mbActive;
48 
49  tWString msText;
50  float mfFade;
51  float mfFadeAdd;
52 
53  cGameMessageHandler *mpMessHandler;
54 };
55 
58 
59 //---------------------------------------
60 
62  friend class cGameMessage;
63 
64 public:
65  cGameMessageHandler(cInit *apInit);
67 
68  void Add(const tWString &asText);
69  void ShowNext();
70 
71  void Update(float afTimeStep);
72  void OnDraw();
73  void Reset();
74 
75  void OnWorldLoad();
76  void OnWorldExit();
77 
78  bool HasMessage() { return !mlstMessages.empty(); }
79 
80  void SetOnMessagesOverCallback(const tString &asFunction);
81 
82  void SetFocusIsedUsed(bool abX) { mbFocusIsedUsed = abX; }
83 
84  void SetBlackText(bool abX) { mbBlackText = abX; }
85 
86 private:
87  cInit *mpInit;
88 
89  FontData *mpFont;
90  ePlayerState mLastState;
91  tString msOverCallback;
92 
93  bool mbFocusIsedUsed;
94 
95  bool mbBlackText;
96 
97  tGameMessageList mlstMessages;
98 };
99 
100 #endif // GAME_GAME_MESSAGE_HANDLER_H
Definition: AI.h:36
Definition: str.h:59
Definition: GameMessageHandler.h:40
Definition: font_data.h:67
Definition: ustr.h:57
Definition: GameMessageHandler.h:61
Definition: Updateable.h:35
Definition: list_intern.h:51
Definition: Init.h:70