Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6258


Ignore:
Timestamp:
Dec 6, 2009, 8:06:14 PM (15 years ago)
Author:
cmueri
Message:

The fullscreen button is now available, but you have to change the filepath in the GraphicsMenu.lua file to use it.

File:
1 edited

Legend:

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

    r6206 r6258  
    1313
    1414function 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)
    1540    dropdown = winMgr:getWindow("orxonox/ResolutionCombobox")
    1641    local resolutionList = {}
     
    5479
    5580function 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()
    58111end
    59112
Note: See TracChangeset for help on using the changeset viewer.