diff options
author | Max Horn | 2007-06-03 17:32:42 +0000 |
---|---|---|
committer | Max Horn | 2007-06-03 17:32:42 +0000 |
commit | cd6f145577453c8025b9b4cb2b062fe80d5034f7 (patch) | |
tree | a394fadf68dc226c7781a843ba2a9de7f79f1b1d /engines/scumm/dialogs.cpp | |
parent | 66f9032d014c4a1bd0076a93b97412549614152a (diff) | |
download | scummvm-rg350-cd6f145577453c8025b9b4cb2b062fe80d5034f7.tar.gz scummvm-rg350-cd6f145577453c8025b9b4cb2b062fe80d5034f7.tar.bz2 scummvm-rg350-cd6f145577453c8025b9b4cb2b062fe80d5034f7.zip |
Modified version of patch #1723779: SCUMM: Improved ctrl+t subtitle cycling
svn-id: r27068
Diffstat (limited to 'engines/scumm/dialogs.cpp')
-rw-r--r-- | engines/scumm/dialogs.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 7541edd0b4..1a59fba5d3 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" @@ -920,6 +921,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) { } |