summaryrefslogtreecommitdiff
path: root/src/gui/setup_audio.cpp
diff options
context:
space:
mode:
authorChuck Miller <shadowmil@gmail.com>2009-12-19 04:40:42 -0500
committerChuck Miller <shadowmil@gmail.com>2009-12-19 05:08:56 -0500
commitcbc14c8a3c6614987d2331057e114d92336cbac0 (patch)
treea3693bd6ac6aca39a34a2d9a9f644873d63ecf32 /src/gui/setup_audio.cpp
parent117cc13e863b788bfc8adef9468dba54c4909b9b (diff)
downloadmana-client-cbc14c8a3c6614987d2331057e114d92336cbac0.tar.gz
mana-client-cbc14c8a3c6614987d2331057e114d92336cbac0.tar.bz2
mana-client-cbc14c8a3c6614987d2331057e114d92336cbac0.tar.xz
mana-client-cbc14c8a3c6614987d2331057e114d92336cbac0.zip
Added support for resources.xml from update server... Also added option to download music optionally
I had to edit the XML wrapper a bit, basicilly its constructor can now take a optional thrid arguement which will tell it to use a resman or open the file directly Also I added fallback support for the old resouce2.txt so servers don't have to upgrade if they do not want to
Diffstat (limited to 'src/gui/setup_audio.cpp')
-rw-r--r--src/gui/setup_audio.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/setup_audio.cpp b/src/gui/setup_audio.cpp
index 990a3ce8..5b1a86b9 100644
--- a/src/gui/setup_audio.cpp
+++ b/src/gui/setup_audio.cpp
@@ -38,7 +38,9 @@ Setup_Audio::Setup_Audio():
mMusicVolume((int)config.getValue("musicVolume", 60)),
mSfxVolume((int)config.getValue("sfxVolume", 100)),
mSoundEnabled(config.getValue("sound", 0)),
+ mDownloadEnabled(config.getValue("download-music", false)),
mSoundCheckBox(new CheckBox(_("Sound"), mSoundEnabled)),
+ mDownloadMusicCheckBox(new CheckBox(_("Download music"), mDownloadEnabled)),
mSfxSlider(new Slider(0, sound.getMaxVolume())),
mMusicSlider(new Slider(0, sound.getMaxVolume()))
{
@@ -71,6 +73,7 @@ Setup_Audio::Setup_Audio():
place(1, 1, sfxLabel);
place(0, 2, mMusicSlider);
place(1, 2, musicLabel);
+ place(0, 3, mDownloadMusicCheckBox);
setDimension(gcn::Rectangle(0, 0, 365, 280));
}
@@ -78,11 +81,20 @@ Setup_Audio::Setup_Audio():
void Setup_Audio::apply()
{
mSoundEnabled = mSoundCheckBox->isSelected();
+ mDownloadEnabled = mDownloadMusicCheckBox->isSelected();
mSfxVolume = (int) config.getValue("sfxVolume", 100);
mMusicVolume = (int) config.getValue("musicVolume", 60);
config.setValue("sound", mSoundEnabled);
+ // Display a message if user has selected to download music,
+ // And if downloadmusic is not already enabled
+ if (mDownloadEnabled && !config.getValue("download-music", false))
+ {
+ new OkDialog(_("Notice"),_("You may have to restart your client if you want to download new music"));
+ }
+ config.setValue("download-music", mDownloadEnabled);
+
if (mSoundEnabled)
{
try
@@ -104,6 +116,7 @@ void Setup_Audio::apply()
void Setup_Audio::cancel()
{
mSoundCheckBox->setSelected(mSoundEnabled);
+ mDownloadMusicCheckBox->setSelected(mDownloadEnabled);
sound.setSfxVolume(mSfxVolume);
mSfxSlider->setValue(mSfxVolume);
@@ -112,6 +125,7 @@ void Setup_Audio::cancel()
mMusicSlider->setValue(mMusicVolume);
config.setValue("sound", mSoundEnabled);
+ config.setValue("download-music", mDownloadEnabled);
config.setValue("sfxVolume", mSfxVolume);
config.setValue("musicVolume", mMusicVolume);
}