From f85871b1fc9540c77b43d8ed200059e7d31948be Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 2 Jun 2007 12:01:09 +0000 Subject: Make InfoDialog::setInfoText a bit more useful, by making it public & reusable svn-id: r27050 --- engines/scumm/dialogs.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'engines/scumm/dialogs.cpp') diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 15c22c2bed..7541edd0b4 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -749,21 +749,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(); -- cgit v1.2.3 From cd6f145577453c8025b9b4cb2b062fe80d5034f7 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sun, 3 Jun 2007 17:32:42 +0000 Subject: Modified version of patch #1723779: SCUMM: Improved ctrl+t subtitle cycling svn-id: r27068 --- engines/scumm/dialogs.cpp | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'engines/scumm/dialogs.cpp') 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) { } -- cgit v1.2.3 From 810390393538842286205974568c287b5ffcbdc3 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 13 Jun 2007 20:41:47 +0000 Subject: Removed redundant code svn-id: r27393 --- engines/scumm/dialogs.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'engines/scumm/dialogs.cpp') diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 1a59fba5d3..85a7a4b675 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -619,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: -- cgit v1.2.3