summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg-stat.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-stat.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-stat.cc')
-rw-r--r--crawl-ref/source/tilereg-stat.cc34
1 files changed, 33 insertions, 1 deletions
diff --git a/crawl-ref/source/tilereg-stat.cc b/crawl-ref/source/tilereg-stat.cc
index 3dd5bf2c10..a468f4d5c0 100644
--- a/crawl-ref/source/tilereg-stat.cc
+++ b/crawl-ref/source/tilereg-stat.cc
@@ -22,8 +22,13 @@ int StatRegion::handle_mouse(MouseEvent &event)
if (event.event != MouseEvent::PRESS || event.button != MouseEvent::LEFT)
return 0;
+#ifdef TOUCH_UI
+ // clicking on stats should show all the stats
+ return command_to_key(CMD_RESISTS_SCREEN);
+#else
// Resting
return command_to_key(CMD_REST);
+#endif
}
bool StatRegion::update_tip_text(string& tip)
@@ -31,8 +36,35 @@ bool StatRegion::update_tip_text(string& tip)
if (mouse_control::current_mode() != MOUSE_MODE_COMMAND)
return false;
- tip = "[L-Click] Rest / Search for a while";
+ if (tiles.is_using_small_layout())
+ tip = "[L-Click] Show player information";
+ else
+ tip = "[L-Click] Rest / Search for a while";
return true;
}
+void StatRegion::_clear_buffers()
+{
+ m_shape_buf.clear();
+}
+
+void StatRegion::render()
+{
+ if (tiles.is_using_small_layout())
+ {
+ _clear_buffers();
+ // black-out part of screen that stats are written on to
+ // - double up area to cover behind where tabs are drawn
+ m_shape_buf.add(sx,sy,ex+(ex-sx),ey,VColour(0,0,0,255));
+ m_shape_buf.draw();
+ }
+ TextRegion::render();
+}
+
+void StatRegion::clear()
+{
+ _clear_buffers();
+ TextRegion::clear();
+}
+
#endif