2010-10-20 21:40:32 +02:00
|
|
|
#ifndef MWGUI_REVIEW_H
|
|
|
|
#define MWGUI_REVIEW_H
|
|
|
|
|
2014-12-19 11:26:54 +01:00
|
|
|
#include <components/esm/attr.hpp>
|
|
|
|
#include <components/esm/loadclas.hpp>
|
2013-04-10 00:32:05 -04:00
|
|
|
#include "windowbase.hpp"
|
2010-10-21 09:28:09 +02:00
|
|
|
#include "widgets.hpp"
|
2010-10-20 21:40:32 +02:00
|
|
|
|
2016-11-18 17:59:05 +01:00
|
|
|
namespace ESM
|
|
|
|
{
|
2016-11-20 15:10:37 +01:00
|
|
|
struct Spell;
|
2016-11-18 17:59:05 +01:00
|
|
|
}
|
|
|
|
|
2010-10-20 21:40:32 +02:00
|
|
|
namespace MWGui
|
|
|
|
{
|
2013-02-25 06:57:32 +01:00
|
|
|
class ReviewDialog : public WindowModal
|
2010-10-20 21:40:32 +02:00
|
|
|
{
|
|
|
|
public:
|
2011-01-02 16:43:13 +01:00
|
|
|
enum Dialogs {
|
|
|
|
NAME_DIALOG,
|
|
|
|
RACE_DIALOG,
|
|
|
|
CLASS_DIALOG,
|
|
|
|
BIRTHSIGN_DIALOG
|
|
|
|
};
|
2010-10-21 09:28:09 +02:00
|
|
|
typedef std::vector<int> SkillList;
|
|
|
|
|
2013-04-10 14:46:21 -04:00
|
|
|
ReviewDialog();
|
2010-10-20 21:40:32 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
bool exit() override { return false; }
|
2017-09-23 12:18:39 +02:00
|
|
|
|
2010-10-21 09:28:09 +02: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 17:12:42 +02: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 09:28:09 +02:00
|
|
|
|
2014-01-03 01:59:15 +01:00
|
|
|
void setAttribute(ESM::Attribute::AttributeID attributeId, const MWMechanics::AttributeValue& value);
|
2010-10-21 09:28:09 +02:00
|
|
|
|
|
|
|
void configureSkills(const SkillList& major, const SkillList& minor);
|
2014-01-03 01:59:15 +01:00
|
|
|
void setSkillValue(ESM::Skill::SkillEnum skillId, const MWMechanics::SkillValue& value);
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void onOpen() override;
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2020-10-16 22:18:54 +04:00
|
|
|
void onFrame(float duration) override;
|
2016-11-18 17:59:05 +01:00
|
|
|
|
2010-10-20 21:40:32 +02:00
|
|
|
// Events
|
2012-09-10 09:10:50 +02:00
|
|
|
typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
|
|
|
|
typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_Int;
|
2010-10-20 21:40:32 +02:00
|
|
|
|
|
|
|
/** Event : Back button clicked.\n
|
|
|
|
signature : void method()\n
|
|
|
|
*/
|
|
|
|
EventHandle_Void eventBack;
|
|
|
|
|
2014-09-07 03:21:24 +02:00
|
|
|
/** Event : Dialog finished, OK button clicked.\n
|
|
|
|
signature : void method()\n
|
|
|
|
*/
|
|
|
|
EventHandle_WindowBase eventDone;
|
|
|
|
|
2011-01-02 16:43:13 +01:00
|
|
|
EventHandle_Int eventActivateDialog;
|
2010-10-23 01:00:07 +02:00
|
|
|
|
2010-10-20 21:40:32 +02:00
|
|
|
protected:
|
|
|
|
void onOkClicked(MyGUI::Widget* _sender);
|
|
|
|
void onBackClicked(MyGUI::Widget* _sender);
|
|
|
|
|
2010-10-23 01:00:07 +02:00
|
|
|
void onNameClicked(MyGUI::Widget* _sender);
|
|
|
|
void onRaceClicked(MyGUI::Widget* _sender);
|
|
|
|
void onClassClicked(MyGUI::Widget* _sender);
|
|
|
|
void onBirthSignClicked(MyGUI::Widget* _sender);
|
|
|
|
|
2012-05-27 06:39:10 +02:00
|
|
|
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
|
|
|
|
2010-10-20 21:40:32 +02:00
|
|
|
private:
|
2010-10-21 09:28:09 +02: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 20:29:30 +02: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);
|
2016-11-18 17:59:05 +01:00
|
|
|
void addItem(const ESM::Spell* spell, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
|
2010-10-23 00:11:54 +02:00
|
|
|
void updateSkillArea();
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2012-07-13 03:51:58 -07:00
|
|
|
MyGUI::TextBox *mNameWidget, *mRaceWidget, *mClassWidget, *mBirthSignWidget;
|
2012-09-10 13:39:22 +02:00
|
|
|
MyGUI::ScrollView* mSkillView;
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2012-07-13 03:51:58 -07:00
|
|
|
Widgets::MWDynamicStatPtr mHealth, mMagicka, mFatigue;
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2012-07-13 03:51:58 -07:00
|
|
|
std::map<int, Widgets::MWAttributePtr> mAttributeWidgets;
|
2010-10-21 09:28:09 +02:00
|
|
|
|
2012-07-13 03:51:58 -07:00
|
|
|
SkillList mMajorSkills, mMinorSkills, mMiscSkills;
|
2014-01-03 01:59:15 +01:00
|
|
|
std::map<int, MWMechanics::SkillValue > mSkillValues;
|
2012-07-13 03:51:58 -07:00
|
|
|
std::map<int, MyGUI::TextBox*> mSkillWidgetMap;
|
|
|
|
std::string mName, mRaceId, mBirthSignId;
|
|
|
|
ESM::Class mKlass;
|
2013-03-03 13:11:02 +01:00
|
|
|
std::vector<MyGUI::Widget*> mSkillWidgets; //< Skills and other information
|
2016-11-18 17:59:05 +01:00
|
|
|
|
|
|
|
bool mUpdateSkillArea;
|
2010-10-20 21:40:32 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|