aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorJohannes Schickel2011-12-24 21:09:46 +0100
committerJohannes Schickel2011-12-26 15:25:41 +0100
commit95cabb0ffd43e6bdd2c600c5baa459cab89f068d (patch)
tree1bb8d8a2926872a48cc8866aca7425697d199e1a /engines/scumm
parent63ba3988fff08911d2fecbf4808f5514e2fd420f (diff)
downloadscummvm-rg350-95cabb0ffd43e6bdd2c600c5baa459cab89f068d.tar.gz
scummvm-rg350-95cabb0ffd43e6bdd2c600c5baa459cab89f068d.tar.bz2
scummvm-rg350-95cabb0ffd43e6bdd2c600c5baa459cab89f068d.zip
SCUMM: Add a difficulty selection dialog for Loom FM-Towns.
It is in spirit of the DOS version's selection dialog, but it has the description above the buttons instead of below it.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/dialogs.cpp34
-rw-r--r--engines/scumm/dialogs.h21
-rw-r--r--engines/scumm/scumm.cpp10
3 files changed, 65 insertions, 0 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 20aedae089..0e531daf73 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -648,4 +648,38 @@ void DebugInputDialog::handleKeyDown(Common::KeyState state) {
}
}
+LoomTownsDifficultyDialog::LoomTownsDifficultyDialog()
+ : Dialog("LoomTownsDifficultyDialog"), _difficulty(-1) {
+ GUI::StaticTextWidget *text1 = new GUI::StaticTextWidget(this, "LoomTownsDifficultyDialog.Description1", _("Select a Proficiency Level."));
+ text1->setAlign(Graphics::kTextAlignCenter);
+ GUI::StaticTextWidget *text2 = new GUI::StaticTextWidget(this, "LoomTownsDifficultyDialog.Description2", _("Refer to your Loom(TM) manual for help."));
+ text2->setAlign(Graphics::kTextAlignCenter);
+
+ new GUI::ButtonWidget(this, "LoomTownsDifficultyDialog.Standard", _("Standard"), 0, kStandardCmd);
+ new GUI::ButtonWidget(this, "LoomTownsDifficultyDialog.Practice", _("Practice"), 0, kPracticeCmd);
+ new GUI::ButtonWidget(this, "LoomTownsDifficultyDialog.Expert", _("Expert"), 0, kExpertCmd);
+}
+
+void LoomTownsDifficultyDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data) {
+ switch (cmd) {
+ case kStandardCmd:
+ _difficulty = 1;
+ close();
+ break;
+
+ case kPracticeCmd:
+ _difficulty = 0;
+ close();
+ break;
+
+ case kExpertCmd:
+ _difficulty = 2;
+ close();
+ break;
+
+ default:
+ GUI::Dialog::handleCommand(sender, cmd, data);
+ }
+}
+
} // End of namespace Scumm
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index c26aa9f414..7977f123ed 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -187,6 +187,27 @@ public:
Common::String mainText;
};
+/**
+ * Difficulty selection dialog for Loom FM-Towns.
+ */
+class LoomTownsDifficultyDialog : public GUI::Dialog {
+public:
+ LoomTownsDifficultyDialog();
+
+ int getSelectedDifficulty() const { return _difficulty; }
+protected:
+ virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
+
+private:
+ enum {
+ kStandardCmd = 'STDD',
+ kPracticeCmd = 'PRAD',
+ kExpertCmd = 'EXPD'
+ };
+
+ int _difficulty;
+};
+
} // End of namespace Scumm
#endif
diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp
index 9a093891d2..d3cc218cd3 100644
--- a/engines/scumm/scumm.cpp
+++ b/engines/scumm/scumm.cpp
@@ -1256,6 +1256,16 @@ void ScummEngine::setupScumm() {
// Load game from specified slot, if any
if (ConfMan.hasKey("save_slot")) {
requestLoad(ConfMan.getInt("save_slot"));
+ } else if (!ConfMan.hasKey("boot_param") && _game.id == GID_LOOM && _game.platform == Common::kPlatformFMTowns) {
+ // In case we run the Loom FM-Towns version and have no boot parameter
+ // nor start save game supplied we will show our own custom difficulty
+ // selection dialog, since the original does not have any.
+ LoomTownsDifficultyDialog difficultyDialog;
+ runDialog(difficultyDialog);
+
+ int difficulty = difficultyDialog.getSelectedDifficulty();
+ if (difficulty != -1)
+ _bootParam = difficulty;
}
_res->allocResTypeData(rtBuffer, 0, 10, kDynamicResTypeMode);