diff options
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/command.cc | 19 | ||||
-rw-r--r-- | crawl-ref/source/spl-book.cc | 14 |
2 files changed, 29 insertions, 4 deletions
diff --git a/crawl-ref/source/command.cc b/crawl-ref/source/command.cc index 46f54fbefb..eb6b429e5e 100644 --- a/crawl-ref/source/command.cc +++ b/crawl-ref/source/command.cc @@ -1520,6 +1520,7 @@ static bool _find_description(bool &again, std::string& error_inout) bool doing_gods = false; bool doing_branches = false; bool doing_features = false; + bool doing_spells = false; switch (ch) { @@ -1532,8 +1533,9 @@ static bool _find_description(bool &again, std::string& error_inout) doing_mons = true; break; case 'S': - type = "spell"; - filter = _spell_filter; + type = "spell"; + filter = _spell_filter; + doing_spells = true; break; case 'K': type = "skill"; @@ -1702,7 +1704,7 @@ static bool _find_description(bool &again, std::string& error_inout) // For tiles builds use a tiles menu to display monsters. const bool text_only = #ifdef USE_TILE - !(doing_mons || doing_features); + !(doing_mons || doing_features || doing_spells); #else true; #endif @@ -1765,6 +1767,17 @@ static bool _find_description(bool &again, std::string& error_inout) me = new MenuEntry(uppercase_first(key_list[i]), MEL_ITEM, 1, letter); +#ifdef USE_TILE + if (doing_spells) + { + spell_type spell = spell_by_name(str); + if (spell != SPELL_NO_SPELL) + me->add_tile(tile_def(tileidx_spell(spell), TEX_GUI)); + } +#else + UNUSED(doing_spells); +#endif + me->data = (void*) &key_list[i]; } diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index bed2cf7b3c..c69bdce331 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -1529,8 +1529,15 @@ static spell_type _choose_mem_spell(spell_list &spells, { std::sort(spells.begin(), spells.end(), _sort_mem_spells); +#ifdef USE_TILE + const bool text_only = false; +#else + const bool text_only = true; +#endif + Menu spell_menu(MF_SINGLESELECT | MF_ANYPRINTABLE - | MF_ALWAYS_SHOW_MORE | MF_ALLOW_FORMATTING); + | MF_ALWAYS_SHOW_MORE | MF_ALLOW_FORMATTING, + "", text_only); #ifdef USE_TILE { // [enne] - Hack. Make title an item so that it's aligned. @@ -1609,6 +1616,11 @@ static spell_type _choose_mem_spell(spell_list &spells, MenuEntry* me = new MenuEntry(desc.str(), MEL_ITEM, 1, index_to_letter(i % 52)); + +#ifdef USE_TILE + me->add_tile(tile_def(tileidx_spell(spell), TEX_GUI)); +#endif + me->data = &spells[i]; spell_menu.add_entry(me); } |