summaryrefslogtreecommitdiff
path: root/src/gui/skilldialog.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-26 00:27:05 +0100
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-03-26 00:32:19 +0100
commitdfcc6397848d4597b386b688f689352de6c19ae2 (patch)
treea6e8c9afd6a49ea96e4498080a96d3e06ecaebd7 /src/gui/skilldialog.cpp
parentcd20fb3432498b8871401bdd65a143197e2a6538 (diff)
downloadmana-dfcc6397848d4597b386b688f689352de6c19ae2.tar.gz
mana-dfcc6397848d4597b386b688f689352de6c19ae2.tar.bz2
mana-dfcc6397848d4597b386b688f689352de6c19ae2.tar.xz
mana-dfcc6397848d4597b386b688f689352de6c19ae2.zip
Remove redundancy, fix variable names and other code cleanups
Diffstat (limited to 'src/gui/skilldialog.cpp')
-rw-r--r--src/gui/skilldialog.cpp57
1 files changed, 56 insertions, 1 deletions
diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp
index 22d1db60..9506e7f8 100644
--- a/src/gui/skilldialog.cpp
+++ b/src/gui/skilldialog.cpp
@@ -40,6 +40,61 @@
#include "../utils/gettext.h"
#include "../utils/stringutils.h"
+class Skill_Tab : public GCContainer, public gcn::ActionListener
+{
+ public:
+ /**
+ * The type of this skill tab
+ */
+ const std::string type;
+
+ /**
+ * Constructor
+ */
+ Skill_Tab(const std::string &type);
+
+ /**
+ * Update this tab
+ */
+ void update();
+
+ /**
+ * Called when receiving actions from widget.
+ */
+ void action(const gcn::ActionEvent &event) {}
+
+ private:
+ /**
+ * Update the information of a skill at
+ * the given index
+ */
+ void updateSkill(int index);
+
+ /**
+ * Gets the number of skills in this particular
+ * type of tab.
+ */
+ int getSkillNum();
+
+ /**
+ * Get the first enumeration of this skill tab's
+ * skill type.
+ */
+ int getSkillBegin();
+
+ /**
+ * Get the icon associated with the given index
+ */
+ Icon* getIcon(int index);
+
+ std::vector<Icon *> mSkillIcons;
+ std::vector<gcn::Label *> mSkillNameLabels;
+ std::vector<gcn::Label *> mSkillLevelLabels;
+ std::vector<gcn::Label *> mSkillExpLabels;
+ std::vector<ProgressBar *> mSkillProgress;
+};
+
+
SkillDialog::SkillDialog():
Window(_("Skills"))
{
@@ -50,7 +105,7 @@ SkillDialog::SkillDialog():
TabbedArea *panel = new TabbedArea();
panel->setDimension(gcn::Rectangle(5, 5, 270, 420));
- Skill_Tab* tab;
+ Skill_Tab *tab;
// Add each type of skill tab to the panel
tab = new Skill_Tab("Weapon");