OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
spellcreationdialog.hpp
Go to the documentation of this file.
1 #ifndef MWGUI_SPELLCREATION_H
2 #define MWGUI_SPELLCREATION_H
3 
6 
7 #include "windowbase.hpp"
8 #include "referenceinterface.hpp"
9 
10 namespace Gui
11 {
12  class MWList;
13 }
14 
15 namespace MWGui
16 {
17 
18  class SelectSkillDialog;
19  class SelectAttributeDialog;
20 
22  {
23  public:
25 
26  virtual void open();
27  virtual void exit();
28 
29  void setConstantEffect(bool constant);
30 
31  void setSkill(int skill);
32  void setAttribute(int attribute);
33 
34  void newEffect (const ESM::MagicEffect* effect);
35  void editEffect (ESM::ENAMstruct effect);
36  typedef MyGUI::delegates::CMultiDelegate1<ESM::ENAMstruct> EventHandle_Effect;
37 
41 
42  protected:
43  MyGUI::Button* mCancelButton;
44  MyGUI::Button* mOkButton;
45  MyGUI::Button* mDeleteButton;
46 
47  MyGUI::Button* mRangeButton;
48 
49  MyGUI::Widget* mDurationBox;
50  MyGUI::Widget* mMagnitudeBox;
51  MyGUI::Widget* mAreaBox;
52 
53  MyGUI::TextBox* mMagnitudeMinValue;
54  MyGUI::TextBox* mMagnitudeMaxValue;
55  MyGUI::TextBox* mDurationValue;
56  MyGUI::TextBox* mAreaValue;
57 
58  MyGUI::ScrollBar* mMagnitudeMinSlider;
59  MyGUI::ScrollBar* mMagnitudeMaxSlider;
60  MyGUI::ScrollBar* mDurationSlider;
61  MyGUI::ScrollBar* mAreaSlider;
62 
63  MyGUI::TextBox* mAreaText;
64 
65  MyGUI::ImageBox* mEffectImage;
66  MyGUI::TextBox* mEffectName;
67 
68  bool mEditing;
69 
70  protected:
71  void onRangeButtonClicked (MyGUI::Widget* sender);
72  void onDeleteButtonClicked (MyGUI::Widget* sender);
73  void onOkButtonClicked (MyGUI::Widget* sender);
74  void onCancelButtonClicked (MyGUI::Widget* sender);
75 
76  void onMagnitudeMinChanged (MyGUI::ScrollBar* sender, size_t pos);
77  void onMagnitudeMaxChanged (MyGUI::ScrollBar* sender, size_t pos);
78  void onDurationChanged (MyGUI::ScrollBar* sender, size_t pos);
79  void onAreaChanged (MyGUI::ScrollBar* sender, size_t pos);
80  void setMagicEffect(const ESM::MagicEffect* effect);
81 
82  void updateBoxes();
83 
84  protected:
87 
89 
91  };
92 
93 
95  {
96  public:
97  enum Type
98  {
101  };
102 
103  EffectEditorBase(Type type);
104  virtual ~EffectEditorBase();
105 
106  void setConstantEffect(bool constant);
107 
108  protected:
109  std::map<int, short> mButtonMapping; // maps button ID to effect ID
110 
112  MyGUI::ScrollView* mUsedEffectsView;
113 
117 
120 
122 
123  std::vector<ESM::ENAMstruct> mEffects;
124 
125  void onEffectAdded(ESM::ENAMstruct effect);
126  void onEffectModified(ESM::ENAMstruct effect);
127  void onEffectRemoved(ESM::ENAMstruct effect);
128 
129  void onAvailableEffectClicked (MyGUI::Widget* sender);
130 
132  void onSelectAttribute();
133  void onSelectSkill();
134 
135  void onEditEffect(MyGUI::Widget* sender);
136 
137  void updateEffectsView();
138 
139  void startEditing();
140  void setWidgets (Gui::MWList* availableEffectsList, MyGUI::ScrollView* usedEffectsView);
141 
142  virtual void notifyEffectsChanged () {}
143 
144  private:
146  };
147 
149  {
150  public:
152 
153  virtual void open();
154  virtual void exit();
155 
156  void startSpellMaking(MWWorld::Ptr actor);
157 
158  protected:
159  virtual void onReferenceUnavailable ();
160 
161  void onCancelButtonClicked (MyGUI::Widget* sender);
162  void onBuyButtonClicked (MyGUI::Widget* sender);
163 
164  virtual void notifyEffectsChanged ();
165 
166  MyGUI::EditBox* mNameEdit;
167  MyGUI::TextBox* mMagickaCost;
168  MyGUI::TextBox* mSuccessChance;
169  MyGUI::Button* mBuyButton;
170  MyGUI::Button* mCancelButton;
171  MyGUI::TextBox* mPriceLabel;
172 
174 
175  };
176 
177 }
178 
179 #endif
MyGUI::TextBox * mMagickaCost
Definition: spellcreationdialog.hpp:167
void updateEffectsView()
Definition: spellcreationdialog.cpp:667
short mSelectedKnownEffectId
Definition: spellcreationdialog.hpp:119
Definition: spellcreationdialog.hpp:148
MyGUI::TextBox * mMagnitudeMinValue
Definition: spellcreationdialog.hpp:53
void newEffect(const ESM::MagicEffect *effect)
Definition: spellcreationdialog.cpp:115
void onEffectModified(ESM::ENAMstruct effect)
Definition: spellcreationdialog.cpp:654
virtual void open()
Notify that window has been made visible.
Definition: spellcreationdialog.cpp:100
MyGUI::Button * mCancelButton
Definition: spellcreationdialog.hpp:170
virtual void onReferenceUnavailable()
called when reference has become unavailable
Definition: spellcreationdialog.cpp:420
void onCancelButtonClicked(MyGUI::Widget *sender)
Definition: spellcreationdialog.cpp:268
virtual void notifyEffectsChanged()
Definition: spellcreationdialog.hpp:142
void onEditEffect(MyGUI::Widget *sender)
Definition: spellcreationdialog.cpp:722
ESM::ENAMstruct mOldEffect
Definition: spellcreationdialog.hpp:86
MyGUI::EditBox * mNameEdit
Definition: spellcreationdialog.hpp:166
void onOkButtonClicked(MyGUI::Widget *sender)
Definition: spellcreationdialog.cpp:263
std::map< int, short > mButtonMapping
Definition: spellcreationdialog.hpp:109
const ESM::MagicEffect * mMagicEffect
Definition: spellcreationdialog.hpp:88
MyGUI::ImageBox * mEffectImage
Definition: spellcreationdialog.hpp:65
MyGUI::TextBox * mAreaText
Definition: spellcreationdialog.hpp:63
Definition: loadspel.hpp:14
EditEffectDialog mAddEffectDialog
Definition: spellcreationdialog.hpp:114
MyGUI::ScrollBar * mDurationSlider
Definition: spellcreationdialog.hpp:60
virtual void open()
Notify that window has been made visible.
Definition: spellcreationdialog.cpp:410
a very simple list widget that supports word-wrapping entries
Definition: list.hpp:12
void setWidgets(Gui::MWList *availableEffectsList, MyGUI::ScrollView *usedEffectsView)
Definition: spellcreationdialog.cpp:568
void onAvailableEffectClicked(MyGUI::Widget *sender)
Definition: spellcreationdialog.cpp:609
void onDurationChanged(MyGUI::ScrollBar *sender, size_t pos)
Definition: spellcreationdialog.cpp:312
MyGUI::Button * mBuyButton
Definition: spellcreationdialog.hpp:169
void onSelectAttribute()
Definition: spellcreationdialog.cpp:576
MyGUI::Widget * mAreaBox
Definition: spellcreationdialog.hpp:51
MyGUI::Widget * mMagnitudeBox
Definition: spellcreationdialog.hpp:50
MyGUI::TextBox * mDurationValue
Definition: spellcreationdialog.hpp:55
void onMagnitudeMinChanged(MyGUI::ScrollBar *sender, size_t pos)
Definition: spellcreationdialog.cpp:285
void editEffect(ESM::ENAMstruct effect)
Definition: spellcreationdialog.cpp:157
EventHandle_Effect eventEffectModified
Definition: spellcreationdialog.hpp:39
MyGUI::ScrollBar * mAreaSlider
Definition: spellcreationdialog.hpp:61
void onAreaChanged(MyGUI::ScrollBar *sender, size_t pos)
Definition: spellcreationdialog.cpp:319
MyGUI::TextBox * mAreaValue
Definition: spellcreationdialog.hpp:56
void setConstantEffect(bool constant)
Definition: spellcreationdialog.cpp:95
Definition: effectlist.hpp:17
void onCancelButtonClicked(MyGUI::Widget *sender)
Definition: spellcreationdialog.cpp:355
bool mConstantEffect
Definition: spellcreationdialog.hpp:90
MyGUI::TextBox * mMagnitudeMaxValue
Definition: spellcreationdialog.hpp:54
virtual ~EffectEditorBase()
Definition: spellcreationdialog.cpp:503
virtual void exit()
Gracefully exits the window.
Definition: spellcreationdialog.cpp:415
void onDeleteButtonClicked(MyGUI::Widget *sender)
Definition: spellcreationdialog.cpp:256
MyGUI::delegates::CMultiDelegate1< ESM::ENAMstruct > EventHandle_Effect
Definition: spellcreationdialog.hpp:36
EventHandle_Effect eventEffectRemoved
Definition: spellcreationdialog.hpp:40
void onSelectSkill()
Definition: spellcreationdialog.cpp:587
Definition: class.hpp:172
Definition: spellcreationdialog.hpp:21
void setMagicEffect(const ESM::MagicEffect *effect)
Definition: spellcreationdialog.cpp:181
Type mType
Definition: spellcreationdialog.hpp:145
MyGUI::Button * mDeleteButton
Definition: spellcreationdialog.hpp:45
MyGUI::ScrollBar * mMagnitudeMaxSlider
Definition: spellcreationdialog.hpp:59
Definition: spellcreationdialog.hpp:99
MyGUI::Widget * mDurationBox
Definition: spellcreationdialog.hpp:49
MyGUI::TextBox * mEffectName
Definition: spellcreationdialog.hpp:66
MyGUI::Button * mRangeButton
Definition: spellcreationdialog.hpp:47
SelectSkillDialog * mSelectSkillDialog
Definition: spellcreationdialog.hpp:116
MyGUI::TextBox * mPriceLabel
Definition: spellcreationdialog.hpp:171
Definition: spellcreationdialog.hpp:100
void startEditing()
Definition: spellcreationdialog.cpp:507
void onEffectRemoved(ESM::ENAMstruct effect)
Definition: spellcreationdialog.cpp:661
void updateBoxes()
Definition: spellcreationdialog.cpp:194
std::vector< ESM::ENAMstruct > mEffects
Definition: spellcreationdialog.hpp:123
Definition: loadmgef.hpp:13
EditEffectDialog()
Definition: spellcreationdialog.cpp:56
void setConstantEffect(bool constant)
Definition: spellcreationdialog.cpp:732
Definition: class.hpp:203
Gui::MWList * mAvailableEffectsList
Definition: spellcreationdialog.hpp:111
int mSelectedEffect
Definition: spellcreationdialog.hpp:118
MyGUI::Button * mOkButton
Definition: spellcreationdialog.hpp:44
Definition: windowbase.hpp:16
bool mEditing
Definition: spellcreationdialog.hpp:68
virtual void exit()
Gracefully exits the window.
Definition: spellcreationdialog.cpp:106
Type
Definition: spellcreationdialog.hpp:97
void onRangeButtonClicked(MyGUI::Widget *sender)
Definition: spellcreationdialog.cpp:223
void startSpellMaking(MWWorld::Ptr actor)
Definition: spellcreationdialog.cpp:347
this class is intended for GUI interfaces that access an MW-Reference for example dialogue window acc...
Definition: referenceinterface.hpp:12
MyGUI::TextBox * mSuccessChance
Definition: spellcreationdialog.hpp:168
void onMagnitudeMaxChanged(MyGUI::ScrollBar *sender, size_t pos)
Definition: spellcreationdialog.cpp:295
EffectEditorBase(Type type)
Definition: spellcreationdialog.cpp:485
ESM::Spell mSpell
Definition: spellcreationdialog.hpp:173
MyGUI::ScrollView * mUsedEffectsView
Definition: spellcreationdialog.hpp:112
void onBuyButtonClicked(MyGUI::Widget *sender)
Definition: spellcreationdialog.cpp:360
Pointer to a LiveCellRef.
Definition: ptr.hpp:19
ESM::ENAMstruct mEffect
Definition: spellcreationdialog.hpp:85
EventHandle_Effect eventEffectAdded
Definition: spellcreationdialog.hpp:38
MyGUI::Button * mCancelButton
Definition: spellcreationdialog.hpp:43
void onEffectAdded(ESM::ENAMstruct effect)
Definition: spellcreationdialog.cpp:714
void setAttribute(int attribute)
Definition: spellcreationdialog.cpp:279
void setSkill(int skill)
Definition: spellcreationdialog.cpp:273
Definition: spellcreationdialog.hpp:94
MyGUI::ScrollBar * mMagnitudeMinSlider
Definition: spellcreationdialog.hpp:58
bool mConstantEffect
Definition: spellcreationdialog.hpp:121
SelectAttributeDialog * mSelectAttributeDialog
Definition: spellcreationdialog.hpp:115
virtual void notifyEffectsChanged()
Definition: spellcreationdialog.cpp:426
Definition: windowbase.hpp:41
void onAttributeOrSkillCancel()
Definition: spellcreationdialog.cpp:598
SpellCreationDialog()
Definition: spellcreationdialog.cpp:328