From b232c1bc260f956250c7f75f9b9fe4516410a97c Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Sat, 21 Nov 2009 21:50:55 -0800 Subject: tiles: spell_list() now shows spell tiles Also, spell_list() now always displays in tiles mode for tiles builds. --- crawl-ref/source/spl-cast.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/spl-cast.cc') diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index b2ed7ad242..1c970443ff 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -231,11 +231,17 @@ static bool _spell_no_hostile_in_range(spell_type spell, int minRange) } int list_spells(bool toggle_with_I, bool viewing, int minRange, - spell_selector selector, bool text_only) + spell_selector selector) { if (toggle_with_I && get_spell_by_letter('I') != SPELL_NO_SPELL) toggle_with_I = false; +#ifdef USE_TILE + const bool text_only = false; +#else + const bool text_only = true; +#endif + ToggleableMenu spell_menu(MF_SINGLESELECT | MF_ANYPRINTABLE | MF_ALWAYS_SHOW_MORE | MF_ALLOW_FORMATTING, text_only); @@ -310,6 +316,11 @@ int list_spells(bool toggle_with_I, bool viewing, int minRange, new ToggleableMenuEntry(_spell_base_description(spell, grey), _spell_extra_description(spell, grey), MEL_ITEM, 1, letter); + +#ifdef USE_TILE + me->add_tile(tile_def(tileidx_spell(spell), TEX_GUI)); +#endif + spell_menu.add_entry(me); } } -- cgit v1.2.3-54-g00ecf