summaryrefslogtreecommitdiff
path: root/src/gui/npcpostdialog.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-02-13 15:04:58 -0700
committerJared Adams <jaxad0127@gmail.com>2010-02-13 15:08:54 -0700
commit8bc425ff48b7a874ca0fb9d2285044c75f3010ab (patch)
tree5904c7f53cde9ffbe7df2a63f088561141e06b66 /src/gui/npcpostdialog.h
parent28c9cec5d39c9a1b98694eba9a28281cf111e34a (diff)
downloadmana-8bc425ff48b7a874ca0fb9d2285044c75f3010ab.tar.gz
mana-8bc425ff48b7a874ca0fb9d2285044c75f3010ab.tar.bz2
mana-8bc425ff48b7a874ca0fb9d2285044c75f3010ab.tar.xz
mana-8bc425ff48b7a874ca0fb9d2285044c75f3010ab.zip
Make NPC dialogs instance instead of global
This change allows players to talk to multiple NPCs at a time (if the server agrees). Manaserv's netcode allows multiple commerce instances too. eAthena's is limited to one commerce instance, due to protocol limitations.
Diffstat (limited to 'src/gui/npcpostdialog.h')
-rw-r--r--src/gui/npcpostdialog.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/gui/npcpostdialog.h b/src/gui/npcpostdialog.h
index 355d0ae1..9364eb0e 100644
--- a/src/gui/npcpostdialog.h
+++ b/src/gui/npcpostdialog.h
@@ -35,23 +35,35 @@ public:
/**
* Constructor
*/
- NpcPostDialog();
+ NpcPostDialog(int npcId);
+
+ ~NpcPostDialog();
/**
* Called when receiving actions from the widgets.
*/
void action(const gcn::ActionEvent &event);
+ void setVisible(bool visible);
+
+ /**
+ * Returns true if any instances exist.
+ */
+ static bool isActive() { return instances.size() > 0; }
+
/**
- * Clear the contents of the dialog
+ * Closes all instances.
*/
- void clear();
+ static void closeAll();
private:
+ typedef std::list<NpcPostDialog*> DialogList;
+ static DialogList instances;
+
+ int mNpcId;
+
TextBox *mText;
TextField *mSender;
};
-extern NpcPostDialog *npcPostDialog;
-
#endif