summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-06 19:19:35 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-06-06 19:19:35 +0000
commitc7116e761c1805b3991509f50f87b89eaad3a857 (patch)
tree06aec90cff3983dff786681477bd62e44eec6ba3 /crawl-ref/source/tilereg.cc
parentd73eb4aaefb38e2aac5a8b20ed5da7619526c034 (diff)
downloadcrawl-ref-c7116e761c1805b3991509f50f87b89eaad3a857.tar.gz
crawl-ref-c7116e761c1805b3991509f50f87b89eaad3a857.zip
Apply r9904 to trunk.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9905 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r--crawl-ref/source/tilereg.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 3bb15874ae..0188f20de0 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -2625,8 +2625,8 @@ void MenuRegion::place_entries()
const int heading_indent = 10;
const int tile_indent = 20;
const int text_indent = (Options.tile_menu_icons ? 58 : 20);
- const int max_tile_height = 32;
- const int entry_buffer = 1;
+ const int max_tile_height = (Options.tile_menu_icons ? 32 : 0);
+ const int entry_buffer = 1;
const VColour selected_colour(50, 50, 10, 255);
m_font_buf.clear();
@@ -2668,7 +2668,7 @@ void MenuRegion::place_entries()
column++;
}
- int text_width = m_font_entry->string_width(m_entries[i].text);
+ int text_width = m_font_entry->string_width(m_entries[i].text);
int text_height = m_font_entry->char_height();
if (m_entries[i].heading)
@@ -2714,7 +2714,8 @@ void MenuRegion::place_entries()
int text_sy = m_entries[i].sy;
text_sy += (entry_height - m_font_entry->char_height()) / 2;
- if (text_sx + text_width > entry_start + column_width)
+ if (Options.tile_menu_icons
+ && text_sx + text_width > entry_start + column_width)
{
// [enne] - Ugh, hack. Maybe MenuEntry could specify the
// presence and length of this substring?
@@ -2841,10 +2842,14 @@ int MenuRegion::maxpagesize() const
// It would be better to make menus use a dynamic number of items per page,
// but it'd require a lot more refactoring of menu.cc to handle that.
- int lines = count_linebreaks(m_more);
- int more_height = (lines + 1) * m_font_entry->char_height();
+ const int lines = count_linebreaks(m_more);
+ const int more_height = (lines + 1) * m_font_entry->char_height();
+
+ // Similar to the definition of max_entry_height in place_entries().
+ const int div = (Options.tile_menu_icons ? 32
+ : m_font_entry->char_height());
- int pagesize = ((my - more_height) / 32) * m_max_columns;
+ const int pagesize = ((my - more_height) / div) * m_max_columns;
// Upper limit for inventory menus. (jpeg)
// Non-inventory menus only have one column and need