From 52b6be101b78990d5b4523dd5c6523dc5c7c6709 Mon Sep 17 00:00:00 2001 From: Aaron Marks Date: Tue, 4 Jan 2005 04:46:02 +0000 Subject: Converted Skills dialog from old gui to Guichan. Files modified: graphics.cpp, graphics.h, game.cpp, main.cpp, skills.h, skills.cpp. Other files are unmodified (timestamp error) --- src/gui/skill.h | 49 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 15 deletions(-) (limited to 'src/gui/skill.h') diff --git a/src/gui/skill.h b/src/gui/skill.h index 33e94a18..21f76212 100644 --- a/src/gui/skill.h +++ b/src/gui/skill.h @@ -21,30 +21,49 @@ * $Id$ */ -#ifdef WIN32 - #pragma warning (disable:4312) -#endif - #ifndef _SKILL_H #define _SKILL_H #include +#include "button.h" #include "../main.h" -//DIALOG skill_dialog[]; +struct SKILL { + short id; //index into "skill_db" array + short lv, sp; +}; -extern int n_skills; +class SkillListModel : public gcn::ListModel +{ + std::vector skillList; + public: + SkillListModel(); + ~SkillListModel(); -struct SKILL { - short id, lv, sp; - SKILL *next; + 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); }; +class SkillDialog : public Window, public gcn::ActionListener +{ + gcn::ListBox *skillListBox; + SkillListModel *skills; + gcn::Label *pointsLabel; + + Button *incButton; + Button *closeButton; + public: + SkillDialog(gcn::Container *); + ~SkillDialog(); + + void action(const std::string&); + SkillListModel* getModel() { return skills; } + + void setPoints(int i); +}; -void update_skill_dialog(); -void add_skill(short id, short lv, short sp); -char *skill_list(int index, int *list_size); -int get_skill_id(int index); -SKILL *is_skill(int id); -void increaseStatus(void *dp3, int d1); #endif -- cgit v1.2.3-70-g09d2