diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-06 19:02:28 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-06 19:02:28 +0000 |
commit | 330032c4329842cdbfd5e0cde77a242f3fb11016 (patch) | |
tree | 081eed2f93e365a987b89209da64c20dbd8c0ff6 /crawl-ref/source/tilereg.cc | |
parent | a4e8c54ac5ddc996f16ff6f33ba1b486ada4f490 (diff) | |
download | crawl-ref-330032c4329842cdbfd5e0cde77a242f3fb11016.tar.gz crawl-ref-330032c4329842cdbfd5e0cde77a242f3fb11016.zip |
* Fix menus missing entries with Options.tile_menu_icons = false.
* Add new sort order option charged to list empty wands last.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@9904 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r-- | crawl-ref/source/tilereg.cc | 19 |
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 |