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.
This commit is contained in:
Johannes Schickel 2011-12-24 21:09:46 +01:00
parent 63ba3988ff
commit 95cabb0ffd
13 changed files with 1600 additions and 1411 deletions

View File

@ -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

View File

@ -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

View File

@ -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);

View File

@ -35,7 +35,7 @@
#include "graphics/pixelformat.h"
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.5"
#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8.6"
class OSystem;

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -1 +1 @@
[SCUMMVM_STX0.8.5:ScummVM Classic Theme:No Author]
[SCUMMVM_STX0.8.6:ScummVM Classic Theme:No Author]

View File

@ -818,6 +818,27 @@
</layout>
</dialog>
<dialog name = 'LoomTownsDifficultyDialog' overlays = 'screen_center'>
<layout type = 'vertical' padding = '8, 8, 8, 8' center = 'true'>
<widget name = 'Description1'
width = '320'
height = 'Globals.Line.Height'
/>
<widget name = 'Description2'
height = 'Globals.Line.Height'
/>
<widget name = 'Standard'
type = 'Button'
/>
<widget name = 'Practice'
type = 'Button'
/>
<widget name = 'Expert'
type = 'Button'
/>
</layout>
</dialog>
<dialog name = 'MassAdd' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 32, 8' center = 'true'>
<widget name = 'DirProgressText'

View File

@ -820,6 +820,27 @@
</layout>
</dialog>
<dialog name = 'LoomTownsDifficultyDialog' overlays = 'screen_center'>
<layout type = 'vertical' padding = '8, 8, 8, 8' center = 'true'>
<widget name = 'Description1'
width = '280'
height = 'Globals.Line.Height'
/>
<widget name = 'Description2'
height = 'Globals.Line.Height'
/>
<widget name = 'Standard'
type = 'Button'
/>
<widget name = 'Practice'
type = 'Button'
/>
<widget name = 'Expert'
type = 'Button'
/>
</layout>
</dialog>
<dialog name = 'MassAdd' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '4, 4, 16, 4' center = 'true'>
<widget name = 'DirProgressText'

Binary file not shown.

View File

@ -1 +1 @@
[SCUMMVM_STX0.8.5:ScummVM Modern Theme:No Author]
[SCUMMVM_STX0.8.6:ScummVM Modern Theme:No Author]

View File

@ -833,6 +833,27 @@
</layout>
</dialog>
<dialog name = 'LoomTownsDifficultyDialog' overlays = 'screen_center'>
<layout type = 'vertical' padding = '8, 8, 8, 8' center = 'true'>
<widget name = 'Description1'
width = '320'
height = 'Globals.Line.Height'
/>
<widget name = 'Description2'
height = 'Globals.Line.Height'
/>
<widget name = 'Standard'
type = 'Button'
/>
<widget name = 'Practice'
type = 'Button'
/>
<widget name = 'Expert'
type = 'Button'
/>
</layout>
</dialog>
<dialog name = 'MassAdd' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 32, 8' center = 'true'>
<widget name = 'DirProgressText'

View File

@ -819,6 +819,27 @@
</layout>
</dialog>
<dialog name = 'LoomTownsDifficultyDialog' overlays = 'screen_center'>
<layout type = 'vertical' padding = '8, 8, 8, 8' center = 'true'>
<widget name = 'Description1'
width = '280'
height = 'Globals.Line.Height'
/>
<widget name = 'Description2'
height = 'Globals.Line.Height'
/>
<widget name = 'Standard'
type = 'Button'
/>
<widget name = 'Practice'
type = 'Button'
/>
<widget name = 'Expert'
type = 'Button'
/>
</layout>
</dialog>
<dialog name = 'MassAdd' overlays = 'screen_center' shading = 'dim'>
<layout type = 'vertical' padding = '4, 4, 16, 4' center = 'true'>
<widget name = 'DirProgressText'