diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-28 22:10:37 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2013-04-30 21:21:06 +0200 |
commit | a6b11834f227b8edbfb39633380806480fd2a2c5 (patch) | |
tree | c9397013f135d61f3321c45d8b10493aecac2344 /src/gui/charcreatedialog.h | |
parent | 286eb6552fa059d8e4561fb4bb13cb5266dff71d (diff) | |
download | mana-a6b11834f227b8edbfb39633380806480fd2a2c5.tar.gz mana-a6b11834f227b8edbfb39633380806480fd2a2c5.tar.bz2 mana-a6b11834f227b8edbfb39633380806480fd2a2c5.tar.xz mana-a6b11834f227b8edbfb39633380806480fd2a2c5.zip |
Hide attribute sliders on character creation when appropriate
When the minimum and maximum values of the attributes are equal, then
there is nothing for the player to customize and the sliders are not
shown.
At the same time the dialog has been fixed to resize properly to any
number of modifiable attributes.
Diffstat (limited to 'src/gui/charcreatedialog.h')
-rw-r--r-- | src/gui/charcreatedialog.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/charcreatedialog.h b/src/gui/charcreatedialog.h index 7548bbff..9f49f6c5 100644 --- a/src/gui/charcreatedialog.h +++ b/src/gui/charcreatedialog.h @@ -58,14 +58,12 @@ class CharCreateDialog : public Window, public gcn::ActionListener void unlock(); void setAttributes(const std::vector<std::string> &labels, - unsigned int available, - unsigned int min, unsigned int max); + unsigned available, + unsigned min, unsigned max); void setFixedGender(bool fixed, Gender gender = GENDER_FEMALE); private: - int getDistributedPoints() const; - void updateSliders(); /** @@ -94,13 +92,13 @@ class CharCreateDialog : public Window, public gcn::ActionListener gcn::RadioButton *mMale; gcn::RadioButton *mFemale; + std::vector<int> mAttributes; std::vector<gcn::Slider*> mAttributeSlider; std::vector<gcn::Label*> mAttributeLabel; std::vector<gcn::Label*> mAttributeValue; gcn::Label *mAttributesLeft; - int mMaxPoints; - int mUsedPoints; + unsigned mMaxPoints; gcn::Button *mCreateButton; gcn::Button *mCancelButton; |