ScummVM API documentation
dialog.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 #ifndef ULTIMA_ULTIMA1_U1DIALOGS_DIALOG_H
23 #define ULTIMA_ULTIMA1_U1DIALOGS_DIALOG_H
24 
25 #include "ultima/shared/gfx/popup.h"
26 #include "ultima/shared/gfx/character_input.h"
27 #include "ultima/shared/core/str.h"
28 
29 namespace Ultima {
30 namespace Ultima1 {
31 
32 class Ultima1Game;
33 namespace Maps {
34  class Ultima1Map;
35 }
36 
37 namespace U1Dialogs {
38 
42 class Dialog : public Shared::Gfx::Popup {
43 protected:
44  Ultima1Game *_game;
45  Common::String _prompt;
46 protected:
50  Ultima1Game *getGame() { return _game; }
51 
55  Maps::Ultima1Map *getMap();
56 
63  void addInfoMsg(const Common::String &text, bool newLine = true, bool replaceLine = false);
64 
68  void getKeypress();
69 
73  void getInput(bool isNumeric = true, size_t maxCharacters = 4);
74 
78  void centerText(const Common::String &line, int yp);
79 
83  void centerText(const Shared::StringArray &lines, int yp);
84 public:
88  Dialog(Ultima1Game *game);
89 
93  void draw() override;
94 
98  void hide() override;
99 };
100 
101 } // End of namespace U1Dialogs
102 } // End of namespace Ultima1
103 } // End of namespace Ultima
104 
105 #endif
Definition: str.h:59
Definition: detection.h:27
Definition: game.h:42
Definition: dialog.h:42
Definition: popup.h:38
Ultima1Game * getGame()
Definition: dialog.h:50