Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 9, 2011, 2:42:04 PM (13 years ago)
Author:
baermatt
Message:

Changed some level tags.

Location:
code/branches/menue/data/gui/scripts
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/menue/data/gui/scripts/SingleplayerMenu.lua

    r8914 r8927  
    1111   
    1212    -- create tabs with desired tab as argument (nil for all)
    13     P.createFilterTab("Tests", "test")
     13    P.createFilterTab("Missions", "mission")
    1414    P.createFilterTab("Tutorials", "tutorial")
    1515    P.createFilterTab("Showcases", "showcase")
    16     P.createFilterTab("SP?", "singleplayer")
    1716    P.createFilterTab("Presentations", "presentation")
     17    P.createFilterTab("Tests", "test")
    1818    P.createFilterTab("Show All", nil)
    19 
     19   
     20    SingleplayerSelectionChanged()
     21   
    2022    --buttons are arranged in a 1x3 matrix
    2123    P:setButton(1, 1, {
     
    6264        tabName = tabName..tag
    6365    end
    64     -- add new tab window with desired name
    65     local tabControl = winMgr:getWindow("orxonox/SingleplayerTabControl")
     66    -- create new tab window with desired name
    6667    local listbox = CEGUI.toListbox(winMgr:createWindow("MenuWidgets/Listbox", tabName))
    6768    listbox:setText(name)
    6869    listbox:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
    69     listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.7,0}}")
    70     tabControl:addChildWindow(tabName)
     70    listbox:setProperty("UnifiedAreaRect", "{{0.05,0},{0.1,0},{0.5,0},{0.675,0}}")
    7171    -- fill listbox with items
    7272    listbox:resetList()
     
    8989    table.insert(P.activeTabIndexes, tabIndexes)
    9090    listbox:subscribeEvent("ItemSelectionChanged", "SingleplayerSelectionChanged")
     91    local tabControl = winMgr:getWindow("orxonox/SingleplayerTabControl")
    9192    tabControl:subscribeEvent("TabSelectionChanged", "SingleplayerSelectionChanged")
    92     SingleplayerSelectionChanged()
     93    if listbox:getItemCount() > 0 then
     94        tabControl:addChildWindow(tabName)
     95    end
    9396end
    9497
     
    108111
    109112function SingleplayerSelectionChanged(e)
     113    local levelImage = winMgr:getWindow("orxonox/SingleplayerLevelImage")
     114    local levelDescription = winMgr:getWindow("orxonox/SingleplayerLevelDescription")
    110115    local level = P.SingleplayerGetSelectedLevel()
    111116    if level ~= nil then
    112117        local levelXMLFilename = level:getXMLFilename()
    113118        local imageName = level:getScreenshot()
    114         local levelImage = winMgr:getWindow("orxonox/SingleplayerLevelImage")
    115119        levelImage:setProperty("Image", "set:"..levelXMLFilename..imageName.." image:full_image")
    116         local levelDescription = winMgr:getWindow("orxonox/SingleplayerLevelDescription")
    117         local height = getStaticTextWindowHeight(levelDescription)
    118 --        local width = getStaticTextWindowWidth(levelDescription)
    119         levelDescription:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(0.0, height)))
    120120        levelDescription:setText(level:getDescription())
     121    else
     122        levelImage:setProperty("Image", nil)
     123        levelDescription:setText("")
    121124    end
    122125end
     
    131134
    132135function P.SingleplayerConfigButton_clicked(e)
    133     hideMenuSheet(P.name)
     136    showMenuSheet("SingleplayerConfigMenu", true)
    134137end
    135138
     
    139142
    140143return P
    141 
Note: See TracChangeset for help on using the changeset viewer.