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 ++++++++++++- crawl-ref/source/spl-cast.h | 3 +-- crawl-ref/source/tilereg.cc | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) (limited to 'crawl-ref') 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); } } diff --git a/crawl-ref/source/spl-cast.h b/crawl-ref/source/spl-cast.h index 9f5c658d86..83f56e8fc0 100644 --- a/crawl-ref/source/spl-cast.h +++ b/crawl-ref/source/spl-cast.h @@ -49,8 +49,7 @@ enum spret_type typedef bool (*spell_selector)(spell_type spell, bool &grey); int list_spells(bool toggle_with_I = true, bool viewing = false, - int minRange = -1, spell_selector selector = NULL, - bool text_only = true); + int minRange = -1, spell_selector selector = NULL); int spell_fail( spell_type spell ); int calc_spell_power(spell_type spell, bool apply_intel, bool fail_rate_chk = false, bool cap_power = true); diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index b941b51e85..1ff7b38339 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -1377,7 +1377,7 @@ static bool _cast_spell_on_target(actor* target) ASSERT(_spell_target == NULL); _spell_target = target; - const int letter = list_spells(true, false, -1, _spell_selector, false); + const int letter = list_spells(true, false, -1, _spell_selector); _spell_target = NULL; -- cgit v1.2.3-54-g00ecf