summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/menu.cc
diff options
context:
space:
mode:
authorFlorian Diebold <flodiebold@gmail.com>2013-04-28 13:11:07 +0200
committerFlorian Diebold <flodiebold@gmail.com>2013-04-28 13:11:07 +0200
commit43fc226534901047a62d236473b43b034438ac1b (patch)
treee3ee59eabf9b8c96c92409ebbc17e8e8dd0b9e2c /crawl-ref/source/menu.cc
parent8e1f0a710952af69f09dea14dd529ee7f1929380 (diff)
downloadcrawl-ref-43fc226534901047a62d236473b43b034438ac1b.tar.gz
crawl-ref-43fc226534901047a62d236473b43b034438ac1b.zip
Simplify and rename a function.
Diffstat (limited to 'crawl-ref/source/menu.cc')
-rw-r--r--crawl-ref/source/menu.cc13
1 files changed, 4 insertions, 9 deletions
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index 21b58fb5a1..0e22a0d3f4 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -1604,7 +1604,7 @@ void Menu::webtiles_write_item(int index, const MenuEntry* me) const
tiles.json_close_object();
}
-void Menu::webtiles_new_first_entry()
+void Menu::webtiles_update_section_boundaries()
{
if (first_entry < webtiles_section_start()
|| webtiles_section_end() <= first_entry)
@@ -1879,7 +1879,7 @@ bool formatted_scroller::jump_to(int i)
first_entry = i - 1;
#ifdef USE_TILE_WEB
- webtiles_new_first_entry();
+ webtiles_update_section_boundaries();
webtiles_write_menu(true);
#endif
@@ -1965,13 +1965,8 @@ vector<MenuEntry *> formatted_scroller::show(bool reuse_selections)
{
#ifdef USE_TILE_WEB
_webtiles_section_start = 0;
- _webtiles_section_end = 1;
- while (_webtiles_section_end < (int) items.size()
- && items[_webtiles_section_end]->level != MEL_TITLE)
- {
- _webtiles_section_end++;
- }
- webtiles_new_first_entry();
+ _webtiles_section_end = 0;
+ webtiles_update_section_boundaries();
#endif
return Menu::show(reuse_selections);
}