summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg.h
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-16 00:09:45 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-10-16 00:09:45 +0000
commit42f25ae23ee34f9ae3a0e31fc0039258deab2bc3 (patch)
treecb46297c71d456fe35854a23918518b900207089 /crawl-ref/source/tilereg.h
parent84789445f8c4937c2930a0d67e602408c2605201 (diff)
downloadcrawl-ref-42f25ae23ee34f9ae3a0e31fc0039258deab2bc3.tar.gz
crawl-ref-42f25ae23ee34f9ae3a0e31fc0039258deab2bc3.zip
Support for inline graphics and mouse input on menus.
Menus in the console version should be unchanged. Let me know if this is not the case. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7258 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilereg.h')
-rw-r--r--crawl-ref/source/tilereg.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/crawl-ref/source/tilereg.h b/crawl-ref/source/tilereg.h
index b46a033945..4111e6152a 100644
--- a/crawl-ref/source/tilereg.h
+++ b/crawl-ref/source/tilereg.h
@@ -9,9 +9,13 @@
#ifndef TILEREG_H
#define TILEREG_H
+#include "AppHdr.h"
+#include "format.h"
+#include "tilebuf.h"
#include "tiletex.h"
#include "tiles.h"
#include <vector>
+
class mcache_entry;
class ImageManager
@@ -174,6 +178,52 @@ public:
virtual int handle_mouse(MouseEvent &event);
};
+class MenuEntry;
+
+class MenuRegion : public Region
+{
+public:
+ MenuRegion(ImageManager *im, FTFont *entry);
+
+ virtual int handle_mouse(MouseEvent &event);
+ virtual void render();
+ virtual void clear();
+
+ int maxpagesize() const;
+ void set_entry(int index, const std::string &s, int colour, const MenuEntry *me);
+ void set_offset(int lines);
+ void set_more(const formatted_string &more);
+protected:
+ virtual void on_resize();
+ virtual void place_entries();
+ int mouse_entry(int x, int y);
+
+ struct MenuRegionEntry
+ {
+ formatted_string text;
+ int tile;
+ TextureID texture;
+ int sx, ex, sy, ey;
+ bool selected;
+ bool heading;
+ char key;
+ bool valid;
+ };
+
+ ImageManager *m_image;
+ FTFont *m_font_entry;
+ formatted_string m_more;
+ int m_mouse_idx;
+ bool m_dirty;
+
+ std::vector<MenuRegionEntry> m_entries;
+
+ ShapeBuffer m_shape_buf;
+ LineBuffer m_line_buf;
+ FontBuffer m_font_buf;
+ TileBuffer m_tile_buf;
+};
+
class TileRegion : public Region
{
public: