Add a checkbox in frontend to turn music off
authorunc0rr
Sun, 27 Jul 2008 22:14:43 +0000
changeset 1129 b74ffca22762
parent 1128 9b3f42bf4eef
child 1130 aceef9d93f5d
Add a checkbox in frontend to turn music off
QTfrontend/game.cpp
QTfrontend/gameuiconfig.cpp
QTfrontend/gameuiconfig.h
QTfrontend/pages.cpp
QTfrontend/pages.h
--- a/QTfrontend/game.cpp	Sun Jul 27 22:09:40 2008 +0000
+++ b/QTfrontend/game.cpp	Sun Jul 27 22:14:43 2008 +0000
@@ -267,7 +267,7 @@
 	arguments << (config->isShowFPSEnabled() ? "1" : "0");
 	arguments << (config->isAltDamageEnabled() ? "1" : "0");
 	arguments << config->netNick().toUtf8().toBase64();
-	arguments << "1";
+	arguments << (config->isMusicEnabled() ? "1" : "0");
 	return arguments;
 }
 
--- a/QTfrontend/gameuiconfig.cpp	Sun Jul 27 22:09:40 2008 +0000
+++ b/QTfrontend/gameuiconfig.cpp	Sun Jul 27 22:14:43 2008 +0000
@@ -40,6 +40,7 @@
 	Form->ui.pageOptions->CBFullscreen->setChecked(value("video/fullscreen", false).toBool());
 
 	Form->ui.pageOptions->CBEnableSound->setChecked(value("audio/sound", true).toBool());
+	Form->ui.pageOptions->CBEnableMusic->setChecked(value("audio/music", true).toBool());
 
 	Form->ui.pageOptions->editNetNick->setText(value("net/nick", QLineEdit::tr("unnamed")).toString());
 
@@ -77,6 +78,7 @@
 	setValue("video/fullscreen", vid_Fullscreen());
 
 	setValue("audio/sound", isSoundEnabled());
+	setValue("audio/music", isMusicEnabled());
 
 	setValue("net/nick", netNick());
 	setValue("net/ip", *netHost);
@@ -115,6 +117,11 @@
 	return Form->ui.pageOptions->CBEnableSound->isChecked();
 }
 
+bool GameUIConfig::isMusicEnabled()
+{
+	return Form->ui.pageOptions->CBEnableMusic->isChecked();
+}
+
 bool GameUIConfig::isShowFPSEnabled()
 {
 	return Form->ui.pageOptions->CBShowFPS->isChecked();
--- a/QTfrontend/gameuiconfig.h	Sun Jul 27 22:09:40 2008 +0000
+++ b/QTfrontend/gameuiconfig.h	Sun Jul 27 22:14:43 2008 +0000
@@ -36,6 +36,7 @@
 	QRect vid_Resolution();
 	bool vid_Fullscreen();
 	bool isSoundEnabled();
+	bool isMusicEnabled();
 	bool isShowFPSEnabled();
 	bool isAltDamageEnabled();
 	quint8 timerInterval();
--- a/QTfrontend/pages.cpp	Sun Jul 27 22:09:40 2008 +0000
+++ b/QTfrontend/pages.cpp	Sun Jul 27 22:14:43 2008 +0000
@@ -318,6 +318,10 @@
 	CBEnableSound->setText(QCheckBox::tr("Enable sound"));
 	GBAlayout->addWidget(CBEnableSound);
 
+	CBEnableMusic = new	QCheckBox(AGGroupBox);
+	CBEnableMusic->setText(QCheckBox::tr("Enable music"));
+	GBAlayout->addWidget(CBEnableMusic);
+
 	CBShowFPS = new QCheckBox(AGGroupBox);
 	CBShowFPS->setText(QCheckBox::tr("Show FPS"));
 	GBAlayout->addWidget(CBShowFPS);
--- a/QTfrontend/pages.h	Sun Jul 27 22:09:40 2008 +0000
+++ b/QTfrontend/pages.h	Sun Jul 27 22:14:43 2008 +0000
@@ -173,6 +173,7 @@
 	QGroupBox *AGGroupBox;
 	QComboBox *CBResolution;
 	QCheckBox *CBEnableSound;
+	QCheckBox *CBEnableMusic;
 	QCheckBox *CBFullscreen;
 	QCheckBox *CBShowFPS;
 	QCheckBox *CBAltDamage;