mail[Wesnoth-commits] r13877 - /branches/1.2/src/hotkeys.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by queen . killer on October 10, 2006 - 11:01:
Author: queenkiller
Date: Tue Oct 10 11:01:13 2006
New Revision: 13877

URL: http://svn.gna.org/viewcvs/wesnoth?rev=13877&view=rev
Log:
fixed mute bug (#7129)

Modified:
    branches/1.2/src/hotkeys.cpp

Modified: branches/1.2/src/hotkeys.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.2/src/hotkeys.cpp?rev=13877&r1=13876&r2=13877&view=diff
==============================================================================
--- branches/1.2/src/hotkeys.cpp (original)
+++ branches/1.2/src/hotkeys.cpp Tue Oct 10 11:01:13 2006
@@ -519,9 +519,26 @@
                        preferences::set_turbo(!preferences::turbo());
                        break;
                case HOTKEY_MUTE:
-                       // Toggle both sound & music, based on music (the 
more obvious cue)
-                       preferences::set_sound(!preferences::music_on());
-                       preferences::set_music(!preferences::music_on());
+                       // look if both is not playing
+                       static struct before_muted_s
+                       {
+                               bool playing_sound,playing_music;
+                               before_muted_s() : 
playing_sound(false),playing_music(false){}
+                       } before_muted;
+                       if (preferences::music_on() || 
preferences::sound_on())
+                       {
+                               //then remember settings and mute both
+                               before_muted.playing_sound = 
preferences::sound_on();
+                               before_muted.playing_music = 
preferences::music_on();
+                               preferences::set_sound(false);
+                               preferences::set_music(false);
+                       }
+                       else
+                       {
+                               //then set setings before mute
+                               
preferences::set_sound(before_muted.playing_sound);
+                               
preferences::set_music(before_muted.playing_music);
+                       }
                        break;
                case HOTKEY_CYCLE_UNITS:
                        if(executor)




Related Messages


Powered by MHonArc, Updated Tue Oct 10 12:00:50 2006