Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 26, 2016, 4:15:54 PM (8 years ago)
Author:
fvultier
Message:

merged campain menu

Location:
code/branches/presentationFS16
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentationFS16

  • code/branches/presentationFS16/data/gui/layouts/CampaignMenu.layout

    r11052 r11206  
    88        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1.0,0},{1.0,0}}" />
    99        <Property Name="BackgroundEnabled" Value="False" />
     10
    1011        <Window Type="MenuWidgets/Button" Name="orxonox/Mission1Button" >
    1112            <Property Name="Text" Value="Mission One" />
    1213            <Property Name="Visible" Value="False"/>
    1314            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    14             <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.1,0},{0.65,0},{0.15,0}}" />
     15            <Property Name="UnifiedAreaRect" Value="{{0.01,0},{0.34,0},{0.3,0},{0.39,0}}" />
    1516            <Event Name="Clicked" Function="CampaignMenu.Mission1Button_clicked"/>
    1617        </Window>
     18
    1719        <Window Type="MenuWidgets/Button" Name="orxonox/Mission2Button" >
    1820            <Property Name="Text" Value="Fight in our Back" />
    1921            <Property Name="Visible" Value="False"/>
    2022            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    21             <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.18,0},{0.65,0},{0.23,0}}" />
    22             <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"/>
    2325            <Event Name="Clicked" Function="CampaignMenu.Mission2Button_clicked"/>
    2426        </Window>
     27
    2528        <Window Type="MenuWidgets/Button" Name="orxonox/Mission3Button" >
    2629            <Property Name="Text" Value="Pirate Attack" />
    2730            <Property Name="Visible" Value="False"/>
    2831            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    29             <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}}" />
    3033            <Property Name="Disabled" Value="True" />
    3134            <Event Name="Clicked" Function="CampaignMenu.Mission3Button_clicked"/>
    3235        </Window>
     36
    3337        <Window Type="MenuWidgets/Button" Name="orxonox/Mission4Button" >
    3438            <Property Name="Text" Value="Trip to Area 51" />
    3539            <Property Name="Visible" Value="False"/>
    3640            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    37             <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}}" />
    3842            <Property Name="Disabled" Value="True" />
    3943            <Event Name="Clicked" Function="CampaignMenu.Mission4Button_clicked"/>
    4044        </Window>
     45
    4146        <Window Type="MenuWidgets/Button" Name="orxonox/Mission5Button" >
    4247            <Property Name="Text" Value="Area 51 under Fire" />
    4348            <Property Name="Visible" Value="False"/>
    4449            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    45             <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}}" />
    4651            <Property Name="Disabled" Value="True" />
    4752            <Event Name="Clicked" Function="CampaignMenu.Mission5Button_clicked"/>
    4853        </Window>
     54
    4955        <Window Type="MenuWidgets/Button" Name="orxonox/Mission6Button" >
    5056            <Property Name="Text" Value="Escape the Bastards" />
    5157            <Property Name="Visible" Value="False"/>
    5258            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    53             <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}}" />
    5460            <Property Name="Disabled" Value="True" />
    5561            <Event Name="Clicked" Function="CampaignMenu.Mission6Button_clicked"/>
    5662        </Window>
     63
    5764        <Window Type="MenuWidgets/Button" Name="orxonox/Mission7Button" >
    5865            <Property Name="Text" Value="Expedition to Sector 5C" />
    5966            <Property Name="Visible" Value="False"/>
    6067            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    61             <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}}" />
    6269            <Property Name="Disabled" Value="True" />
    6370            <Event Name="Clicked" Function="CampaignMenu.Mission7Button_clicked"/>
    6471        </Window>
     72
    6573        <Window Type="MenuWidgets/Button" Name="orxonox/Mission8Button" >
    6674            <Property Name="Text" Value="Shuttle under Attack" />
    6775            <Property Name="Visible" Value="False"/>
    6876            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    69             <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}}" />
    7078            <Property Name="Disabled" Value="True" />
    7179            <Event Name="Clicked" Function="CampaignMenu.Mission8Button_clicked"/>
    7280        </Window>
     81
    7382        <Window Type="MenuWidgets/Button" Name="orxonox/Mission9Button" >
    7483            <Property Name="Text" Value="Retaliation" />
    7584            <Property Name="Visible" Value="False"/>
    7685            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    77             <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}}" />
    7887            <Property Name="Disabled" Value="True" />
    7988            <Event Name="Clicked" Function="CampaignMenu.Mission9Button_clicked"/>
    8089        </Window>
    8190
    82 
    8391        <Window Type="MenuWidgets/Button" Name="orxonox/CampaignMenuBackButton" >
    8492            <Property Name="Text" Value="Back" />
     93            <Property Name="Visible" Value="False"/>
    8594            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    8695            <Property Name="UnifiedAreaRect" Value="{{0.35,0},{0.85,0},{0.65,0},{0.9,0}}" />
     96            <Property Name="Visible" Value="True"/>
     97            <Property Name="Disabled" Value="False"/>
    8798            <Event Name="Clicked" Function="CampaignMenu.CampaignMenuBackButton_clicked"/>
    8899        </Window>
     100
    89101        <Window Type="MenuWidgets/StaticText" Name="orxonox/CampaignMenuCongratulation" >
    90102            <Property Name="Text" Value="Campaign Completed!!!" />
  • code/branches/presentationFS16/data/gui/scripts/CampaignMenu.lua

    r11052 r11206  
    1717    P.updateButton(7, winMgr:getWindow("orxonox/Mission8Button"))
    1818    P.updateButton(8, winMgr:getWindow("orxonox/Mission9Button"))
     19end
    1920
    2021
    21     if (P.getIndexOfLastFinishedMission() == orxonox.LevelManager:getInstance():getNumberOfCampaignMissions() - 1) then
    22         local label = winMgr:getWindow("orxonox/CampaignMenuCongratulation")
    23         label:setProperty("Visible","True")
     22function P.updateButton(index, button)
     23    local lastMission = orxonox.LevelManager:getInstance():getLastWonMission()
     24    if (lastMission == "") then
     25    else
     26        local lastwon =P.getIndexOfLastFinishedMission()
     27        orxonox.LevelManager:getInstance():updatewon(lastwon)
     28    end
     29
     30    local test =orxonox.LevelManager:getInstance():missionactivate(index)
     31
     32    if (test==1) then
     33        button:setProperty("Visible", "True")
     34        button:setProperty("Disabled", "False")
     35    elseif (test==2) then
     36        button:setProperty("Visible", "True")
     37        button:setProperty("Disabled", "True")
     38    else
     39        button:setProperty("Visible", "False")
     40        button:setProperty("Disabled", "True")
    2441    end
    2542end
    2643
    27 function P.updateButton(index, button)
    28     if (P.shouldDisplayButton(index)) then
    29         button:setProperty("Visible", "True")
    30 
    31         if (P.shouldEnableButton(index)) then
    32             button:setProperty("Disabled", "False")
    33         end
    34     end
    35 end
    36 
    37 function P.shouldDisplayButton(index)
    38     local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()
    39     return index < size
    40 end
    41 
    42 function P.shouldEnableButton(index)
    43     return index <= P.getIndexOfLastFinishedMission() + 1
    44 end
    45 
    4644function P.getIndexOfLastFinishedMission()
    47     local lastMission = orxonox.LevelManager:getInstance():getLastFinishedCampaignMission()
     45    local lastMission = orxonox.LevelManager:getInstance():getLastWonMission()
    4846    if (lastMission and lastMission ~= "") then
    4947        local size = orxonox.LevelManager:getInstance():getNumberOfCampaignMissions()
  • code/branches/presentationFS16/data/gui/scripts/SingleplayerMenu.lua

    r10258 r11206  
    172172
    173173function P.CampaignButton_clicked(e)
     174--    P.test()
    174175    showMenuSheet("CampaignMenu", true)
    175176end
    176177
     178--function P.test()
     179--    orxonox.CampaignMenu:test()
     180--end
     181
    177182return P
Note: See TracChangeset for help on using the changeset viewer.