Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5527


Ignore:
Timestamp:
May 21, 2009, 5:18:23 PM (16 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
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • data/media/gui/layouts/MainMenu.layout

    r5435 r5527  
    1212            <Property Name="Text" Value="Standalone"/>
    1313            <Event Name="Clicked" Function="button_standalone_clicked"/>
     14        </Window>
     15       
     16        <Window Type="TaharezLook/Listbox" Name="orxonox/LevelListbox">
    1417        </Window>
    1518       
  • data/media/gui/layouts/MainMenu_2.layout

    r5496 r5527  
    1111            <Property Name="UnifiedSize" Value="{{0.15,0},{0.05,0}}"/>
    1212            <Property Name="Text" Value="Standalone"/>
     13            <Property Name="Disabled" Value="true"/>
    1314            <Event Name="Clicked" Function="mainmenu_2.button_standalone_clicked"/>
     15        </Window>
     16       
     17        <Window Type="TaharezLook/Listbox" Name="orxonox/LevelListbox">
     18            <Property Name="UnifiedPosition" Value="{{0.4,0},{0.3,0}}"/>
     19            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     20            <Property Name="UnifiedSize" Value="{{0.35,0},{0.33,0}}" />
     21            <Property Name="Tooltip" Value="Available Levels." />
     22            <Event Name="ItemSelectionChanged" Function="mainmenu_2.listbox_level_selectionchanged" />
    1423        </Window>
    1524       
  • 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.