diff options
Diffstat (limited to 'src/gui/npcdialog.h')
-rw-r--r-- | src/gui/npcdialog.h | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h index 337da6f2..86a0e70c 100644 --- a/src/gui/npcdialog.h +++ b/src/gui/npcdialog.h @@ -22,8 +22,7 @@ #ifndef NPCDIALOG_H #define NPCDIALOG_H -#include "configlistener.h" -#include "npc.h" +#include "eventlistener.h" #include "gui/widgets/window.h" @@ -45,15 +44,12 @@ class Button; * * \ingroup Interface */ -class NpcDialog : public Window, public gcn::ActionListener, - public gcn::ListModel, public ConfigListener +class NpcDialog : public Window, + public gcn::ActionListener, + public gcn::ListModel, + public EventListener { public: - /** - * Constructor. - * - * @see Window::Window - */ NpcDialog(int npcId); ~NpcDialog(); @@ -120,13 +116,6 @@ class NpcDialog : public Window, public gcn::ActionListener, void addChoice(const std::string &); /** - * Fills the options list for an NPC dialog. - * - * @param itemString A string with the options separated with colons. - */ - void parseListItems(const std::string &itemString); - - /** * Requests a text string from the user. */ void textRequest(const std::string &defaultText = ""); @@ -138,10 +127,9 @@ class NpcDialog : public Window, public gcn::ActionListener, static bool isAnyInputFocused(); /** - * Requests a interger from the user. + * Requests an integer from the user. */ - void integerRequest(int defaultValue = 0, int min = 0, - int max = 2147483647); + void integerRequest(int defaultValue, int min, int max); void move(int amount); @@ -154,12 +142,9 @@ class NpcDialog : public Window, public gcn::ActionListener, void setVisible(bool visible); - void optionChanged(const std::string &name); + void event(Event::Channel channel, const Event &event); - /** - * Returns true if any instances exist. - */ - static bool isActive() { return instances.size() > 0; } + void mouseClicked(gcn::MouseEvent &mouseEvent); /** * Returns the first active instance. Useful for pushing user @@ -172,6 +157,8 @@ class NpcDialog : public Window, public gcn::ActionListener, */ static void closeAll(); + static void setup(); + private: typedef std::list<NpcDialog*> DialogList; static DialogList instances; |