[Orxonox-commit 4380] r9051 - code/trunk/data/gui/scripts

dafrick at orxonox.net dafrick at orxonox.net
Wed Mar 21 21:32:23 CET 2012


Author: dafrick
Date: 2012-03-21 21:32:23 +0100 (Wed, 21 Mar 2012)
New Revision: 9051

Modified:
   code/trunk/data/gui/scripts/GraphicsMenu.lua
Log:
Resolving some issues with typecasts and comboboxes in graphics menu.


Modified: code/trunk/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- code/trunk/data/gui/scripts/GraphicsMenu.lua	2012-03-21 20:31:38 UTC (rev 9050)
+++ code/trunk/data/gui/scripts/GraphicsMenu.lua	2012-03-21 20:32:23 UTC (rev 9051)
@@ -33,8 +33,8 @@
     -----------------
 
     -- resolution combobox
-    local resolutionCombobox = winMgr:getWindow("orxonox/Display/Resolution/Combobox")
-    CEGUI.toCombobox(resolutionCombobox):setReadOnly(true)
+    local resolutionCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/Resolution/Combobox"))
+    resolutionCombobox:setReadOnly(true)
 
     for k,v in pairs(P.resolutionList) do
         local item = CEGUI.createListboxTextItem(v)
@@ -43,8 +43,8 @@
     end
 
     -- themes combobox
-    local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")
-    CEGUI.toCombobox(themeCombobox):setReadOnly(true)
+    local themeCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/Theme/Combobox"))
+    themeCombobox:setReadOnly(true)
 
     for k,v in pairs(P.schemeList) do
         local item = CEGUI.createListboxTextItem(v)
@@ -53,8 +53,8 @@
     end
 
     -- fsaa combobox
-    local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")
-    CEGUI.toCombobox(fsaaCombobox):setReadOnly(true)
+    local fsaaCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/More/FSAA"))
+    fsaaCombobox:setReadOnly(true)
 
     for k,v in pairs(P.fsaaList) do
         local item = CEGUI.createListboxTextItem(v)
@@ -63,8 +63,8 @@
     end
 
     -- particle lod combobox
-    local particleLodCombobox = winMgr:getWindow("orxonox/Settings/ParticleLodCombobox")
-    CEGUI.toCombobox(particleLodCombobox):setReadOnly(true)
+    local particleLodCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Settings/ParticleLodCombobox"))
+    particleLodCombobox:setReadOnly(true)
 
     for k,v in pairs(P.particleLodList) do
         local item = CEGUI.createListboxTextItem(v)
@@ -90,7 +90,7 @@
     aspectRatioEditbox:setText(currentAspectRatio)
 
     -- themes combobox
-    local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")
+    local themeCombobox =  CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/Theme/Combobox"))
     local currentTheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
 
     for i = 0, themeCombobox:getDropList():getItemCount() - 1 do
@@ -104,7 +104,7 @@
     CEGUI.toCheckbox(vsyncCheckbox):setSelected(hasVSync)
 
     -- fsaa combobox
-    local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")
+    local fsaaCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/More/FSAA"))
     local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode()
 
     for i = 0, fsaaCombobox:getDropList():getItemCount() - 1 do
@@ -130,7 +130,7 @@
     fpsEditbox:setText(currentFpsLimit)
 
     -- particle lod combobox
-    local particleLodCombobox = winMgr:getWindow("orxonox/Settings/ParticleLodCombobox")
+    local particleLodCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Settings/ParticleLodCombobox"))
     local currentParticleLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings particlesDetailLevel")
 
     if currentParticleLod == "" then
@@ -172,7 +172,7 @@
     CEGUI.toCheckbox(fullscreenCheckbox):setSelected(isFullscreen)
 
     -- resolution combobox
-    local resolutionCombobox = winMgr:getWindow("orxonox/Display/Resolution/Combobox")
+    local resolutionCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/Resolution/Combobox"))
 
     local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
     local currentHeight = orxonox.GraphicsManager:getInstance():getWindowHeight()
@@ -201,7 +201,7 @@
 -- updates the text of the resolution checkboxes and checks if they should be enabled (only if the "custom" resolution was selected)
 function P.updateResolutionEditboxes()
     -- resolution combobox
-    local resolutionCombobox = winMgr:getWindow("orxonox/Display/Resolution/Combobox")
+    local resolutionCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Display/Resolution/Combobox"))
 
     local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
     local currentHeight = orxonox.GraphicsManager:getInstance():getWindowHeight()
@@ -396,7 +396,7 @@
     orxonox.CommandExecutor:execute("config GraphicsSettings fpsLimit " .. fpsEditbox:getText())
 
     -- particle lod
-    local particleLodCombobox = winMgr:getWindow("orxonox/Settings/ParticleLodCombobox")
+    local particleLodCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Settings/ParticleLodCombobox"))
     local item = particleLodCombobox:getSelectedItem()
     if item then
         orxonox.CommandExecutor:execute("config GraphicsSettings particlesDetailLevel " .. particleLodCombobox:getItemIndex(item))




More information about the Orxonox-commit mailing list