OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
review.hpp
Go to the documentation of this file.
1 #ifndef MWGUI_REVIEW_H
2 #define MWGUI_REVIEW_H
3 
6 #include "windowbase.hpp"
7 #include "widgets.hpp"
8 
9 namespace ESM
10 {
11  struct Spell;
12 }
13 
14 namespace MWGui
15 {
16  class WindowManager;
17 }
18 
19 namespace MWGui
20 {
21  class ReviewDialog : public WindowModal
22  {
23  public:
24  enum Dialogs {
29  };
30  typedef std::vector<int> SkillList;
31 
32  ReviewDialog();
33 
34  void setPlayerName(const std::string &name);
35  void setRace(const std::string &raceId);
36  void setClass(const ESM::Class& class_);
37  void setBirthSign (const std::string &signId);
38 
39  void setHealth(const MWMechanics::DynamicStat<float>& value);
42 
44 
45  void configureSkills(const SkillList& major, const SkillList& minor);
47 
48  virtual void open();
49 
50  void onFrame(float duration);
51 
52  // Events
53  typedef MyGUI::delegates::CMultiDelegate0 EventHandle_Void;
54  typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_Int;
55 
60 
65 
67 
68  protected:
69  void onOkClicked(MyGUI::Widget* _sender);
70  void onBackClicked(MyGUI::Widget* _sender);
71 
72  void onNameClicked(MyGUI::Widget* _sender);
73  void onRaceClicked(MyGUI::Widget* _sender);
74  void onClassClicked(MyGUI::Widget* _sender);
75  void onBirthSignClicked(MyGUI::Widget* _sender);
76 
77  void onMouseWheel(MyGUI::Widget* _sender, int _rel);
78 
79  private:
80  void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
81  void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
82  void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
83  MyGUI::TextBox* addValueItem(const std::string& text, const std::string &value, const std::string& state, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
84  void addItem(const std::string& text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
85  void addItem(const ESM::Spell* spell, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
86  void updateSkillArea();
87 
88  static const int sLineHeight;
89 
91  MyGUI::ScrollView* mSkillView;
92 
94 
95  std::map<int, Widgets::MWAttributePtr> mAttributeWidgets;
96 
98  std::map<int, MWMechanics::SkillValue > mSkillValues;
99  std::map<int, MyGUI::TextBox*> mSkillWidgetMap;
100  std::string mName, mRaceId, mBirthSignId;
102  std::vector<MyGUI::Widget*> mSkillWidgets; //< Skills and other information
103 
105  };
106 }
107 #endif
Definition: review.hpp:27
MyGUI::TextBox * mBirthSignWidget
Definition: review.hpp:90
Widgets::MWDynamicStatPtr mHealth
Definition: review.hpp:93
Definition: stat.hpp:108
void setRace(const std::string &raceId)
Definition: review.cpp:124
std::string mName
Definition: review.hpp:100
void setMagicka(const MWMechanics::DynamicStat< float > &value)
Definition: review.cpp:168
Definition: loadspel.hpp:14
std::map< int, MWMechanics::SkillValue > mSkillValues
Definition: review.hpp:98
void updateSkillArea()
Definition: review.cpp:348
void onBirthSignClicked(MyGUI::Widget *_sender)
Definition: review.cpp:476
MyGUI::delegates::CMultiDelegate0 EventHandle_Void
Definition: review.hpp:53
void onBackClicked(MyGUI::Widget *_sender)
Definition: review.cpp:456
MyGUI::ScrollView * mSkillView
Definition: review.hpp:91
void onFrame(float duration)
Definition: review.cpp:110
ReviewDialog()
Definition: review.cpp:32
std::vector< int > SkillList
Definition: review.hpp:30
bool mUpdateSkillArea
Definition: review.hpp:104
void onNameClicked(MyGUI::Widget *_sender)
Definition: review.cpp:461
void setAttribute(ESM::Attribute::AttributeID attributeId, const MWMechanics::AttributeValue &value)
Definition: review.cpp:182
EventHandle_Int eventActivateDialog
Definition: review.hpp:66
MyGUI::TextBox * mNameWidget
Definition: review.hpp:90
MyGUI::TextBox * addValueItem(const std::string &text, const std::string &value, const std::string &state, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
Definition: review.cpp:259
void setBirthSign(const std::string &signId)
Definition: review.cpp:146
SkillList mMajorSkills
Definition: review.hpp:97
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
Definition: review.cpp:248
void onRaceClicked(MyGUI::Widget *_sender)
Definition: review.cpp:466
SkillList mMinorSkills
Definition: review.hpp:97
Widgets::MWDynamicStatPtr mFatigue
Definition: review.hpp:93
void setHealth(const MWMechanics::DynamicStat< float > &value)
Definition: review.cpp:161
void setFatigue(const MWMechanics::DynamicStat< float > &value)
Definition: review.cpp:175
SkillList mMiscSkills
Definition: review.hpp:97
Definition: review.hpp:28
virtual void open()
Notify that window has been made visible.
Definition: review.cpp:104
Dialogs
Definition: review.hpp:24
std::string mRaceId
Definition: review.hpp:100
Definition: review.hpp:26
ESM::Class mKlass
Definition: review.hpp:101
void onOkClicked(MyGUI::Widget *_sender)
Definition: review.cpp:451
Definition: review.hpp:21
void setPlayerName(const std::string &name)
Definition: review.cpp:119
void configureSkills(const SkillList &major, const SkillList &minor)
Definition: review.cpp:216
Definition: review.hpp:25
void onMouseWheel(MyGUI::Widget *_sender, int _rel)
Definition: review.cpp:481
std::map< int, Widgets::MWAttributePtr > mAttributeWidgets
Definition: review.hpp:95
EventHandle_Void eventBack
Definition: review.hpp:59
void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
Definition: review.cpp:310
MyGUI::delegates::CMultiDelegate1< int > EventHandle_Int
Definition: review.hpp:54
static const int sLineHeight
Definition: review.hpp:88
std::string mBirthSignId
Definition: review.hpp:100
Definition: loadclas.hpp:18
MyGUI::delegates::CMultiDelegate1< WindowBase * > EventHandle_WindowBase
Definition: windowbase.hpp:22
Definition: widgets.hpp:277
Definition: stat.hpp:137
void addItem(const std::string &text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
Definition: review.cpp:282
std::vector< MyGUI::Widget * > mSkillWidgets
Definition: review.hpp:102
Widgets::MWDynamicStatPtr mMagicka
Definition: review.hpp:93
SkillEnum
Definition: loadskil.hpp:45
void setSkillValue(ESM::Skill::SkillEnum skillId, const MWMechanics::SkillValue &value)
Definition: review.cpp:195
std::map< int, MyGUI::TextBox * > mSkillWidgetMap
Definition: review.hpp:99
MyGUI::TextBox * mClassWidget
Definition: review.hpp:90
void setClass(const ESM::Class &class_)
Definition: review.cpp:139
void onClassClicked(MyGUI::Widget *_sender)
Definition: review.cpp:471
AttributeID
Definition: attr.hpp:14
EventHandle_WindowBase eventDone
Definition: review.hpp:64
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
Definition: review.cpp:237
MyGUI::TextBox * mRaceWidget
Definition: review.hpp:90
Definition: windowbase.hpp:41
const char * name
Definition: crashcatcher.cpp:59