Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 4, 2017, 4:11:36 PM (7 years ago)
Author:
rrogge
Message:

Buttons

Location:
code/branches/Dialogue_FS17/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialogue_FS17/data/gui/scripts/Dialogue.lua

    r11407 r11413  
    9393    P.wrapper:setSize(CEGUI.UVector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
    9494    root:addChildWindow(P.wrapper)
    95     root:addChild(answerButton)
    9695   
    97    
     96   
     97    local detailsButton = winMgr:createWindow("MenuWidgets/Button", "/DetailsButton")
     98    local a1 = orxonox.DialogueManager:getInstance():getanswers1()
     99    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+2*P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
     100    detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     101    detailsButton:setText(a1)
     102    orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name ..".a1Button_clicked")
     103    root:addChildWindow(detailsButton)
     104
     105    local a2Button = winMgr:createWindow("MenuWidgets/Button", "/a2Button")
     106    local a2 = orxonox.DialogueManager:getInstance():getanswers2()
     107    a2Button:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+40+2*P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2)))
     108    a2Button:setSize(CEGUI.UVector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))
     109    a2Button:setText(a2)
     110    orxonox.GUIManager:subscribeEventHelper(a2Button, "Clicked", P.name ..".a2Button_clicked")
     111    root:addChildWindow(a2Button)
     112
    98113
    99114end
     
    119134
    120135
    121 function P.InventoryBackButton_clicked(e)
    122     orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialogue")
     136function P.a1Button_clicked(e)
     137    orxonox.DialogueManager:getInstance():a1clicked()
     138end
     139
     140function P.a2Button_clicked(e)
     141    orxonox.DialogueManager:getInstance():a2clicked()
    123142end
    124143
  • code/branches/Dialogue_FS17/data/levels/events.oxw

    r11401 r11413  
    5757    -->
    5858
    59 <DistanceTrigger name="test" position="0,0,0" target="Pawn" distance=25 stayActive="true"/>
     59    <DistanceTrigger name="test" position="0,0,0" target="Pawn" distance=25 stayActive="true" />
    6060    <Backlight position="0,0,0" visible=true frequency=0.6 amplitude=3 material="Flares/lensflare" colour="1,0,1"/>
    61     <NextQuestion question="Hello World3">
     61    <NextQuestion  question="Continue?" a1="yes" a2="no" >
     62      <!-- <possibleQuestions>
     63        <NextQuestion  question="Are you sure?" a1="yep let me continue" a2="no actually not" />
     64        <NextQuestion  question="Why?" a1="Got a dentist's appointment" a2="this sucks" />
     65      </possibleQuestions>     -->
    6266      <events>
    6367        <execute>
Note: See TracChangeset for help on using the changeset viewer.