aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBorja Lorente2016-07-25 16:43:20 +0200
committerBorja Lorente2016-08-14 18:59:10 +0200
commita7f2cea37d7ec5101d4b2235168e2b660993258a (patch)
treec2a96b17089b86a0b240a0eb275b659571451cfe /engines
parentfb180a8cdbf7e75c28502a8f3531d78cc5224535 (diff)
downloadscummvm-rg350-a7f2cea37d7ec5101d4b2235168e2b660993258a.tar.gz
scummvm-rg350-a7f2cea37d7ec5101d4b2235168e2b660993258a.tar.bz2
scummvm-rg350-a7f2cea37d7ec5101d4b2235168e2b660993258a.zip
MACVENTURE: Add scroll to console window
Diffstat (limited to 'engines')
-rw-r--r--engines/macventure/gui.cpp6
-rw-r--r--engines/macventure/gui.h14
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;
};