[Orxonox-commit 3336] r8024 - code/branches/usability/data/gui/scripts
landauf at orxonox.net
landauf at orxonox.net
Sat Mar 5 23:19:06 CET 2011
Author: landauf
Date: 2011-03-05 23:19:06 +0100 (Sat, 05 Mar 2011)
New Revision: 8024
Modified:
code/branches/usability/data/gui/scripts/GraphicsMenu.lua
Log:
store the selected resolution to display it correctly again after resizing the window
Modified: code/branches/usability/data/gui/scripts/GraphicsMenu.lua
===================================================================
--- code/branches/usability/data/gui/scripts/GraphicsMenu.lua 2011-03-05 22:07:39 UTC (rev 8023)
+++ code/branches/usability/data/gui/scripts/GraphicsMenu.lua 2011-03-05 22:19:06 UTC (rev 8024)
@@ -176,6 +176,13 @@
local currentWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
local currentHeight = orxonox.GraphicsManager:getInstance():getWindowHeight()
+
+ if P.forceResolutionEditboxes then
+ currentWidth = P.newWidth
+ currentHeight = P.newHeight
+ P.forceResolutionEditboxes = false
+ end
+
local currentResolution = currentWidth .. " x " .. currentHeight
for i = 0, resolutionCombobox:getDropList():getItemCount() - 1 do
@@ -322,6 +329,10 @@
local widthEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxWidth")
local heightEditbox = winMgr:getWindow("orxonox/Display/Resolution/EditboxHeight")
+ P.newWidth = widthEditbox:getText()
+ P.newHeight = heightEditbox:getText()
+ P.forceResolutionEditboxes = true
+
-- start revert timer
P.oldWidth = orxonox.GraphicsManager:getInstance():getWindowWidth()
P.oldHeight = orxonox.GraphicsManager:getInstance():getWindowHeight()
@@ -330,7 +341,7 @@
P.revertTimerHandle = orxonox.CommandExecutor:query("delayreal 10 \"hideGUI DecisionPopup; GraphicsManager setScreenResolution " .. P.oldWidth .. " " .. P.oldHeight .. " " .. tostring(P.oldFullscreen) .. "\"")
-- change settings
- orxonox.CommandExecutor:execute("GraphicsManager setScreenResolution " .. widthEditbox:getText() .. " " .. heightEditbox:getText() .. " " .. checkedFullscreen)
+ orxonox.CommandExecutor:execute("GraphicsManager setScreenResolution " .. P.newWidth .. " " .. P.newHeight .. " " .. checkedFullscreen)
P.updateApplyButton()
More information about the Orxonox-commit
mailing list