Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 21, 2009, 5:18:23 PM (15 years ago)
Author:
bknecht
Message:

media update for a working main menu. I hope this does not destroy something, I think it shouldn't.

Location:
data/media/gui/scripts
Files:
3 edited

Legend:

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

    r5523 r5527  
    1515    setmetatable(newElement, self) -- connects new element with class
    1616    self.__index = self
    17     P:init()
     17    self:init()
    1818    return newElement
    1919end
  • data/media/gui/scripts/loadGUI_3.lua

    r5491 r5527  
    1111system:setDefaultMouseCursor("TaharezLook", "MouseArrow")
    1212system:setDefaultFont("BlueHighway-12")
     13system:setDefaultTooltip("TaharezLook/Tooltip")
    1314
    1415loadedGUIs = {}
  • data/media/gui/scripts/mainmenu_2.lua

    r5523 r5527  
    99
    1010function P:init()
    11     --win = winMgr:getWindow("orxonox/LevelListBox")
    12     --print(win.getItemCount())
    13     --item = winMgr:createWindow("TaharezLook/ListboxItem", "orxonox/LevelListBoxItem1")
    14     --item:setText("HiHo")
    15     --win:addItem(item)
    16     --print(win:getItemCount())
     11    listbox = winMgr:getWindow("orxonox/LevelListbox")
     12    orxonox.GUIManager:getInstance():getLevelList()
     13    for k,v in pairs(levellist) do
     14        item = CEGUI.createListboxTextItem(v)
     15        item:setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush")
     16        CEGUI.toListbox(listbox):addItem(item)
     17    end
    1718end
    1819
     
    2021-- events for mainmenu
    2122function P.button_quit_clicked(e)
    22   hideGUI()
    23   orxonox.CommandExecutor:execute("exit")
     23    hideGUI()
     24    orxonox.CommandExecutor:execute("exit")
    2425end
    2526
    2627function P.button_standalone_clicked(e)
    27   orxonox.CommandExecutor:execute("startGame")
    28   toggleGUI()
     28    choice = winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem()
     29    if choice then
     30        orxonox.CommandExecutor:execute("setLevel " .. choice:getText() .. ".oxw")
     31        orxonox.CommandExecutor:execute("startGame")
     32        toggleGUI()
     33    end
    2934end
    3035
     
    4449end
    4550
     51function P.listbox_level_selectionchanged(e)
     52    if winMgr:getWindow("orxonox/LevelListbox"):getFirstSelectedItem() then
     53        winMgr:getWindow("orxonox/StandaloneButton"):enable()
     54    else
     55        winMgr:getWindow("orxonox/StandaloneButton"):disable()
     56    end
     57end
     58
    4659return mainmenu_2
    4760
Note: See TracChangeset for help on using the changeset viewer.