Changeset 6258
- Timestamp:
- Dec 6, 2009, 8:06:14 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/data/gui/scripts/GraphicsMenu.lua
r6206 r6258 13 13 14 14 function P:init() 15 file = "C:\\Games\\Orxonox\\menu\\build\\config\\Debug\\" .. orxonox.getConfig("GraphicsManager", "ogreConfigFile_") 16 search_mode = 0 17 f = io.open(file, "r") 18 firstline = f:read("*line") 19 rendersystem = string.sub(firstline, 15) 20 for line in f:lines() do 21 if search_mode == 0 then 22 if string.find(line, rendersystem) ~= nil then 23 search_mode = 1 24 end 25 end 26 if search_mode == 1 then 27 if string.sub(line, 1, 11) == "Full Screen" then 28 if string.sub(line, 13) == "Yes" then 29 fullscreen = true 30 else 31 fullscreen = false 32 end 33 break 34 end 35 end 36 end 37 f:close() 38 local fullscreenwindow = tolua.cast(winMgr:getWindow("orxonox/FullscreenCheckbox"),"CEGUI::Checkbox") 39 fullscreenwindow:setSelected(fullscreen) 15 40 dropdown = winMgr:getWindow("orxonox/ResolutionCombobox") 16 41 local resolutionList = {} … … 54 79 55 80 function P.GraphicsFullscreenCheckbox_clicked(e) 56 -- fullscreen 57 debug("event: fullscreen") 81 search_mode = 0 82 f = io.open(file, "r") 83 firstline = f:read("*line") 84 text = firstline .. "\n" 85 rendersystem = string.sub(firstline, 15) 86 for line in f:lines() do 87 if search_mode == 0 then 88 if string.find(line, rendersystem) ~= nil then 89 search_mode = 1 90 end 91 end 92 if search_mode == 1 then 93 if string.sub(line, 1, 11) == "Full Screen" then 94 if fullscreen == true then 95 line = "Full Screen=No" 96 fullscreen = false 97 else 98 line = "Full Screen=Yes" 99 fullscreen = true 100 end 101 debug(line) 102 search_mode = 2 103 end 104 end 105 text = text .. line .. "\n" 106 end 107 f:close() 108 f = io.open(file, "w") 109 f:write(text) 110 f:close() 58 111 end 59 112
Note: See TracChangeset
for help on using the changeset viewer.