Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7689


Ignore:
Timestamp:
Dec 1, 2010, 3:00:19 PM (13 years ago)
Author:
dafrick
Message:

Merging menu branch to trunk.

Location:
code/trunk
Files:
18 edited
2 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/data/gui/layouts/HostMenu.layout

    r7687 r7689  
    88        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
    99        <Property Name="BackgroundEnabled" Value="False" />
    10 
    11 
    1210        <Window Type="MenuWidgets/StaticText" Name="orxonox/HostMenuWindow" >
    1311            <Property Name="Text" Value="Multiplayer" />
     
    1715            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    1816            <Property Name="VertFormatting" Value="TopAligned" />
    19             <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.6375,0}}" />
     17            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.7,0}}" />
    2018            <Window Type="MenuWidgets/Listbox" Name="orxonox/HostMenuListbox" >
    2119                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    22                 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.8,0}}" />
     20                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.85,0}}" />
    2321            </Window>
    24            
    25 
    2622            <Window Type="MenuWidgets/RadioButton" Name="orxonox/HostMenuHostButton" >
    2723                <Property Name="Text" Value="Build Server"/>
    2824                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    29                 <Property Name="UnifiedAreaRect" Value="{{0.2,0},{0.85,0},{0.4,0},{0.95,0}}" />
     25                <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.87,0},{0.3,0},{0.97,0}}" />
    3026                <Event Name="SelectStateChanged" Function="HostMenu.HostMenuBuildServerButton_clicked"/>
    3127            </Window>
     
    3329                <Property Name="Text" Value="Dedicated" />
    3430                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    35                 <Property Name="UnifiedAreaRect" Value="{{0.7,0},{0.85,0},{0.9,0},{0.95,0}}" />
     31                <Property Name="UnifiedAreaRect" Value="{{0.5,0},{0.87,0},{0.7,0},{0.97,0}}" />
    3632                <Event Name="SelectStateChanged" Function="HostMenu.HostMenuDedicatedButton_clicked"/>
    3733            </Window>
    38 
     34            <Window Type="MenuWidgets/Checkbox" Name="orxonox/MultiplayerShowAllCheckbox" >
     35                <Property Name="Text" Value="show all" />
     36                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     37                <Property Name="UnifiedAreaRect" Value="{{0.8,0},{0.87,0},{1,0},{.97,0}}" />
     38                <Event Name="CheckStateChanged" Function="HostMenu.MultiplayerShowAll_clicked"/>
     39            </Window>
    3940        </Window>
    40 
    4141        <Window Type="MenuWidgets/Button" Name="orxonox/HostMenuStartButton" >
    4242            <Property Name="Text" Value="Start" />
    4343            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    44             <Property Name="UnifiedAreaRect" Value="{{0.2875,0},{0.6625,0},{0.4875,0},{0.7125,0}}" />
     44            <Property Name="UnifiedAreaRect" Value="{{0.2875,0},{0.725,0},{0.4875,0},{0.775,0}}" />
    4545            <Event Name="Clicked" Function="HostMenu.HostMenuStartButton_clicked"/>
    4646        </Window>
    4747        <Window Type="MenuWidgets/Button" Name="orxonox/HostMenuBackButton" >
    48                     <Property Name="Text" Value="Back" />
    49                     <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    50                     <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.6625,0},{0.7125,0},{0.7125,0}}" />
    51                     <Event Name="Clicked" Function="HostMenu.HostMenuBackButton_clicked"/>
    52                 </Window>
    53 
     48            <Property Name="Text" Value="Back" />
     49            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     50            <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.725,0},{0.7125,0},{0.775,0}}" />
     51            <Event Name="Clicked" Function="HostMenu.HostMenuBackButton_clicked"/>
     52        </Window>
    5453    </Window>
    5554</GUILayout>
  • code/trunk/data/gui/layouts/MainMenuBackground.layout

    r6746 r7689  
    22<GUILayout>
    33    <Window Type="MenuWidgets/StaticImage" Name="orxonox/Background">
    4     <Property Name="UnifiedSize" Value="{{1.0,0},{1.0,0}}"/>
    5     <Property Name="Image" Value="set:MainMenuBackground image:Background"/>
    6     <Property Name="FrameEnabled" Value="set:true"/>
    7     <Property Name="BackgroundEnabled" Value="set:false"/>
    8     <Property Name="InheritsAlpha" Value="False" />
     4        <Property Name="UnifiedSize" Value="{{1.0,0},{1.0,0}}"/>
     5        <Property Name="Image" Value="set:MainMenuBackground image:Background"/>
     6        <Property Name="FrameEnabled" Value="set:true"/>
     7        <Property Name="BackgroundEnabled" Value="set:false"/>
     8        <Property Name="InheritsAlpha" Value="False" />
    99    </Window>
    1010</GUILayout>
  • code/trunk/data/gui/layouts/MultiplayerMenu.layout

    r7648 r7689  
    1515            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    1616            <Property Name="VertFormatting" Value="TopAligned" />
    17             <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.7,0}}" />
     17            <Property Name="UnifiedAreaRect" Value="{{0.25,0},{0.2875,0},{0.75,0},{0.6375,0}}" />
    1818            <Window Type="MenuWidgets/Listbox" Name="orxonox/MultiplayerListbox" >
    1919                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    2020                <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.8,0}}" />
    2121            </Window>
    22             <Window Type="MenuWidgets/RadioButton" Name="orxonox/MultiplayerJoinButton" >
    23                 <Property Name="Text" Value="Join" />
    24                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    25                 <Property Name="UnifiedAreaRect" Value="{{0.1,0},{0.81,0},{0.3,0},{0.89,0}}" />
    26                 <Event Name="SelectStateChanged" Function="MultiplayerMenu.MultiplayerJoinButton_clicked"/>
    27             </Window>
    28             <Window Type="MenuWidgets/RadioButton" Name="orxonox/MultiplayerHostButton" >
    29                 <Property Name="Text" Value="Host" />
    30                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    31                 <Property Name="UnifiedAreaRect" Value="{{0.4,0},{0.81,0},{0.6,0},{0.89,0}}" />
    32                 <Event Name="SelectStateChanged" Function="MultiplayerMenu.MultiplayerHostButton_clicked"/>
    33             </Window>
    34             <Window Type="MenuWidgets/RadioButton" Name="orxonox/MultiplayerDedicatedButton" >
    35                 <Property Name="Text" Value="Dedicated" />
    36                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    37                 <Property Name="UnifiedAreaRect" Value="{{0.7,0},{0.81,0},{0.9,0},{0.89,0}}" />
    38                 <Event Name="SelectStateChanged" Function="MultiplayerMenu.MultiplayerDedicatedButton_clicked"/>
    39             </Window>
    40             <Window Type="MenuWidgets/Checkbox" Name="orxonox/MultiplayerShowAllCheckbox" >
    41                 <Property Name="Text" Value="show all" />
    42                 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    43                 <Property Name="UnifiedAreaRect" Value="{{0.65,0},{0.89,0},{0.8,0},{0.99,0}}" />
    44                 <Property Name="Disabled" Value="True" />
    45                 <Event Name="CheckStateChanged" Function="MultiplayerMenu.MultiplayerShowAll_clicked"/>
    46             </Window>
    4722        </Window>
    48         <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerStartButton" >
    49             <Property Name="Text" Value="Start" />
    50             <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    51             <Property Name="UnifiedAreaRect" Value="{{0.2875,0},{0.725,0},{0.4875,0},{0.775,0}}" />
    52             <Event Name="Clicked" Function="MultiplayerMenu.MultiplayerStartButton_clicked"/>
    53         </Window>
    54         <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerBackButton" >
     23         <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerBackButton" >
    5524            <Property Name="Text" Value="Back" />
    5625            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
    57             <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.725,0},{0.7125,0},{0.775,0}}" />
     26            <Property Name="UnifiedAreaRect" Value="{{0.7125,0},{0.8625,0},{0.9125,0},{0.9125,0}}" />
    5827            <Event Name="Clicked" Function="MultiplayerMenu.MultiplayerBackButton_clicked"/>
     28        </Window>
     29        <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerJoinButton" >
     30            <Property Name="Text" Value="Join" />
     31            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     32            <Property Name="UnifiedAreaRect" Value="{{0.2875,0},{0.6625,0},{0.4875,0},{0.7125,0}}" />
     33            <Event Name="Clicked" Function="MultiplayerMenu.MultiplayerJoinButton_clicked"/>
     34        </Window>
     35        <Window Type="MenuWidgets/Button" Name="orxonox/MultiplayerHostButton" >
     36            <Property Name="Text" Value="Host" />
     37            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
     38            <Property Name="UnifiedAreaRect" Value="{{0.5125,0},{0.6625,0},{0.7125,0},{0.7125,0}}" />
     39            <Event Name="Clicked" Function="MultiplayerMenu.MultiplayerHostButton_clicked"/>
    5940        </Window>
    6041    </Window>
    6142</GUILayout>
     43
  • code/trunk/data/gui/scripts/AudioMenu.lua

    r6746 r7689  
    22
    33local P = createMenuSheet("AudioMenu")
     4
     5P.buttonList = {}
     6
     7function P.onShow()
     8    P.oldindex = -2
     9    P.index = -1
     10end
    411
    512function P.onLoad()
     
    4249        listboxwindow:setItemSelectState(0,true)
    4350    end
     51
     52    local item = {
     53            ["button"] = winMgr:getWindow("orxonox/AudioBackButton"),
     54            ["function"]  = P.AudioBackButton_clicked
     55    }
     56    P.buttonList[1] = item
    4457end
    4558
     
    172185end
    173186
     187function P.onKeyPressed()
     188    buttonIteratorHelper(P.buttonList, code, P, 1, 1)
     189end
     190
    174191return P
    175192
  • code/trunk/data/gui/scripts/ControlsMenu.lua

    r6748 r7689  
    22
    33local P = createMenuSheet("ControlsMenu")
     4P.buttonList = {}
    45P.loadAlong = { "MouseControlsMenu", "KeyBindMenu" }
     6
     7function P.onLoad()
     8    P.multiplayerMode = "startClient"
     9
     10    --buttons are arranged in a 3x1 matrix:
     11    local item = {
     12            ["button"] = winMgr:getWindow("orxonox/MouseControlsButton"),
     13            ["function"]  = P.ControlsMouseControlsButton_clicked
     14    }
     15    P.buttonList[1] = item
     16
     17    local item = {
     18            ["button"] = winMgr:getWindow("orxonox/KeybindingsButton"),
     19            ["function"]  = P.ControlsKeyboardControlsButton_clicked
     20    }
     21    P.buttonList[2] = item
     22
     23    local item = {
     24            ["button"] = winMgr:getWindow("orxonox/ControlsBackButton"),
     25            ["function"]  = P.ControlsBackButton_clicked
     26    }
     27    P.buttonList[3] = item
     28
     29end
     30
     31function P.onShow()
     32    --indices to iterate through buttonlist
     33    P.oldindex = -2
     34    P.index = -1
     35end
    536
    637function P.ControlsMouseControlsButton_clicked(e)
     
    1647end
    1748
     49function P.onKeyPressed()
     50    buttonIteratorHelper(P.buttonList, code, P, 3, 1)
     51end
     52
    1853return P
    1954
  • code/trunk/data/gui/scripts/CreditsMenu.lua

    r6746 r7689  
    22
    33local P = createMenuSheet("CreditsMenu")
     4
     5P.buttonList = {}
     6
     7function P.onLoad()
     8    local item = {
     9            ["button"] = winMgr:getWindow("orxonox/CreditsBackButton"),
     10            ["function"]  = P.CreditsBackButton_clicked
     11    }
     12    P.buttonList[1] = item
     13end
     14
     15function P.onShow()
     16    --indices to iterate through buttonlist
     17    P.oldindex = -2
     18    P.index = -1
     19end
    420
    521function P.CreditsBackButton_clicked(e)
     
    723end
    824
     25function P.onKeyPressed()
     26    buttonIteratorHelper(P.buttonList, code, P, 1, 1)
     27end
     28
    929return P
    1030
  • code/trunk/data/gui/scripts/GUISheet.lua

    r7403 r7689  
    6464end
    6565
     66function P:onKeyPressed(e)
     67end
     68
    6669return P
  • code/trunk/data/gui/scripts/GUITools.lua

    r7163 r7689  
    5454    return height
    5555end
     56
     57--function to iterate through a menu sheet by using arrowkeys
     58
     59--@arguments:
     60--  list: 2-dimensional table, arguments are items that contain a button and its function
     61--        !!note: each button can only be in the list once!!
     62--  code: code of any key on the keyboard
     63--  P: menusheet
     64--  n: number of rows of the buttontable
     65--  m: number of colums of the buttontable
     66
     67function buttonIteratorHelper(list, code, P, n, m)
     68
     69    --after a key (down,up,left,right) is pressed the index of the current button has to be updated   
     70
     71    --key down
     72    if code == "208" then
     73        if P.index < 0 then     -- initial status
     74            P.index = 0
     75            P.oldindex = -1
     76        else
     77            P.oldindex = P.index
     78            P.index = (P.index + m) % (m*n)     --modulo operation works as a "wrap around" in the button menu
     79                                               
     80            while list[P.index+1] == nil do     
     81                P.oldindex = P.index
     82                P.index = (P.index + m) % (m*n)
     83            end
     84        end
     85
     86    --key up
     87    elseif code == "200" then
     88        if P.index < 0 then
     89            P.index = 0
     90            P.oldindex = -1
     91        elseif(P.index == 0) then
     92            P.oldindex = P.index
     93            P.index = m*n-m
     94
     95            while list[P.index+1] == nil do
     96                P.oldindex = P.index
     97                P.index = (P.index-m)%(m*n)
     98            end
     99        else
     100            P.oldindex = P.index
     101            P.index = (P.index -m) % (m*n)
     102
     103            while list[P.index+1] == nil do
     104                P.oldindex = P.index
     105                P.index = (P.index-m)%(m*n)
     106            end
     107        end
     108
     109    --key right
     110    elseif code == "205" then
     111        if P.index < 0 then
     112            P.index = 0
     113            P.oldindex = -1
     114        elseif (P.index+1) % m == 0 then     -- we are at the right-end of a row
     115            P.oldindex = P.index
     116            P.index = P.index + 1 -m
     117
     118            while list[P.index+1] == nil do
     119                P.oldindex = P.index
     120                P.index = P.index + 1
     121            end
     122        else
     123            P.oldindex = P.index
     124            P.index = P.index + 1
     125
     126            while list[P.index+1] == nil do
     127                if (P.index+1) % m == 0 then     -- we are at the right-end of a row
     128                    P.oldindex = P.index
     129                    P.index = P.index + 1-m
     130
     131                else   
     132                    P.oldindex = P.index
     133                    P.index = P.index + 1
     134                end
     135            end
     136        end   
     137
     138    --key left
     139    elseif code == "203" then
     140        if P.index < 0 then
     141            P.index = 0
     142            P.oldindex = -1
     143        elseif P.index % m == 0 then         -- we are at the left-end of a row
     144            P.oldindex = P.index
     145            P.index = P.index +m-1
     146
     147            while list[P.index+1] == nil do
     148                P.oldindex = P.index
     149                P.index = P.index -1
     150            end
     151        else
     152            P.oldindex = P.index
     153            P.index = P.index -1
     154
     155            while list[P.index+1] == nil do
     156                if P.index % m == 0 then     -- we are at the left-end of a row
     157                    P.oldindex = P.index
     158                    P.index = P.index -1 + m
     159                else               
     160                    P.oldindex = P.index
     161                    P.index = P.index -1
     162                end
     163            end   
     164        end
     165    end
     166       
     167    --to update the new current button
     168    if (code == "208" or code == "200" or code == "203" or code == "205") and P.oldindex~= P.index then
     169
     170        local system = CEGUI.System:getSingleton()
     171        local window = winMgr:getWindow("orxonox/MainMenuBackground")
     172
     173        local item = list[P.index+1]
     174        local child = item["button"]
     175
     176        --teste ob der Button nicht schon gehighlightet ist
     177        if child:getProperty("NormalImageRightEdge") == "set:TaharezGreenLook image:ButtonRightHighlight" then
     178            --nop
     179        else
     180            child:setProperty("NormalImageRightEdge", string.sub(child:getProperty("NormalImageRightEdge"),1,-7) .. "Highlight")
     181            child:setProperty("NormalImageLeftEdge", string.sub(child:getProperty("NormalImageLeftEdge"),1,-7) .. "Highlight")
     182            child:setProperty("NormalImageBackground", string.sub(child:getProperty("NormalImageBackground"),1,-7) .. "Highlight")
     183            if P.oldindex >= 0 then
     184                if list[P.oldindex+1] ~= nil then
     185                    local item = list[P.oldindex+1]
     186                    local oldChild = item["button"]
     187                    oldChild:setProperty("NormalImageRightEdge", string.sub(oldChild:getProperty("NormalImageRightEdge"),1,-10) .. "Normal")
     188                    oldChild:setProperty("NormalImageLeftEdge", string.sub(oldChild:getProperty("NormalImageLeftEdge"),1,-10) .. "Normal")
     189                    oldChild:setProperty("NormalImageBackground", string.sub(oldChild:getProperty("NormalImageBackground"),1,-10) .. "Normal")
     190                end
     191            end
     192        end
     193
     194        --for every highlighted button check if index is on its position. If not, set imageproperty on "normal"
     195        local i = 1
     196        while i < (n*m) do
     197            if i == P.index +1 then
     198                i = i+1
     199            else
     200                if list[i] ~= nil then
     201                local item = list[i]
     202                local child = item["button"]
     203                    if child:getProperty("NormalImageRightEdge") == "set:TaharezGreenLook image:ButtonRightHighlight" then
     204                        child:setProperty("NormalImageRightEdge", string.sub(child:getProperty("NormalImageRightEdge"),1,-10) .. "Normal")
     205                        child:setProperty("NormalImageLeftEdge", string.sub(child:getProperty("NormalImageLeftEdge"),1,-10) .. "Normal")
     206                        child:setProperty("NormalImageBackground", string.sub(child:getProperty("NormalImageBackground"),1,-10) .. "Normal")
     207                    end
     208                end
     209            end
     210                i=i+1
     211        end
     212    end
     213   
     214    --enter
     215    if code == "28" then
     216        local item = list[P.index+1]
     217        local child = item["button"]
     218        child:setProperty("NormalImageRightEdge", string.sub(child:getProperty("NormalImageRightEdge"),1,-10) .. "Normal")
     219        child:setProperty("NormalImageLeftEdge", string.sub(child:getProperty("NormalImageLeftEdge"),1,-10) .. "Normal")
     220        child:setProperty("NormalImageBackground", string.sub(child:getProperty("NormalImageBackground"),1,-10) .. "Normal")
     221
     222        local foo = item["function"]
     223        foo()
     224    end
     225
     226end
     227
     228--write index and oldindex on the console
     229--works like buttonIteratorHelper
     230function indexTester(list,code,P,n,m)
     231    --key down
     232    if code == "208" then
     233        if P.index < 0 then     -- initial status
     234            P.index = 0
     235            P.oldindex = -1
     236        else
     237            P.oldindex = P.index
     238            P.index = (P.index + m) % (m*n)
     239
     240            while list[P.index+1] == nil do
     241                P.oldindex = P.index
     242                P.index = (P.index + m) % (m*n)
     243            end
     244        end
     245
     246    --key up
     247    elseif code == "200" then
     248        if P.index < 0 then
     249            P.index = 0
     250            P.oldindex = -1
     251        elseif(P.index == 0) then
     252            P.oldindex = P.index
     253            P.index = m*n-m
     254
     255            while list[P.index+1] == nil do
     256                P.oldindex = P.index
     257                P.index = (P.index-m)%(m*n)
     258            end
     259        else
     260            P.oldindex = P.index
     261            P.index = (P.index -m) % (m*n)
     262
     263            while list[P.index+1] == nil do
     264                P.oldindex = P.index
     265                P.index = P.index -m
     266            end
     267        end
     268
     269    --key right
     270    elseif code == "205" then
     271        if P.index < 0 then
     272            P.index = 0
     273            P.oldindex = -1
     274        elseif (P.index+1) % m == 0 then     -- we are at the right-end of a row
     275            P.oldindex = P.index
     276            P.index = P.index + 1 -m
     277
     278            while list[P.index+1] == nil do
     279                P.oldindex = P.index
     280                P.index = P.index + 1
     281            end
     282        else
     283            P.oldindex = P.index
     284            P.index = P.index + 1
     285
     286            while list[P.index+1] == nil do
     287                if (P.index+1) % m == 0 then     -- we are at the right-end of a row
     288                    P.oldindex = P.index
     289                    P.index = P.index + 1-m
     290
     291                else   
     292                    P.oldindex = P.index
     293                    P.index = P.index + 1
     294                end
     295            end
     296        end   
     297
     298    --key left
     299    elseif code == "203" then
     300        if P.index < 0 then
     301            P.index = 0
     302            P.oldindex = -1
     303        elseif P.index % m == 0 then         -- we are at the left-end of a row
     304            P.oldindex = P.index
     305            P.index = P.index +m-1
     306
     307            while list[P.index+1] == nil do
     308                P.oldindex = P.index
     309                P.index = P.index -1
     310            end
     311        else
     312            P.oldindex = P.index
     313            P.index = P.index -1
     314
     315            while list[P.index+1] == nil do
     316                if P.index % m == 0 then     -- we are at the left-end of a row
     317                    P.oldindex = P.index
     318                    P.index = P.index -1 + m
     319                else               
     320                    P.oldindex = P.index
     321                    P.index = P.index -1
     322                end
     323            end   
     324        end
     325    end   
     326
     327    cout(0, P.oldindex)
     328    cout(0, P.index)
     329
     330end
     331
     332
     333
     334
  • code/trunk/data/gui/scripts/GraphicsMenu.lua

    r6746 r7689  
    22
    33local P = createMenuSheet("GraphicsMenu")
     4
     5P.buttonList = {}
     6
     7function P.onShow()
     8    --indices to iterate through buttonlist (trivial in this menu sheet)
     9    P.oldindex = -2
     10    P.index = -1
     11end
    412
    513function P.onLoad()
     
    8391    scrollbar_active = false
    8492    block = false
     93
     94    local item = {
     95            ["button"] = winMgr:getWindow("orxonox/GraphicsBackButton"),
     96            ["function"]  = P.GraphicsBackButton_clicked
     97    }
     98    P.buttonList[1] = item
    8599end
    86100
     
    195209end
    196210
     211function P.onKeyPressed()
     212    buttonIteratorHelper(P.buttonList, code, P, 1, 1)
     213end
     214
    197215return P
    198216
  • code/trunk/data/gui/scripts/HostMenu.lua

    r7687 r7689  
    66
    77P.buttonList = {}
     8P.levelList = {}
     9P.itemList = {}
     10P.showAll = false
    811
    912function P.onLoad()
    10     P.multiplayerMode = "startClient"
     13    P.multiplayerMode = "startServer"
     14    local window = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
     15    local button = tolua.cast(window,"CEGUI::Checkbox")
     16    button:setSelected(false)
     17    P.createLevelList()
    1118
    1219    local item = {
     
    2835        local button = tolua.cast(window,"CEGUI::RadioButton")
    2936        button:setSelected(true)
    30         P.showLevelList()
     37        P.createLevelList()
    3138    end
    3239
     
    3542        local button = tolua.cast(window,"CEGUI::RadioButton")
    3643        button:setSelected(true)
    37         P.showLevelList()
     44        P.createLevelList()
    3845    end
    3946
     
    4350end
    4451
     52function P.createLevelList()
     53    P.levelList = {}
     54    P.itemList = {}
     55    local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/HostMenuListbox"))
     56    listbox:resetList()
     57    orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true)
     58    local preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
     59    local size = orxonox.LevelManager:getInstance():getNumberOfLevels()
     60    local index = 0
     61    local level = nil
     62    while index < size do
     63        level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
     64        if level ~= nil then
     65            if P.showAll or not level:hasTag("test") then
     66                table.insert(P.levelList, level)
     67            end
     68        end
     69        index = index + 1
     70    end
     71    --TODO: Reintroduce sorting, if needed. At the moment it's sorted by filename.
     72    --table.sort(levelList)
     73    for k,v in pairs(P.levelList) do
     74        local item = CEGUI.createListboxTextItem(v:getName())
     75        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
     76        listbox:addItem(item)
     77        if v:getXMLFilename() == preselect then
     78            listbox:setItemSelectState(item, true)
     79        end
     80        P.itemList[k] = listbox:getListboxItemFromIndex(k-1)
     81        orxonox.GUIManager:setTooltipTextHelper(P.itemList[k], v:getDescription())
     82    end
     83end
     84
    4585function P.HostMenuBuildServerButton_clicked(e)
    4686    P.multiplayerMode = "startServer"
    47     P.showLevelList()
     87    P.createLevelList()
    4888end
    4989
    5090function P.HostMenuDedicatedButton_clicked(e)
    5191    P.multiplayerMode = "startDedicated"
    52     P.showLevelList()
     92    P.createLevelList()
    5393end
    5494
     
    5797end
    5898
    59 function P.HostMenuStartButton_clicked(e)
    60     local choice = winMgr:getWindow("orxonox/HostMenuListbox"):getFirstSelectedItem()
    61         if choice then
    62             orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    63         else
    64             return
    65         end
    66     orxonox.execute(P.multiplayerMode)
    67     hideAllMenuSheets()
    68 end
    69 
    70 
    71 
    72 function P.showLevelList()
    73     local listbox = winMgr:getWindow("orxonox/HostMenuListbox")
    74     CEGUI.toListbox(listbox):resetList()
    75     local preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
    76     orxonox.LevelManager:getInstance():compileAvailableLevelList()
    77     local levelList = {}
    78     local index = 0
    79     local level = ""
    80     while true do
    81         level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
    82         if level == "" then
    83             break
    84         end
    85         table.insert(levelList, level)
    86         index = index + 1
    87     end
    88     table.sort(levelList)
    89     index = 1
    90     for k,v in pairs(levelList) do
    91         local item = CEGUI.createListboxTextItem(v)
    92         item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
    93         item:setID(index)
    94         index = index + 1
    95         CEGUI.toListbox(listbox):addItem(item)
    96         if v .. ".oxw" == preselect then
    97             listbox:setItemSelectState(item, true)
     99function P.HostMenuStartButton_clicked(e)   
     100    local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/HostMenuListbox"))
     101    local choice = listbox:getFirstSelectedItem()
     102    if choice ~= nil then
     103        local index = listbox:getItemIndex(choice)
     104        local level = P.levelList[index+1]
     105        if level ~= nil then
     106            orxonox.LevelManager:getInstance():setDefaultLevel(level:getXMLFilename())
     107            orxonox.execute(P.multiplayerMode)
     108            hideAllMenuSheets()
    98109        end
    99110    end
    100111end
    101112
     113function P.MultiplayerShowAll_clicked(e)
     114    local checkbox = tolua.cast(winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox"), "CEGUI::Checkbox")
     115    local show = checkbox:isSelected()
     116    if show ~= P.showAll then
     117        P.showAll = show
     118        P.createLevelList()
     119   end
     120end
    102121
    103122function P.onKeyPressed()
     
    105124end
    106125
    107 
    108 
    109126return P
  • code/trunk/data/gui/scripts/InGameMenu.lua

    r6748 r7689  
    1212    orxonox.Game:getInstance():popState()
    1313    orxonox.Game:getInstance():popState()
    14     orxonox.Game:getInstance():requestState("mainmenu")
    1514    hideMenuSheet("InGameMenu")
    1615end
  • code/trunk/data/gui/scripts/MainMenu.lua

    r7163 r7689  
    33local P = createMenuSheet("MainMenu")
    44P.loadAlong = { "SingleplayerMenu", "MultiplayerMenu", "SettingsMenu", "CreditsMenu" }
     5
     6P.buttonList = {}
     7
     8function P.onLoad()
     9    --buttons are arranged in a 6x1 Matrix (list)
     10    local item = {
     11            ["button"] = winMgr:getWindow("orxonox/QuickGameTestButton"),
     12            ["function"]  = P.QuickGameTestButton_clicked
     13    }
     14    table.insert(P.buttonList,item)
     15
     16    item = {
     17            ["button"] = winMgr:getWindow("orxonox/SingleplayerButton"),
     18            ["function"]  = P.SingleplayerButton_clicked
     19    }
     20    table.insert(P.buttonList,item)
     21
     22    item = {
     23            ["button"] = winMgr:getWindow("orxonox/MultiplayerButton"),
     24            ["function"]  = P.MultiplayerButton_clicked
     25    }
     26    table.insert(P.buttonList,item)
     27
     28    item = {
     29            ["button"] = winMgr:getWindow("orxonox/SettingsButton"),
     30            ["function"]  = P.SettingsButton_clicked
     31    }
     32    table.insert(P.buttonList,item)
     33
     34    item = {
     35            ["button"] = winMgr:getWindow("orxonox/CreditsButton"),
     36            ["function"]  = P.CreditsButton_clicked
     37    }
     38    table.insert(P.buttonList,item)
     39
     40    item = {
     41            ["button"] = winMgr:getWindow("orxonox/ExitButton"),
     42            ["function"]  = P.ExitButton_clicked
     43    }
     44    table.insert(P.buttonList,item)
     45end
     46
     47function P.onShow()
     48    --indices to iterate through buttonlist
     49    P.oldindex = -2
     50    P.index = -1
     51end
    552
    653-- events for MainMenu
     
    3077end
    3178
     79function P.onKeyPressed()
     80    buttonIteratorHelper(P.buttonList, code, P, 6, 1)
     81end
     82
    3283return P
    3384
  • code/trunk/data/gui/scripts/MenuSheet.lua

    r7163 r7689  
    1616    newSheet.bHidePrevious  = handleDefArg(_bHidePrevious,  true)
    1717    newSheet.tShowCursor    = handleDefArg(_tShowCusor,     TriBool.True)
    18     newSheet.tUseKeyboard   = handleDefArg(_tUseKeyboard,   TriBool.Dontcare)
     18    newSheet.tUseKeyboard   = handleDefArg(_tUseKeyboard,   TriBool.True)
    1919    newSheet.bBlockJoyStick = handleDefArg(_bBlockJoyStick, false)
    2020
  • code/trunk/data/gui/scripts/MultiplayerMenu.lua

    r7648 r7689  
    33local P = createMenuSheet("MultiplayerMenu")
    44
    5 P.levelList = {}
    6 P.itemList = {}
    7 P.showAll = false
     5P.buttonList = {}
    86
    97function P.onLoad()
    10     P.multiplayerMode = "startClient"
     8    P.multiplayerMode = "startClient"
     9
     10    --button are arranged in a 2x2 matrix, the left lower item is nil
     11    local item = {
     12            ["button"] = winMgr:getWindow("orxonox/MultiplayerJoinButton"),
     13            ["function"]  = P.MultiplayerJoinButton2_clicked
     14    }
     15    P.buttonList[1] = item
     16
     17    local item = {
     18            ["button"] = winMgr:getWindow("orxonox/MultiplayerHostButton"),
     19            ["function"]  = P.MultiplayerHostButton2_clicked
     20    }
     21    P.buttonList[2] = item
     22
     23    local item = {
     24            ["button"] = winMgr:getWindow("orxonox/MultiplayerBackButton"),
     25            ["function"]  = P.MultiplayerBackButton_clicked
     26    }
     27    P.buttonList[4] = item
     28
    1129end
    1230
    1331function P.onShow()
    14     if P.multiplayerMode == "startClient" then
    15         local window = winMgr:getWindow("orxonox/MultiplayerJoinButton")
    16         local button = tolua.cast(window,"CEGUI::RadioButton")
    17         button:setSelected(true)
    18         local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
    19         checkbox:setProperty("Disabled", "True")
    20         P.showServerList()
    21     end
    22     if P.multiplayerMode == "startServer" then
    23         local window = winMgr:getWindow("orxonox/MultiplayerHostButton")
    24         local button = tolua.cast(window,"CEGUI::RadioButton")
    25         button:setSelected(true)
    26         local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
    27         checkbox:setProperty("Disabled", "False")
    28         P.showLevelList()
    29     end
    30     if P.multiplayerMode == "startDedicated" then
    31         local window = winMgr:getWindow("orxonox/MultiplayerDedicatedButton")
    32         local button = tolua.cast(window,"CEGUI::RadioButton")
    33         button:setSelected(true)
    34         local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
    35         checkbox:setProperty("Disabled", "True")
    36         P.showLevelList()
    37     end
    38 end
     32    P.showServerList()
    3933
    40 function P.MultiplayerJoinButton_clicked(e)
    41     P.multiplayerMode = "startClient"
    42     local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
    43     checkbox:setProperty("Disabled", "True")
    44     P.showServerList()
     34    --indices to iterate through buttonlist
     35    P.oldindex = -2
     36    P.index = -1
    4537end
    4638
    4739function P.MultiplayerHostButton_clicked(e)
    48     P.multiplayerMode = "startServer"
    49     local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
    50     checkbox:setProperty("Disabled", "False")
    51     P.showLevelList()
     40    showMenuSheet("HostMenu", true)
    5241end
    5342
    54 function P.MultiplayerDedicatedButton_clicked(e)
    55     P.multiplayerMode = "startDedicated"
    56     local checkbox = winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox")
    57     checkbox:setProperty("Disabled", "True")
    58     P.showLevelList()
    59 end
    6043
    61 function P.MultiplayerShowAll_clicked(e)
    62     local checkbox = tolua.cast(winMgr:getWindow("orxonox/MultiplayerShowAllCheckbox"), "CEGUI::Checkbox")
    63     local show = checkbox:isSelected()
    64     if show ~= P.showAll then
    65         P.showAll = show
    66         P.createLevelList()
     44function P.MultiplayerJoinButton_clicked(e)
     45    local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem()
     46    if choice then
     47        local client = orxonox.Client:getInstance()
     48        local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID()
     49        client:setDestination( P.serverList[index][2], 55556 )
     50    else
     51        return
    6752    end
    68 end
    69 
    70 function P.MultiplayerStartButton_clicked(e)
    71     local choice = winMgr:getWindow("orxonox/MultiplayerListbox"):getFirstSelectedItem()
    72     if P.multiplayerMode == "startClient" then
    73         if choice then
    74             local client = orxonox.Client:getInstance()
    75             local index = tolua.cast(choice, "CEGUI::ListboxItem"):getID()
    76             client:setDestination( P.serverList[index][2], 55556 )
    77         else
    78             return
    79         end
    80     else
    81         if choice then
    82             orxonox.LevelManager:getInstance():setDefaultLevel(choice:getText() .. ".oxw")
    83         else
    84             return
    85         end
    86     end
    87     orxonox.execute(P.multiplayerMode)
     53    orxonox.execute("startClient")
    8854    hideAllMenuSheets()
    8955end
     
    9157function P.MultiplayerBackButton_clicked(e)
    9258    hideMenuSheet(P.name)
    93 end
    94 
    95 function P.showLevelList()
    96     P.createLevelList()
    97 end
    98 
    99 function P.createLevelList()
    100     P.levelList = {}
    101     P.itemList = {}
    102     local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/MultiplayerListbox"))
    103     listbox:resetList()
    104     orxonox.GUIManager:setItemTooltipsEnabledHelper(listbox, true)
    105     local preselect = orxonox.LevelManager:getInstance():getDefaultLevel()
    106     local size = orxonox.LevelManager:getInstance():getNumberOfLevels()
    107     local index = 0
    108     local level = nil
    109     while index < size do
    110         level = orxonox.LevelManager:getInstance():getAvailableLevelListItem(index)
    111         if level ~= nil then
    112             if P.showAll or not level:hasTag("test") then
    113                 table.insert(P.levelList, level)
    114             end
    115         end
    116         index = index + 1
    117     end
    118     --TODO: Reintroduce sorting, if needed. At the moment it's sorted by filename.
    119     --table.sort(levelList)
    120     for k,v in pairs(P.levelList) do
    121         local item = CEGUI.createListboxTextItem(v:getName())
    122         item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
    123         listbox:addItem(item)
    124         if v:getXMLFilename() == preselect then
    125             listbox:setItemSelectState(item, true)
    126         end
    127         P.itemList[k] = listbox:getListboxItemFromIndex(k-1)
    128         orxonox.GUIManager:setTooltipTextHelper(P.itemList[k], v:getDescription())
    129     end
    13059end
    13160
     
    16190end
    16291
     92function P.onKeyPressed()
     93    buttonIteratorHelper(P.buttonList, code, P, 2, 2)
     94end
     95
    16396return P
    16497
  • code/trunk/data/gui/scripts/SettingsMenu.lua

    r7163 r7689  
    33local P = createMenuSheet("SettingsMenu")
    44P.loadAlong = { "ControlsMenu", "AudioMenu", "GraphicsMenu" }
     5
     6P.buttonList = {}
     7
     8function P.onLoad()
     9    --"Gameplay" and "Multiplayer Options" are not integrated in the list
     10    --buttons are arranged in a 4x2 matrix. The lower-right element is not in the matrix!
     11    local item = {
     12            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/GraphicsButton"),
     13            ["function"]  = P.SettingsGraphicsButton_clicked
     14    }
     15    P.buttonList[2] = item
     16
     17    local item = {
     18            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/AudioButton"),
     19            ["function"]  = P.SettingsAudioButton_clicked
     20    }
     21    P.buttonList[4] = item
     22
     23
     24    local item = {
     25            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/ControlsButton"),
     26            ["function"]  = P.SettingsControlsButton_clicked
     27    }
     28    P.buttonList[5] = item
     29
     30    local item = {
     31            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/MiscellaneousButton"),
     32            ["function"]  = P.SettingsMiscellaneousButton_clicked
     33    }
     34    P.buttonList[6] = item
     35
     36    local item = {
     37            ["button"] = winMgr:getWindow("orxonox/SettingsMenu/SettingsBackButton"),
     38            ["function"]  = P.SettingsBackButton_clicked
     39    }
     40    P.buttonList[7] = item
     41
     42end
     43
     44function P.onShow()
     45    --indices to iterate through buttonlist
     46    P.oldindex = 3
     47    P.index = 2
     48end
    549
    650function P.SettingsGameplayButton_clicked(e)
     
    3276end
    3377
     78function P.onKeyPressed()
     79    buttonIteratorHelper(P.buttonList, code, P, 4, 2)
     80end
     81
    3482return P
    3583
  • code/trunk/data/gui/scripts/SheetManager.lua

    r7403 r7689  
    55local activeMenuSheets = {size = 0, topSheetTuple = nil}
    66local menuSheetsRoot = guiMgr:getMenuRootWindow()
     7local bInGameConsoleClosed = false
     8local mainMenuLoaded = false
     9orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed")
    710
    811-----------------------
     
    6972
    7073    -- Count the number of sheets that don't need input till the first that does.
    71     local counter = noInputSheetCounter()
     74    local counter = noInputSheetIndex()
    7275    -- Pause game control if this is the first menu to be displayed
    7376    -- HUGE HACK?
     
    100103    menuSheetsRoot:addChildWindow(menuSheet.window)
    101104
     105    -- If sheet is the MainMenu
     106    if name == "MainMenu" then
     107        mainMenuLoaded = true
     108    end
     109
    102110    -- Handle input distribution
    103111    if bNoInput == false then
     
    118126        end
    119127    end
    120 
     128   
    121129    menuSheet:show()
     130    menuSheetsRoot:activate()
    122131
    123132    return menuSheet
     
    161170    activeMenuSheets.topSheetTuple = activeMenuSheets[activeMenuSheets.size]
    162171
     172    -- If sheet is the MainMenu
     173    if name == "MainMenu" then
     174        mainMenuLoaded = false
     175    end
     176
    163177    -- Leave the input state
    164178    if not sheetTuple.bNoInput then
     
    179193
    180194    -- Count the number of sheets that don't need input till the first that does.
    181     local counter = noInputSheetCounter()
     195    local counter = noInputSheetIndex()
    182196    -- Resume control if the last (non-noInput) menu is hidden
    183197    if counter == 0 then
     
    199213    -- HUGE, very HUGE hacks!
    200214
    201     -- Count the number of sheets that don't need input till the first that does.
    202     local counter = noInputSheetCounter()
     215    -- If the InGameConsole is active, ignore the ESC command.
     216    if bInGameConsoleClosed == true then
     217        bInGameConsoleClosed = false
     218        return
     219    end
     220
     221    -- Count the number of sheets that don't need input till the first that does.
     222    local counter = noInputSheetIndex()
    203223
    204224    -- If the first sheet that needs input is the MainMenu.
    205     if counter == 1 and activeMenuSheets[1].sheet.name == "MainMenu" then
     225    if noInputSheetCounter() == 1 and activeMenuSheets[counter].sheet.name == "MainMenu" then
    206226        orxonox.execute("exit")
    207227    -- If there is at least one sheet that needs input.
     
    213233end
    214234
     235function keyPressed(e)
     236    local we = tolua.cast(e, "CEGUI::KeyEventArgs")
     237    local sheet = activeMenuSheets[activeMenuSheets.size]
     238    code = tostring(we.scancode)
     239    -- Some preprocessing
     240    if not mainMenuLoaded and not sheet.bNoInput then
     241        if code == "1" then
     242            keyESC()
     243        elseif code == "0"then
     244            orxonox.CommandExecutor:execute("openConsole")
     245        end
     246    end
     247    sheet.sheet:onKeyPressed()
     248end
     249
    215250function setBackgroundImage(imageSet, imageName)
    216251    guiMgr:setBackgroundImage(imageSet, imageName)
    217252end
    218253
     254function noInputSheetIndex()
     255    -- Count the number of sheets that don't need input till the first that does.
     256    local index = activeMenuSheets.size
     257    while index > 0 and activeMenuSheets[index].bNoInput do
     258        index = index - 1
     259    end
     260    return index
     261end
     262
    219263function noInputSheetCounter()
    220     -- Count the number of sheets that don't need input till the first that does.
     264    -- Count the number of sheets that do need input.
    221265    local counter = activeMenuSheets.size
    222     while counter > 0 and activeMenuSheets[counter].bNoInput do
    223         counter = counter - 1
     266    for i = 1,activeMenuSheets.size do
     267        if activeMenuSheets[i].bNoInput then
     268            counter = counter - 1
     269        end
    224270    end
    225271    return counter
     272end
     273
     274function inGameConsoleClosed()
     275    bInGameConsoleClosed = not bInGameConsoleClosed;
    226276end
    227277
  • code/trunk/data/gui/scripts/SingleplayerMenu.lua

    r7648 r7689  
    33local P = createMenuSheet("SingleplayerMenu")
    44
     5P.buttonList = {}
    56P.levelList = {}
    67P.itemList = {}
     
    1213    button:setSelected(false)
    1314    P.createLevelList()
     15
     16    --buttons are arranged in a 1x2 matrix
     17    local item = {
     18            ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"),
     19            ["function"]  = P.SingleplayerStartButton_clicked
     20    }
     21    P.buttonList[1] = item
     22
     23    local item = {
     24            ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"),
     25            ["function"]  = P.SingleplayerBackButton_clicked
     26    }
     27    P.buttonList[2] = item
    1428end
    1529
     
    4761end
    4862
     63function P.onShow()
     64    --indices to iterate through buttonlist
     65    P.oldindex = -2
     66    P.index = -1
     67end
     68
    4969function P.SingleplayerStartButton_clicked(e)
    5070    local listbox = CEGUI.toListbox(winMgr:getWindow("orxonox/SingleplayerLevelListbox"))
     
    7494end
    7595
     96function P.onKeyPressed()
     97    buttonIteratorHelper(P.buttonList, code, P, 1, 2)
     98end
     99
    76100return P
    77101
  • code/trunk/src/orxonox/gamestates/GSMainMenu.cc

    r7284 r7689  
    6767        RegisterRootObject(GSMainMenu);
    6868
    69         InputManager::getInstance().createInputState("MainMenuHackery")->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
     69        InputManager::getInstance().createInputState("MainMenuHackery", true, true)->setKeyHandler(KeyBinderManager::getInstance().getDefaultAsHandler());
    7070
    7171        // create an empty Scene
  • code/trunk/src/orxonox/overlays/InGameConsole.cc

    r7401 r7689  
    4949#include "core/ConfigValueIncludes.h"
    5050#include "core/command/ConsoleCommand.h"
     51#include "core/GUIManager.h"
    5152#include "core/input/InputManager.h"
    5253#include "core/input/InputState.h"
    5354#include "core/input/InputBuffer.h"
     55#include "core/LuaState.h"
    5456
    5557namespace orxonox
     
    119121                {
    120122                    if (this->consoleOverlayTextAreas_[i])
    121                       Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayTextAreas_[i]);
     123                        Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->consoleOverlayTextAreas_[i]);
    122124                    this->consoleOverlayTextAreas_[i] = 0;
    123125                }
     
    495497                }
    496498                else
    497                   this->inputWindowStart_ = 0;
     499                    this->inputWindowStart_ = 0;
    498500                this->displayedText_ = output;
    499501                this->consoleOverlayTextAreas_[index]->setCaption(multi_cast<Ogre::DisplayString>(output));
     
    532534        {
    533535            this->bActive_ = false;
     536            GUIManager::getInstance().getLuaState()->doString("inGameConsoleClosed()"); // Notify the SheetManager in lua, that the console has been closed.
    534537            InputManager::getInstance().leaveState("console");
    535538            this->shell_->unregisterListener(this);
     
    608611    /*static*/ void InGameConsole::closeConsole()
    609612    {
     613        GUIManager::getInstance().getLuaState()->doString("inGameConsoleClosed()");  // Notify the SheetManager in lua, that the console has been closed, but not by ESC.
    610614        InGameConsole::getInstance().deactivate();
    611615    }
     616
    612617}
Note: See TracChangeset for help on using the changeset viewer.