diff options
author | David Corrales | 2007-06-23 18:51:33 +0000 |
---|---|---|
committer | David Corrales | 2007-06-23 18:51:33 +0000 |
commit | cacd7a28fd51d960947de88abbf30c487e66529d (patch) | |
tree | f3baa59853bfb307e452b86b9d93c4737b1fa6ab /engines/scumm/dialogs.cpp | |
parent | 0ac96302fe9c04df79cb01a77d19535b45fe2db0 (diff) | |
parent | 90c2210dae8c91fa8babc6b05564e15c9d445d18 (diff) | |
download | scummvm-rg350-cacd7a28fd51d960947de88abbf30c487e66529d.tar.gz scummvm-rg350-cacd7a28fd51d960947de88abbf30c487e66529d.tar.bz2 scummvm-rg350-cacd7a28fd51d960947de88abbf30c487e66529d.zip |
Merged the FSNode branch with trunk r27031:27680
svn-id: r27681
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) { } |