Modified version of patch #1723779: SCUMM: Improved ctrl+t subtitle cycling

svn-id: r27068
This commit is contained in:
Max Horn 2007-06-03 17:32:42 +00:00
parent 66f9032d01
commit cd6f145577
3 changed files with 68 additions and 11 deletions

View file

@ -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) {
}