parent
4ceec0dfbb
commit
c295f524b2
10 changed files with 62 additions and 5 deletions
|
@ -553,6 +553,11 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
|
||||||
_shouldRTL = true;
|
_shouldRTL = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case Common::EVENT_MUTE:
|
||||||
|
if (g_engine)
|
||||||
|
g_engine->flipMute();
|
||||||
|
break;
|
||||||
|
|
||||||
case Common::EVENT_QUIT:
|
case Common::EVENT_QUIT:
|
||||||
if (ConfMan.getBool("confirm_exit")) {
|
if (ConfMan.getBool("confirm_exit")) {
|
||||||
if (_confirmExitDialogActive) {
|
if (_confirmExitDialogActive) {
|
||||||
|
|
|
@ -252,6 +252,11 @@ bool OSystem_SDL::pollEvent(Common::Event &event) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if ((ev.key.keysym.mod & KMOD_CTRL) && ev.key.keysym.sym == 'u') {
|
||||||
|
event.type = Common::EVENT_MUTE;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// Ctrl-Alt-<key> will change the GFX mode
|
// Ctrl-Alt-<key> will change the GFX mode
|
||||||
if ((b & (Common::KBD_CTRL|Common::KBD_ALT)) == (Common::KBD_CTRL|Common::KBD_ALT)) {
|
if ((b & (Common::KBD_CTRL|Common::KBD_ALT)) == (Common::KBD_CTRL|Common::KBD_ALT)) {
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,7 @@ enum EventType {
|
||||||
|
|
||||||
EVENT_MAINMENU = 15,
|
EVENT_MAINMENU = 15,
|
||||||
EVENT_RTL = 16,
|
EVENT_RTL = 16,
|
||||||
|
EVENT_MUTE = 17,
|
||||||
|
|
||||||
EVENT_QUIT = 10,
|
EVENT_QUIT = 10,
|
||||||
EVENT_SCREEN_CHANGED = 11,
|
EVENT_SCREEN_CHANGED = 11,
|
||||||
|
|
|
@ -304,9 +304,25 @@ void Engine::syncSoundSettings() {
|
||||||
int soundVolumeSFX = ConfMan.getInt("sfx_volume");
|
int soundVolumeSFX = ConfMan.getInt("sfx_volume");
|
||||||
int soundVolumeSpeech = ConfMan.getInt("speech_volume");
|
int soundVolumeSpeech = ConfMan.getInt("speech_volume");
|
||||||
|
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic);
|
bool mute = false;
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, soundVolumeSFX);
|
if (ConfMan.hasKey("mute"))
|
||||||
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech);
|
mute = ConfMan.getBool("mute");
|
||||||
|
|
||||||
|
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, (mute ? 0 : soundVolumeMusic));
|
||||||
|
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, (mute ? 0 : soundVolumeSFX));
|
||||||
|
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, (mute ? 0 : soundVolumeSpeech));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Engine::flipMute() {
|
||||||
|
bool mute = false;
|
||||||
|
|
||||||
|
if (ConfMan.hasKey("mute")) {
|
||||||
|
mute = !ConfMan.getBool("mute");
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfMan.setBool("mute", mute);
|
||||||
|
|
||||||
|
syncSoundSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
Common::Error Engine::loadGameState(int slot) {
|
Common::Error Engine::loadGameState(int slot) {
|
||||||
|
|
|
@ -175,6 +175,11 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void syncSoundSettings();
|
virtual void syncSoundSettings();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flip mute all sound option.
|
||||||
|
*/
|
||||||
|
virtual void flipMute();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load a game state.
|
* Load a game state.
|
||||||
* @param slot the slot from which a savestate should be loaded
|
* @param slot the slot from which a savestate should be loaded
|
||||||
|
|
|
@ -119,6 +119,7 @@ void OptionsDialog::init() {
|
||||||
_speechVolumeDesc = 0;
|
_speechVolumeDesc = 0;
|
||||||
_speechVolumeSlider = 0;
|
_speechVolumeSlider = 0;
|
||||||
_speechVolumeLabel = 0;
|
_speechVolumeLabel = 0;
|
||||||
|
_muteCheckbox = 0;
|
||||||
_subToggleDesc = 0;
|
_subToggleDesc = 0;
|
||||||
_subToggleButton = 0;
|
_subToggleButton = 0;
|
||||||
_subSpeedDesc = 0;
|
_subSpeedDesc = 0;
|
||||||
|
@ -240,12 +241,19 @@ void OptionsDialog::open() {
|
||||||
vol = ConfMan.getInt("speech_volume", _domain);
|
vol = ConfMan.getInt("speech_volume", _domain);
|
||||||
_speechVolumeSlider->setValue(vol);
|
_speechVolumeSlider->setValue(vol);
|
||||||
_speechVolumeLabel->setValue(vol);
|
_speechVolumeLabel->setValue(vol);
|
||||||
|
|
||||||
|
bool val = false;
|
||||||
|
if (ConfMan.hasKey("mute", _domain)) {
|
||||||
|
val = ConfMan.getBool("mute", _domain);
|
||||||
|
} else {
|
||||||
|
ConfMan.setBool("mute", false);
|
||||||
|
}
|
||||||
|
_muteCheckbox->setState(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Subtitle options
|
// Subtitle options
|
||||||
if (_subToggleButton) {
|
if (_subToggleButton) {
|
||||||
int speed;
|
int speed; int sliderMaxValue = _subSpeedSlider->getMaxValue();
|
||||||
int sliderMaxValue = _subSpeedSlider->getMaxValue();
|
|
||||||
|
|
||||||
_subMode = getSubtitleMode(ConfMan.getBool("subtitles", _domain), ConfMan.getBool("speech_mute", _domain));
|
_subMode = getSubtitleMode(ConfMan.getBool("subtitles", _domain), ConfMan.getBool("speech_mute", _domain));
|
||||||
_subToggleButton->setLabel(_subModeDesc[_subMode]);
|
_subToggleButton->setLabel(_subModeDesc[_subMode]);
|
||||||
|
@ -300,10 +308,12 @@ void OptionsDialog::close() {
|
||||||
ConfMan.setInt("music_volume", _musicVolumeSlider->getValue(), _domain);
|
ConfMan.setInt("music_volume", _musicVolumeSlider->getValue(), _domain);
|
||||||
ConfMan.setInt("sfx_volume", _sfxVolumeSlider->getValue(), _domain);
|
ConfMan.setInt("sfx_volume", _sfxVolumeSlider->getValue(), _domain);
|
||||||
ConfMan.setInt("speech_volume", _speechVolumeSlider->getValue(), _domain);
|
ConfMan.setInt("speech_volume", _speechVolumeSlider->getValue(), _domain);
|
||||||
|
ConfMan.setBool("mute", _muteCheckbox->getState(), _domain);
|
||||||
} else {
|
} else {
|
||||||
ConfMan.removeKey("music_volume", _domain);
|
ConfMan.removeKey("music_volume", _domain);
|
||||||
ConfMan.removeKey("sfx_volume", _domain);
|
ConfMan.removeKey("sfx_volume", _domain);
|
||||||
ConfMan.removeKey("speech_volume", _domain);
|
ConfMan.removeKey("speech_volume", _domain);
|
||||||
|
ConfMan.removeKey("mute", _domain);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -514,6 +524,7 @@ void OptionsDialog::setVolumeSettingsState(bool enabled) {
|
||||||
_speechVolumeDesc->setEnabled(enabled);
|
_speechVolumeDesc->setEnabled(enabled);
|
||||||
_speechVolumeSlider->setEnabled(enabled);
|
_speechVolumeSlider->setEnabled(enabled);
|
||||||
_speechVolumeLabel->setEnabled(enabled);
|
_speechVolumeLabel->setEnabled(enabled);
|
||||||
|
_muteCheckbox->setEnabled(enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OptionsDialog::setSubtitleSettingsState(bool enabled) {
|
void OptionsDialog::setSubtitleSettingsState(bool enabled) {
|
||||||
|
@ -640,6 +651,9 @@ void OptionsDialog::addVolumeControls(GuiObject *boss, const String &prefix) {
|
||||||
_musicVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
|
_musicVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
|
||||||
_musicVolumeLabel->setFlags(WIDGET_CLEARBG);
|
_musicVolumeLabel->setFlags(WIDGET_CLEARBG);
|
||||||
|
|
||||||
|
_muteCheckbox = new CheckboxWidget(boss, prefix + "vcMuteCheckbox", "Mute All", 0, 0);
|
||||||
|
|
||||||
|
|
||||||
_sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", "SFX volume:");
|
_sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", "SFX volume:");
|
||||||
_sfxVolumeSlider = new SliderWidget(boss, prefix + "vcSfxSlider", kSfxVolumeChanged);
|
_sfxVolumeSlider = new SliderWidget(boss, prefix + "vcSfxSlider", kSfxVolumeChanged);
|
||||||
_sfxVolumeLabel = new StaticTextWidget(boss, prefix + "vcSfxLabel", "100%");
|
_sfxVolumeLabel = new StaticTextWidget(boss, prefix + "vcSfxLabel", "100%");
|
||||||
|
|
|
@ -145,6 +145,8 @@ private:
|
||||||
StaticTextWidget *_speechVolumeDesc;
|
StaticTextWidget *_speechVolumeDesc;
|
||||||
SliderWidget *_speechVolumeSlider;
|
SliderWidget *_speechVolumeSlider;
|
||||||
StaticTextWidget *_speechVolumeLabel;
|
StaticTextWidget *_speechVolumeLabel;
|
||||||
|
|
||||||
|
CheckboxWidget *_muteCheckbox;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -252,6 +252,11 @@
|
||||||
/>
|
/>
|
||||||
<widget name = 'vcSfxLabel'
|
<widget name = 'vcSfxLabel'
|
||||||
type = 'SmallLabel'
|
type = 'SmallLabel'
|
||||||
|
width = "40"
|
||||||
|
/>
|
||||||
|
<space/>
|
||||||
|
<widget name = 'vcMuteCheckbox'
|
||||||
|
type = 'Checkbox'
|
||||||
/>
|
/>
|
||||||
</layout>
|
</layout>
|
||||||
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
|
<layout type = 'horizontal' padding = '0, 0, 0, 0'>
|
||||||
|
@ -592,8 +597,12 @@
|
||||||
/>
|
/>
|
||||||
<widget name = 'vcSfxLabel'
|
<widget name = 'vcSfxLabel'
|
||||||
type = 'SmallLabel'
|
type = 'SmallLabel'
|
||||||
|
width = "40"
|
||||||
/>
|
/>
|
||||||
</layout>
|
</layout>
|
||||||
|
<widget name = 'vcMuteCheckbox'
|
||||||
|
type = 'Checkbox'
|
||||||
|
/>
|
||||||
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
|
<layout type = 'horizontal' padding = '0, 0, 0, 0' spacing = '8'>
|
||||||
<widget name = 'vcSpeechText'
|
<widget name = 'vcSpeechText'
|
||||||
type = 'OptionsLabel'
|
type = 'OptionsLabel'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue