2010-10-20 19:40:32 +00:00
|
|
|
#ifndef MWGUI_REVIEW_H
|
|
|
|
#define MWGUI_REVIEW_H
|
|
|
|
|
2010-11-06 10:29:03 +00:00
|
|
|
#include "window_base.hpp"
|
2010-10-21 07:28:09 +00:00
|
|
|
#include "../mwmechanics/stat.hpp"
|
|
|
|
#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
|
|
|
|
{
|
|
|
|
using namespace MyGUI;
|
|
|
|
|
2010-11-06 10:29:03 +00:00
|
|
|
class ReviewDialog : public WindowBase
|
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;
|
|
|
|
|
2011-02-21 19:36:35 +00:00
|
|
|
ReviewDialog(WindowManager& parWindowManager);
|
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);
|
|
|
|
|
|
|
|
void setHealth(const MWMechanics::DynamicStat<int>& value);
|
|
|
|
void setMagicka(const MWMechanics::DynamicStat<int>& value);
|
|
|
|
void setFatigue(const MWMechanics::DynamicStat<int>& value);
|
|
|
|
|
|
|
|
void setAttribute(ESM::Attribute::AttributeID attributeId, const MWMechanics::Stat<int>& value);
|
|
|
|
|
|
|
|
void configureSkills(const SkillList& major, const SkillList& minor);
|
|
|
|
void setSkillValue(ESM::Skill::SkillEnum skillId, const MWMechanics::Stat<float>& value);
|
|
|
|
|
2010-10-22 22:11:54 +00:00
|
|
|
void open();
|
2010-10-21 07:28:09 +00:00
|
|
|
|
2010-10-20 19:40:32 +00:00
|
|
|
// Events
|
2012-03-21 12:27:08 +00:00
|
|
|
typedef delegates::CMultiDelegate0 EventHandle_Void;
|
|
|
|
typedef 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;
|
|
|
|
|
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-21 07:28:09 +00:00
|
|
|
void updateScroller();
|
2010-10-22 22:11:54 +00:00
|
|
|
void updateSkillArea();
|
2010-10-21 07:28:09 +00:00
|
|
|
|
2012-03-22 14:23:23 +00:00
|
|
|
void onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos);
|
2011-03-12 12:54:00 +00:00
|
|
|
void onWindowResize(MyGUI::Window* window);
|
2010-10-21 07:28:09 +00:00
|
|
|
|
|
|
|
static const int lineHeight;
|
|
|
|
|
2012-03-21 13:54:02 +00:00
|
|
|
MyGUI::TextBox *nameWidget, *raceWidget, *classWidget, *birthSignWidget;
|
2010-10-21 07:28:09 +00:00
|
|
|
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
|
2012-03-22 14:23:23 +00:00
|
|
|
MyGUI::ScrollBar* skillScrollerWidget;
|
2010-10-21 07:28:09 +00:00
|
|
|
int lastPos, clientHeight;
|
|
|
|
|
|
|
|
Widgets::MWDynamicStatPtr health, magicka, fatigue;
|
|
|
|
|
|
|
|
std::map<int, Widgets::MWAttributePtr> attributeWidgets;
|
|
|
|
|
|
|
|
SkillList majorSkills, minorSkills, miscSkills;
|
|
|
|
std::map<int, MWMechanics::Stat<float> > skillValues;
|
2012-03-21 13:54:02 +00:00
|
|
|
std::map<int, MyGUI::TextBox*> skillWidgetMap;
|
2010-10-21 07:28:09 +00:00
|
|
|
std::string name, raceId, birthSignId;
|
|
|
|
ESM::Class klass;
|
|
|
|
std::vector<MyGUI::WidgetPtr> skillWidgets; //< Skills and other information
|
2010-10-20 19:40:32 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|