Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2009, 3:56:03 PM (15 years ago)
Author:
cmueri
Message:

New layout of the keybind menu.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/data/gui/scripts/KeyBindMenu.lua

    r6284 r6292  
    1717    table.insert(commandList, "fire 1 | unfire")
    1818    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")
    1922    table.insert(commandList, "scale 1 moveRightLeft")
    2023    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")
    2426    table.insert(commandList, "scale 1 rotateRoll")
    2527    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")
    2829    table.insert(commandList, "openConsole")
    2930    table.insert(commandList, "OverlayGroup toggleVisibility Debug")
     
    3637    table.insert(nameList, "Secondary Fire")
    3738    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")
    4141    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")
    4346    table.insert(nameList, "Roll Right")
    4447    table.insert(nameList, "Roll Left")
    45     table.insert(nameList, "Up")
    46     table.insert(nameList, "Down")
     48    table.insert(nameList, "Switch Camera")
    4749    table.insert(nameList, "Open Console")
    4850    table.insert(nameList, "Show Debug")
    4951    table.insert(nameList, "Show Stats")
    50     table.insert(nameList, "mouseLook")
     52    table.insert(nameList, "Look Around")
    5153    table.insert(nameList, "Pause")
    5254
     
    5860        local line = winMgr:createWindow("DefaultWindow", "orxonox/KeyBindPane/Binding" .. k)
    5961        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")
    6267       
    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)))
    6775       
    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)))
    7283       
    7384        command:setText(nameList[k])
    7485        button:setText(orxonox.KeyBinderManager:getInstance():getCurrent():getBinding(v))
    7586        clear:setText("X")
     87        button2:setText(orxonox.KeyBinderManager:getInstance():getCurrent():getBinding(v))
     88        clear2:setText("X")
     89        add:setText("+")
    7690
    7791        orxonox.KeyBinderManager:getInstance():subscribeEventHelper(button, "Clicked", P.filename .. ".KeyBindButton_clicked")
    7892        orxonox.KeyBinderManager:getInstance():subscribeEventHelper(clear, "Clicked", P.filename .. ".KeyBindClear_clicked")
     93        orxonox.KeyBinderManager:getInstance():subscribeEventHelper(add, "Clicked", P.filename .. ".KeyBindAdd_clicked")
    7994        --button:subscribeScriptedEvent("EventClicked", P.filename .. ".KeyBindButton_clicked")
    8095       
     
    8297        line:addChildWindow(button)
    8398        line:addChildWindow(clear)
     99        line:addChildWindow(button2)
     100        line:addChildWindow(clear2)
     101        line:addChildWindow(add)
    84102        window:addChildWindow(line)
    85103    end
     
    90108    local name = we.window:getName()
    91109    buttonNr = tonumber(string.match(name, "%d+"))
    92    
    93110    openInfoPopup("Press any button/key or move a mouse/joystick axis.", KeyBindMenu.keybind)
    94111end
     
    98115    local name = we.window:getName()
    99116    clearNr = tonumber(string.match(name, "%d+"))
    100    
     117end
     118
     119function P.KeyBindAdd_clicked(e)
    101120   
    102121end
     
    118137function P.KeyBindBackButton_clicked(e)
    119138    hideGUI("KeyBindMenu")
    120     debug("event: back")
    121139end
    122140
Note: See TracChangeset for help on using the changeset viewer.