Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7726


Ignore:
Timestamp:
Dec 8, 2010, 1:27:51 PM (14 years ago)
Author:
konrad
Message:

decision popup in ingame menu has been changed

Location:
code/trunk/data/gui/scripts
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/data/gui/scripts/DecisionPopup.lua

    r6746 r7726  
    22
    33local P = createMenuSheet("DecisionPopup")
     4
     5P.buttonList = {}
     6
     7function P.onShow()
     8    --indices to iterate through buttonlist
     9    P.oldindex = -2
     10    P.index = -1
     11end
     12
     13function P.onLoad()
     14
     15    --button are arranged in a 1x2 matrix
     16    local item = {
     17            ["button"] = winMgr:getWindow("orxonox/DecisionPopup_button_yes"),
     18            ["function"]  = P.button_yes
     19    }
     20    P.buttonList[1] = item
     21
     22    local item = {
     23            ["button"] = winMgr:getWindow("orxonox/DecisionPopup_button_no"),
     24            ["function"]  = P.button_no
     25    }
     26    P.buttonList[2] = item
     27
     28end
    429
    530function P.setCallback(functionPtr)
     
    2651end
    2752
     53function P.onKeyPressed()
     54    buttonIteratorHelper(P.buttonList, code, P, 1, 2)
     55end
     56
    2857return P
    2958
  • code/trunk/data/gui/scripts/GUITools.lua

    r7690 r7726  
    172172
    173173        local item = list[P.index+1]
    174         local child = item["button"]
     174        local child = item["button"]
     175        local s = child:getProperty("NormalImageRightEdge")
    175176
    176177        --teste ob der Button nicht schon gehighlightet ist
    177         if child:getProperty("NormalImageRightEdge") == "set:TaharezGreenLook image:ButtonRightHighlight" then
     178        if string.sub(s,string.len(s)-8,string.len(s)) == "Highlight" then
    178179            --nop
    179180        else
     
    201202                local item = list[i]
    202203                local child = item["button"]
    203                     if child:getProperty("NormalImageRightEdge") == "set:TaharezGreenLook image:ButtonRightHighlight" then
     204                local s = child:getProperty("NormalImageRightEdge")
     205                    if string.sub(s,string.len(s)-8,string.len(s)) == "Highlight" then
    204206                        child:setProperty("NormalImageRightEdge", string.sub(child:getProperty("NormalImageRightEdge"),1,-10) .. "Normal")
    205207                        child:setProperty("NormalImageLeftEdge", string.sub(child:getProperty("NormalImageLeftEdge"),1,-10) .. "Normal")
     
    210212                i=i+1
    211213        end
    212     end
    213    
     214    end 
     215
    214216    --enter
    215     if code == "28" and P.index >= 0 then
     217    if code == "28" then
    216218        local item = list[P.index+1]
    217219        local child = item["button"]
  • code/trunk/data/gui/scripts/InGameMenu.lua

    r7689 r7726  
    33local P = createMenuSheet("InGameMenu")
    44P.loadAlong = { "DecisionPopup" }
     5
     6P.buttonList = {}
     7
     8function P.onLoad()
     9    P.multiplayerMode = "startClient"
     10
     11    --button are arranged in a 4x1 matrix, the left lower item is nil
     12    local item = {
     13            ["button"] = winMgr:getWindow("orxonox/InGameMenu_ReturnButton"),
     14            ["function"]  = P.button_settings_clicked
     15    }
     16    P.buttonList[1] = item
     17
     18    local item = {
     19            ["button"] = winMgr:getWindow("orxonox/InGameMenu_MainMenuButton"),
     20            ["function"]  = P.button_mainmenu_clicked
     21    }
     22    P.buttonList[2] = item
     23
     24    local item = {
     25            ["button"] = winMgr:getWindow("orxonox/InGameMenu_SettingsButton"),
     26            ["function"]  = P.button_settings_clicked
     27    }
     28    P.buttonList[3] = item
     29
     30    local item = {
     31            ["button"] = winMgr:getWindow("orxonox/InGameMenu_QuitButton"),
     32            ["function"]  = P.button_quit_clicked
     33    }
     34    P.buttonList[4] = item
     35
     36end
     37
     38function P.onShow()
     39    --indices to iterate through buttonlist
     40    P.oldindex = -2
     41    P.index = -1
     42end
    543
    644-- events for ingamemenu
     
    2765        hideMenuSheet("InGameMenu")
    2866        orxonox.execute("exit")
     67    else
     68        P.onShow()
    2969    end
     70end
     71
     72function P.onKeyPressed()
     73    buttonIteratorHelper(P.buttonList, code, P, 4, 1)
    3074end
    3175
Note: See TracChangeset for help on using the changeset viewer.