From 5324e928729d678c71ef055eea9623d16b73cb2e Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Sat, 12 Sep 2009 19:25:13 +0000 Subject: Adapt Matthew's new memorisation interface for tiles, using the same display as for spellcasting. Also force a redraw() if the player clicked on a spell. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10661 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/tilesdl.cc | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/tilesdl.cc') diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index b7f64cd171..5a71cb750a 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -1437,6 +1437,29 @@ void TilesFramework::update_spells() { std::vector inv; + if (Options.tile_display == TDSP_MEMORISE) + { + std::vector spells = get_mem_spell_list(); + for (unsigned int i = 0; i < spells.size(); ++i) + { + const spell_type spell = spells[i]; + + InventoryTile desc; + desc.tile = tileidx_spell(spell); + desc.idx = (int) spell; + desc.quantity = spell_difficulty(spell); + + if (spell_difficulty(spell) > you.experience_level + || player_spell_levels() < spell_levels_required(spell)) + { + desc.flag |= TILEI_FLAG_MELDED; + } + inv.push_back(desc); + } + m_region_inv->update(inv.size(), &inv[0]); + return; + } + for (int i = 0; i < 52; ++i) { const char letter = index_to_letter(i); @@ -1490,7 +1513,7 @@ void TilesFramework::update_inventory() if (!Options.tile_show_items || crawl_state.arena) return; - if (Options.tile_display_spells) + if (Options.tile_display != TDSP_INVENT) { update_spells(); return; -- cgit v1.2.3-54-g00ecf