Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 24, 2018, 1:05:32 AM (7 years ago)
Author:
landauf
Message:

updated Settings.lua and all sub-menus to cegui 0.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/GraphicsMenu.lua

    r11795 r11800  
    1414
    1515    P:setButton(1, 1, {
    16             ["button"] = winMgr:getWindow("orxonox/GraphicsOkButton"),
     16            ["button"] = P.window:getChild("GraphicsOkButton"),
    1717            ["callback"]  = P.callback_Ok_Clicked
    1818    })
    1919
    2020    P:setButton(1, 2, {
    21             ["button"] = winMgr:getWindow("orxonox/GraphicsCancelButton"),
     21            ["button"] = P.window:getChild("GraphicsCancelButton"),
    2222            ["callback"]  = P.callback_Cancel_Clicked
    2323    })
     
    2525    -- 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
    2626    P:setButton(2, 1, {
    27             ["button"] = winMgr:getWindow("orxonox/Display/Resolution/Apply"),
     27            ["button"] = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Apply"),
    2828            ["callback"]  = P.callback_Apply_Clicked
    2929    })
     
    3434
    3535    -- 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"))
    3737    resolutionCombobox:setReadOnly(true)
    3838
     
    4444
    4545    -- 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"))
    4747    themeCombobox:setReadOnly(true)
    4848
     
    5454
    5555    -- 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"))
    5757    fsaaCombobox:setReadOnly(true)
    5858
     
    6464
    6565    -- 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"))
    6767    particleLodCombobox:setReadOnly(true)
    6868
     
    8686
    8787    -- aspect ratio editbox
    88     local aspectRatioEditbox = winMgr:getWindow("orxonox/Display/Resolution/AspectRatio")
     88    local aspectRatioEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/AspectRatio")
    8989    local currentAspectRatio = orxonox.CommandExecutor:query("getConfig Camera aspectRatio_")
    9090    aspectRatioEditbox:setText(currentAspectRatio)
    9191
    9292    -- 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"))
    9494    local currentTheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
    9595
     
    100100
    101101    -- vsync checkbox
    102     local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")
     102    local vsyncCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/VSync")
    103103    local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled()
    104104    CEGUI.toCheckbox(vsyncCheckbox):setSelected(hasVSync)
    105105
    106106    -- 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"))
    108108    local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode()
    109109
     
    121121
    122122    -- fov editbox
    123     local fovEditbox = winMgr:getWindow("orxonox/Settings/Fov")
     123    local fovEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/Fov")
    124124    local currentFov = orxonox.CommandExecutor:query("getConfig Camera fov_")
    125125    fovEditbox:setText(currentFov)
    126126
    127127    -- fps limit editbox
    128     local fpsEditbox = winMgr:getWindow("orxonox/Settings/FpsLimit")
     128    local fpsEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/FpsLimit")
    129129    local currentFpsLimit = orxonox.CommandExecutor:query("getConfig GraphicsSettings fpsLimit")
    130130    fpsEditbox:setText(currentFpsLimit)
    131131
    132132    -- 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"))
    134134    local currentParticleLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings particlesDetailLevel")
    135135
     
    146146
    147147    -- mesh lod checkbox
    148     local meshLodCheckbox = winMgr:getWindow("orxonox/Settings/MeshLodCheckbox")
     148    local meshLodCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MeshLodCheckbox")
    149149    local hasMeshLod = orxonox.CommandExecutor:query("getConfig GraphicsSettings enableMeshLoD")
    150150    if hasMeshLod == "true" then
     
    156156
    157157    -- motion blur checkbox
    158     local motionBlurCheckbox = winMgr:getWindow("orxonox/Settings/MotionBlurCheckbox")
     158    local motionBlurCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MotionBlurCheckbox")
    159159    local hasMotionBlur = orxonox.CommandExecutor:query("getConfig GraphicsSettings enableMotionBlur")
    160160    if hasMotionBlur == "true" then
     
    168168function P:onWindowResized()
    169169    -- fullscreen checkbox
    170     local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")
     170    local fullscreenCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Fullscreen")
    171171    local isFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen()
    172172    CEGUI.toCheckbox(fullscreenCheckbox):setSelected(isFullscreen)
    173173
    174174    -- 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"))
    176176
    177177    local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
     
    202202function P.updateResolutionEditboxes()
    203203    -- 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"))
    205205
    206206    local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
     
    208208
    209209    -- 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")
    212212    widthEditbox:disable()
    213213    heightEditbox:disable()
     
    233233function P.updateApplyButton()
    234234    -- fullscreen checkbox
    235     local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")
     235    local fullscreenCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Fullscreen")
    236236    local isFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen()
    237237    local fullscreenChanged = (isFullscreen ~= CEGUI.toCheckbox(fullscreenCheckbox):isSelected())
    238238
    239239    -- 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")
    242242    local currentWidth = tostring(orxonox.GraphicsManager:getInstance():getWindowWidth())
    243243    local currentHeight = tostring(orxonox.GraphicsManager:getInstance():getWindowHeight())
     
    247247
    248248    -- apply button
    249     local applyButton = winMgr:getWindow("orxonox/Display/Resolution/Apply")
     249    local applyButton = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Apply")
    250250
    251251    if fullscreenChanged or widthChanged or heightChanged or resolutionEditboxesEnabled then
     
    258258function P.updateRedLabel()
    259259    -- theme
    260     local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")
     260    local themeCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Theme/Combobox")
    261261    local currentTheme = orxonox.CommandExecutor:query("getConfig GUIManager guiScheme_")
    262262    local themeChanged = (currentTheme ~= themeCombobox:getText())
    263263
    264264    -- vsync
    265     local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")
     265    local vsyncCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/VSync")
    266266    local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled()
    267267    local vsyncChanged = (hasVSync ~= CEGUI.toCheckbox(vsyncCheckbox):isSelected())
    268268
    269269    -- fsaa
    270     local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")
     270    local fsaaCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/FSAA")
    271271    local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode()
    272272    local fsaaChanged = (currentFSAAMode ~= fsaaCombobox:getText())
     
    274274    local needRestart = themeChanged or vsyncChanged or fsaaChanged
    275275
    276     local notice = winMgr:getWindow("orxonox/Display/Notice")
     276    local notice = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Notice")
    277277    notice:setVisible(not needRestart)
    278     local noticeRed = winMgr:getWindow("orxonox/Display/NoticeRed")
     278    local noticeRed = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/NoticeRed")
    279279    noticeRed:setVisible(needRestart)
    280280end
     
    286286-- resolution
    287287
    288 function P.callback_FullscreenCheckbox_CheckStateChanged(e)
     288function P.callback_FullscreenCheckbox_SelectStateChanged(e)
    289289    P.updateApplyButton()
    290290end
     
    310310-- vsync
    311311
    312 function P.callback_VSyncCheckbox_CheckStateChanged(e)
     312function P.callback_VSyncCheckbox_SelectStateChanged(e)
    313313    P.updateRedLabel()
    314314end
     
    324324function P.callback_Apply_Clicked(e)
    325325    -- resolution
    326     local fullscreenCheckbox = winMgr:getWindow("orxonox/Display/Resolution/Fullscreen")
     326    local fullscreenCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/Fullscreen")
    327327    local checkedFullscreen = tostring(CEGUI.toCheckbox(fullscreenCheckbox):isSelected())
    328328
    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")
    331331
    332332    P.newWidth = widthEditbox:getText()
     
    339339    P.oldFullscreen = orxonox.GraphicsManager:getInstance():isFullScreen()
    340340
    341     P.revertTimerHandle = orxonox.CommandExecutor:query("delayreal 10 {hideGUI DecisionPopup; GraphicsManager setScreenResolution " .. P.oldWidth .. " " .. P.oldHeight .. " " .. tostring(P.oldFullscreen) .. "; config Core lastLevelTimestamp_ [expr [getConfig Core ogreConfigTimestamp_] + 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]}")
    342342
    343343    -- change settings
     
    362362
    363363    -- 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 Core ogreConfigTimestamp_] + 1]")
     364    orxonox.CommandExecutor:execute("config CoreConfig lastLevelTimestamp_ [expr [getConfig CoreConfig ogreConfigTimestamp_] + 1]")
    365365end
    366366
    367367function P.callback_Ok_Clicked(e)
    368368    -- aspect ratio
    369     local aspectRatioEditbox = winMgr:getWindow("orxonox/Display/Resolution/AspectRatio")
     369    local aspectRatioEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Resolution/AspectRatio")
    370370    orxonox.CommandExecutor:execute("config Camera aspectRatio_ " .. aspectRatioEditbox:getText())
    371371
    372372    -- theme
    373     local themeCombobox = winMgr:getWindow("orxonox/Display/Theme/Combobox")
     373    local themeCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/Theme/Combobox")
    374374    orxonox.CommandExecutor:execute("config GUIManager guiScheme_ " .. themeCombobox:getText())
    375375
    376376    -- vsync
    377     local vsyncCheckbox = winMgr:getWindow("orxonox/Display/More/VSync")
     377    local vsyncCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/VSync")
    378378    local hasVSync = orxonox.GraphicsManager:getInstance():hasVSyncEnabled()
    379379    if hasVSync ~= CEGUI.toCheckbox(vsyncCheckbox):isSelected() then
     
    382382
    383383    -- fsaa
    384     local fsaaCombobox = winMgr:getWindow("orxonox/Display/More/FSAA")
     384    local fsaaCombobox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Display/More/FSAA")
    385385    local currentFSAAMode = orxonox.GraphicsManager:getInstance():getFSAAMode()
    386386    if currentFSAAMode ~= fsaaCombobox:getText() then
     
    389389
    390390    -- fov
    391     local fovEditbox = winMgr:getWindow("orxonox/Settings/Fov")
     391    local fovEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/Fov")
    392392    orxonox.CommandExecutor:execute("config Camera fov_ " .. fovEditbox:getText())
    393393
    394394    -- fps limit
    395     local fpsEditbox = winMgr:getWindow("orxonox/Settings/FpsLimit")
     395    local fpsEditbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/FpsLimit")
    396396    orxonox.CommandExecutor:execute("config GraphicsSettings fpsLimit " .. fpsEditbox:getText())
    397397
    398398    -- particle lod
    399     local particleLodCombobox = CEGUI.toCombobox(winMgr:getWindow("orxonox/Settings/ParticleLodCombobox"))
     399    local particleLodCombobox = CEGUI.toCombobox(P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/ParticleLodCombobox"))
    400400    local item = particleLodCombobox:getSelectedItem()
    401401    if item then
     
    404404
    405405    -- mesh lod
    406     local meshLodCheckbox = winMgr:getWindow("orxonox/Settings/MeshLodCheckbox")
     406    local meshLodCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MeshLodCheckbox")
    407407    orxonox.CommandExecutor:execute("config GraphicsSettings enableMeshLoD " .. tostring(CEGUI.toCheckbox(meshLodCheckbox):isSelected()))
    408408
    409409    -- motion blur
    410     local motionBlurCheckbox = winMgr:getWindow("orxonox/Settings/MotionBlurCheckbox")
     410    local motionBlurCheckbox = P.window:getChild("GraphicsWindow/GraphicsTabControl/Settings/MotionBlurCheckbox")
    411411    orxonox.CommandExecutor:execute("config GraphicsSettings enableMotionBlur " .. tostring(CEGUI.toCheckbox(motionBlurCheckbox):isSelected()))
    412412
Note: See TracChangeset for help on using the changeset viewer.