[Orxonox-commit 3640] r8325 - in code/branches/kicklib2: data/gui/scripts src/orxonox/sound

dafrick at orxonox.net dafrick at orxonox.net
Mon Apr 25 10:09:05 CEST 2011


Author: dafrick
Date: 2011-04-25 10:09:04 +0200 (Mon, 25 Apr 2011)
New Revision: 8325

Modified:
   code/branches/kicklib2/data/gui/scripts/SettingsMenu.lua
   code/branches/kicklib2/src/orxonox/sound/SoundManager.h
Log:
AudioMenu is only accessible if the SoundManager exists.


Modified: code/branches/kicklib2/data/gui/scripts/SettingsMenu.lua
===================================================================
--- code/branches/kicklib2/data/gui/scripts/SettingsMenu.lua	2011-04-25 08:06:49 UTC (rev 8324)
+++ code/branches/kicklib2/data/gui/scripts/SettingsMenu.lua	2011-04-25 08:09:04 UTC (rev 8325)
@@ -34,6 +34,15 @@
     P:setButton(4, 2, P:getButton(4, 1))
 end
 
+function P.onShow()
+    local window = winMgr:getWindow("orxonox/SettingsMenu/AudioButton")
+    if not orxonox.SoundManager:exists() then
+        window:setProperty("Disabled", "true")
+    else
+        window:setProperty("Disabled", "false")
+    end
+end
+
 function P.SettingsGameplayButton_clicked(e)
     showMenuSheet("GameplayMenu", true)
 end

Modified: code/branches/kicklib2/src/orxonox/sound/SoundManager.h
===================================================================
--- code/branches/kicklib2/src/orxonox/sound/SoundManager.h	2011-04-25 08:06:49 UTC (rev 8324)
+++ code/branches/kicklib2/src/orxonox/sound/SoundManager.h	2011-04-25 08:09:04 UTC (rev 8325)
@@ -71,6 +71,7 @@
 
         // tolua_begin
         static SoundManager& getInstance() { return Singleton<SoundManager>::getInstance(); }
+        static bool exists() { return Singleton<SoundManager>::exists(); }
 
         std::string getDeviceName(unsigned int index) const
             { return index < this->deviceNames_.size() ? this->deviceNames_[index] : std::string(); }




More information about the Orxonox-commit mailing list