Changeset 7607 for code/branches/menu
- Timestamp:
- Nov 2, 2010, 11:30:44 PM (14 years ago)
- Location:
- code/branches/menu/data/gui
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/menu/data/gui/layouts/MainMenu.layout
r7588 r7607 8 8 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1.0,0},{1.0,0}}" /> 9 9 <Property Name="BackgroundEnabled" Value="False" /> 10 <Event Name="KeyDown" Function="MainMenu.Key_clicked"/> 10 11 <Window Type="MenuWidgets/Button" Name="orxonox/QuickGameTestButton" > 11 12 <Property Name="Text" Value="Quickstart" /> … … 43 44 <Event Name="Clicked" Function="MainMenu.ExitButton_clicked"/> 44 45 </Window> 45 <Event Name="KeyDown" Function="MainMenu.Key_clicked"/>46 46 </Window> 47 47 </GUILayout> -
code/branches/menu/data/gui/scripts/GUISheet.lua
r7403 r7607 64 64 end 65 65 66 function P:onKeyPressed(e) 67 end 68 66 69 return P -
code/branches/menu/data/gui/scripts/MainMenu.lua
r7594 r7607 10 10 hideAllMenuSheets() 11 11 orxonox.execute("startGame") 12 end 13 14 function P.onShow() 15 12 16 end 13 17 … … 32 36 end 33 37 34 function P.Key_clicked(e) 38 function P.onKeyPressed() 39 --local we = tolua.cast(e, "CEGUI::KeyEventArgs") 40 cout(0, code) 41 if code == "15" then 42 P.index = P.index + 1 43 local window = winMgr:getWindow("orxonox/MainMenuBackground") 44 if P.index == window:getChildCount() then 45 P.index = 1 46 end 47 local child = window:getChildAtIdx(P.index-1) 48 child:setProperty("NormalImageRightEdge", string.sub(child:getProperty("NormalImageRightEdge"),1,-7) .. "Highlight") 49 child:setProperty("NormalImageLeftEdge", string.sub(child:getProperty("NormalImageLeftEdge"),1,-7) .. "Highlight") 50 child:setProperty("NormalImageBackground", string.sub(child:getProperty("NormalImageBackground"),1,-7) .. "Highlight") 51 elseif code == "28" and P.index ~= 0 then 52 if P.index == 1 then 53 P.QuickGameTestButton_clicked() 54 elseif P.index == 2 then 55 P.SingleplayerButton_clicked() 56 elseif P.index == 3 then 57 P.MultiplayerButton_clicked() 58 elseif P.index == 4 then 59 P.SettingsButton_clicked() 60 elseif P.index == 5 then 61 P.CreditsButton_clicked() 62 elseif P.index == 6 then 63 P.ExitButton_clicked() 64 end 65 end 66 end 67 68 --[[function P.Key_clicked(e) 35 69 local we = tolua.cast(e, "CEGUI::KeyEventArgs") 36 70 cout(0, tostring(we.scancode)) … … 60 94 end 61 95 end 62 end 96 end]]-- 63 97 64 98 return P 65 -
code/branches/menu/data/gui/scripts/SheetManager.lua
r7403 r7607 5 5 local activeMenuSheets = {size = 0, topSheetTuple = nil} 6 6 local menuSheetsRoot = guiMgr:getMenuRootWindow() 7 orxonox.GUIManager:subscribeEventHelper(menuSheetsRoot, "KeyDown", "keyPressed") 7 8 8 9 ----------------------- … … 120 121 121 122 menuSheet:show() 123 menuSheetsRoot:activate() 122 124 123 125 return menuSheet … … 213 215 end 214 216 217 function keyPressed(e) 218 local we = tolua.cast(e, "CEGUI::KeyEventArgs") 219 local sheet = activeMenuSheets[activeMenuSheets.size] 220 code = tostring(we.scancode) 221 sheet.sheet:onKeyPressed() 222 end 223 215 224 function setBackgroundImage(imageSet, imageName) 216 225 guiMgr:setBackgroundImage(imageSet, imageName)
Note: See TracChangeset
for help on using the changeset viewer.