diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-02-28 02:14:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-02-28 03:01:38 +0300 |
commit | c85d939d9b3f6c10288dc86ffa7811408e349657 (patch) | |
tree | b1ca825fde3bad322728df1c9133ec25b74b341e /src/gui/okdialog.cpp | |
parent | 5023a1d0b96071a35547dcc309ce45ba6a17eec1 (diff) | |
download | mv-c85d939d9b3f6c10288dc86ffa7811408e349657.tar.gz mv-c85d939d9b3f6c10288dc86ffa7811408e349657.tar.bz2 mv-c85d939d9b3f6c10288dc86ffa7811408e349657.tar.xz mv-c85d939d9b3f6c10288dc86ffa7811408e349657.zip |
Add different sound effects for different events.
Can be configured in audio tab in settings.
Diffstat (limited to 'src/gui/okdialog.cpp')
-rw-r--r-- | src/gui/okdialog.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/okdialog.cpp b/src/gui/okdialog.cpp index 4a3bdf731..fe22cf008 100644 --- a/src/gui/okdialog.cpp +++ b/src/gui/okdialog.cpp @@ -22,6 +22,8 @@ #include "gui/okdialog.h" +#include "sound.h" + #include "gui/gui.h" #include "gui/widgets/button.h" @@ -34,7 +36,8 @@ #include "debug.h" OkDialog::OkDialog(const std::string &title, const std::string &msg, - bool modal, bool showCenter, Window *parent): + int soundEvent, bool modal, bool showCenter, + Window *parent): Window(title, modal, parent, "ok.xml") { mTextBox = new TextBox; @@ -71,6 +74,11 @@ OkDialog::OkDialog(const std::string &title, const std::string &msg, centerHorisontally(); setVisible(true); okButton->requestFocus(); + + if (soundEvent == DIALOG_OK) + sound.playGuiSound("soundinfo"); + else if (soundEvent == DIALOG_ERROR) + sound.playGuiSound("sounderror"); } void OkDialog::action(const gcn::ActionEvent &event) |