summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/menu.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-05 01:33:53 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-05 01:33:53 +0000
commit62f7040f14b39e67042be98f951575fbc819e84e (patch)
treed4fa0598a1bee1d34fff81e2c150de08c2256753 /crawl-ref/source/menu.cc
parent19155f1f85058ef9d65d11e60c63cc69c36d4e8a (diff)
downloadcrawl-ref-62f7040f14b39e67042be98f951575fbc819e84e.tar.gz
crawl-ref-62f7040f14b39e67042be98f951575fbc819e84e.zip
Tiles!
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3194 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/menu.cc')
-rw-r--r--crawl-ref/source/menu.cc32
1 files changed, 30 insertions, 2 deletions
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index a486b9cea9..48aa0100bc 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -12,6 +12,7 @@
#include "macro.h"
#include "message.h"
#include "player.h"
+#include "tiles.h"
#include "tutorial.h"
#include "view.h"
#include "initfile.h"
@@ -128,8 +129,11 @@ void Menu::do_menu()
alive = true;
while (alive)
{
+#ifdef USE_TILE
+ TileRedrawInv(REGION_INV2);
+#endif
int keyin = getchm(c_getch);
-
+
if (!process_key( keyin ))
return;
}
@@ -522,6 +526,20 @@ void Menu::select_index( int index, int qty )
}
}
+int Menu::get_entry_index( const MenuEntry *e ) const
+{
+ int index = 0;
+ for (unsigned int i = first_entry; i < items.size(); i++)
+ {
+ if (items[i] == e)
+ return index;
+ if (items[i]->quantity != 0)
+ index++;
+ }
+
+ return -1;
+}
+
void Menu::draw_menu()
{
clrscr();
@@ -542,6 +560,10 @@ void Menu::draw_menu()
gotoxy( 1, y_offset + pagesize - count_linebreaks(more) );
more.display();
}
+
+#ifdef USE_TILE
+ TileRedrawInv(REGION_INV2);
+#endif
}
void Menu::update_title()
@@ -871,7 +893,7 @@ int slider_menu::item_colour(int index, const MenuEntry *me) const
int colour = Menu::item_colour(index, me);
if (index == selected && selected != -1)
{
-#if defined(WIN32CONSOLE) || defined(DOS)
+#if defined(WIN32CONSOLE) || defined(DOS) || defined (USE_TILE)
colour = dos_brand(colour, CHATTR_REVERSE);
#else
colour |= COLFLAG_REVERSE;
@@ -1475,9 +1497,15 @@ bool formatted_scroller::process_key( int keyin )
case CK_ESCAPE:
return false;
case ' ': case '+': case '=': case CK_PGDN: case '>': case '\'':
+#ifdef USE_TILE
+ case CK_MOUSE_B5:
+#endif
repaint = page_down();
break;
case '-': case CK_PGUP: case '<': case ';':
+#ifdef USE_TILE
+ case CK_MOUSE_B4:
+#endif
repaint = page_up();
break;
case CK_UP: