Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

migrated HighscoreMenu.lua and CampaignMenu.lua to cegui 0.8

Location:
code/branches/cegui0.8_ogre1.9/data/gui
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cegui0.8_ogre1.9/data/gui/layouts/HighscoreMenu.layout

    r11793 r11805  
    11<?xml version='1.0' encoding='utf-8'?>
    22<GUILayout version="4">
    3     <Window name="Background" type="DefaultWindow">
     3    <Window name="HighscoreBackground" type="DefaultWindow">
    44        <Property name="InheritsAlpha" value="False" />
    55        <Property name="MaxSize" value="{{1,0},{1,0}}" />
     
    99            <Property name="Alpha" value="0.8" />
    1010            <Property name="InheritsAlpha" value="False" />
    11             <Property name="HorzFormatting" value="HorzCentred" />
     11            <Property name="HorzFormatting" value="CentreAligned" />
    1212            <Property name="MaxSize" value="{{1,0},{1,0}}" />
    1313            <Property name="VertFormatting" value="TopAligned" />
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/CampaignMenu.lua

    r11359 r11805  
    88
    99function P.updateButtons()
    10     P.updateButton(0, winMgr:getWindow("orxonox/Mission1Button"))
    11     P.updateButton(0, winMgr:getWindow("orxonox/Mission1Text"))
    12     P.updateButton(1, winMgr:getWindow("orxonox/Mission2Button"))
    13     P.updateButton(1, winMgr:getWindow("orxonox/Mission2Text"))
    14     P.updateButton(2, winMgr:getWindow("orxonox/Mission3Button"))
    15     P.updateButton(2, winMgr:getWindow("orxonox/Mission3Text"))
    16     P.updateButton(3, winMgr:getWindow("orxonox/Mission4Button"))
    17     P.updateButton(3, winMgr:getWindow("orxonox/Mission4Text"))
    18     P.updateButton(4, winMgr:getWindow("orxonox/Mission5Button"))
    19     P.updateButton(4, winMgr:getWindow("orxonox/Mission5Text"))
    20     P.updateButton(5, winMgr:getWindow("orxonox/Mission6Button"))
    21     P.updateButton(5, winMgr:getWindow("orxonox/Mission6Text"))
    22     P.updateButton(6, winMgr:getWindow("orxonox/Mission7Button"))
    23     P.updateButton(6, winMgr:getWindow("orxonox/Mission7Text"))
    24     P.updateButton(7, winMgr:getWindow("orxonox/Mission8Button"))
    25     P.updateButton(7, winMgr:getWindow("orxonox/Mission8Text"))
    26     P.updateButton(8, winMgr:getWindow("orxonox/Mission9Button"))
    27     P.updateButton(8, winMgr:getWindow("orxonox/Mission9Text"))
     10    P.updateButton(0, P.window:getChild("Mission1Button"))
     11    P.updateButton(0, P.window:getChild("Mission1Text"))
     12    P.updateButton(1, P.window:getChild("Mission2Button"))
     13    P.updateButton(1, P.window:getChild("Mission2Text"))
     14    P.updateButton(2, P.window:getChild("Mission3Button"))
     15    P.updateButton(2, P.window:getChild("Mission3Text"))
     16    P.updateButton(3, P.window:getChild("Mission4Button"))
     17    P.updateButton(3, P.window:getChild("Mission4Text"))
     18    P.updateButton(4, P.window:getChild("Mission5Button"))
     19    P.updateButton(4, P.window:getChild("Mission5Text"))
     20    P.updateButton(5, P.window:getChild("Mission6Button"))
     21    P.updateButton(5, P.window:getChild("Mission6Text"))
     22    P.updateButton(6, P.window:getChild("Mission7Button"))
     23    P.updateButton(6, P.window:getChild("Mission7Text"))
     24    P.updateButton(7, P.window:getChild("Mission8Button"))
     25    P.updateButton(7, P.window:getChild("Mission8Text"))
     26    P.updateButton(8, P.window:getChild("Mission9Button"))
     27    P.updateButton(8, P.window:getChild("Mission9Text"))
    2828
    2929
    3030    if (P.getIndexOfLastFinishedMission() == orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() - 1) then
    31         local label = winMgr:getWindow("orxonox/CampaignMenuCongratulation")
     31        local label = P.window:getChild("CampaignMenuCongratulation")
    3232        label:setProperty("Visible","True")
    3333    end
  • 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.