diff options
author | Paul Gilbert | 2017-11-12 20:27:42 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-11-12 20:27:42 -0500 |
commit | 97e4f3878dac865a4bb829b18cc27f40974b04c6 (patch) | |
tree | dab3ab9567a550c1d184dd039daca785c07f4150 | |
parent | 191e491f0a9792ad82420a43e27b9234cf48727c (diff) | |
download | scummvm-rg350-97e4f3878dac865a4bb829b18cc27f40974b04c6.tar.gz scummvm-rg350-97e4f3878dac865a4bb829b18cc27f40974b04c6.tar.bz2 scummvm-rg350-97e4f3878dac865a4bb829b18cc27f40974b04c6.zip |
XEEN: Added How Much dialog
-rw-r--r-- | engines/xeen/dialogs_input.cpp | 28 | ||||
-rw-r--r-- | engines/xeen/dialogs_input.h | 11 | ||||
-rw-r--r-- | engines/xeen/party.cpp | 4 | ||||
-rw-r--r-- | engines/xeen/resources.cpp | 2 | ||||
-rw-r--r-- | engines/xeen/resources.h | 1 |
5 files changed, 44 insertions, 2 deletions
diff --git a/engines/xeen/dialogs_input.cpp b/engines/xeen/dialogs_input.cpp index 5376fb7c46..ca4127224b 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 8221320b22..26fdb47f4b 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 0cde1c25af..3d2f13dd0a 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 4f576835f6..082f9b881e 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 1ca6c62453..000e332ad4 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; |