OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
charactercreation.hpp
Go to the documentation of this file.
1 #ifndef CHARACTER_CREATION_HPP
2 #define CHARACTER_CREATION_HPP
3 
6 
7 #include <vector>
8 
9 #include "../mwmechanics/stat.hpp"
10 
11 namespace osg
12 {
13  class Group;
14 }
15 
16 namespace Resource
17 {
18  class ResourceSystem;
19 }
20 
21 namespace MWGui
22 {
23  class WindowBase;
24 
25  class TextInputDialog;
26  class InfoBoxDialog;
27  class RaceDialog;
28  class DialogueWindow;
29  class ClassChoiceDialog;
30  class GenerateClassResultDialog;
31  class PickClassDialog;
32  class CreateClassDialog;
33  class BirthDialog;
34  class ReviewDialog;
35  class MessageBoxManager;
36 
38  {
39  public:
40  typedef std::vector<int> SkillList;
41 
42  CharacterCreation(osg::Group* parent, Resource::ResourceSystem* resourceSystem);
44 
45  //Show a dialog
46  void spawnDialog(const char id);
47 
48  void setValue (const std::string& id, const MWMechanics::AttributeValue& value);
49  void setValue (const std::string& id, const MWMechanics::DynamicStat<float>& value);
50  void setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::SkillValue& value);
51  void configureSkills (const SkillList& major, const SkillList& minor);
52 
53  void onFrame(float duration);
54 
55  private:
56  osg::Group* mParent;
58 
59  //Dialogs
69 
70  //Player data
71  std::string mPlayerName;
72  std::string mPlayerRaceId;
73  std::string mPlayerBirthSignId;
75 
76  //Class generation vars
77  unsigned mGenerateClassStep; // Keeps track of current step in Generate Class dialog
78  unsigned mGenerateClassSpecializations[3]; // A counter for each specialization which is increased when an answer is chosen
79  std::string mGenerateClass; // In order: Stealth, Combat, Magic
80 
82  //Name dialog
83  void onNameDialogDone(WindowBase* parWindow);
84 
85  //Race dialog
86  void onRaceDialogDone(WindowBase* parWindow);
87  void onRaceDialogBack();
88  void selectRace();
89 
90  //Class dialogs
91  void onClassChoice(int _index);
92  void onPickClassDialogDone(WindowBase* parWindow);
93  void onPickClassDialogBack();
94  void onCreateClassDialogDone(WindowBase* parWindow);
97  void onClassQuestionChosen(int _index);
98  void onGenerateClassBack();
99  void onGenerateClassDone(WindowBase* parWindow);
100  void selectGeneratedClass();
101  void selectCreatedClass();
102  void selectPickedClass();
103 
104  //Birthsign dialog
105  void onBirthSignDialogDone(WindowBase* parWindow);
106  void onBirthSignDialogBack();
107  void selectBirthSign();
108 
109  //Review dialog
110  void onReviewDialogDone(WindowBase* parWindow);
111  void onReviewDialogBack();
112  void onReviewActivateDialog(int parDialog);
113 
114  enum CSE //Creation Stage Enum
115  {
123  };
124 
125  CSE mCreationStage; // Which state the character creating is in, controls back/next/ok buttons
126 
127  void handleDialogDone(CSE currentStage, int nextMode);
128  };
129 }
130 
131 #endif
void spawnDialog(const char id)
Definition: charactercreation.cpp:141
std::string mPlayerName
Definition: charactercreation.hpp:71
Definition: stat.hpp:108
std::string mPlayerRaceId
Definition: charactercreation.hpp:72
Wrapper class that constructs and provides access to the most commonly used resource subsystems...
Definition: resourcesystem.hpp:24
void onGenerateClassDone(WindowBase *parWindow)
Definition: charactercreation.cpp:659
Definition: class.hpp:13
CSE mCreationStage
Definition: charactercreation.hpp:125
void onBirthSignDialogBack()
Definition: charactercreation.cpp:458
~CharacterCreation()
Definition: charactercreation.cpp:666
ESM::Class mPlayerClass
Definition: charactercreation.hpp:74
Definition: charactercreation.hpp:121
void handleDialogDone(CSE currentStage, int nextMode)
Definition: charactercreation.cpp:679
Definition: birth.hpp:8
void onClassChoice(int _index)
Definition: charactercreation.cpp:360
std::string mPlayerBirthSignId
Definition: charactercreation.hpp:73
Definition: textinput.hpp:13
void showClassQuestionDialog()
Definition: charactercreation.cpp:542
void onRaceDialogDone(WindowBase *parWindow)
Definition: charactercreation.cpp:430
CharacterCreation(osg::Group *parent, Resource::ResourceSystem *resourceSystem)
Definition: charactercreation.cpp:65
unsigned mGenerateClassSpecializations[3]
Definition: charactercreation.hpp:78
Definition: charactercreation.hpp:116
Definition: class.hpp:259
void onFrame(float duration)
Definition: charactercreation.cpp:135
GenerateClassResultDialog * mGenerateClassResultDialog
Definition: charactercreation.hpp:64
Definition: class.hpp:48
void onNameDialogDone(WindowBase *parWindow)
Definition: charactercreation.cpp:385
void selectPickedClass()
Definition: charactercreation.cpp:323
RaceDialog * mRaceDialog
Definition: charactercreation.hpp:61
void onCreateClassDialogBack()
Definition: charactercreation.cpp:508
Resource::ResourceSystem * mResourceSystem
Definition: charactercreation.hpp:57
void selectBirthSign()
Definition: charactercreation.cpp:437
CSE
Definition: charactercreation.hpp:114
void selectRace()
Definition: charactercreation.cpp:399
void configureSkills(const SkillList &major, const SkillList &minor)
Definition: charactercreation.cpp:129
Definition: charactercreation.hpp:117
std::vector< int > SkillList
Definition: charactercreation.hpp:40
void selectGeneratedClass()
Definition: charactercreation.cpp:635
ReviewDialog * mReviewDialog
Definition: charactercreation.hpp:68
Definition: charactercreation.hpp:37
std::string mGenerateClass
Definition: charactercreation.hpp:79
unsigned mGenerateClassStep
Definition: charactercreation.hpp:77
void onReviewActivateDialog(int parDialog)
Definition: charactercreation.cpp:299
Definition: review.hpp:21
void setValue(const std::string &id, const MWMechanics::AttributeValue &value)
Definition: charactercreation.cpp:85
osg::Group * mParent
Definition: charactercreation.hpp:56
void selectCreatedClass()
Definition: charactercreation.cpp:466
void onCreateClassDialogDone(WindowBase *parWindow)
Definition: charactercreation.cpp:501
BirthDialog * mBirthSignDialog
Definition: charactercreation.hpp:67
void onReviewDialogDone(WindowBase *parWindow)
Definition: charactercreation.cpp:281
void onBirthSignDialogDone(WindowBase *parWindow)
Definition: charactercreation.cpp:451
void onRaceDialogBack()
Definition: charactercreation.cpp:422
void onGenerateClassBack()
Definition: charactercreation.cpp:651
Definition: charactercreation.hpp:119
Definition: race.hpp:34
Definition: windowbase.hpp:16
Definition: charactercreation.hpp:122
ClassChoiceDialog * mClassChoiceDialog
Definition: charactercreation.hpp:62
Definition: class.hpp:62
void onPickClassDialogBack()
Definition: charactercreation.cpp:352
Definition: charactercreation.hpp:118
Definition: loadclas.hpp:18
Definition: stat.hpp:137
Definition: charactercreation.hpp:120
Definition: class.hpp:94
TextInputDialog * mNameDialog
Definition: charactercreation.hpp:60
InfoBoxDialog * mGenerateClassQuestionDialog
Definition: charactercreation.hpp:63
SkillEnum
Definition: loadskil.hpp:45
void onPickClassDialogDone(WindowBase *parWindow)
Definition: charactercreation.cpp:345
void onClassQuestionChosen(int _index)
Definition: charactercreation.cpp:517
void onReviewDialogBack()
Definition: charactercreation.cpp:289
PickClassDialog * mPickClassDialog
Definition: charactercreation.hpp:65
CreateClassDialog * mCreateClassDialog
Definition: charactercreation.hpp:66