Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5532


Ignore:
Timestamp:
May 24, 2009, 2:39:59 AM (15 years ago)
Author:
bknecht
Message:

lua code to upgrade the mainmenu

File:
1 edited

Legend:

Unmodified
Added
Removed
  • data/media/gui/scripts/mainmenu_2.lua

    r5527 r5532  
    1010function P:init()
    1111    listbox = winMgr:getWindow("orxonox/LevelListbox")
    12     orxonox.GUIManager:getInstance():getLevelList()
     12    preselect = orxonox.Game:getInstance():getLevel()
     13    orxonox.GUIManager:getInstance():getLevelList() --levellist variable ist set now
    1314    for k,v in pairs(levellist) do
    14         item = CEGUI.createListboxTextItem(v)
     15        item = CEGUI.createListboxTextItem(v)       
    1516        item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
    1617        CEGUI.toListbox(listbox):addItem(item)
     18        if v .. ".oxw" == preselect then
     19            listbox:setItemSelectState(item, true)
     20        end
    1721    end
    1822end
     
    2832    choice = winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem()
    2933    if choice then
    30         orxonox.CommandExecutor:execute("setLevel " .. choice:getText() .. ".oxw")
     34        orxonox.Game:getInstance():setLevel(choice:getText() .. ".oxw")
    3135        orxonox.CommandExecutor:execute("startGame")
    3236        toggleGUI()
Note: See TracChangeset for help on using the changeset viewer.