From cb2b1d5ca1e28a1192e86a89b37006d72cc6b078 Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 12 Feb 2014 21:39:29 +0100 Subject: AVALANCHE: Rename/implement rest of getMe(). --- engines/avalanche/help.cpp | 41 ++++++++++++++++++++++++++++++++++++++--- engines/avalanche/help.h | 2 +- 2 files changed, 39 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/avalanche/help.cpp b/engines/avalanche/help.cpp index c75be19cea..12ea31ebde 100644 --- a/engines/avalanche/help.cpp +++ b/engines/avalanche/help.cpp @@ -38,7 +38,11 @@ Help::Help(AvalancheEngine *vm) { _highlightWas = 0; } -void Help::getMe(byte which) { +/** + * Loads and draws the chosen page of the help. + * @remarks Originally called 'getme' + */ +void Help::switchPage(byte which) { // Help icons are 80x20. _highlightWas = 177; // Forget where the highlight was. @@ -83,7 +87,38 @@ void Help::getMe(byte which) { y++; } while (true); - warning("STUB: Help::getMe()"); + // We are now at the end of the text. Next we must read the icons: + y = 0; + while (!file.eos()) { + _buttons[y]._trigger = file.readByte(); + if (_buttons[y]._trigger == 177) + break; + byte index = file.readByte(); + if (_buttons[y]._trigger != 0) + _vm->_graphics->helpDrawButton(13 + (y + 1) * 27, index); + _buttons[y]._whither = file.readByte(); // This is the position to jump to. + + Common::String text = ""; + switch (_buttons[y]._trigger) { + case 254: + text = Common::String("Esc"); + break; + case 'Ö': + text = Common::String(24); + break; + case 'Ø': + text = Common::String(25); + break; + default: + text = Common::String(_buttons[y]._trigger); + break; + } + + _vm->_graphics->drawBigText(text, _vm->_font, 8, 589 - (text.size() * 8), 18 + (y + 1) * 27, kColorBlack); + _vm->_graphics->drawBigText(text, _vm->_font, 8, 590 - (text.size() * 8), 17 + (y + 1) * 27, kColorCyan); + + y++; + } _vm->_graphics->refreshScreen(); @@ -120,7 +155,7 @@ void Help::run() { _vm->_graphics->loadMouse(kCurHelp); - getMe(0); + switchPage(0); continueHelp(); diff --git a/engines/avalanche/help.h b/engines/avalanche/help.h index f2d02f3e32..626709b6c3 100644 --- a/engines/avalanche/help.h +++ b/engines/avalanche/help.h @@ -49,7 +49,7 @@ private: Button _buttons[10]; byte _highlightWas; - void getMe(byte which); + void switchPage(byte which); Common::String getLine(Common::File &file); // It was a nested function in getMe(). byte checkMouse(); // Returns clicked-on button, or 0 if none. void continueHelp(); -- cgit v1.2.3