Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 12, 2016, 4:07:25 PM (9 years ago)
Author:
binderm
Message:

LevelStatus and levelmanager in two files, LevelStatus saves and changes the actual campaign progress

Location:
code/branches/bindermFS16/data/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/bindermFS16/data/gui/layouts/CampaignMenu.layout

    r11180 r11186  
    1313            <Property Name="Visible" Value="False"/>
    1414            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    15             <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.01,0},{0.3,0},{0.06,0}}" />
     15            <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.34,0},{0.3,0},{0.39,0}}" />
    1616            <Event Name="Clicked" Function="CampaignMenu.Mission1Button_clicked"/>
    1717        </Window>
     
    2121            <Property Name="Visible" Value="False"/>
    2222            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    23             <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.18,0},{0.65,0},{0.23,0}}" />
    24             <Property Name="Disabled" Value="True" />
     23            <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.26,0},{0.4,0},{0.31,0}}" />
     24            <Property Name="Disabled" Value="True"/>
    2525            <Event Name="Clicked" Function="CampaignMenu.Mission2Button_clicked"/>
    2626        </Window>
     
    3030            <Property Name="Visible" Value="False"/>
    3131            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    32             <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.26,0},{0.65,0},{0.31,0}}" />
     32            <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.42,0},{0.4,0},{0.47,0}}" />
    3333            <Property Name="Disabled" Value="True" />
    3434            <Event Name="Clicked" Function="CampaignMenu.Mission3Button_clicked"/>
     
    3939            <Property Name="Visible" Value="False"/>
    4040            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    41             <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.34,0},{0.65,0},{0.39,0}}" />
     41            <Property Name="UnifiedAreaRect" Value="{{0.41,0},{0.26,0},{0.71,0},{0.31,0}}" />
    4242            <Property Name="Disabled" Value="True" />
    4343            <Event Name="Clicked" Function="CampaignMenu.Mission4Button_clicked"/>
     
    4848            <Property Name="Visible" Value="False"/>
    4949            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    50             <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.42,0},{0.65,0},{0.47,0}}" />
     50            <Property Name="UnifiedAreaRect" Value="{{0.41,0},{0.42,0},{0.71,0},{0.47,0}}" />
    5151            <Property Name="Disabled" Value="True" />
    5252            <Event Name="Clicked" Function="CampaignMenu.Mission5Button_clicked"/>
     
    5757            <Property Name="Visible" Value="False"/>
    5858            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    59             <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.50,0},{0.65,0},{0.55,0}}" />
     59            <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.10,0},{0.99,0},{0.15,0}}" />
    6060            <Property Name="Disabled" Value="True" />
    6161            <Event Name="Clicked" Function="CampaignMenu.Mission6Button_clicked"/>
     
    6666            <Property Name="Visible" Value="False"/>
    6767            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    68             <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.58,0},{0.65,0},{0.63,0}}" />
     68            <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.18,0},{0.99,0},{0.23,0}}" />
    6969            <Property Name="Disabled" Value="True" />
    7070            <Event Name="Clicked" Function="CampaignMenu.Mission7Button_clicked"/>
     
    7575            <Property Name="Visible" Value="False"/>
    7676            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    77             <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.66,0},{0.65,0},{0.71,0}}" />
     77            <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.50,0},{0.99,0},{0.55,0}}" />
    7878            <Property Name="Disabled" Value="True" />
    7979            <Event Name="Clicked" Function="CampaignMenu.Mission8Button_clicked"/>
     
    8484            <Property Name="Visible" Value="False"/>
    8585            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    86             <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.74,0},{0.65,0},{0.79,0}}" />
     86            <Property Name="UnifiedAreaRect" Value="{{0.72,0},{0.58,0},{0.99,0},{0.63,0}}" />
    8787            <Property Name="Disabled" Value="True" />
    8888            <Event Name="Clicked" Function="CampaignMenu.Mission9Button_clicked"/>
  • code/branches/bindermFS16/data/gui/scripts/CampaignMenu.lua

    r11180 r11186  
    2626
    2727function P.updateButton(index, button)
     28    local lastMission = orxonox.LevelManager:getInstance():getLastWonMission()
     29    if (lastMission == "") then
     30    else
     31        local lastwon =P.getIndexOfLastFinishedMission()
     32        orxonox.LevelManager:getInstance():updatewon(lastwon)
     33    end
     34
    2835    local test =orxonox.LevelManager:getInstance():missionactivate(index)
     36
    2937    if (test==1) then
    3038        button:setProperty("Visible", "True")
     
    4856--end
    4957
    50 --function P.getIndexOfLastFinishedMission()
    51 --    local lastMission = orxonox.LevelManager:getInstance():getLastFinishedCampaignMission()
    52 --    if (lastMission and lastMission ~= "") then
    53 --        local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()
    54 --        local index = 0
    55 --        while index < size do
    56 --            local mission = orxonox.LevelManager:getInstance():getCampaignMission(index)
    57 --            if (mission == lastMission) then
    58 --                return index
    59 --            end
    60 --            index = index + 1
    61 --        end
    62 --    end
    63 --    return -1
    64 --end
     58function P.getIndexOfLastFinishedMission()
     59    local lastMission = orxonox.LevelManager:getInstance():getLastWonMission()
     60    if (lastMission and lastMission ~= "") then
     61        local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()
     62        local index = 0
     63        while index < size do
     64            local mission = orxonox.LevelManager:getInstance():getCampaignMission(index)
     65            if (mission == lastMission) then
     66                return index
     67            end
     68            index = index + 1
     69        end
     70    end
     71    return -1
     72end
    6573
    6674function P.Mission1Button_clicked(e)
Note: See TracChangeset for help on using the changeset viewer.