summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/menu.cc15
-rw-r--r--crawl-ref/source/menu.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index 846f5fc0fa..e489aa0d83 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -272,6 +272,21 @@ void Menu::add_entry( MenuEntry *entry )
items.push_back( entry );
}
+bool Menu::del_entry( MenuEntry *entry )
+{
+ for (unsigned int i = first_entry; i < items.size(); i++)
+ {
+ if (items[i] == entry)
+ {
+ items.erase(items.begin() + i);
+ last_selected = -1;
+ return (true);
+ }
+ }
+
+ return (false);
+}
+
void Menu::reset()
{
first_entry = 0;
diff --git a/crawl-ref/source/menu.h b/crawl-ref/source/menu.h
index fb822388ed..8760d7a0d9 100644
--- a/crawl-ref/source/menu.h
+++ b/crawl-ref/source/menu.h
@@ -316,6 +316,8 @@ public:
void set_highlighter( MenuHighlighter *h );
void set_title( MenuEntry *e, bool first = true );
void add_entry( MenuEntry *entry );
+ bool del_entry( MenuEntry *entry );
+ bool del_entry( int entry_index );
void get_selected( std::vector<MenuEntry*> *sel ) const;
void set_maxpagesize(int max);