Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 1, 2010, 2:04:54 PM (14 years ago)
Author:
konrad
Message:

—function to iterate throgh a menusheet by using arrowkeys is added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/menu/data/gui/scripts/MainMenu.lua

    r7663 r7687  
    66P.buttonList = {}
    77
    8 P.testArray = {}
    9 
    10 
    118function P.onLoad()
     9    --buttons are arranged in a 6x1 Matrix (list)
    1210    local item = {
    1311            ["button"] = winMgr:getWindow("orxonox/QuickGameTestButton"),
     
    4846
    4947function P.onShow()
     48    --indices to iterate through buttonlist
    5049    P.oldindex = -2
    5150    P.index = -1
     
    7877end
    7978
    80 
    81 --[[
    82 list = {}
    83 local item =
    84 {
    85     ["button"] = buttonWindow,
    86     ["function"]  = buttonFunction,
    87 }
    88 table.insert(list, item)
    89 item = list[i]
    90 
    91 for i,item in pairs(list) do
    92     button = item["button"]
    93 end
    94 
    95 --]]
    96 --[[
    97 function createList()
    98     list = {}
    99 
    100     local j
    101     while j < P.loadAlong
    102         local item =
    103         {
    104             ["button"] = buttonWindow,
    105             ["function"]  = buttonFunction,
    106         }
    107         table.insert(list, item)
    108     end
    109 
    110 --]]
    111 
    11279function P.onKeyPressed()
    113     cout(0,code)
    11480    buttonIteratorHelper(P.buttonList, code, P, 6, 1)
    115     --indexTester(P.buttonList,code,P,6,1)
    11681end
    11782
Note: See TracChangeset for help on using the changeset viewer.