Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 24, 2018, 2:50:16 AM (6 years ago)
Author:
landauf
Message:

migrated HighscoreMenu.lua and CampaignMenu.lua to cegui 0.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/HighscoreMenu.lua

    r11783 r11805  
    3939
    4040    -- delete old windows to reload them on show
    41     local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
     41    local tabControl = P.window:getChild("HighscoreWindow/HighscoreTabControl")
    4242    for k,v in pairs(P.tabList) do
    43             local default = winMgr:getWindow(v)
    44             tabControl:removeChildWindow(default)
     43            local default = tabControl:getChild(v)
     44            tabControl:removeChild(default)
    4545            winMgr:destroyWindow(default)
    4646    end
     
    6161function P.createFilterTab(name, tag)
    6262    -- create unique tab window name
    63     local tabName = "orxonox/HighscoreLevelTab"
     63    local tabName = "HighscoreLevelTab"
    6464    if tag ~= nil then
    6565        tabName = tabName..tag
     
    7070    local default = (winMgr:createWindow("DefaultWindow", tabName))
    7171    default:setText(name)
    72     default:setProperty("UnifiedMaxSize", "{{1,0},{1,0}}")
    73     default:setProperty("UnifiedAreaRect", "{{0,0},{0,0},{1,0},{1,0}}")
     72    default:setProperty("MaxSize", "{{1,0},{1,0}}")
     73    default:setProperty("Area", "{{0,0},{0,0},{1,0},{1,0}}")
    7474    local pane = winMgr:createWindow("MenuWidgets/ScrollablePane", tabName .. "pane")
    75     pane:setSize(CEGUI.UVector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
    76     default:addChildWindow(pane)
     75    pane:setSize(CEGUI.USize(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
     76    default:addChild(pane)
    7777
    7878   
     
    8585            table.insert(P.linesList, line)
    8686            line:setYPosition(CEGUI.UDim(0,offset))
    87             offset = offset + line:getHeight():asAbsolute(1)+2
    88             pane:addChildWindow(line)
     87            offset = offset + P.imageHeight +2
     88            pane:addChild(line)
    8989        end
    9090       
    9191    end
    9292
    93     local tabControl = winMgr:getWindow("orxonox/HighscoreTabControl")
    94     tabControl:addChildWindow(default)
     93    local tabControl = P.window:getChild("HighscoreWindow/HighscoreTabControl")
     94    tabControl:addChild(default)
    9595 
    9696
     
    9999function P.createPickupEntry(parent,k,tag)
    100100   
    101     local name = "orxonox/HiscoreEntry" .. parent
     101    local name = "HiscoreEntry" .. parent
    102102    local splitlist = P.Split(P.highscoreList[k],"./.")
    103103    local item = winMgr:createWindow("DefaultWindow", name)
    104     item:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight)))
     104    item:setSize(CEGUI.USize(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight)))
    105105    item:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0)))
    106106
     
    108108    player:setText(splitlist[1])
    109109    player:setPosition(CEGUI.UVector2(CEGUI.UDim(0.005,0), CEGUI.UDim(0,0)))
    110     player:setSize(CEGUI.UVector2(CEGUI.UDim(0.49, 0), CEGUI.UDim(0, P.imageHeight)))
     110    player:setSize(CEGUI.USize(CEGUI.UDim(0.49, 0), CEGUI.UDim(0, P.imageHeight)))
    111111   
    112     item:addChildWindow(player)
     112    item:addChild(player)
    113113       
    114114    local score = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Score")
    115115    score:setText(splitlist[3])
    116116    score:setPosition(CEGUI.UVector2(CEGUI.UDim(0.5,0), CEGUI.UDim(0,0)))
    117     score:setSize(CEGUI.UVector2(CEGUI.UDim(0.495, 0), CEGUI.UDim(0, P.imageHeight)))
     117    score:setSize(CEGUI.USize(CEGUI.UDim(0.495, 0), CEGUI.UDim(0, P.imageHeight)))
    118118   
    119     item:addChildWindow(score)
     119    item:addChild(score)
    120120
    121121    return item
     
    123123function P.HighscoreGetSelectedLevel()
    124124    -- choose the active listbox
    125     local tabControl = CEGUI.toTabControl(winMgr:getWindow("orxonox/HighscoreTabControl"))
     125    local tabControl = CEGUI.toTabControl(P.window:getChild("HighscoreWindow/HighscoreTabControl"))
    126126    local listbox = CEGUI.toListbox(tabControl:getTabContentsAtIndex(tabControl:getSelectedTabIndex()))
    127127    local choice = listbox:getFirstSelectedItem()
Note: See TracChangeset for help on using the changeset viewer.