- Timestamp:
- Feb 24, 2018, 1:05:32 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cegui0.8_ogre1.9/data/gui/scripts/GraphicsMenu.lua
r11795 r11800 14 14 15 15 P:setButton(1, 1, { 16 ["button"] = winMgr:getWindow("orxonox/GraphicsOkButton"),16 ["button"] = P.window:getChild("GraphicsOkButton"), 17 17 ["callback"] = P.callback_Ok_Clicked 18 18 }) 19 19 20 20 P:setButton(1, 2, { 21 ["button"] = winMgr:getWindow("orxonox/GraphicsCancelButton"),21 ["button"] = P.window:getChild("GraphicsCancelButton"), 22 22 ["callback"] = P.callback_Cancel_Clicked 23 23 }) … … 25 25 -- place apply button at the bottom in the matrix, even though it's in fact at the top, to make the OK button highlighted by default 26 26 P:setButton(2, 1, { 27 ["button"] = winMgr:getWindow("orxonox/Display/Resolution/Apply"),27 ["button"] = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Apply"), 28 28 ["callback"] = P.callback_Apply_Clicked 29 29 }) … … 34 34 35 35 -- resolution combobox 36 local resolutionCombobox = CEGUI.toCombobox( winMgr:getWindow("orxonox/Display/Resolution/Combobox"))36 local resolutionCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Combobox")) 37 37 resolutionCombobox:setReadOnly(true) 38 38 … … 44 44 45 45 -- themes combobox 46 local themeCombobox = CEGUI.toCombobox( winMgr:getWindow("orxonox/Display/Theme/Combobox"))46 local themeCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Theme/Combobox")) 47 47 themeCombobox:setReadOnly(true) 48 48 … … 54 54 55 55 -- fsaa combobox 56 local fsaaCombobox = CEGUI.toCombobox( winMgr:getWindow("orxonox/Display/More/FSAA"))56 local fsaaCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/FSAA")) 57 57 fsaaCombobox:setReadOnly(true) 58 58 … … 64 64 65 65 -- particle lod combobox 66 local particleLodCombobox = CEGUI.toCombobox( winMgr:getWindow("orxonox/Settings/ParticleLodCombobox"))66 local particleLodCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/ParticleLodCombobox")) 67 67 particleLodCombobox:setReadOnly(true) 68 68 … … 86 86 87 87 -- aspect ratio editbox 88 local aspectRatioEditbox = winMgr:getWindow("orxonox/Display/Resolution/AspectRatio")88 local aspectRatioEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/AspectRatio") 89 89 local currentAspectRatio = orxonox.CommandExecutor:query("getConfig Camera aspectRatio_") 90 90 aspectRatioEditbox:setText(currentAspectRatio) 91 91 92 92 -- themes combobox 93 local themeCombobox = CEGUI.toCombobox( winMgr:getWindow("orxonox/Display/Theme/Combobox"))93 local themeCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Theme/Combobox")) 94 94 local currentTheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_") 95 95 … … 100 100 101 101 -- vsync checkbox 102 local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")102 local vsyncCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/VSync") 103 103 local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled() 104 104 CEGUI.toCheckbox(vsyncCheckbox):setSelected(hasVSync) 105 105 106 106 -- fsaa combobox 107 local fsaaCombobox = CEGUI.toCombobox( winMgr:getWindow("orxonox/Display/More/FSAA"))107 local fsaaCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/FSAA")) 108 108 local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode() 109 109 … … 121 121 122 122 -- fov editbox 123 local fovEditbox = winMgr:getWindow("orxonox/Settings/Fov")123 local fovEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/Fov") 124 124 local currentFov = orxonox.CommandExecutor:query("getConfig Camera fov_") 125 125 fovEditbox:setText(currentFov) 126 126 127 127 -- fps limit editbox 128 local fpsEditbox = winMgr:getWindow("orxonox/Settings/FpsLimit")128 local fpsEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/FpsLimit") 129 129 local currentFpsLimit = orxonox.CommandExecutor:query("getConfig GraphicsSettings fpsLimit") 130 130 fpsEditbox:setText(currentFpsLimit) 131 131 132 132 -- particle lod combobox 133 local particleLodCombobox = CEGUI.toCombobox( winMgr:getWindow("orxonox/Settings/ParticleLodCombobox"))133 local particleLodCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/ParticleLodCombobox")) 134 134 local currentParticleLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings particlesDetailLevel") 135 135 … … 146 146 147 147 -- mesh lod checkbox 148 local meshLodCheckbox = winMgr:getWindow("orxonox/Settings/MeshLodCheckbox")148 local meshLodCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MeshLodCheckbox") 149 149 local hasMeshLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings enableMeshLoD") 150 150 if hasMeshLod == "true" then … … 156 156 157 157 -- motion blur checkbox 158 local motionBlurCheckbox = winMgr:getWindow("orxonox/Settings/MotionBlurCheckbox")158 local motionBlurCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MotionBlurCheckbox") 159 159 local hasMotionBlur = orxonox.CommandExecutor:query("getConfig GraphicsSettings enableMotionBlur") 160 160 if hasMotionBlur == "true" then … … 168 168 function P:onWindowResized() 169 169 -- fullscreen checkbox 170 local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")170 local fullscreenCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Fullscreen") 171 171 local isFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen() 172 172 CEGUI.toCheckbox(fullscreenCheckbox):setSelected(isFullscreen) 173 173 174 174 -- resolution combobox 175 local resolutionCombobox = CEGUI.toCombobox( winMgr:getWindow("orxonox/Display/Resolution/Combobox"))175 local resolutionCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Combobox")) 176 176 177 177 local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth() … … 202 202 function P.updateResolutionEditboxes() 203 203 -- resolution combobox 204 local resolutionCombobox = CEGUI.toCombobox( winMgr:getWindow("orxonox/Display/Resolution/Combobox"))204 local resolutionCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Combobox")) 205 205 206 206 local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth() … … 208 208 209 209 -- resolution editboxes 210 local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth")211 local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")210 local widthEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxWidth") 211 local heightEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxHeight") 212 212 widthEditbox:disable() 213 213 heightEditbox:disable() … … 233 233 function P.updateApplyButton() 234 234 -- fullscreen checkbox 235 local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")235 local fullscreenCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Fullscreen") 236 236 local isFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen() 237 237 local fullscreenChanged = (isFullscreen ~= CEGUI.toCheckbox(fullscreenCheckbox):isSelected()) 238 238 239 239 -- resolution editboxes 240 local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth")241 local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")240 local widthEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxWidth") 241 local heightEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxHeight") 242 242 local currentWidth = tostring(orxonox.GraphicsManager:getInstance():getWindowWidth()) 243 243 local currentHeight = tostring(orxonox.GraphicsManager:getInstance():getWindowHeight()) … … 247 247 248 248 -- apply button 249 local applyButton = winMgr:getWindow("orxonox/Display/Resolution/Apply")249 local applyButton = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Apply") 250 250 251 251 if fullscreenChanged or widthChanged or heightChanged or resolutionEditboxesEnabled then … … 258 258 function P.updateRedLabel() 259 259 -- theme 260 local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")260 local themeCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Theme/Combobox") 261 261 local currentTheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_") 262 262 local themeChanged = (currentTheme ~= themeCombobox:getText()) 263 263 264 264 -- vsync 265 local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")265 local vsyncCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/VSync") 266 266 local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled() 267 267 local vsyncChanged = (hasVSync ~= CEGUI.toCheckbox(vsyncCheckbox):isSelected()) 268 268 269 269 -- fsaa 270 local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")270 local fsaaCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/FSAA") 271 271 local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode() 272 272 local fsaaChanged = (currentFSAAMode ~= fsaaCombobox:getText()) … … 274 274 local needRestart = themeChanged or vsyncChanged or fsaaChanged 275 275 276 local notice = winMgr:getWindow("orxonox/Display/Notice")276 local notice = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Notice") 277 277 notice:setVisible(not needRestart) 278 local noticeRed = winMgr:getWindow("orxonox/Display/NoticeRed")278 local noticeRed = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/NoticeRed") 279 279 noticeRed:setVisible(needRestart) 280 280 end … … 286 286 -- resolution 287 287 288 function P.callback_FullscreenCheckbox_ CheckStateChanged(e)288 function P.callback_FullscreenCheckbox_SelectStateChanged(e) 289 289 P.updateApplyButton() 290 290 end … … 310 310 -- vsync 311 311 312 function P.callback_VSyncCheckbox_ CheckStateChanged(e)312 function P.callback_VSyncCheckbox_SelectStateChanged(e) 313 313 P.updateRedLabel() 314 314 end … … 324 324 function P.callback_Apply_Clicked(e) 325 325 -- resolution 326 local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")326 local fullscreenCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Fullscreen") 327 327 local checkedFullscreen = tostring(CEGUI.toCheckbox(fullscreenCheckbox):isSelected()) 328 328 329 local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth")330 local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")329 local widthEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxWidth") 330 local heightEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/EditboxHeight") 331 331 332 332 P.newWidth = widthEditbox:getText() … … 339 339 P.oldFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen() 340 340 341 P.revertTimerHandle = orxonox.CommandExecutor:query("delayreal 10 {hideGUI DecisionPopup; GraphicsManager setScreenResolution " .. P.oldWidth .. " " .. P.oldHeight .. " " .. tostring(P.oldFullscreen) .. "; config Core lastLevelTimestamp_ [expr [getConfig CoreogreConfigTimestamp_] + 1]}")341 P.revertTimerHandle = orxonox.CommandExecutor:query("delayreal 10 {hideGUI DecisionPopup; GraphicsManager setScreenResolution " .. P.oldWidth .. " " .. P.oldHeight .. " " .. tostring(P.oldFullscreen) .. "; config CoreConfig lastLevelTimestamp_ [expr [getConfig CoreConfig ogreConfigTimestamp_] + 1]}") 342 342 343 343 -- change settings … … 362 362 363 363 -- update timestamp to avoid showing the ogre config dialog again after the user accepted or reverted the resolution 364 orxonox.CommandExecutor:execute("config Core lastLevelTimestamp_ [expr [getConfig CoreogreConfigTimestamp_] + 1]")364 orxonox.CommandExecutor:execute("config CoreConfig lastLevelTimestamp_ [expr [getConfig CoreConfig ogreConfigTimestamp_] + 1]") 365 365 end 366 366 367 367 function P.callback_Ok_Clicked(e) 368 368 -- aspect ratio 369 local aspectRatioEditbox = winMgr:getWindow("orxonox/Display/Resolution/AspectRatio")369 local aspectRatioEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/AspectRatio") 370 370 orxonox.CommandExecutor:execute("config Camera aspectRatio_ " .. aspectRatioEditbox:getText()) 371 371 372 372 -- theme 373 local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")373 local themeCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Theme/Combobox") 374 374 orxonox.CommandExecutor:execute("config GUIManager guiScheme_ " .. themeCombobox:getText()) 375 375 376 376 -- vsync 377 local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")377 local vsyncCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/VSync") 378 378 local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled() 379 379 if hasVSync ~= CEGUI.toCheckbox(vsyncCheckbox):isSelected() then … … 382 382 383 383 -- fsaa 384 local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")384 local fsaaCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/FSAA") 385 385 local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode() 386 386 if currentFSAAMode ~= fsaaCombobox:getText() then … … 389 389 390 390 -- fov 391 local fovEditbox = winMgr:getWindow("orxonox/Settings/Fov")391 local fovEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/Fov") 392 392 orxonox.CommandExecutor:execute("config Camera fov_ " .. fovEditbox:getText()) 393 393 394 394 -- fps limit 395 local fpsEditbox = winMgr:getWindow("orxonox/Settings/FpsLimit")395 local fpsEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/FpsLimit") 396 396 orxonox.CommandExecutor:execute("config GraphicsSettings fpsLimit " .. fpsEditbox:getText()) 397 397 398 398 -- particle lod 399 local particleLodCombobox = CEGUI.toCombobox( winMgr:getWindow("orxonox/Settings/ParticleLodCombobox"))399 local particleLodCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/ParticleLodCombobox")) 400 400 local item = particleLodCombobox:getSelectedItem() 401 401 if item then … … 404 404 405 405 -- mesh lod 406 local meshLodCheckbox = winMgr:getWindow("orxonox/Settings/MeshLodCheckbox")406 local meshLodCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MeshLodCheckbox") 407 407 orxonox.CommandExecutor:execute("config GraphicsSettings enableMeshLoD " .. tostring(CEGUI.toCheckbox(meshLodCheckbox):isSelected())) 408 408 409 409 -- motion blur 410 local motionBlurCheckbox = winMgr:getWindow("orxonox/Settings/MotionBlurCheckbox")410 local motionBlurCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MotionBlurCheckbox") 411 411 orxonox.CommandExecutor:execute("config GraphicsSettings enableMotionBlur " .. tostring(CEGUI.toCheckbox(motionBlurCheckbox):isSelected())) 412 412
Note: See TracChangeset
for help on using the changeset viewer.