2010-10-20 19:40:32 +00:00
|
|
|
#ifndef MWGUI_REVIEW_H
|
|
|
|
#define MWGUI_REVIEW_H
|
|
|
|
|
2013-04-10 04:32:05 +00:00
|
|
|
#include "windowbase.hpp"
|
2010-10-21 07:28:09 +00:00
|
|
|
#include "widgets.hpp"
|
2010-10-20 19:40:32 +00:00
|
|
|
|
2011-02-21 19:36:35 +00:00
|
|
|
namespace MWGui
|
2010-10-20 19:40:32 +00:00
|
|
|
{
|
2011-02-21 19:36:35 +00:00
|
|
|
class WindowManager;
|
2010-10-20 19:40:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
This file contains the dialog for reviewing the generated character.
|
2012-07-03 09:34:20 +00:00
|
|
|
Layout is defined by resources/mygui/openmw_chargen_review.layout.
|
2010-10-20 19:40:32 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace MWGui
|
|
|
|
{
|
2013-02-25 05:57:32 +00:00
|
|
|
class ReviewDialog : public WindowModal
|
2010-10-20 19:40:32 +00:00
|
|
|
{
|
|
|
|
public:
|
2011-01-02 15:43:13 +00:00
|
|
|
enum Dialogs {
|
|
|
|
NAME_DIALOG,
|
|
|
|
RACE_DIALOG,
|
|
|
|
CLASS_DIALOG,
|
|
|
|
BIRTHSIGN_DIALOG
|
|
|
|
};
|
2010-10-21 07:28:09 +00:00
|
|
|
typedef std::vector<int> SkillList;
|
|
|
|
|
2013-04-10 18:46:21 +00:00
|
|
|
ReviewDialog();
|
2010-10-20 19:40:32 +00:00
|
|
|
|
2010-10-21 07:28:09 +00:00
|
|
|
void setPlayerName(const std::string &name);
|
|
|
|
void setRace(const std::string &raceId);
|
|
|
|
void setClass(const ESM::Class& class_);
|
|
|
|
void setBirthSign (const std::string &signId);
|
|
|
|
|
2012-09-15 15:12:42 +00:00
|
|
|
void setHealth(const MWMechanics::DynamicStat<float>& value);
|
|
|
|
void setMagicka(const MWMechanics::DynamicStat<float>& value);
|
|
|
|
void setFatigue(const MWMechanics::DynamicStat<float>& value);
|
2010-10-21 07:28:09 +00:00
|
|
|
|
2014-01-03 00:59:15 +00:00
|
|
|
void setAttribute(ESM::Attribute::AttributeID attributeId, const MWMechanics::AttributeValue& value);
|
2010-10-21 07:28:09 +00:00
|
|
|
|
|
|
|
void configureSkills(const SkillList& major, const SkillList& minor);
|
2014-01-03 00:59:15 +00:00
|
|
|
void setSkillValue(ESM::Skill::SkillEnum skillId, const MWMechanics::SkillValue& value);
|
2010-10-21 07:28:09 +00:00
|
|
|
|
2012-08-27 19:29:04 +00:00
|
|
|
virtual void open();
|
2010-10-21 07:28:09 +00:00
|
|
|
|
2010-10-20 19:40:32 +00:00
|
|
|
// Events
|
2012-09-10 07:10:50 +00:00
|
|
|
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
|
|
|
typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_Int;
|
2010-10-20 19:40:32 +00:00
|
|
|
|
|
|
|
/** Event : Back button clicked.\n
|
|
|
|
signature : void method()\n
|
|
|
|
*/
|
|
|
|
EventHandle_Void eventBack;
|
|
|
|
|
2014-09-07 01:21:24 +00:00
|
|
|
/** Event : Dialog finished, OK button clicked.\n
|
|
|
|
signature : void method()\n
|
|
|
|
*/
|
|
|
|
EventHandle_WindowBase eventDone;
|
|
|
|
|
2011-01-02 15:43:13 +00:00
|
|
|
EventHandle_Int eventActivateDialog;
|
2010-10-22 23:00:07 +00:00
|
|
|
|
2010-10-20 19:40:32 +00:00
|
|
|
protected:
|
|
|
|
void onOkClicked(MyGUI::Widget* _sender);
|
|
|
|
void onBackClicked(MyGUI::Widget* _sender);
|
|
|
|
|
2010-10-22 23:00:07 +00:00
|
|
|
void onNameClicked(MyGUI::Widget* _sender);
|
|
|
|
void onRaceClicked(MyGUI::Widget* _sender);
|
|
|
|
void onClassClicked(MyGUI::Widget* _sender);
|
|
|
|
void onBirthSignClicked(MyGUI::Widget* _sender);
|
|
|
|
|
2012-05-27 04:39:10 +00:00
|
|
|
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
|
|
|
|
2010-10-20 19:40:32 +00:00
|
|
|
private:
|
2010-10-21 07:28:09 +00:00
|
|
|
void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
|
|
|
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
|
|
|
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
2012-06-06 18:29:30 +00:00
|
|
|
MyGUI::TextBox* addValueItem(const std::string& text, const std::string &value, const std::string& state, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
|
|
|
void addItem(const std::string& text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
2010-10-22 22:11:54 +00:00
|
|
|
void updateSkillArea();
|
2010-10-21 07:28:09 +00:00
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
static const int sLineHeight;
|
2010-10-21 07:28:09 +00:00
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
MyGUI::TextBox *mNameWidget, *mRaceWidget, *mClassWidget, *mBirthSignWidget;
|
2012-09-10 11:39:22 +00:00
|
|
|
MyGUI::ScrollView* mSkillView;
|
2010-10-21 07:28:09 +00:00
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
Widgets::MWDynamicStatPtr mHealth, mMagicka, mFatigue;
|
2010-10-21 07:28:09 +00:00
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
std::map<int, Widgets::MWAttributePtr> mAttributeWidgets;
|
2010-10-21 07:28:09 +00:00
|
|
|
|
2012-07-13 10:51:58 +00:00
|
|
|
SkillList mMajorSkills, mMinorSkills, mMiscSkills;
|
2014-01-03 00:59:15 +00:00
|
|
|
std::map<int, MWMechanics::SkillValue > mSkillValues;
|
2012-07-13 10:51:58 +00:00
|
|
|
std::map<int, MyGUI::TextBox*> mSkillWidgetMap;
|
|
|
|
std::string mName, mRaceId, mBirthSignId;
|
|
|
|
ESM::Class mKlass;
|
2013-03-03 12:11:02 +00:00
|
|
|
std::vector<MyGUI::Widget*> mSkillWidgets; //< Skills and other information
|
2010-10-20 19:40:32 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|