[Scummvm-cvs-logs] scummvm master -> 563ac93c166f31864c2bcaa9e99e71e2c5882910

Strangerke arnaud.boutonne at gmail.com
Thu Mar 17 20:08:10 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
563ac93c16 Hugo: Use EntryDialog in Box()


Commit: 563ac93c166f31864c2bcaa9e99e71e2c5882910
    https://github.com/scummvm/scummvm/commit/563ac93c166f31864c2bcaa9e99e71e2c5882910
Author: strangerke (arnaud.boutonne at gmail.com)
Date: 2011-03-17T12:07:24-07:00

Commit Message:
Hugo: Use EntryDialog in Box()

Changed paths:
    engines/hugo/dialogs.h
    engines/hugo/util.cpp
    engines/hugo/util.h



diff --git a/engines/hugo/dialogs.h b/engines/hugo/dialogs.h
index 1ef196a..f870414 100644
--- a/engines/hugo/dialogs.h
+++ b/engines/hugo/dialogs.h
@@ -101,6 +101,7 @@ protected:
 };
 
 class EntryDialog : public GUI::Dialog {
+public:
 	EntryDialog(const Common::String &title, const Common::String &buttonLabel, const Common::String &defaultValue);
 	virtual ~EntryDialog();
 
diff --git a/engines/hugo/util.cpp b/engines/hugo/util.cpp
index f342d4e..f36c431 100644
--- a/engines/hugo/util.cpp
+++ b/engines/hugo/util.cpp
@@ -89,7 +89,7 @@ void Utils::reverseByte(byte *data) {
 	*data = result;
 }
 
-char *Utils::Box(box_t dismiss, const char *s, ...) {
+const char *Utils::Box(box_t dismiss, const char *s, ...) {
 	static char buffer[kMaxStrLength + 1];          // Format text into this
 
 	if (!s)
@@ -126,18 +126,18 @@ char *Utils::Box(box_t dismiss, const char *s, ...) {
 		break;
 		}
 	case kBoxPrompt: {
-		// TODO: Some boxes (i.e. the combination code for the shed), needs to return an input.
-		warning("Box: unhandled BOX_PROMPT");
-		int boxTime = strlen(buffer) * 30;
-		GUI::TimedMessageDialog dialog(buffer, MAX(1500, boxTime));
-		dialog.runModal();
+		EntryDialog dialog(buffer, "OK", "");
+		Common::String result = dialog.getEditString();
+
+		return result.c_str();
+
 		break;
 		}
 	default:
 		error("Unknown BOX Type %d", dismiss);
 	}
 
-	return buffer;
+	return 0;
 }
 
 char *Utils::strlwr(char *buffer) {
diff --git a/engines/hugo/util.h b/engines/hugo/util.h
index 10376c8..acead5a 100644
--- a/engines/hugo/util.h
+++ b/engines/hugo/util.h
@@ -47,7 +47,7 @@ int   lastBit(byte data);
 
 void  reverseByte(byte *data);
 
-char *Box(box_t, const char *, ...) GCC_PRINTF(2, 3);
+const char *Box(box_t, const char *, ...) GCC_PRINTF(2, 3);
 char *strlwr(char *buffer);
 }
 






More information about the Scummvm-git-logs mailing list