[Scummvm-git-logs] scummvm master -> 97e4f3878dac865a4bb829b18cc27f40974b04c6

dreammaster dreammaster at scummvm.org
Mon Nov 13 02:27:45 CET 2017


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:
97e4f3878d XEEN: Added How Much dialog


Commit: 97e4f3878dac865a4bb829b18cc27f40974b04c6
    https://github.com/scummvm/scummvm/commit/97e4f3878dac865a4bb829b18cc27f40974b04c6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-11-12T20:27:42-05:00

Commit Message:
XEEN: Added How Much dialog

Changed paths:
    engines/xeen/dialogs_input.cpp
    engines/xeen/dialogs_input.h
    engines/xeen/party.cpp
    engines/xeen/resources.cpp
    engines/xeen/resources.h


diff --git a/engines/xeen/dialogs_input.cpp b/engines/xeen/dialogs_input.cpp
index 5376fb7..ca41272 100644
--- a/engines/xeen/dialogs_input.cpp
+++ b/engines/xeen/dialogs_input.cpp
@@ -272,4 +272,32 @@ void Choose123::loadButtons(int numOptions) {
 		addButton(Common::Rect(286, 75, 311, 95), Common::KEYCODE_3, &_iconSprites);
 }
 
+/*------------------------------------------------------------------------*/
+
+int HowMuch::show(XeenEngine *vm) {
+	HowMuch *dlg = new HowMuch(vm);
+	int result = dlg->execute();
+	delete dlg;
+
+	return result;
+}
+
+int HowMuch::execute() {
+	Map &map = *_vm->_map;
+	Party &party = *_vm->_party;
+	Screen &screen = *_vm->_screen;
+	Window &w = screen._windows[6];
+	Common::String num;
+
+	w.open();
+	w.writeString(Res.HOW_MUCH);
+	w.update();
+	int lineSize = Input::show(_vm, &w, num, 8, 70, true);
+	w.close();
+
+	if (!lineSize)
+		return -1;
+	return atoi(num.c_str());
+}
+
 } // End of namespace Xeen
diff --git a/engines/xeen/dialogs_input.h b/engines/xeen/dialogs_input.h
index 8221320..26fdb47 100644
--- a/engines/xeen/dialogs_input.h
+++ b/engines/xeen/dialogs_input.h
@@ -82,6 +82,17 @@ public:
 	static int show(XeenEngine *vm, int numOptions);
 };
 
+class HowMuch : public ButtonContainer {
+private:
+	SpriteResource _iconSprites;
+
+	HowMuch(XeenEngine *vm) : ButtonContainer(vm) {}
+
+	int execute();
+public:
+	static int show(XeenEngine *vm);
+};
+
 } // End of namespace Xeen
 
 #endif /* XEEN_DIALOGS_STRING_INPUT_H */
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index 0cde1c2..3d2f13d 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -24,6 +24,7 @@
 #include "common/algorithm.h"
 #include "xeen/party.h"
 #include "xeen/dialogs_error.h"
+#include "xeen/dialogs_input.h"
 #include "xeen/files.h"
 #include "xeen/resources.h"
 #include "xeen/saves.h"
@@ -1380,8 +1381,7 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
 }
 
 int Party::howMuch() {
-	warning("TODO");
-	return -1;
+	return HowMuch::show(_vm);
 }
 
 void Party::subPartyTime(int time) {
diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp
index 4f57683..082f9b8 100644
--- a/engines/xeen/resources.cpp
+++ b/engines/xeen/resources.cpp
@@ -98,6 +98,8 @@ const char *const Resources::THE_PARTY_NEEDS_REST = "\x0B""012The Party needs re
 const char *const Resources::WHO_WILL = "\x03""c\x0B""000\x09""000%s\x0A\x0A"
 	"Who will\x0A%s?\x0A\x0B""055F1 - F%d";
 
+const char *const Resources::HOW_MUCH = "\x3""cHow Much\n\n";
+
 const char *const Resources::WHATS_THE_PASSWORD = "What's the Password?";
 
 const char *const Resources::IN_NO_CONDITION = "\x0B""007%s is not in any condition to perform actions!";
diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h
index 1ca6c62..000e332 100644
--- a/engines/xeen/resources.h
+++ b/engines/xeen/resources.h
@@ -45,6 +45,7 @@ public:
 	static const char *const OPTIONS_TITLE;
 	static const char *const THE_PARTY_NEEDS_REST;
 	static const char *const WHO_WILL;
+	static const char *const HOW_MUCH;
 	static const char *const WHATS_THE_PASSWORD;
 	static const char *const IN_NO_CONDITION;
 	static const char *const NOTHING_HERE;





More information about the Scummvm-git-logs mailing list