Ticket #8664: subtitles-settings.patch
File subtitles-settings.patch, 3.4 KB (added by , 17 years ago) |
---|
-
engines/scumm/input.cpp
416 416 if (lastKeyHit == 20) { 417 417 // FIXME: What key is '20' supposed to indicate? I can't trigger 418 418 // it with my keyboard, it seems... 419 char buf[256];420 419 421 _voiceMode++; 422 if (_voiceMode == 3) 423 _voiceMode = 0; 420 SubtitleSettingsDialog dialog(this, _voiceMode); 421 _voiceMode = runDialog(dialog); 424 422 425 423 switch (_voiceMode) { 426 424 case 0: 427 sprintf(buf, "Speech Only");428 425 ConfMan.setBool("speech_mute", false); 429 426 ConfMan.setBool("subtitles", false); 430 427 break; 431 428 case 1: 432 sprintf(buf, "Speech and Subtitles");433 429 ConfMan.setBool("speech_mute", false); 434 430 ConfMan.setBool("subtitles", true); 435 431 break; 436 432 case 2: 437 sprintf(buf, "Subtitles Only");438 433 ConfMan.setBool("speech_mute", true); 439 434 ConfMan.setBool("subtitles", true); 440 435 break; … … 443 438 if (VAR_VOICE_MODE != 0xFF) 444 439 VAR(VAR_VOICE_MODE) = _voiceMode; 445 440 446 GUI::TimedMessageDialog dialog(buf, 1500);447 runDialog(dialog);448 441 return; 449 442 } 450 443 -
engines/scumm/dialogs.cpp
27 27 #include "common/config-manager.h" 28 28 #include "common/savefile.h" 29 29 #include "common/system.h" 30 #include "common/events.h" 30 31 31 32 #include "graphics/scaler.h" 32 33 … … 920 921 _timer = getMillis() + kDisplayDelay; 921 922 } 922 923 924 SubtitleSettingsDialog::SubtitleSettingsDialog(ScummEngine *scumm, int value) 925 : InfoDialog(scumm, "") { 926 927 _value = value + 1; 928 if (_value == 3) 929 _value = 0; 930 931 setInfoText(_subtitleDesc[_value]); 932 } 933 934 void SubtitleSettingsDialog::handleTickle() { 935 InfoDialog::handleTickle(); 936 if (getMillis() > _timer) 937 close(); 938 } 939 940 void SubtitleSettingsDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { 941 if (keycode == 't' && modifiers == Common::KBD_CTRL) { 942 _value++; 943 if (_value == 3) 944 _value = 0; 945 946 setInfoText(_subtitleDesc[_value]); 947 reflowLayout(); 948 setResult(_value); 949 _timer = getMillis() + 1500; 950 draw(); 951 } else { 952 close(); 953 } 954 } 955 956 void SubtitleSettingsDialog::open() { 957 InfoDialog::open(); 958 setResult(_value); 959 _timer = getMillis() + 1500; 960 } 961 962 const char* SubtitleSettingsDialog::_subtitleDesc[] = { 963 "Speech Only", 964 "Speech and Subtitles", 965 "Subtitles Only" 966 }; 967 923 968 Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text) 924 969 : InfoDialog(scumm, text) { 925 970 } -
engines/scumm/dialogs.h
236 236 uint32 _timer; 237 237 }; 238 238 239 /** 240 * A dialog used to display and cycle subtitle settings. 241 * Automatically closes after a brief time has passed. 242 */ 243 class SubtitleSettingsDialog : public InfoDialog { 244 public: 245 SubtitleSettingsDialog(ScummEngine *scumm, int value); 239 246 247 virtual void open(); 248 virtual void handleTickle(); 249 virtual void handleMouseDown(int x, int y, int button, int clickCount) { 250 close(); 251 } 252 virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers); 253 protected: 254 int _value; 255 uint32 _timer; 256 257 static const char* _subtitleDesc[]; 258 }; 259 240 260 //The Indy IQ dialog 241 261 class Indy3IQPointsDialog : public InfoDialog { 242 262 public: