From c9bb66d595927bd14871c10b216ed05ffb5e3b12 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 27 Jul 2012 02:32:32 +0300 Subject: Add support for images in npc menu. --- src/gui/npcdialog.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/gui/npcdialog.h') diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h index 75c55ae96..e3cc274c8 100644 --- a/src/gui/npcdialog.h +++ b/src/gui/npcdialog.h @@ -25,6 +25,7 @@ #include "configlistener.h" +#include "gui/widgets/extendedlistmodel.h" #include "gui/widgets/window.h" #include "utils/stringvector.h" @@ -38,7 +39,7 @@ class Being; class BrowserBox; class ItemLinkHandler; class IntTextField; -class ListBox; +class ExtendedListBox; class PlayerBox; class TextBox; class TextField; @@ -55,7 +56,7 @@ namespace gcn * \ingroup Interface */ class NpcDialog : public Window, public gcn::ActionListener, - public gcn::ListModel, public ConfigListener + public ExtendedListModel, public ConfigListener { public: /** @@ -118,6 +119,11 @@ class NpcDialog : public Window, public gcn::ActionListener, */ std::string getElementAt(int i); + /** + * Returns the image of item number i of the choices list. + */ + const Image *getImageAt(int i); + /** * Makes this dialog request a choice selection from the user. */ @@ -222,9 +228,10 @@ class NpcDialog : public Window, public gcn::ActionListener, std::string mNewText; // Used for choice input - ListBox *mItemList; + ExtendedListBox *mItemList; gcn::ScrollArea *mListScrollArea; StringVect mItems; + std::vector mImages; ItemLinkHandler *mItemLinkHandler; // Used for string and integer input -- cgit v1.2.3-60-g2f50