[6363] | 1 | -- GraphicsMenu.lua |
---|
| 2 | |
---|
[6746] | 3 | local P = createMenuSheet("GraphicsMenu") |
---|
[6363] | 4 | |
---|
[8018] | 5 | P.resolutionList = {"custom", "640 x 480", "720 x 480", "720 x 576", "800 x 600", "1024 x 600", "1024 x 768", "1152 x 864", "1280 x 720", "1280 x 800", "1280 x 960", "1280 x 1024", "1360 x 768", "1440 x 900", "1600 x 900", "1600 x 1200", "1680 x 1050"} |
---|
[7801] | 6 | P.schemeList = {"TaharezGreen", "Orxonox"} |
---|
[8018] | 7 | P.fsaaList = {"0", "2", "4", "8", "8 [Quality]"} |
---|
| 8 | P.particleLodList = {"None", "Low", "Normal", "High"} |
---|
[7689] | 9 | |
---|
[8018] | 10 | function P:onLoad() |
---|
| 11 | ------------------- |
---|
| 12 | -- Button matrix -- |
---|
| 13 | ------------------- |
---|
| 14 | |
---|
| 15 | P:setButton(1, 1, { |
---|
| 16 | ["button"] = winMgr:getWindow("orxonox/GraphicsOkButton"), |
---|
| 17 | ["callback"] = P.callback_Ok_Clicked |
---|
| 18 | }) |
---|
| 19 | |
---|
| 20 | P:setButton(1, 2, { |
---|
| 21 | ["button"] = winMgr:getWindow("orxonox/GraphicsCancelButton"), |
---|
| 22 | ["callback"] = P.callback_Cancel_Clicked |
---|
| 23 | }) |
---|
| 24 | |
---|
| 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 | P:setButton(2, 1, { |
---|
| 27 | ["button"] = winMgr:getWindow("orxonox/Display/Resolution/Apply"), |
---|
| 28 | ["callback"] = P.callback_Apply_Clicked |
---|
| 29 | }) |
---|
| 30 | |
---|
| 31 | ----------------- |
---|
| 32 | -- Combo boxes -- |
---|
| 33 | ----------------- |
---|
| 34 | |
---|
| 35 | -- resolution combobox |
---|
| 36 | local resolutionCombobox = winMgr:getWindow("orxonox/Display/Resolution/Combobox") |
---|
| 37 | CEGUI.toCombobox(resolutionCombobox):setReadOnly(true) |
---|
| 38 | |
---|
| 39 | for k,v in pairs(P.resolutionList) do |
---|
| 40 | local item = CEGUI.createListboxTextItem(v) |
---|
| 41 | item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") |
---|
| 42 | resolutionCombobox:addItem(item) |
---|
[6363] | 43 | end |
---|
[8018] | 44 | |
---|
| 45 | -- themes combobox |
---|
| 46 | local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox") |
---|
| 47 | CEGUI.toCombobox(themeCombobox):setReadOnly(true) |
---|
| 48 | |
---|
| 49 | for k,v in pairs(P.schemeList) do |
---|
| 50 | local item = CEGUI.createListboxTextItem(v) |
---|
[6746] | 51 | item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") |
---|
[8018] | 52 | themeCombobox:addItem(item) |
---|
[6363] | 53 | end |
---|
[8018] | 54 | |
---|
| 55 | -- fsaa combobox |
---|
| 56 | local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA") |
---|
| 57 | CEGUI.toCombobox(fsaaCombobox):setReadOnly(true) |
---|
| 58 | |
---|
| 59 | for k,v in pairs(P.fsaaList) do |
---|
| 60 | local item = CEGUI.createListboxTextItem(v) |
---|
| 61 | item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") |
---|
| 62 | fsaaCombobox:addItem(item) |
---|
[6363] | 63 | end |
---|
[7689] | 64 | |
---|
[8018] | 65 | -- particle lod combobox |
---|
| 66 | local particleLodCombobox = winMgr:getWindow("orxonox/Settings/ParticleLodCombobox") |
---|
| 67 | CEGUI.toCombobox(particleLodCombobox):setReadOnly(true) |
---|
[7801] | 68 | |
---|
[8018] | 69 | for k,v in pairs(P.particleLodList) do |
---|
| 70 | local item = CEGUI.createListboxTextItem(v) |
---|
[7801] | 71 | item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush") |
---|
[8018] | 72 | particleLodCombobox:addItem(item) |
---|
| 73 | end |
---|
| 74 | end |
---|
| 75 | |
---|
| 76 | function P:onShow() |
---|
| 77 | ----------------- |
---|
| 78 | -- Display tab -- |
---|
| 79 | ----------------- |
---|
| 80 | |
---|
| 81 | -- fullscreen checkbox / resolution combobox / resolution editboxes |
---|
| 82 | self:onWindowResized() |
---|
| 83 | |
---|
| 84 | -- apply button |
---|
| 85 | self.updateApplyButton() |
---|
| 86 | |
---|
| 87 | -- aspect ratio editbox |
---|
| 88 | local aspectRatioEditbox = winMgr:getWindow("orxonox/Display/Resolution/AspectRatio") |
---|
| 89 | local currentAspectRatio = orxonox.CommandExecutor:query("getConfig Camera aspectRatio_") |
---|
| 90 | aspectRatioEditbox:setText(currentAspectRatio) |
---|
| 91 | |
---|
| 92 | -- themes combobox |
---|
| 93 | local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox") |
---|
[8019] | 94 | local currentTheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_") |
---|
[8018] | 95 | |
---|
| 96 | for i = 0, themeCombobox:getDropList():getItemCount() - 1 do |
---|
| 97 | local item = themeCombobox:getListboxItemFromIndex(i) |
---|
[8019] | 98 | themeCombobox:setItemSelectState(item, (item:getText() == currentTheme)) |
---|
[8018] | 99 | end |
---|
| 100 | |
---|
| 101 | -- vsync checkbox |
---|
| 102 | local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync") |
---|
| 103 | local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled() |
---|
| 104 | CEGUI.toCheckbox(vsyncCheckbox):setSelected(hasVSync) |
---|
| 105 | |
---|
| 106 | -- fsaa combobox |
---|
| 107 | local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA") |
---|
| 108 | local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode() |
---|
| 109 | |
---|
| 110 | for i = 0, fsaaCombobox:getDropList():getItemCount() - 1 do |
---|
| 111 | local item = fsaaCombobox:getListboxItemFromIndex(i) |
---|
| 112 | fsaaCombobox:setItemSelectState(item, (item:getText() == currentFSAAMode)) |
---|
| 113 | end |
---|
| 114 | |
---|
| 115 | -- notice |
---|
[8019] | 116 | self:updateRedLabel() |
---|
[8018] | 117 | |
---|
| 118 | ------------------ |
---|
| 119 | -- Settings tab -- |
---|
| 120 | ------------------ |
---|
| 121 | |
---|
| 122 | -- fov editbox |
---|
| 123 | local fovEditbox = winMgr:getWindow("orxonox/Settings/Fov") |
---|
| 124 | local currentFov = orxonox.CommandExecutor:query("getConfig Camera fov_") |
---|
| 125 | fovEditbox:setText(currentFov) |
---|
| 126 | |
---|
| 127 | -- fps limit editbox |
---|
| 128 | local fpsEditbox = winMgr:getWindow("orxonox/Settings/FpsLimit") |
---|
| 129 | local currentFpsLimit = orxonox.CommandExecutor:query("getConfig GraphicsSettings fpsLimit") |
---|
| 130 | fpsEditbox:setText(currentFpsLimit) |
---|
| 131 | |
---|
| 132 | -- particle lod combobox |
---|
| 133 | local particleLodCombobox = winMgr:getWindow("orxonox/Settings/ParticleLodCombobox") |
---|
| 134 | local currentParticleLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings particlesDetailLevel") |
---|
| 135 | |
---|
| 136 | if currentParticleLod == "" then |
---|
| 137 | particleLodCombobox:disable() |
---|
| 138 | else |
---|
| 139 | particleLodCombobox:enable() |
---|
| 140 | |
---|
| 141 | for i = 0, particleLodCombobox:getDropList():getItemCount() - 1 do |
---|
| 142 | local item = particleLodCombobox:getListboxItemFromIndex(i) |
---|
| 143 | particleLodCombobox:setItemSelectState(item, (tostring(i) == currentParticleLod)) |
---|
[7801] | 144 | end |
---|
| 145 | end |
---|
| 146 | |
---|
[8018] | 147 | -- model lod checkbox |
---|
| 148 | local modelLodCheckbox = winMgr:getWindow("orxonox/Settings/ModelLodCheckbox") |
---|
| 149 | local hasModelLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings enableModelLoD") |
---|
| 150 | if hasModelLod == "true" then |
---|
| 151 | hasModelLod = true |
---|
| 152 | elseif hasModelLod == "false" then |
---|
| 153 | hasModelLod = false |
---|
| 154 | end |
---|
| 155 | CEGUI.toCheckbox(modelLodCheckbox):setSelected(hasModelLod) |
---|
| 156 | |
---|
| 157 | -- motion blur checkbox |
---|
| 158 | local motionBlurCheckbox = winMgr:getWindow("orxonox/Settings/MotionBlurCheckbox") |
---|
| 159 | local hasMotionBlur = orxonox.CommandExecutor:query("getConfig GraphicsSettings enableMotionBlur") |
---|
| 160 | if hasMotionBlur == "true" then |
---|
| 161 | hasMotionBlur = true |
---|
| 162 | elseif hasMotionBlur == "false" then |
---|
| 163 | hasMotionBlur = false |
---|
| 164 | end |
---|
| 165 | CEGUI.toCheckbox(motionBlurCheckbox):setSelected(hasMotionBlur) |
---|
[6363] | 166 | end |
---|
| 167 | |
---|
[8018] | 168 | function P:onWindowResized() |
---|
| 169 | -- fullscreen checkbox |
---|
| 170 | local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen") |
---|
| 171 | local isFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen() |
---|
| 172 | CEGUI.toCheckbox(fullscreenCheckbox):setSelected(isFullscreen) |
---|
| 173 | |
---|
| 174 | -- resolution combobox |
---|
| 175 | local resolutionCombobox = winMgr:getWindow("orxonox/Display/Resolution/Combobox") |
---|
| 176 | |
---|
| 177 | local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth() |
---|
| 178 | local currentHeight = orxonox.GraphicsManager:getInstance():getWindowHeight() |
---|
| 179 | local currentResolution = currentWidth .. " x " .. currentHeight |
---|
| 180 | |
---|
| 181 | for i = 0, resolutionCombobox:getDropList():getItemCount() - 1 do |
---|
| 182 | local item = resolutionCombobox:getListboxItemFromIndex(i) |
---|
| 183 | resolutionCombobox:setItemSelectState(item, item:getText() == currentResolution) |
---|
[7801] | 184 | end |
---|
[8018] | 185 | |
---|
| 186 | -- resolution editboxes |
---|
| 187 | self.updateResolutionEditboxes() |
---|
[7801] | 188 | end |
---|
| 189 | |
---|
[8018] | 190 | ---------------------- |
---|
| 191 | -- Helper functions -- |
---|
| 192 | ---------------------- |
---|
| 193 | |
---|
| 194 | -- updates the text of the resolution checkboxes and checks if they should be enabled (only if the "custom" resolution was selected) |
---|
| 195 | function P.updateResolutionEditboxes() |
---|
| 196 | -- resolution combobox |
---|
| 197 | local resolutionCombobox = winMgr:getWindow("orxonox/Display/Resolution/Combobox") |
---|
| 198 | |
---|
| 199 | local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth() |
---|
| 200 | local currentHeight = orxonox.GraphicsManager:getInstance():getWindowHeight() |
---|
| 201 | |
---|
| 202 | -- resolution editboxes |
---|
| 203 | local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth") |
---|
| 204 | local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight") |
---|
| 205 | widthEditbox:disable() |
---|
| 206 | heightEditbox:disable() |
---|
| 207 | |
---|
| 208 | -- selected combobox item |
---|
| 209 | local item = resolutionCombobox:getSelectedItem() |
---|
| 210 | if item then |
---|
| 211 | local itemText = item:getText() |
---|
| 212 | if itemText ~= "custom" then |
---|
| 213 | currentWidth = string.sub(itemText, 1, string.find(itemText, "x") - 2) |
---|
| 214 | currentHeight = string.sub(itemText, string.find(itemText, "x") + 2) |
---|
| 215 | else |
---|
| 216 | widthEditbox:enable() |
---|
| 217 | heightEditbox:enable() |
---|
[6363] | 218 | end |
---|
| 219 | end |
---|
[8018] | 220 | |
---|
| 221 | widthEditbox:setText(currentWidth) |
---|
| 222 | heightEditbox:setText(currentHeight) |
---|
[6363] | 223 | end |
---|
| 224 | |
---|
[8018] | 225 | -- checks if the apply button should be enabled or disabled (only enabled if the current settings are different from the selected values) |
---|
| 226 | function P.updateApplyButton() |
---|
| 227 | -- fullscreen checkbox |
---|
| 228 | local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen") |
---|
| 229 | local isFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen() |
---|
| 230 | local fullscreenChanged = (isFullscreen ~= CEGUI.toCheckbox(fullscreenCheckbox):isSelected()) |
---|
| 231 | |
---|
| 232 | -- resolution editboxes |
---|
| 233 | local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth") |
---|
| 234 | local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight") |
---|
| 235 | local currentWidth = tostring(orxonox.GraphicsManager:getInstance():getWindowWidth()) |
---|
| 236 | local currentHeight = tostring(orxonox.GraphicsManager:getInstance():getWindowHeight()) |
---|
| 237 | local widthChanged = (currentWidth ~= widthEditbox:getText()) |
---|
| 238 | local heightChanged = (currentHeight ~= heightEditbox:getText()) |
---|
| 239 | local resolutionEditboxesEnabled = not widthEditbox:isDisabled() |
---|
| 240 | |
---|
| 241 | -- apply button |
---|
| 242 | local applyButton = winMgr:getWindow("orxonox/Display/Resolution/Apply") |
---|
| 243 | |
---|
| 244 | if fullscreenChanged or widthChanged or heightChanged or resolutionEditboxesEnabled then |
---|
| 245 | applyButton:enable() |
---|
| 246 | else |
---|
| 247 | applyButton:disable() |
---|
[6363] | 248 | end |
---|
| 249 | end |
---|
| 250 | |
---|
[8019] | 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 | |
---|
[8018] | 269 | local notice = winMgr:getWindow("orxonox/Display/Notice") |
---|
[8019] | 270 | notice:setVisible(not needRestart) |
---|
[8018] | 271 | local noticeRed = winMgr:getWindow("orxonox/Display/NoticeRed") |
---|
[8019] | 272 | noticeRed:setVisible(needRestart) |
---|
[6363] | 273 | end |
---|
| 274 | |
---|
[8018] | 275 | --------------------- |
---|
| 276 | -- Event callbacks -- |
---|
| 277 | --------------------- |
---|
| 278 | |
---|
| 279 | -- resolution |
---|
| 280 | |
---|
| 281 | function P.callback_FullscreenCheckbox_CheckStateChanged(e) |
---|
| 282 | P.updateApplyButton() |
---|
[6363] | 283 | end |
---|
| 284 | |
---|
[8018] | 285 | function P.callback_ResolutionCombobox_ListSelectionAccepted(e) |
---|
| 286 | P.updateResolutionEditboxes() |
---|
| 287 | end |
---|
| 288 | |
---|
| 289 | function P.callback_ResolutionEditboxWidth_TextChanged(e) |
---|
| 290 | P.updateApplyButton() |
---|
| 291 | end |
---|
| 292 | |
---|
| 293 | function P.callback_ResolutionEditboxHeight_TextChanged(e) |
---|
| 294 | P.updateApplyButton() |
---|
| 295 | end |
---|
| 296 | |
---|
| 297 | -- theme |
---|
| 298 | |
---|
| 299 | function P.callback_ThemeCombobox_ListSelectionAccepted(e) |
---|
[8019] | 300 | P.updateRedLabel() |
---|
[8018] | 301 | end |
---|
| 302 | |
---|
| 303 | -- vsync |
---|
| 304 | |
---|
| 305 | function P.callback_VSyncCheckbox_CheckStateChanged(e) |
---|
[8019] | 306 | P.updateRedLabel() |
---|
[8018] | 307 | end |
---|
| 308 | |
---|
| 309 | -- fsaa |
---|
| 310 | |
---|
| 311 | function P.callback_FSAACombobox_ListSelectionAccepted(e) |
---|
[8019] | 312 | P.updateRedLabel() |
---|
[8018] | 313 | end |
---|
| 314 | |
---|
| 315 | -- buttons |
---|
| 316 | |
---|
| 317 | function P.callback_Apply_Clicked(e) |
---|
| 318 | -- resolution |
---|
| 319 | local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen") |
---|
| 320 | local checkedFullscreen = tostring(CEGUI.toCheckbox(fullscreenCheckbox):isSelected()) |
---|
| 321 | |
---|
| 322 | local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth") |
---|
| 323 | local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight") |
---|
| 324 | |
---|
[8021] | 325 | -- start revert timer |
---|
| 326 | P.oldWidth = orxonox.GraphicsManager:getInstance():getWindowWidth() |
---|
| 327 | P.oldHeight = orxonox.GraphicsManager:getInstance():getWindowHeight() |
---|
| 328 | P.oldFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen() |
---|
| 329 | |
---|
[8022] | 330 | P.revertTimerHandle = orxonox.CommandExecutor:query("delayreal 10 \"hideGUI DecisionPopup; GraphicsManager setScreenResolution " .. P.oldWidth .. " " .. P.oldHeight .. " " .. tostring(P.oldFullscreen) .. "\"") |
---|
[8021] | 331 | |
---|
| 332 | -- change settings |
---|
[8018] | 333 | orxonox.CommandExecutor:execute("GraphicsManager setScreenResolution " .. widthEditbox:getText() .. " " .. heightEditbox:getText() .. " " .. checkedFullscreen) |
---|
| 334 | |
---|
| 335 | P.updateApplyButton() |
---|
[8021] | 336 | |
---|
| 337 | -- prompt for confirmation |
---|
| 338 | openDecisionPopup("Do you want to keep these settings? (Settings will be reverted in 10 seconds if not accepted)", GraphicsMenu.callback_ApplyDecisionPopup) |
---|
[8023] | 339 | if checkedFullscreen then |
---|
| 340 | showCursor() |
---|
| 341 | end |
---|
[8018] | 342 | end |
---|
| 343 | |
---|
[8021] | 344 | function P.callback_ApplyDecisionPopup(pressedOK) |
---|
| 345 | orxonox.CommandExecutor:execute("killdelay " .. P.revertTimerHandle) |
---|
| 346 | |
---|
| 347 | if not pressedOK then |
---|
| 348 | orxonox.CommandExecutor:execute("GraphicsManager setScreenResolution " .. P.oldWidth .. " " .. P.oldHeight .. " " .. tostring(P.oldFullscreen)) |
---|
| 349 | P:onShow() |
---|
| 350 | end |
---|
| 351 | end |
---|
| 352 | |
---|
[8018] | 353 | function P.callback_Ok_Clicked(e) |
---|
| 354 | -- aspect ratio |
---|
| 355 | local aspectRatioEditbox = winMgr:getWindow("orxonox/Display/Resolution/AspectRatio") |
---|
| 356 | orxonox.CommandExecutor:execute("config Camera aspectRatio_ " .. aspectRatioEditbox:getText()) |
---|
| 357 | |
---|
| 358 | -- theme |
---|
| 359 | local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox") |
---|
| 360 | orxonox.CommandExecutor:execute("config GUIManager guiScheme_ " .. themeCombobox:getText()) |
---|
| 361 | |
---|
| 362 | -- vsync |
---|
| 363 | local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync") |
---|
[8019] | 364 | local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled() |
---|
| 365 | if hasVSync ~= CEGUI.toCheckbox(vsyncCheckbox):isSelected() then |
---|
| 366 | orxonox.CommandExecutor:execute("GraphicsManager setVSync " .. tostring(CEGUI.toCheckbox(vsyncCheckbox):isSelected())) |
---|
| 367 | end |
---|
[8018] | 368 | |
---|
| 369 | -- fsaa |
---|
| 370 | local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA") |
---|
[8019] | 371 | local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode() |
---|
| 372 | if currentFSAAMode ~= fsaaCombobox:getText() then |
---|
| 373 | orxonox.CommandExecutor:execute("GraphicsManager setFSAA {" .. fsaaCombobox:getText() .. "}") -- enclose argument in { ... } because it can contain [brackets] (conflicts with tcl) |
---|
| 374 | end |
---|
[8018] | 375 | |
---|
| 376 | -- fov |
---|
| 377 | local fovEditbox = winMgr:getWindow("orxonox/Settings/Fov") |
---|
| 378 | orxonox.CommandExecutor:execute("config Camera fov_ " .. fovEditbox:getText()) |
---|
| 379 | |
---|
| 380 | -- fps limit |
---|
| 381 | local fpsEditbox = winMgr:getWindow("orxonox/Settings/FpsLimit") |
---|
| 382 | orxonox.CommandExecutor:execute("config GraphicsSettings fpsLimit " .. fpsEditbox:getText()) |
---|
| 383 | |
---|
| 384 | -- particle lod |
---|
| 385 | local particleLodCombobox = winMgr:getWindow("orxonox/Settings/ParticleLodCombobox") |
---|
| 386 | local item = particleLodCombobox:getSelectedItem() |
---|
| 387 | if item then |
---|
| 388 | orxonox.CommandExecutor:execute("config GraphicsSettings particlesDetailLevel " .. particleLodCombobox:getItemIndex(item)) |
---|
[6363] | 389 | end |
---|
[8018] | 390 | |
---|
| 391 | -- model lod |
---|
| 392 | local modelLodCheckbox = winMgr:getWindow("orxonox/Settings/ModelLodCheckbox") |
---|
| 393 | orxonox.CommandExecutor:execute("config GraphicsSettings enableModelLoD " .. tostring(CEGUI.toCheckbox(modelLodCheckbox):isSelected())) |
---|
| 394 | |
---|
| 395 | -- motion blur |
---|
| 396 | local motionBlurCheckbox = winMgr:getWindow("orxonox/Settings/MotionBlurCheckbox") |
---|
| 397 | orxonox.CommandExecutor:execute("config GraphicsSettings enableMotionBlur " .. tostring(CEGUI.toCheckbox(motionBlurCheckbox):isSelected())) |
---|
| 398 | |
---|
| 399 | hideMenuSheet(P.name) |
---|
[6363] | 400 | end |
---|
| 401 | |
---|
[8018] | 402 | function P.callback_Cancel_Clicked(e) |
---|
[6746] | 403 | hideMenuSheet(P.name) |
---|
[6363] | 404 | end |
---|
| 405 | |
---|
| 406 | return P |
---|
| 407 | |
---|