diff options
author | Arnaud Boutonné | 2010-09-30 22:22:05 +0000 |
---|---|---|
committer | Arnaud Boutonné | 2010-09-30 22:22:05 +0000 |
commit | cc69fa8297e157d96aaa53f79c48febd710fa2fe (patch) | |
tree | 6a67855aa982599e77157bdd90d8b211155965e9 | |
parent | 7296a2d8d03b7358bdef0e9217f53eb4ee81ce9e (diff) | |
download | scummvm-rg350-cc69fa8297e157d96aaa53f79c48febd710fa2fe.tar.gz scummvm-rg350-cc69fa8297e157d96aaa53f79c48febd710fa2fe.tar.bz2 scummvm-rg350-cc69fa8297e157d96aaa53f79c48febd710fa2fe.zip |
HUGO: Improve message boxes
- Use OK and YES/NO messages boxes when required
- Empty messages are no longer displayed
svn-id: r52960
-rw-r--r-- | engines/hugo/util.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp index 42ae9131d3..0d439584db 100644 --- a/engines/hugo/util.cpp +++ b/engines/hugo/util.cpp @@ -100,12 +100,31 @@ char *Utils::Box(box_t dismiss, const char *s, ...) { vsprintf(buffer, s, marker); // Format string into buffer va_end(marker); - //Warn(false, "BOX: %s", buffer); - int boxTime = strlen(buffer) * 30; - GUI::TimedMessageDialog dialog(buffer, MAX(1500, boxTime)); - dialog.runModal(); + if (buffer[0] == '\0') + return(NULL); + switch(dismiss) { + case BOX_ANY: + case BOX_OK: { + GUI::MessageDialog dialog(buffer, "OK"); + dialog.runModal(); + break; + } + case BOX_YESNO: { + GUI::MessageDialog dialog(buffer, "YES", "NO"); + if (dialog.runModal() == GUI::kMessageOK) + return(buffer); + return 0; + break; + } + case BOX_PROMPT: + warning("Box: unhandled BOX_PROMPT"); + int boxTime = strlen(buffer) * 30; + GUI::TimedMessageDialog dialog(buffer, MAX(1500, boxTime)); + dialog.runModal(); // TODO: Some boxes (i.e. the combination code for the shed), needs to return an input. + } + return buffer; } |