[Scummvm-cvs-logs] SF.net SVN: scummvm:[52960] scummvm/trunk/engines/hugo/util.cpp
strangerke at users.sourceforge.net
strangerke at users.sourceforge.net
Fri Oct 1 00:22:06 CEST 2010
Revision: 52960
http://scummvm.svn.sourceforge.net/scummvm/?rev=52960&view=rev
Author: strangerke
Date: 2010-09-30 22:22:05 +0000 (Thu, 30 Sep 2010)
Log Message:
-----------
HUGO: Improve message boxes
- Use OK and YES/NO messages boxes when required
- Empty messages are no longer displayed
Modified Paths:
--------------
scummvm/trunk/engines/hugo/util.cpp
Modified: scummvm/trunk/engines/hugo/util.cpp
===================================================================
--- scummvm/trunk/engines/hugo/util.cpp 2010-09-30 18:09:01 UTC (rev 52959)
+++ scummvm/trunk/engines/hugo/util.cpp 2010-09-30 22:22:05 UTC (rev 52960)
@@ -100,12 +100,31 @@
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;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list