aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/agi/text.cpp')
-rw-r--r--engines/agi/text.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp
index 8806aeee28..c6c0f93651 100644
--- a/engines/agi/text.cpp
+++ b/engines/agi/text.cpp
@@ -64,6 +64,8 @@ TextMgr::TextMgr(AgiEngine *vm, Words *words, GfxMgr *gfx) {
promptDisable();
promptReset();
+ _inputStringRow = 0;
+ _inputStringColumn = 0;
_inputStringMaxLen = 0;
_inputStringCursorPos = 0;
_inputString[0] = 0;
@@ -107,16 +109,21 @@ void TextMgr::charPos_Set(int16 row, int16 column) {
_textPos.column = column;
}
-void TextMgr::charPos_Get(TextPos_Struct *posPtr) {
- posPtr->row = _textPos.row;
- posPtr->column = _textPos.column;
-}
-
void TextMgr::charPos_Set(TextPos_Struct *posPtr) {
_textPos.row = posPtr->row;
_textPos.column = posPtr->column;
}
+void TextMgr::charPos_Get(int16 &row, int16 &column) {
+ row = _textPos.row;
+ column = _textPos.column;
+}
+
+void TextMgr::charPos_Get(TextPos_Struct *posPtr) {
+ posPtr->row = _textPos.row;
+ posPtr->column = _textPos.column;
+}
+
void TextMgr::charPos_Push() {
if (_textPosArrayCount < TEXTPOSARRAY_MAX) {
charPos_Get(&_textPosArray[_textPosArrayCount]);
@@ -735,9 +742,21 @@ void TextMgr::stringSet(const char *text) {
_inputString[sizeof(_inputString) - 1] = 0; // terminator
}
+void TextMgr::stringPos_Get(int16 &row, int16 &column) {
+ row = _inputStringRow;
+ column = _inputStringColumn;
+}
+int16 TextMgr::stringGetMaxLen() {
+ return _inputStringMaxLen;
+}
+
void TextMgr::stringEdit(int16 stringMaxLen) {
int16 inputStringLen = strlen((const char *)_inputString);
+ // Remember current position for predictive dialog
+ _inputStringRow = _textPos.row;
+ _inputStringColumn = _textPos.column;
+
// Caller can set the input string
_inputStringCursorPos = 0;
while (_inputStringCursorPos < inputStringLen) {