diff options
Diffstat (limited to 'engines/scumm/dialogs.cpp')
| -rw-r--r-- | engines/scumm/dialogs.cpp | 66 | 
1 files changed, 54 insertions, 12 deletions
| diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 15c22c2bed..85a7a4b675 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -27,6 +27,7 @@  #include "common/config-manager.h"  #include "common/savefile.h"  #include "common/system.h" +#include "common/events.h"  #include "graphics/scaler.h" @@ -618,14 +619,6 @@ ConfigDialog::~ConfigDialog() {  #endif  } -void ConfigDialog::open() { -	GUI_OptionsDialog::open(); -} - -void ConfigDialog::close() { -	GUI_OptionsDialog::close(); -} -  void ConfigDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {  	switch (cmd) {  	case kKeysCmd: @@ -749,21 +742,28 @@ void HelpDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {  InfoDialog::InfoDialog(ScummEngine *scumm, int res)  : ScummDialog("scummDummyDialog"), _vm(scumm) { // dummy x and w -	setInfoText(queryResString(res)); + +	_message = queryResString(res); + +	// Width and height are dummy +	_text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);  }  InfoDialog::InfoDialog(ScummEngine *scumm, const String& message)  : ScummDialog("scummDummyDialog"), _vm(scumm) { // dummy x and w -	setInfoText(message); -} -void InfoDialog::setInfoText(const String& message) {  	_message = message;  	// Width and height are dummy  	_text = new StaticTextWidget(this, 4, 4, 10, 10, _message, kTextAlignCenter);  } +void InfoDialog::setInfoText(const String& message) { +	_message = message; +	_text->setLabel(_message); +	//reflowLayout(); // FIXME: Should we call this here? Depends on the usage patterns, I guess... +} +  void InfoDialog::reflowLayout() {  	const int screenW = g_system->getOverlayWidth();  	const int screenH = g_system->getOverlayHeight(); @@ -913,6 +913,48 @@ void ValueDisplayDialog::open() {  	_timer = getMillis() + kDisplayDelay;  } +SubtitleSettingsDialog::SubtitleSettingsDialog(ScummEngine *scumm, int value)  +	: InfoDialog(scumm, ""), _value(value) { + +} + +void SubtitleSettingsDialog::handleTickle() { +	InfoDialog::handleTickle(); +	if (getMillis() > _timer) +		close(); +} + +void SubtitleSettingsDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { +	if (keycode == 't' && modifiers == Common::KBD_CTRL) { +		cycleValue(); + +		reflowLayout(); +		draw(); +	} else { +		close(); +	} +} + +void SubtitleSettingsDialog::open() { +	cycleValue(); +	InfoDialog::open(); +} + +void SubtitleSettingsDialog::cycleValue() { +	static const char* subtitleDesc[] = { +		"Speech Only", +		"Speech and Subtitles", +		"Subtitles Only" +	}; +	 +	_value = (_value + 1) % 3; + +	setInfoText(subtitleDesc[_value]); + +	setResult(_value); +	_timer = getMillis() + 1500; +} +  Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text)  	: InfoDialog(scumm, text) {  } | 
