Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 5, 2011, 11:19:06 PM (14 years ago)
Author:
landauf
Message:

store the selected resolution to display it correctly again after resizing the window

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability/data/gui/scripts/GraphicsMenu.lua

    r8023 r8024  
    177177    local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
    178178    local currentHeight = orxonox.GraphicsManager:getInstance():getWindowHeight()
     179
     180    if P.forceResolutionEditboxes then
     181        currentWidth = P.newWidth
     182        currentHeight = P.newHeight
     183        P.forceResolutionEditboxes = false
     184    end
     185
    179186    local currentResolution = currentWidth .. " x " .. currentHeight
    180187
     
    323330    local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")
    324331
     332    P.newWidth = widthEditbox:getText()
     333    P.newHeight = heightEditbox:getText()
     334    P.forceResolutionEditboxes = true
     335
    325336    -- start revert timer
    326337    P.oldWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
     
    331342
    332343    -- change settings
    333     orxonox.CommandExecutor:execute("GraphicsManager setScreenResolution " .. widthEditbox:getText() .. " " .. heightEditbox:getText() .. " " .. checkedFullscreen)
     344    orxonox.CommandExecutor:execute("GraphicsManager setScreenResolution " .. P.newWidth .. " " .. P.newHeight .. " " .. checkedFullscreen)
    334345
    335346    P.updateApplyButton()
Note: See TracChangeset for help on using the changeset viewer.