ALL: add support for -m -s -r commands

This commit is contained in:
grisenti 2022-05-07 00:51:24 +02:00 committed by Eugene Sandulenko
parent b7f6964fb4
commit 5fc5353ecc
2 changed files with 18 additions and 3 deletions

View file

@ -1851,6 +1851,15 @@ bool processSettings(Common::String &command, Common::StringMap &settings, Commo
if (settings.contains("render-mode")) { if (settings.contains("render-mode")) {
ConfMan.set("render_mode", settings["render-mode"], Common::ConfigManager::kSessionDomain); ConfMan.set("render_mode", settings["render-mode"], Common::ConfigManager::kSessionDomain);
} }
if (settings.contains("music-volume")) {
ConfMan.set("music_volume", settings["music-volume"], Common::ConfigManager::kSessionDomain);
}
if (settings.contains("sfx-volume")) {
ConfMan.set("sfx_volume", settings["sfx-volume"], Common::ConfigManager::kSessionDomain);
}
if (settings.contains("speech-volume")) {
ConfMan.set("speech_volume", settings["speech-volume"], Common::ConfigManager::kSessionDomain);
}
// Finally, store the command line settings into the config manager. // Finally, store the command line settings into the config manager.

View file

@ -958,7 +958,7 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
updateSpeechVolume(newValue); updateSpeechVolume(newValue);
} }
} }
_musicVolumeDesc->setFontColor(ThemeEngine::FontColor::kFontColorNormal);
break; break;
} }
case kSfxVolumeChanged: { case kSfxVolumeChanged: {
@ -973,7 +973,7 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
if (_guioptions.contains(GUIO_LINKSPEECHTOSFX)) { if (_guioptions.contains(GUIO_LINKSPEECHTOSFX)) {
updateSpeechVolume(newValue); updateSpeechVolume(newValue);
} }
_sfxVolumeDesc->setFontColor(ThemeEngine::FontColor::kFontColorNormal);
break; break;
} }
case kSpeechVolumeChanged: { case kSpeechVolumeChanged: {
@ -988,7 +988,7 @@ void OptionsDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
updateMusicVolume(newValue); updateMusicVolume(newValue);
} }
} }
_speechVolumeDesc->setFontColor(ThemeEngine::FontColor::kFontColorNormal);
break; break;
} }
case kMuteAllChanged: case kMuteAllChanged:
@ -1676,6 +1676,8 @@ void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &pre
_musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _("Music volume:")); _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _("Music volume:"));
else else
_musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _c("Music volume:", "lowres")); _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", _c("Music volume:", "lowres"));
if (ConfMan.isKeyTemporary("music_volume"))
_musicVolumeDesc->setFontColor(ThemeEngine::FontColor::kFontColorOverride);
_musicVolumeSlider = new SliderWidget(boss, prefix + "vcMusicSlider", Common::U32String(), kMusicVolumeChanged); _musicVolumeSlider = new SliderWidget(boss, prefix + "vcMusicSlider", Common::U32String(), kMusicVolumeChanged);
_musicVolumeLabel = new StaticTextWidget(boss, prefix + "vcMusicLabel", Common::U32String("100%"), Common::U32String(), ThemeEngine::kFontStyleBold, Common::UNK_LANG, false); _musicVolumeLabel = new StaticTextWidget(boss, prefix + "vcMusicLabel", Common::U32String("100%"), Common::U32String(), ThemeEngine::kFontStyleBold, Common::UNK_LANG, false);
_musicVolumeSlider->setMinValue(0); _musicVolumeSlider->setMinValue(0);
@ -1688,6 +1690,8 @@ void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &pre
_sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _("SFX volume:"), _("Special sound effects volume")); _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _("SFX volume:"), _("Special sound effects volume"));
else else
_sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _c("SFX volume:", "lowres"), _("Special sound effects volume")); _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", _c("SFX volume:", "lowres"), _("Special sound effects volume"));
if (ConfMan.isKeyTemporary("sfx_volume"))
_sfxVolumeDesc->setFontColor(ThemeEngine::FontColor::kFontColorOverride);
_sfxVolumeSlider = new SliderWidget(boss, prefix + "vcSfxSlider", _("Special sound effects volume"), kSfxVolumeChanged); _sfxVolumeSlider = new SliderWidget(boss, prefix + "vcSfxSlider", _("Special sound effects volume"), kSfxVolumeChanged);
_sfxVolumeLabel = new StaticTextWidget(boss, prefix + "vcSfxLabel", Common::U32String("100%"), Common::U32String(), ThemeEngine::kFontStyleBold, Common::UNK_LANG, false); _sfxVolumeLabel = new StaticTextWidget(boss, prefix + "vcSfxLabel", Common::U32String("100%"), Common::U32String(), ThemeEngine::kFontStyleBold, Common::UNK_LANG, false);
_sfxVolumeSlider->setMinValue(0); _sfxVolumeSlider->setMinValue(0);
@ -1698,6 +1702,8 @@ void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &pre
_speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _("Speech volume:")); _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _("Speech volume:"));
else else
_speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _c("Speech volume:", "lowres")); _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , _c("Speech volume:", "lowres"));
if (ConfMan.isKeyTemporary("speech_volume"))
_speechVolumeDesc->setFontColor(ThemeEngine::FontColor::kFontColorOverride);
_speechVolumeSlider = new SliderWidget(boss, prefix + "vcSpeechSlider", Common::U32String(), kSpeechVolumeChanged); _speechVolumeSlider = new SliderWidget(boss, prefix + "vcSpeechSlider", Common::U32String(), kSpeechVolumeChanged);
_speechVolumeLabel = new StaticTextWidget(boss, prefix + "vcSpeechLabel", Common::U32String("100%"), Common::U32String(), ThemeEngine::kFontStyleBold, Common::UNK_LANG, false); _speechVolumeLabel = new StaticTextWidget(boss, prefix + "vcSpeechLabel", Common::U32String("100%"), Common::U32String(), ThemeEngine::kFontStyleBold, Common::UNK_LANG, false);
_speechVolumeSlider->setMinValue(0); _speechVolumeSlider->setMinValue(0);