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/SingleplayerMenu.lua

    r7163 r7687  
    22
    33local P = createMenuSheet("SingleplayerMenu")
     4
     5P.buttonList = {}
    46
    57function P.onLoad()
     
    2830    end
    2931
     32    --buttons are arranged in a 1x2 matrix
     33    local item = {
     34            ["button"] = winMgr:getWindow("orxonox/SingleplayerStartButton"),
     35            ["function"]  = P.SingleplayerStartButton_clicked
     36    }
     37    P.buttonList[1] = item
     38
     39    local item = {
     40            ["button"] = winMgr:getWindow("orxonox/SingleplayerBackButton"),
     41            ["function"]  = P.SingleplayerBackButton_clicked
     42    }
     43    P.buttonList[2] = item
     44
     45end
     46
     47function P.onShow()
     48    --indices to iterate through buttonlist
     49    P.oldindex = -2
     50    P.index = -1
    3051end
    3152
     
    4364end
    4465
     66function P.onKeyPressed()
     67    buttonIteratorHelper(P.buttonList, code, P, 1, 2)
     68end
     69
    4570return P
    4671
Note: See TracChangeset for help on using the changeset viewer.