From 13f82f10d92816d0239db56b7936fd2403f50897 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 15 Jan 2005 19:08:49 +0000 Subject: Fixed upping skills. --- src/gui/skill.h | 49 +++++++++++++------------------------------------ 1 file changed, 13 insertions(+), 36 deletions(-) (limited to 'src/gui/skill.h') diff --git a/src/gui/skill.h b/src/gui/skill.h index 1d68bffe..5db90f04 100644 --- a/src/gui/skill.h +++ b/src/gui/skill.h @@ -24,59 +24,31 @@ #ifndef _TMW_SKILL_H #define _TMW_SKILL_H -#include +#include #include "window.h" struct SKILL { - short id; //index into "skill_db" array + short id; /**< Index into "skill_db" array */ short lv, sp; }; -/** - * The skill list model. - * - * \ingroup GUI - */ -class SkillListModel : public gcn::ListModel -{ - private: - std::vector skillList; - - public: - /** - * Constructor. - */ - SkillListModel(); - - /** - * Destructor. - */ - virtual ~SkillListModel(); - - int getNumberOfElements(); - std::string getElementAt(int); - - bool hasSkill(int id); - void addSkill(int id, int lv, int sp); - void setSkill(int id, int lv, int sp); -}; - /** * The skill dialog. * * \ingroup GUI */ -class SkillDialog : public Window, public gcn::ActionListener +class SkillDialog : public Window, public gcn::ActionListener, + public gcn::ListModel { private: gcn::ListBox *skillListBox; gcn::ScrollArea *skillScrollArea; - SkillListModel *skills; gcn::Label *pointsLabel; - gcn::Button *incButton; gcn::Button *closeButton; + std::vector skillList; + public: /** * Constructor. @@ -90,9 +62,14 @@ class SkillDialog : public Window, public gcn::ActionListener void action(const std::string&); - SkillListModel* getModel(); - void setPoints(int i); + + int getNumberOfElements(); + std::string getElementAt(int); + + bool hasSkill(int id); + void addSkill(int id, int lv, int sp); + void setSkill(int id, int lv, int sp); }; #endif -- cgit v1.2.3-60-g2f50