diff options
Diffstat (limited to 'engines/macventure')
-rw-r--r-- | engines/macventure/gui.cpp | 6 | ||||
-rw-r--r-- | engines/macventure/gui.h | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/engines/macventure/gui.cpp b/engines/macventure/gui.cpp index 13f0a9d692..6a30985b74 100644 --- a/engines/macventure/gui.cpp +++ b/engines/macventure/gui.cpp @@ -1270,6 +1270,12 @@ bool MacVenture::Gui::processOutConsoleEvents(WindowClick click, Common::Event & if (_engine->needsClickToContinue()) return true; + debug("OutConsoleEvent: %d", click); + if (click == kBorderScrollUp) { + _consoleText->scrollUp(); + return true; + } + return getWindowData(kOutConsoleWindow).visible; } diff --git a/engines/macventure/gui.h b/engines/macventure/gui.h index 90f2f42991..aea6733d2f 100644 --- a/engines/macventure/gui.h +++ b/engines/macventure/gui.h @@ -363,7 +363,6 @@ public: void renderInto(Graphics::ManagedSurface *target, uint leftOffset) { target->fillRect(target->getBounds(), kColorWhite); const Graphics::Font *font = &_gui->getCurrentFont(); - // HACK print the last lines visible (no scroll) uint y = target->h - font->getFontHeight(); for (uint i = _lines.size() - 1; i != 0; i--) { font->drawString(target, _lines[i], leftOffset, y, font->getStringWidth(_lines[i]), kColorBlack); @@ -372,14 +371,25 @@ public: } void updateScroll() { - // TODO implemebt + _scrollPos = _lines.size() - 1; } + void scrollDown() { + if (_scrollPos < _lines.size() - 1) _scrollPos++; + } + + void scrollUp() { + debug("scroll up"); + if (_scrollPos > 0) _scrollPos--; + } + + private: Gui *_gui; Common::StringArray _lines; + int _scrollPos; }; |