aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/screen.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-03-28 22:31:18 -0400
committerPaul Gilbert2015-03-28 22:31:18 -0400
commit7fec58a57d9c45f7b899f67042af57b54ca80252 (patch)
tree16eca932733be1edb5b040af5f6ad5a8544811bf /engines/sherlock/screen.cpp
parentc28416f38ef77eef0858756d0b3265c44ad90216 (diff)
downloadscummvm-rg350-7fec58a57d9c45f7b899f67042af57b54ca80252.tar.gz
scummvm-rg350-7fec58a57d9c45f7b899f67042af57b54ca80252.tar.bz2
scummvm-rg350-7fec58a57d9c45f7b899f67042af57b54ca80252.zip
SHERLOCK: Beginnings of inventory display
Diffstat (limited to 'engines/sherlock/screen.cpp')
-rw-r--r--engines/sherlock/screen.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp
index f1562e2468..16d590c0f4 100644
--- a/engines/sherlock/screen.cpp
+++ b/engines/sherlock/screen.cpp
@@ -409,4 +409,22 @@ void Screen::vgaBar(const Common::Rect &r, int color) {
slamRect(r);
}
+/**
+ * Draws a button for use in the inventory, talk, and examine dialogs.
+ */
+void Screen::makeButton(const Common::Rect &bounds, int textX,
+ const Common::String &str) {
+
+ Surface &bb = *_backBuffer;
+ bb.fillRect(Common::Rect(bounds.left, bounds.top, bounds.right, bounds.top + 1), BUTTON_TOP);
+ bb.fillRect(Common::Rect(bounds.left, bounds.top, bounds.left + 1, bounds.bottom), BUTTON_TOP);
+ bb.fillRect(Common::Rect(bounds.right - 1, bounds.top, bounds.right, bounds.bottom), BUTTON_BOTTOM);
+ bb.fillRect(Common::Rect(bounds.left + 1, bounds.bottom - 1, bounds.right, bounds.bottom), BUTTON_BOTTOM);
+ bb.fillRect(Common::Rect(bounds.left + 1, bounds.top + 1, bounds.right - 1, bounds.bottom - 1), BUTTON_MIDDLE);
+
+ gPrint(Common::Point(textX, bounds.top), COMMAND_HIGHLIGHTED, "%c", str[0]);
+ gPrint(Common::Point(textX + charWidth(str[0]), bounds.top),
+ COMMAND_FOREGROUND, "%s", str.c_str() + 1);
+}
+
} // End of namespace Sherlock