From dfcc6397848d4597b386b688f689352de6c19ae2 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Thu, 26 Mar 2009 00:27:05 +0100 Subject: Remove redundancy, fix variable names and other code cleanups --- src/gui/skilldialog.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) (limited to 'src/gui/skilldialog.cpp') 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 mSkillIcons; + std::vector mSkillNameLabels; + std::vector mSkillLevelLabels; + std::vector mSkillExpLabels; + std::vector 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"); -- cgit v1.2.3-70-g09d2