OpenMW
|
00001 #ifndef CHARACTER_CREATION_HPP 00002 #define CHARACTER_CREATION_HPP 00003 00004 #include "../mwbase/world.hpp" 00005 #include "../mwbase/windowmanager.hpp" 00006 00007 namespace MWGui 00008 { 00009 class WindowBase; 00010 00011 class TextInputDialog; 00012 class InfoBoxDialog; 00013 class RaceDialog; 00014 class DialogueWindow; 00015 class ClassChoiceDialog; 00016 class GenerateClassResultDialog; 00017 class PickClassDialog; 00018 class CreateClassDialog; 00019 class BirthDialog; 00020 class ReviewDialog; 00021 class MessageBoxManager; 00022 00023 class CharacterCreation 00024 { 00025 public: 00026 typedef std::vector<int> SkillList; 00027 00028 CharacterCreation(); 00029 ~CharacterCreation(); 00030 00031 //Show a dialog 00032 void spawnDialog(const char id); 00033 00034 void setValue (const std::string& id, const MWMechanics::Stat<int>& value); 00035 void setValue (const std::string& id, const MWMechanics::DynamicStat<float>& value); 00036 void setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat<float>& value); 00037 void configureSkills (const SkillList& major, const SkillList& minor); 00038 void doRenderUpdate(); 00039 00040 private: 00041 //Dialogs 00042 TextInputDialog* mNameDialog; 00043 RaceDialog* mRaceDialog; 00044 ClassChoiceDialog* mClassChoiceDialog; 00045 InfoBoxDialog* mGenerateClassQuestionDialog; 00046 GenerateClassResultDialog* mGenerateClassResultDialog; 00047 PickClassDialog* mPickClassDialog; 00048 CreateClassDialog* mCreateClassDialog; 00049 BirthDialog* mBirthSignDialog; 00050 ReviewDialog* mReviewDialog; 00051 00052 //Player data 00053 std::string mPlayerName; 00054 std::string mPlayerRaceId; 00055 std::string mPlayerBirthSignId; 00056 ESM::Class mPlayerClass; 00057 00058 //Class generation vars 00059 unsigned mGenerateClassStep; // Keeps track of current step in Generate Class dialog 00060 unsigned mGenerateClassSpecializations[3]; // A counter for each specialization which is increased when an answer is chosen 00061 std::string mGenerateClass; // In order: Stealth, Combat, Magic 00062 00064 //Name dialog 00065 void onNameDialogDone(WindowBase* parWindow); 00066 00067 //Race dialog 00068 void onRaceDialogDone(WindowBase* parWindow); 00069 void onRaceDialogBack(); 00070 00071 //Class dialogs 00072 void onClassChoice(int _index); 00073 void onPickClassDialogDone(WindowBase* parWindow); 00074 void onPickClassDialogBack(); 00075 void onCreateClassDialogDone(WindowBase* parWindow); 00076 void onCreateClassDialogBack(); 00077 void showClassQuestionDialog(); 00078 void onClassQuestionChosen(int _index); 00079 void onGenerateClassBack(); 00080 void onGenerateClassDone(WindowBase* parWindow); 00081 00082 //Birthsign dialog 00083 void onBirthSignDialogDone(WindowBase* parWindow); 00084 void onBirthSignDialogBack(); 00085 00086 //Review dialog 00087 void onReviewDialogDone(WindowBase* parWindow); 00088 void onReviewDialogBack(); 00089 void onReviewActivateDialog(int parDialog); 00090 00091 enum CSE //Creation Stage Enum 00092 { 00093 CSE_NotStarted, 00094 CSE_NameChosen, 00095 CSE_RaceChosen, 00096 CSE_ClassChosen, 00097 CSE_BirthSignChosen, 00098 CSE_ReviewBack, 00099 CSE_ReviewNext 00100 }; 00101 00102 CSE mCreationStage; // Which state the character creating is in, controls back/next/ok buttons 00103 }; 00104 } 00105 00106 #endif