summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilesdl.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-12 19:25:13 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-09-12 19:25:13 +0000
commit5324e928729d678c71ef055eea9623d16b73cb2e (patch)
tree4d11ac9ab7847185bdc3e209cc5f17f47be045fd /crawl-ref/source/tilesdl.cc
parent1eee7e398be993bd28d97073059736779822ec2a (diff)
downloadcrawl-ref-5324e928729d678c71ef055eea9623d16b73cb2e.tar.gz
crawl-ref-5324e928729d678c71ef055eea9623d16b73cb2e.zip
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
Diffstat (limited to 'crawl-ref/source/tilesdl.cc')
-rw-r--r--crawl-ref/source/tilesdl.cc25
1 files changed, 24 insertions, 1 deletions
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<InventoryTile> inv;
+ if (Options.tile_display == TDSP_MEMORISE)
+ {
+ std::vector<spell_type> 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;