From 91774a0aebb0b37010627e448a1ac18169cec07f Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 2 Apr 2015 19:19:36 -0400 Subject: [PATCH] SHERLOCK: Implemented Journal::doButtons --- engines/sherlock/journal.cpp | 24 ++++++++++++++++++++++-- engines/sherlock/journal.h | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp index 94c6cf69e73..b45d7727168 100644 --- a/engines/sherlock/journal.cpp +++ b/engines/sherlock/journal.cpp @@ -51,7 +51,7 @@ Journal::Journal(SherlockEngine *vm): _vm(vm) { _maxPage = 0; _index = 0; _sub = 0; - _up = _down = 0; + _up = _down = false; _page = 0; _converseNum = -1; @@ -504,8 +504,28 @@ void Journal::drawInterface() { screen.slamArea(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT); } +/** + * Display the arrows that can be used to scroll up and down pages + */ void Journal::doArrows() { - // TODO + Screen &screen = *_vm->_screen; + byte color; + + color = (_page > 1) ? COMMAND_FOREGROUND : COMMAND_NULL; + screen.buttonPrint(Common::Point(JOURNAL_POINTS[1][2], JOURNAL_BUTTONS_Y), color, false, "Back 10"); + screen.buttonPrint(Common::Point(JOURNAL_POINTS[2][2], JOURNAL_BUTTONS_Y), color, false, "Up"); + + color = _down ? COMMAND_FOREGROUND : COMMAND_NULL; + screen.buttonPrint(Common::Point(JOURNAL_POINTS[3][2], JOURNAL_BUTTONS_Y), color, false, "Down"); + screen.buttonPrint(Common::Point(JOURNAL_POINTS[4][2], JOURNAL_BUTTONS_Y), color, false, "Ahead 10"); + screen.buttonPrint(Common::Point(JOURNAL_POINTS[7][2], JOURNAL_BUTTONS_Y + 11), color, false, "Last Page"); + + color = _journal.size() > 0 ? COMMAND_FOREGROUND : COMMAND_NULL; + screen.buttonPrint(Common::Point(JOURNAL_POINTS[5][2], JOURNAL_BUTTONS_Y + 11), color, false, "Search"); + screen.buttonPrint(Common::Point(JOURNAL_POINTS[8][2], JOURNAL_BUTTONS_Y + 11), color, false, "Print Text"); + + color = _page > 1 ? COMMAND_FOREGROUND : COMMAND_NULL; + screen.buttonPrint(Common::Point(JOURNAL_POINTS[6][2], JOURNAL_BUTTONS_Y + 11), color, false, "First Page"); } void Journal::doJournal(int direction, int howFar) { diff --git a/engines/sherlock/journal.h b/engines/sherlock/journal.h index 34d99af0ec1..8ad19dc0e59 100644 --- a/engines/sherlock/journal.h +++ b/engines/sherlock/journal.h @@ -53,7 +53,7 @@ private: int _maxPage; int _index; int _sub; - int _up, _down; + bool _up, _down; int _page; int _converseNum;