Skip to content

Commit

Permalink
WAGE: Firther work on input improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Feb 14, 2016
1 parent c0be640 commit 47e3fec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions engines/wage/gui.cpp
Expand Up @@ -578,9 +578,10 @@ void Gui::drawInput() {
_bordersDirty = true;
}

_out.pop_back();
_lines.pop_back();
appendText(_engine->_inputText.c_str());
_inputTextLineNum = _lines.size() - 1;
_inputTextLineNum = _out.size() - 1;

const Graphics::Font *font = getConsoleFont();

Expand All @@ -590,7 +591,7 @@ void Gui::drawInput() {
int x = kConWPadding + _consoleTextArea.left;
int y = _cursorY + _consoleTextArea.top;

Common::Rect r(x, y, x + _consoleTextArea.width(), y + font->getFontHeight());
Common::Rect r(x, y, x + _consoleTextArea.width() - kConWPadding, y + font->getFontHeight());
_screen.fillRect(r, kColorWhite);

// undraw cursor
Expand All @@ -599,12 +600,12 @@ void Gui::drawInput() {
cursorTimerHandler(this);
_cursorOff = false;

font->drawString(&_screen, _lines[_inputTextLineNum], x, y, _screen.w, kColorBlack);
font->drawString(&_screen, _out[_inputTextLineNum], x, y, _screen.w, kColorBlack);

g_system->copyRectToScreen(_screen.getBasePtr(x, y), _screen.pitch, x, y, _consoleTextArea.width(), font->getFontHeight());
}

_cursorX = font->getStringWidth(_lines[_inputTextLineNum]) + kConHPadding;
_cursorX = font->getStringWidth(_out[_inputTextLineNum]) + kConHPadding;
}

void Gui::loadFonts() {
Expand Down
1 change: 0 additions & 1 deletion engines/wage/wage.cpp
Expand Up @@ -172,7 +172,6 @@ void WageEngine::processEvents() {

processTurn(&_inputText, NULL);
_inputText = "";
_gui->drawInput();
break;

default:
Expand Down

0 comments on commit 47e3fec

Please sign in to comment.