From 5d8c5a8912ab91b313fd33c2b4b91d1dc14ea779 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sun, 10 Jun 2007 09:31:00 +0000 Subject: Added information to the abilities screen during tutorials, akin to my previous commit for skills. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1568 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/abl-show.cc | 2 +- crawl-ref/source/menu.cc | 50 ++++++++++++++++++++++++++++++++++++++++++++ crawl-ref/source/menu.h | 2 ++ 3 files changed, 53 insertions(+), 1 deletion(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index d8f50a7997..6541b39445 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -1709,7 +1709,7 @@ int choose_ability_menu(const std::vector& talents) } } - std::vector sel = abil_menu.show(); + std::vector sel = abil_menu.show_ab(); redraw_screen(); if ( sel.empty() ) { diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc index d1b2d7ad6c..8c0ae7645b 100644 --- a/crawl-ref/source/menu.cc +++ b/crawl-ref/source/menu.cc @@ -114,6 +114,56 @@ std::vector Menu::show(bool reuse_selections) return (sel); } +std::vector Menu::show_ab(bool reuse_selections) +{ + cursor_control cs(false); + + if (reuse_selections) + get_selected(&sel); + else + deselect_all(false); + + // Lose lines for the title + room for -more- line. + pagesize = get_number_of_lines() - !!title - 1; + if (max_pagesize > 0 && pagesize > max_pagesize) + pagesize = max_pagesize; + + do_menu_ab(); + + return (sel); +} + +void Menu::do_menu_ab() +{ + draw_menu(); + if (Options.tutorial_left) + { + const int bottom_line = (get_number_of_lines() > 30) ? 30 : get_number_of_lines(); + textcolor(MAGENTA); + gotoxy(1, bottom_line-5); + std::string text = + "This screen shows your character's set of talents. You can gain new " EOL + "abilities via certain items, through religion or by way of mutations. " EOL + "Activation of an ability usually comes at a cost, e.g. nutrition or " EOL + "Magic power. "; + if (you.religion == GOD_TROG) text += + "Renounce Religion will make your character leave your god" EOL + "(and usually anger said god), while Berserk temporarily increases your" EOL + "damage output in melee fights."; + + formatted_string::parse_block(text, false).display(); + } + + alive = true; + while (alive) + { + int keyin = getchm(c_getch); + + if (!process_key( keyin )) + return; + } +} + void Menu::do_menu() { draw_menu(); diff --git a/crawl-ref/source/menu.h b/crawl-ref/source/menu.h index ceaf517fe4..ceb0d66066 100644 --- a/crawl-ref/source/menu.h +++ b/crawl-ref/source/menu.h @@ -185,6 +185,7 @@ public: void reset(); std::vector show(bool reuse_selections = false); + std::vector show_ab(bool reuse_selections = false); std::vector selected_entries() const; size_t item_count() const { return items.size(); } @@ -222,6 +223,7 @@ protected: protected: void do_menu(); + void do_menu_ab(); virtual void draw_select_count(int count, bool force = false); virtual void draw_item( int index ) const; virtual void draw_index_item(int index, const MenuEntry *me) const; -- cgit v1.2.3-54-g00ecf