1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 21:19:57 +00:00
openmw-tes3mp/apps/openmw/mwgui/charactercreation.hpp

137 lines
3.8 KiB
C++
Raw Normal View History

2012-01-30 17:27:49 +00:00
#ifndef CHARACTER_CREATION_HPP
#define CHARACTER_CREATION_HPP
2014-02-23 19:11:05 +00:00
#include <components/esm/loadclas.hpp>
#include <map>
2015-01-10 00:00:52 +00:00
#include <vector>
2020-06-05 14:22:53 +00:00
#include "statswatcher.hpp"
namespace osg
2015-05-20 00:18:20 +00:00
{
class Group;
2015-05-20 00:18:20 +00:00
}
namespace Resource
{
class ResourceSystem;
}
2012-01-30 17:27:49 +00:00
namespace MWGui
{
class WindowBase;
2012-01-30 17:27:49 +00:00
class TextInputDialog;
class InfoBoxDialog;
class RaceDialog;
class DialogueWindow;
class ClassChoiceDialog;
class GenerateClassResultDialog;
class PickClassDialog;
class CreateClassDialog;
class BirthDialog;
class ReviewDialog;
class MessageBoxManager;
2020-06-05 14:22:53 +00:00
class CharacterCreation : public StatsListener
2012-01-30 17:27:49 +00:00
{
public:
typedef std::vector<int> SkillList;
CharacterCreation(osg::Group* parent, Resource::ResourceSystem* resourceSystem);
2020-06-05 14:22:53 +00:00
virtual ~CharacterCreation();
2012-01-30 17:27:49 +00:00
//Show a dialog
void spawnDialog(const char id);
2020-06-05 14:22:53 +00:00
void setValue (const std::string& id, const MWMechanics::AttributeValue& value) override;
void setValue (const std::string& id, const MWMechanics::DynamicStat<float>& value) override;
void setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::SkillValue& value) override;
void configureSkills(const SkillList& major, const SkillList& minor) override;
void onFrame(float duration);
2012-01-30 17:27:49 +00:00
private:
osg::Group* mParent;
2015-05-20 00:18:20 +00:00
Resource::ResourceSystem* mResourceSystem;
SkillList mPlayerMajorSkills, mPlayerMinorSkills;
std::map<int, MWMechanics::AttributeValue> mPlayerAttributes;
std::map<int, MWMechanics::SkillValue> mPlayerSkillValues;
2012-01-30 17:27:49 +00:00
//Dialogs
TextInputDialog* mNameDialog;
RaceDialog* mRaceDialog;
ClassChoiceDialog* mClassChoiceDialog;
InfoBoxDialog* mGenerateClassQuestionDialog;
GenerateClassResultDialog* mGenerateClassResultDialog;
PickClassDialog* mPickClassDialog;
CreateClassDialog* mCreateClassDialog;
BirthDialog* mBirthSignDialog;
ReviewDialog* mReviewDialog;
2012-01-30 17:27:49 +00:00
//Player data
std::string mPlayerName;
std::string mPlayerRaceId;
std::string mPlayerBirthSignId;
ESM::Class mPlayerClass;
//Class generation vars
unsigned mGenerateClassStep; // Keeps track of current step in Generate Class dialog
2019-08-11 12:22:02 +00:00
ESM::Class::Specialization mGenerateClassResponses[3];
unsigned mGenerateClassSpecializations[3]; // A counter for each specialization which is increased when an answer is chosen
2019-08-11 12:22:02 +00:00
std::string mGenerateClass; // In order: Combat, Magic, Stealth
2012-01-30 17:27:49 +00:00
////Dialog events
//Name dialog
void onNameDialogDone(WindowBase* parWindow);
2012-01-30 17:27:49 +00:00
//Race dialog
void onRaceDialogDone(WindowBase* parWindow);
void onRaceDialogBack();
void selectRace();
//Class dialogs
2012-01-30 17:27:49 +00:00
void onClassChoice(int _index);
void onPickClassDialogDone(WindowBase* parWindow);
void onPickClassDialogBack();
void onCreateClassDialogDone(WindowBase* parWindow);
void onCreateClassDialogBack();
void showClassQuestionDialog();
void onClassQuestionChosen(int _index);
void onGenerateClassBack();
void onGenerateClassDone(WindowBase* parWindow);
void selectGeneratedClass();
void selectCreatedClass();
void selectPickedClass();
//Birthsign dialog
void onBirthSignDialogDone(WindowBase* parWindow);
void onBirthSignDialogBack();
void selectBirthSign();
//Review dialog
void onReviewDialogDone(WindowBase* parWindow);
void onReviewDialogBack();
void onReviewActivateDialog(int parDialog);
enum CSE //Creation Stage Enum
2012-01-30 17:27:49 +00:00
{
CSE_NotStarted,
CSE_NameChosen,
CSE_RaceChosen,
CSE_ClassChosen,
CSE_BirthSignChosen,
CSE_ReviewBack,
CSE_ReviewNext
2012-01-30 17:27:49 +00:00
};
CSE mCreationStage; // Which state the character creating is in, controls back/next/ok buttons
2015-03-11 23:43:28 +00:00
void handleDialogDone(CSE currentStage, int nextMode);
};
2012-01-30 17:27:49 +00:00
}
#endif