summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg-spl.cc
diff options
context:
space:
mode:
authorChris West <therealchriswest@hotmail.com>2012-12-29 16:17:48 +0000
committerChris West <therealchriswest@hotmail.com>2013-01-05 16:25:23 +0000
commit10e7a704c28f35be409b468c5881b81ed1c452a8 (patch)
tree0bba7a6daaee7fe3a23ed741bdc8e575c5e34962 /crawl-ref/source/tilereg-spl.cc
parentd11e3248a35dcfb6ad16f5dc28db7a0b8ad0c8d5 (diff)
downloadcrawl-ref-10e7a704c28f35be409b468c5881b81ed1c452a8.tar.gz
crawl-ref-10e7a704c28f35be409b468c5881b81ed1c452a8.zip
merge of small-screen changes from old build env
Diffstat (limited to 'crawl-ref/source/tilereg-spl.cc')
-rw-r--r--crawl-ref/source/tilereg-spl.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/tilereg-spl.cc b/crawl-ref/source/tilereg-spl.cc
index 5e770109f9..1637bab31c 100644
--- a/crawl-ref/source/tilereg-spl.cc
+++ b/crawl-ref/source/tilereg-spl.cc
@@ -59,6 +59,10 @@ int SpellRegion::handle_mouse(MouseEvent &event)
const spell_type spell = (spell_type) m_items[item_idx].idx;
if (event.button == MouseEvent::LEFT)
{
+ // close tab again if using small layout
+ if (tiles.is_using_small_layout())
+ tiles.deactivate_tab();
+
m_last_clicked_item = item_idx;
tiles.set_need_redraw();
if (!cast_a_spell(false, spell))
@@ -149,6 +153,9 @@ int SpellRegion::get_max_slots()
void SpellRegion::pack_buffers()
{
+ if (m_items.size()==0)
+ return;
+
const int max_spells = get_max_slots();
// Pack base separately, as it comes from a different texture...