Changeset 6292 for code/branches/presentation2/data/gui/scripts
- Timestamp:
- Dec 9, 2009, 3:56:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/data/gui/scripts/KeyBindMenu.lua
r6284 r6292 17 17 table.insert(commandList, "fire 1 | unfire") 18 18 table.insert(commandList, "onpress fire 2") 19 table.insert(commandList, "scale 1 moveFrontBack") 20 table.insert(commandList, "scale -1 moveFrontBack") 21 table.insert(commandList, "boost") 19 22 table.insert(commandList, "scale 1 moveRightLeft") 20 23 table.insert(commandList, "scale -1 moveRightLeft") 21 table.insert(commandList, "scale 1 moveFrontBack") 22 table.insert(commandList, "boost") 23 table.insert(commandList, "scale -1 moveFrontBack") 24 table.insert(commandList, "scale 1 moveUpDown") 25 table.insert(commandList, "scale -1 moveUpDown") 24 26 table.insert(commandList, "scale 1 rotateRoll") 25 27 table.insert(commandList, "scale -1 rotateRoll") 26 table.insert(commandList, "scale 1 moveUpDown") 27 table.insert(commandList, "scale -1 moveUpDown") 28 table.insert(commandList, "switchCamera") 28 29 table.insert(commandList, "openConsole") 29 30 table.insert(commandList, "OverlayGroup toggleVisibility Debug") … … 36 37 table.insert(nameList, "Secondary Fire") 37 38 table.insert(nameList, "Fire Rocket") 38 table.insert(nameList, "Steer Right") 39 table.insert(nameList, "Steer Left") 40 table.insert(nameList, "Give Thrust") 39 table.insert(nameList, "Accelerate") 40 table.insert(nameList, "Break") 41 41 table.insert(nameList, "Boost") 42 table.insert(nameList, "Hit Breaks") 42 table.insert(nameList, "Move Right") 43 table.insert(nameList, "Move Left") 44 table.insert(nameList, "Move Up") 45 table.insert(nameList, "Move Down") 43 46 table.insert(nameList, "Roll Right") 44 47 table.insert(nameList, "Roll Left") 45 table.insert(nameList, "Up") 46 table.insert(nameList, "Down") 48 table.insert(nameList, "Switch Camera") 47 49 table.insert(nameList, "Open Console") 48 50 table.insert(nameList, "Show Debug") 49 51 table.insert(nameList, "Show Stats") 50 table.insert(nameList, " mouseLook")52 table.insert(nameList, "Look Around") 51 53 table.insert(nameList, "Pause") 52 54 … … 58 60 local line = winMgr:createWindow("DefaultWindow", "orxonox/KeyBindPane/Binding" .. k) 59 61 local command = winMgr:createWindow("TaharezLook/StaticText", "orxonox/KeyBindPane/Binding" .. k .. "/Command") 60 local button = winMgr:createWindow("TaharezLook/Button", "orxonox/KeyBindPane/Binding" .. k .. "/Button") 61 local clear = winMgr:createWindow("TaharezLook/Button", "orxonox/KeyBindPane/Binding" .. k .. "/Clear") 62 local button = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Button") 63 local clear = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Clear") 64 local button2 = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Button2") 65 local clear2 = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Clear2") 66 local add = winMgr:createWindow("TaharezLook/TabButton", "orxonox/KeyBindPane/Binding" .. k .. "/Add") 62 67 63 line:setSize(CEGUI.UVector2(CEGUI.UDim(1,-13),CEGUI.UDim(0, lineHeight))) 64 command:setSize(CEGUI.UVector2(CEGUI.UDim(0.55, 0), CEGUI.UDim(1, 0))) 65 button:setSize(CEGUI.UVector2(CEGUI.UDim(0.4, 0), CEGUI.UDim(1, 0))) 66 clear:setSize(CEGUI.UVector2(CEGUI.UDim(0.05, 0),CEGUI.UDim(1,0))) 68 line:setSize(CEGUI.UVector2(CEGUI.UDim(1, -13), CEGUI.UDim(0, lineHeight))) 69 command:setSize(CEGUI.UVector2(CEGUI.UDim(1, 0), CEGUI.UDim(1, 0))) 70 button:setSize(CEGUI.UVector2(CEGUI.UDim(0.25, 0), CEGUI.UDim(0.6, 0))) 71 clear:setSize(CEGUI.UVector2(CEGUI.UDim(0.05, 0), CEGUI.UDim(0.6, 0))) 72 button2:setSize(CEGUI.UVector2(CEGUI.UDim(0.25, 0), CEGUI.UDim(0.6, 0))) 73 clear2:setSize(CEGUI.UVector2(CEGUI.UDim(0.05, 0), CEGUI.UDim(0.6, 0))) 74 add:setSize(CEGUI.UVector2(CEGUI.UDim(0.05, 0), CEGUI.UDim(0.6, 0))) 67 75 68 line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0),CEGUI.UDim(0, lineHeight*(k-1)))) 69 command:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0),CEGUI.UDim(0, 0))) 70 button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.55, 0),CEGUI.UDim(0, 0))) 71 clear:setPosition(CEGUI.UVector2(CEGUI.UDim(0.95, 0),CEGUI.UDim(0, 0))) 76 line:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, lineHeight*(k-1)))) 77 command:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0))) 78 button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.25, 0), CEGUI.UDim(0.2, 0))) 79 clear:setPosition(CEGUI.UVector2(CEGUI.UDim(0.5, 0), CEGUI.UDim(0.2, 0))) 80 button2:setPosition(CEGUI.UVector2(CEGUI.UDim(0.6, 0), CEGUI.UDim(0.2, 0))) 81 clear2:setPosition(CEGUI.UVector2(CEGUI.UDim(0.85, 0), CEGUI.UDim(0.2, 0))) 82 add:setPosition(CEGUI.UVector2(CEGUI.UDim(0.925, 0), CEGUI.UDim(0.2, 0))) 72 83 73 84 command:setText(nameList[k]) 74 85 button:setText(orxonox.KeyBinderManager:getInstance():getCurrent():getBinding(v)) 75 86 clear:setText("X") 87 button2:setText(orxonox.KeyBinderManager:getInstance():getCurrent():getBinding(v)) 88 clear2:setText("X") 89 add:setText("+") 76 90 77 91 orxonox.KeyBinderManager:getInstance():subscribeEventHelper(button, "Clicked", P.filename .. ".KeyBindButton_clicked") 78 92 orxonox.KeyBinderManager:getInstance():subscribeEventHelper(clear, "Clicked", P.filename .. ".KeyBindClear_clicked") 93 orxonox.KeyBinderManager:getInstance():subscribeEventHelper(add, "Clicked", P.filename .. ".KeyBindAdd_clicked") 79 94 --button:subscribeScriptedEvent("EventClicked", P.filename .. ".KeyBindButton_clicked") 80 95 … … 82 97 line:addChildWindow(button) 83 98 line:addChildWindow(clear) 99 line:addChildWindow(button2) 100 line:addChildWindow(clear2) 101 line:addChildWindow(add) 84 102 window:addChildWindow(line) 85 103 end … … 90 108 local name = we.window:getName() 91 109 buttonNr = tonumber(string.match(name, "%d+")) 92 93 110 openInfoPopup("Press any button/key or move a mouse/joystick axis.", KeyBindMenu.keybind) 94 111 end … … 98 115 local name = we.window:getName() 99 116 clearNr = tonumber(string.match(name, "%d+")) 100 117 end 118 119 function P.KeyBindAdd_clicked(e) 101 120 102 121 end … … 118 137 function P.KeyBindBackButton_clicked(e) 119 138 hideGUI("KeyBindMenu") 120 debug("event: back")121 139 end 122 140
Note: See TracChangeset
for help on using the changeset viewer.