aboutsummaryrefslogtreecommitdiff
path: root/engines/macventure/dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/macventure/dialog.cpp')
-rw-r--r--engines/macventure/dialog.cpp34
1 files changed, 25 insertions, 9 deletions
diff --git a/engines/macventure/dialog.cpp b/engines/macventure/dialog.cpp
index 78fb942db1..3a09feffd5 100644
--- a/engines/macventure/dialog.cpp
+++ b/engines/macventure/dialog.cpp
@@ -41,13 +41,26 @@ struct PrebuiltDialog {
PrebuiltDialog prebuiltDialogs[kPrebuiltDialogCount] = {
{/* kSaveAsDialog */
- Common::Rect(0, 146, 456, 254),
- { {kDEButton, "YES", kDANone, Common::Point(24, 68), 120, 22},
- {kDEButton, "NO", kDACloseDialog, Common::Point(168, 68), 120, 22},
- {kDEButton, "CANCEL", kDACloseDialog, Common::Point(312, 68), 120, 22},
- {kDEPlainText, "Save As...", kDANone, Common::Point(100, 10), 340, 38},
- {kDETextInput, "", kDANone, Common::Point(100, 30), 340, 20},
- {kDEEnd, "", kDANone, Common::Point(0, 0), 0, 0}}
+ Common::Rect(0, 146, 456, 254),
+ {
+ {kDEButton, "YES", kDANone, Common::Point(24, 68), 120, 22},
+ {kDEButton, "NO", kDACloseDialog, Common::Point(168, 68), 120, 22},
+ {kDEButton, "CANCEL", kDACloseDialog, Common::Point(312, 68), 120, 22},
+ {kDEPlainText, "Save As...", kDANone, Common::Point(100, 10), 340, 38},
+ {kDETextInput, "", kDANone, Common::Point(100, 30), 340, 20},
+ {kDEEnd, "", kDANone, Common::Point(0, 0), 0, 0}
+ }
+ },
+
+ { /* kSpeakDialog */
+ Common::Rect(20, 92, 400, 200),
+ {
+ {kDEButton, "OK", kDASubmit, Common::Point(10, 70), 50, 20},
+ {kDEButton, "CANCEL", kDACloseDialog, Common::Point(96, 70), 50, 20},
+ {kDEPlainText, "What would you like to say?", kDANone, Common::Point(10, 10), 400, 20},
+ {kDETextInput, "", kDANone, Common::Point(10, 25), 350, 40},
+ {kDEEnd, "", kDANone, Common::Point(0, 0), 0, 0}
+ }
}
};
@@ -75,6 +88,10 @@ void Dialog::handleDialogAction(DialogElement *trigger, DialogAction action) {
case kDACloseDialog:
_gui->closeDialog();
break;
+ case kDASubmit:
+ _gui->setTextInput(_userInput);
+ _gui->closeDialog();
+ break;
}
}
@@ -122,7 +139,6 @@ void Dialog::localize(Common::Point &point) {
void Dialog::setUserInput(Common::String content) {
_userInput = content;
- debug(2, "Set user input: %s", _userInput.c_str());
}
void Dialog::addPrebuiltElement(const MacVenture::PrebuiltDialogElement &element) {
@@ -211,7 +227,7 @@ bool DialogPlainText::doProcessEvent(MacVenture::Dialog *dialog, Common::Event e
void DialogPlainText::doDraw(MacVenture::Dialog *dialog, Graphics::ManagedSurface &target) {
// Draw contents
dialog->getFont().drawString(
- &target, _text, _bounds.left, _bounds.top, _bounds.width(), kColorBlack);
+ &target, _text, _bounds.left, _bounds.top, _bounds.width(), kColorBlack, Graphics::kTextAlignCenter);
}