Index: code/branches/presentation2/data/gui/layouts/AudioMenu.layout
===================================================================
--- code/branches/presentation2/data/gui/layouts/AudioMenu.layout	(revision 6230)
+++ code/branches/presentation2/data/gui/layouts/AudioMenu.layout	(revision 6233)
@@ -15,12 +15,12 @@
             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
             <Property Name="VertFormatting" Value="TopAligned" />
-            <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.325,0},{0.85,0},{0.6,0}}" />
+            <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.325,0},{0.8,0},{0.6,0}}" />
             <Window Type="TaharezLook/StaticText" Name="orxonox/MasterVolume" >
-                <Property Name="Text" Value="Master volume" />
+                <Property Name="Text" Value="Master volume               " />
                 <Property Name="InheritsAlpha" Value="False" />
                 <Property Name="HorzFormatting" Value="HorzCentred" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="VertFormatting" Value="TopAligned" />
-                <Property Name="UnifiedAreaRect" Value="{{0.03,0},{0.2,0},{0.34,0},{0.4,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.041666,0},{0.2,0},{0.5625,0},{0.4,0}}" />
                 <Window Type="TaharezLook/HorizontalScrollbar" Name="orxonox/MasterScrollbar" >
                     <Property Name="PageSize" Value="0" />
@@ -31,17 +31,23 @@
                     <Property Name="StepSize" Value="0.1" />
                     <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.6,0},{0.95,0},{0.8,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.04,0},{0.6,0},{0.71,0},{0.8,0}}" />
                     <Event Name="ThumbTrackStarted" Function="AudioMenu.AudioMasterScrollbar_started" />
                     <Event Name="ThumbTrackEnded" Function="AudioMenu.AudioMasterScrollbar_ended" />
                     <Event Name="ScrollPosChanged" Function="AudioMenu.AudioMasterScrollbar_changed" />
                 </Window>
+                <Window Type="TaharezLook/Checkbox" Name="orxonox/MasterCheckbox" >
+                    <Property Name="Text" Value="Mute" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.775,0},{0.45,0},{0.96,0},{0.9,0}}" />
+                    <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteMasterCheckbox_clicked"/>
+                </Window>
             </Window>
             <Window Type="TaharezLook/StaticText" Name="orxonox/MusicVolume" >
-                <Property Name="Text" Value="Music volume" />
+                <Property Name="Text" Value="Music volume               " />
                 <Property Name="InheritsAlpha" Value="False" />
                 <Property Name="HorzFormatting" Value="HorzCentred" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="VertFormatting" Value="TopAligned" />
-                <Property Name="UnifiedAreaRect" Value="{{0.03,0},{0.45,0},{0.34,0},{0.65,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.041666,0},{0.45,0},{0.5625,0},{0.65,0}}" />
                 <Window Type="TaharezLook/HorizontalScrollbar" Name="orxonox/MusicScrollbar" >
                     <Property Name="PageSize" Value="0" />
@@ -52,17 +58,23 @@
                     <Property Name="StepSize" Value="0.1" />
                     <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.6,0},{0.95,0},{0.8,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.04,0},{0.6,0},{0.71,0},{0.8,0}}" />
                     <Event Name="ThumbTrackStarted" Function="AudioMenu.AudioMusicScrollbar_started" />
                     <Event Name="ThumbTrackEnded" Function="AudioMenu.AudioMusicScrollbar_ended" />
                     <Event Name="ScrollPosChanged" Function="AudioMenu.AudioMusicScrollbar_changed" />
                 </Window>
+                <Window Type="TaharezLook/Checkbox" Name="orxonox/MusicCheckbox" >
+                    <Property Name="Text" Value="Mute" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.775,0},{0.45,0},{0.96,0},{0.9,0}}" />
+                    <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteMusicCheckbox_clicked"/>
+                </Window>
             </Window>
             <Window Type="TaharezLook/StaticText" Name="orxonox/EffectsVolume" >
-                <Property Name="Text" Value="Effects volume" />
+                <Property Name="Text" Value="Effects volume               " />
                 <Property Name="InheritsAlpha" Value="False" />
                 <Property Name="HorzFormatting" Value="HorzCentred" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="VertFormatting" Value="TopAligned" />
-                <Property Name="UnifiedAreaRect" Value="{{0.03,0},{0.7,0},{0.34,0},{0.9,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.041666,0},{0.7,0},{0.5625,0},{0.9,0}}" />
                 <Window Type="TaharezLook/HorizontalScrollbar" Name="orxonox/EffectsScrollbar" >
                     <Property Name="PageSize" Value="0" />
@@ -73,8 +85,14 @@
                     <Property Name="StepSize" Value="0.1" />
                     <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                    <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.6,0},{0.95,0},{0.8,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.04,0},{0.6,0},{0.71,0},{0.8,0}}" />
                     <Event Name="ThumbTrackStarted" Function="AudioMenu.AudioEffectsScrollbar_started" />
                     <Event Name="ThumbTrackEnded" Function="AudioMenu.AudioEffectsScrollbar_ended" />
                     <Event Name="ScrollPosChanged" Function="AudioMenu.AudioEffectsScrollbar_changed" />
+                </Window>
+                <Window Type="TaharezLook/Checkbox" Name="orxonox/EffectsCheckbox" >
+                    <Property Name="Text" Value="Mute" />
+                    <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
+                    <Property Name="UnifiedAreaRect" Value="{{0.775,0},{0.45,0},{0.96,0},{0.9,0}}" />
+                    <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteEffectsCheckbox_clicked"/>
                 </Window>
             </Window>
@@ -85,5 +103,5 @@
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="VertFormatting" Value="TopAligned" />
-                <Property Name="UnifiedAreaRect" Value="{{0.66,0},{0.2,0},{0.97,0},{0.9,0}}" />
+                <Property Name="UnifiedAreaRect" Value="{{0.604166,0},{0.2,0},{0.958333,0},{0.9,0}}" />
                 <Window Type="TaharezLook/Combobox" Name="orxonox/AudioThemeCombobox" >
                     <Property Name="AlwaysOnTop" Value="True" />
@@ -95,22 +113,4 @@
                 </Window>
             </Window>
-            <Window Type="TaharezLook/Checkbox" Name="orxonox/MasterCheckbox" >
-                <Property Name="Text" Value="Mute master" />
-                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                <Property Name="UnifiedAreaRect" Value="{{0.375,0},{0.275,0},{0.625,0},{0.375,0}}" />
-                <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteMasterCheckbox_clicked"/>
-            </Window>
-            <Window Type="TaharezLook/Checkbox" Name="orxonox/MusicCheckbox" >
-                <Property Name="Text" Value="Mute music" />
-                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                <Property Name="UnifiedAreaRect" Value="{{0.375,0},{0.525,0},{0.625,0},{0.625,0}}" />
-                <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteMusicCheckbox_clicked"/>
-            </Window>
-            <Window Type="TaharezLook/Checkbox" Name="orxonox/EffectsCheckbox" >
-                <Property Name="Text" Value="Mute effects" />
-                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-                <Property Name="UnifiedAreaRect" Value="{{0.375,0},{0.775,0},{0.625,0},{0.875,0}}" />
-                <Event Name="CheckStateChanged" Function="AudioMenu.AudioMuteEffectsCheckbox_clicked"/>
-            </Window>
         </Window>
         <Window Type="TaharezLook/Button" Name="orxonox/AudioBackButton" >
@@ -120,13 +120,4 @@
             <Event Name="Clicked" Function="AudioMenu.AudioBackButton_clicked"/>
         </Window>
-        <Window Type="TaharezLook/StaticText" Name="orxonox/AudioAvailable" >
-            <Property Name="Text" Value="Changes in audio settings are not yet available." />
-            <Property Name="TextColours" Value="FFFF0000" />
-            <Property Name="InheritsAlpha" Value="False" />
-            <Property Name="HorzFormatting" Value="HorzCentred" />
-            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
-            <Property Name="VertFormatting" Value="TopAligned" />
-            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.75,0},{0.75,0},{0.8,0}}" />
-        </Window>
     </Window>
 </GUILayout>
Index: code/branches/presentation2/data/gui/layouts/SettingsMenu.layout
===================================================================
--- code/branches/presentation2/data/gui/layouts/SettingsMenu.layout	(revision 6230)
+++ code/branches/presentation2/data/gui/layouts/SettingsMenu.layout	(revision 6233)
@@ -26,4 +26,5 @@
             <Window Type="TaharezLook/Button" Name="orxonox/MultiplayerOptionsButton" >
                 <Property Name="Text" Value="Multiplayer options" />
+                <Property Name="Disabled" Value="True" />
                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.454545,0},{0.45,0},{0.636363,0}}" />
Index: code/branches/presentation2/data/gui/scripts/AudioMenu.lua
===================================================================
--- code/branches/presentation2/data/gui/scripts/AudioMenu.lua	(revision 6230)
+++ code/branches/presentation2/data/gui/scripts/AudioMenu.lua	(revision 6233)
@@ -14,4 +14,5 @@
 function P:init()
     soundMgr = orxonox.SoundManager:getInstance()
+    block = false
     masterscrollbar_active = false
     musicscrollbar_active = false
@@ -20,11 +21,21 @@
     musicvolume = soundMgr:getVolume(orxonox.SoundType.ambient)
     effectsvolume = soundMgr:getVolume(orxonox.SoundType.effects)
-    window = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar")
-    window:setScrollPosition(mastervolume)
-    window = tolua.cast(winMgr:getWindow("orxonox/MusicScrollbar"),"CEGUI::Scrollbar")
-    window:setScrollPosition(musicvolume)
-    window = tolua.cast(winMgr:getWindow("orxonox/EffectsScrollbar"),"CEGUI::Scrollbar")
-    window:setScrollPosition(effectsvolume)
-    dropdown = winMgr:getWindow("orxonox/AudioThemeCombobox")
+    mastermute = soundMgr:getMute(orxonox.SoundType.none)
+    musicmute = soundMgr:getMute(orxonox.SoundType.ambient)
+    effectsmute = soundMgr:getMute(orxonox.SoundType.effects)
+    masterscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar")
+    musicscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/MusicScrollbar"),"CEGUI::Scrollbar")
+    effectsscrollbarwindow = tolua.cast(winMgr:getWindow("orxonox/EffectsScrollbar"),"CEGUI::Scrollbar")
+    mastermutewindow = tolua.cast(winMgr:getWindow("orxonox/MasterCheckbox"),"CEGUI::Checkbox")
+    musicmutewindow = tolua.cast(winMgr:getWindow("orxonox/MusicCheckbox"),"CEGUI::Checkbox")
+    effectsmutewindow = tolua.cast(winMgr:getWindow("orxonox/EffectsCheckbox"),"CEGUI::Checkbox")
+    masterscrollbarwindow:setScrollPosition(mastervolume)
+    musicscrollbarwindow:setScrollPosition(musicvolume)
+    effectsscrollbarwindow:setScrollPosition(effectsvolume)
+    mastermutewindow:setSelected(mastermute)
+    musicmutewindow:setSelected(musicmute)
+    effectsmutewindow:setSelected(effectsmute)
+    choice = "Default"
+    dropdownwindow = winMgr:getWindow("orxonox/AudioThemeCombobox")
     local themeList = {}
     table.insert(themeList, "Default")
@@ -33,13 +44,19 @@
         item = CEGUI.createListboxTextItem(v)        
         item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
-        CEGUI.toCombobox(dropdown):addItem(item)
+        CEGUI.toCombobox(dropdownwindow):addItem(item)
     end
+    dropdownwindow:setItemSelectState(0,true)
 end
 
 function P.AudioMasterScrollbar_changed(e)
+    if mastermute then
+        block = true
+        mastermutewindow:setSelected(false)
+        block = false
+        mastermute = false
+    end
     if masterscrollbar_active == false then
-        window = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar")
-        volume = window:getScrollPosition()
-        orxonox.CommandExecutor:execute("config SoundManager soundVolume_ " .. volume)
+        mastervolume = masterscrollbarwindow:getScrollPosition()
+        orxonox.CommandExecutor:execute("config SoundManager soundVolume_ " .. mastervolume)
     end
 end
@@ -50,15 +67,19 @@
 
 function P.AudioMasterScrollbar_ended(e)
-    window = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar")
-    volume = window:getScrollPosition()
-    orxonox.CommandExecutor:execute("config SoundManager soundVolume_ " .. volume)
+    mastervolume = masterscrollbarwindow:getScrollPosition()
+    orxonox.CommandExecutor:execute("config SoundManager soundVolume_ " .. mastervolume)
     masterscrollbar_active = false
 end
 
 function P.AudioMusicScrollbar_changed(e)
+    if musicmute then
+        block = true
+        musicmutewindow:setSelected(false)
+        block = false
+        musicmute = false
+    end
     if musicscrollbar_active == false then
-        window = tolua.cast(winMgr:getWindow("orxonox/MusicScrollbar"),"CEGUI::Scrollbar")
-        volume = window:getScrollPosition()
-        orxonox.CommandExecutor:execute("config SoundManager ambientVolume_ " .. volume)
+        musicvolume = musicscrollbarwindow:getScrollPosition()
+        orxonox.CommandExecutor:execute("config SoundManager ambientVolume_ " .. musicvolume)
     end
 end
@@ -69,15 +90,20 @@
 
 function P.AudioMusicScrollbar_ended(e)
-    window = tolua.cast(winMgr:getWindow("orxonox/MusicScrollbar"),"CEGUI::Scrollbar")
-    volume = window:getScrollPosition()
-    orxonox.CommandExecutor:execute("config SoundManager ambientVolume_ " .. volume)
+    musicmutewindow:setSelected(false)
+    musicvolume = musicscrollbarwindow:getScrollPosition()
+    orxonox.CommandExecutor:execute("config SoundManager ambientVolume_ " .. musicvolume)
     musicscrollbar_active = false
 end
 
 function P.AudioEffectsScrollbar_changed(e)
+    if effectsmute then
+        block = true
+        effectsmutewindow:setSelected(false)
+        block = false
+        effectsmute = false
+    end
     if effectsscrollbar_active == false then
-        window = tolua.cast(winMgr:getWindow("orxonox/EffectsScrollbar"),"CEGUI::Scrollbar")
-        volume = window:getScrollPosition()
-        orxonox.CommandExecutor:execute("config SoundManager effectsVolume_ " .. volume)
+        effectsvolume = effectsscrollbarwindow:getScrollPosition()
+        orxonox.CommandExecutor:execute("config SoundManager effectsVolume_ " .. effectsvolume)
     end
 end
@@ -88,37 +114,61 @@
 
 function P.AudioEffectsScrollbar_ended(e)
-    window = tolua.cast(winMgr:getWindow("orxonox/EffectsScrollbar"),"CEGUI::Scrollbar")
-    volume = window:getScrollPosition()
-    orxonox.CommandExecutor:execute("config SoundManager effectsVolume_ " .. volume)
+    effectsmutewindow:setSelected(false)
+    effectsvolume = effectsscrollbarwindow:getScrollPosition()
+    orxonox.CommandExecutor:execute("config SoundManager effectsVolume_ " .. effectsvolume)
     effectsscrollbar_active = false
 end
 
 function P.AudioMuteMasterCheckbox_clicked(e)
---    if
---        mastervolume = soundMgr:getVolume(orxonox.SoundType.none)
---        window = tolua.cast(winMgr:getWindow("orxonox/MasterScrollbar"),"CEGUI::Scrollbar")
---        window:setScrollPosition(0)
---    end
-    soundMgr:toggleMute(orxonox.SoundType.none)
+    if block == false then
+        if mastermute then
+            masterscrollbarwindow:setScrollPosition(mastervolume)
+            mastermute = false
+        else
+            temp = masterscrollbarwindow:getScrollPosition()
+            masterscrollbarwindow:setScrollPosition(0)
+            mastervolume = temp
+            mastermute = true
+        end
+        soundMgr:toggleMute(orxonox.SoundType.none)
+    end
 end
 
 function P.AudioMuteMusicCheckbox_clicked(e)
-    soundMgr:toggleMute(orxonox.SoundType.ambient)
+    if block == false then
+        if musicmute then
+            musicscrollbarwindow:setScrollPosition(musicvolume)
+            musicmute = false
+        else
+            temp = musicscrollbarwindow:getScrollPosition()
+            musicscrollbarwindow:setScrollPosition(0)
+            musicvolume = temp
+            musicmute = true
+        end
+        soundMgr:toggleMute(orxonox.SoundType.ambient)
+    end
 end
 
 function P.AudioMuteEffectsCheckbox_clicked(e)
-    soundMgr:toggleMute(orxonox.SoundType.effects)
+    if block == false then
+        if effectsmute then
+            effectsscrollbarwindow:setScrollPosition(effectsvolume)
+            effectsmute = false
+        else
+            temp = effectsscrollbarwindow:getScrollPosition()
+            effectsscrollbarwindow:setScrollPosition(0)
+            effectsvolume = temp
+            effectsmute = true
+        end
+        soundMgr:toggleMute(orxonox.SoundType.effects)
+    end
 end
 
 function P.AudioThemeCombobox_changed(e)
---    local choice = winMgr:getWindow("orxonox/AudioThemeCombobox"):getFirstSelectedItem()
---    if choice == "Default" then
---        orxonox.CommandExecutor:execute("setMood default")
---        debug("default selected")
---    end
---    if choice == "Drum 'n Bass" then
---        orxonox.CommandExecutor:execute("setMood dnb")
---        debug("dnb selected")
---    end
+    if dropdownwindow:isItemSelected(1) then
+        orxonox.CommandExecutor:execute("setMood dnb")
+    else
+        orxonox.CommandExecutor:execute("setMood default")
+    end
 end
 
