aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/scumm/dialogs.cpp15
-rw-r--r--engines/scumm/dialogs.h3
2 files changed, 13 insertions, 5 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 15c22c2bed..7541edd0b4 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -749,21 +749,28 @@ void HelpDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
InfoDialog::InfoDialog(ScummEngine *scumm, int res)
: ScummDialog("scummDummyDialog"), _vm(scumm) { // dummy x and w
- setInfoText(queryResString(res));
+
+ _message = queryResString(res);
+
+ // Width and height are dummy
+ _text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);
}
InfoDialog::InfoDialog(ScummEngine *scumm, const String& message)
: ScummDialog("scummDummyDialog"), _vm(scumm) { // dummy x and w
- setInfoText(message);
-}
-void InfoDialog::setInfoText(const String& message) {
_message = message;
// Width and height are dummy
_text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);
}
+void InfoDialog::setInfoText(const String& message) {
+ _message = message;
+ _text->setLabel(_message);
+ //reflowLayout(); // FIXME: Should we call this here? Depends on the usage patterns, I guess...
+}
+
void InfoDialog::reflowLayout() {
const int screenW = g_system->getOverlayWidth();
const int screenH = g_system->getOverlayHeight();
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index d3ee9dbc18..73c02ea32f 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -165,6 +165,8 @@ public:
// from resources
InfoDialog(ScummEngine *scumm, int res);
+ void setInfoText(const String& message);
+
virtual void handleMouseDown(int x, int y, int button, int clickCount) {
setResult(0);
close();
@@ -177,7 +179,6 @@ public:
virtual void reflowLayout();
protected:
- void setInfoText (const String& message);
// Query a string from the resources
const String queryResString(int stringno);