xoreos  0.0.5
charpremade.h
Go to the documentation of this file.
1 /* xoreos - A reimplementation of BioWare's Aurora engine
2  *
3  * xoreos is the legal property of its developers, whose names
4  * can be found in the AUTHORS file distributed with this source
5  * distribution.
6  *
7  * xoreos is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 3
10  * of the License, or (at your option) any later version.
11  *
12  * xoreos 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 xoreos. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
25 #ifndef ENGINES_NWN_GUI_MAIN_CHARPREMADE_H
26 #define ENGINES_NWN_GUI_MAIN_CHARPREMADE_H
27 
28 #include <vector>
29 
30 #include "src/common/scopedptr.h"
31 
32 #include "src/aurora/types.h"
33 
34 #include "src/engines/nwn/types.h"
35 
37 
39 
40 namespace Engines {
41 
42 namespace NWN {
43 
44 class Module;
45 class Portrait;
46 
48 public:
50  const Common::UString &name , const Common::UString &classes,
51  const Common::UString &portrait, float spacing = 0.0f);
53 
54  void show();
55  void hide();
56 
57  void setPosition(float x, float y, float z);
58 
59 private:
63 };
64 
66 class CharPremadeMenu : public GUI {
67 public:
68  CharPremadeMenu(Module &module, ::Engines::Console *console = 0);
70 
71  void show();
72 
73 protected:
74  void fixWidgetType(const Common::UString &tag, WidgetType &type);
75 
76  void callbackActive(Widget &widget);
77 
78 private:
79  struct Character {
81 
85 
87 
89 
90  bool operator<(const Character &c) const;
91  };
92 
94 
96 
97  std::vector<Character> _characters;
98 
100 
101  void initCharacterList();
102  void playCharacter();
103 };
104 
105 } // End of namespace NWN
106 
107 } // End of namespace Engines
108 
109 #endif // ENGINES_NWN_GUI_MAIN_CHARPREMADE_H
void fixWidgetType(const Common::UString &tag, WidgetType &type)
WidgetListItemCharacter(::Engines::GUI &gui, const Common::UString &font, const Common::UString &name, const Common::UString &classes, const Common::UString &portrait, float spacing=0.0f)
Definition: charpremade.cpp:53
A class holding an UTF-8 string.
Definition: ustring.h:48
void show()
Show the GUI.
Common::ScopedPtr< Portrait > _portrait
Definition: charpremade.h:62
The NWN character creator.
Definition: charpremade.h:66
Common::ScopedPtr< Graphics::Aurora::Text > _textName
Definition: charpremade.h:60
Basic Neverwinter Nights type definitions.
A simple scoped smart pointer template.
bool operator<(const Character &c) const
Definition: charpremade.cpp:98
A GUI.
Definition: gui.h:43
A NWN GUI.
Definition: gui.h:54
Common::ScopedPtr< GUI > _charGen
Definition: charpremade.h:95
const Common::UString & getSelectedCharacter()
Basic type definitions to handle files used in BioWare&#39;s Aurora engine.
Button items used in WidgetListBox.
A widget in a GUI.
Definition: widget.h:40
uint32_t uint32
Definition: types.h:204
void callbackActive(Widget &widget)
Callback that&#39;s triggered when a widget was activated.
Common::ScopedPtr< Graphics::Aurora::Text > _textClass
Definition: charpremade.h:61
void setPosition(float x, float y, float z)
Set the widget&#39;s position.
Definition: charpremade.cpp:84
std::vector< Character > _characters
Definition: charpremade.h:97
CharPremadeMenu(Module &module, ::Engines::Console *console=0)
A NWN GUI.