Changeset 8019
- Timestamp:
- Mar 5, 2011, 5:59:17 PM (14 years ago)
- Location:
- code/branches/usability/data/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/usability/data/gui/layouts/GraphicsMenu.layout
r8018 r8019 132 132 <Window Type="MenuWidgets/StaticText" Name="orxonox/Display/NoticeRed" > 133 133 <Property Name="Font" Value="BlueHighway-12" /> 134 <Property Name="Text" >Changing the theme, FSAA, 135 or VSync requires a restart</Property> 134 <Property Name="Text" >Restart required</Property> 136 135 <Property Name="TextColours" Value="tl:FFFF0000 tr:FFFF8888 bl:FFFF8888 br:FFFFFFFF" /> 137 136 <Property Name="HorzFormatting" Value="HorzCentred" /> -
code/branches/usability/data/gui/scripts/GraphicsMenu.lua
r8018 r8019 92 92 -- themes combobox 93 93 local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox") 94 local current Scheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")94 local currentTheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_") 95 95 96 96 for i = 0, themeCombobox:getDropList():getItemCount() - 1 do 97 97 local item = themeCombobox:getListboxItemFromIndex(i) 98 themeCombobox:setItemSelectState(item, (item:getText() == current Scheme))98 themeCombobox:setItemSelectState(item, (item:getText() == currentTheme)) 99 99 end 100 100 … … 114 114 115 115 -- notice 116 local notice = winMgr:getWindow("orxonox/Display/Notice") 117 notice:setVisible(true) 118 local noticeRed = winMgr:getWindow("orxonox/Display/NoticeRed") 119 noticeRed:setVisible(false) 116 self:updateRedLabel() 120 117 121 118 ------------------ … … 252 249 end 253 250 254 function P.makeLabelRed() 251 function P.updateRedLabel() 252 -- theme 253 local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox") 254 local currentTheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_") 255 local themeChanged = (currentTheme ~= themeCombobox:getText()) 256 257 -- vsync 258 local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync") 259 local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled() 260 local vsyncChanged = (hasVSync ~= CEGUI.toCheckbox(vsyncCheckbox):isSelected()) 261 262 -- fsaa 263 local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA") 264 local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode() 265 local fsaaChanged = (currentFSAAMode ~= fsaaCombobox:getText()) 266 267 local needRestart = themeChanged or vsyncChanged or fsaaChanged 268 255 269 local notice = winMgr:getWindow("orxonox/Display/Notice") 256 notice:setVisible( false)270 notice:setVisible(not needRestart) 257 271 local noticeRed = winMgr:getWindow("orxonox/Display/NoticeRed") 258 noticeRed:setVisible( true)272 noticeRed:setVisible(needRestart) 259 273 end 260 274 … … 284 298 285 299 function P.callback_ThemeCombobox_ListSelectionAccepted(e) 286 P. makeLabelRed()300 P.updateRedLabel() 287 301 end 288 302 … … 290 304 291 305 function P.callback_VSyncCheckbox_CheckStateChanged(e) 292 P. makeLabelRed()306 P.updateRedLabel() 293 307 end 294 308 … … 296 310 297 311 function P.callback_FSAACombobox_ListSelectionAccepted(e) 298 P. makeLabelRed()312 P.updateRedLabel() 299 313 end 300 314 … … 325 339 -- vsync 326 340 local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync") 327 orxonox.CommandExecutor:execute("GraphicsManager setVSync " .. tostring(CEGUI.toCheckbox(vsyncCheckbox):isSelected())) 341 local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled() 342 if hasVSync ~= CEGUI.toCheckbox(vsyncCheckbox):isSelected() then 343 orxonox.CommandExecutor:execute("GraphicsManager setVSync " .. tostring(CEGUI.toCheckbox(vsyncCheckbox):isSelected())) 344 end 328 345 329 346 -- fsaa 330 347 local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA") 331 orxonox.CommandExecutor:execute("GraphicsManager setFSAA {" .. fsaaCombobox:getText() .. "}") -- enclose argument in { ... } because it can contain [brackets] (conflicts with tcl) 348 local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode() 349 if currentFSAAMode ~= fsaaCombobox:getText() then 350 orxonox.CommandExecutor:execute("GraphicsManager setFSAA {" .. fsaaCombobox:getText() .. "}") -- enclose argument in { ... } because it can contain [brackets] (conflicts with tcl) 351 end 332 352 333 353 -- fov
Note: See TracChangeset
for help on using the changeset viewer.