Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 30, 2017, 3:35:25 PM (7 years ago)
Author:
kuchlert
Message:

funktioniert bis dialogmanager getInstance, angefangen und noch zu tun: luafunktionen von dialogmanager, lua und layout

Location:
code/branches/Dialog_HS17/data/gui/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/Dialog_HS17/data/gui/scripts/Dialog.lua

    r11579 r11612  
    1 
    2 -- Dialog.lua
     1-- Dialogue.lua
    32
    43local P = createMenuSheet("Dialog")
    54
    65P.wrapper = nil
    7 P.answerList = {}
    8 P.scrollbarWidht = 13
    9 P.selectedAnswer = {}
     6P.detailsWindows = {}
    107
    118P.showing = false
     
    1411P.imageHeight = 50
    1512P.detailImageSize = 100
    16 P.textHeight = 30
    17 P.buttonWidth = 85
     13P.textHeight = 50
     14P.buttonWidth = 50
    1815
    1916function P.onLoad()
    2017    P.wrapper = nil
    21 
    2218end
    2319
    2420function P.onShow()
     21
    2522    orxonox.CommandExecutor:execute("setTimeFactor 0")
    2623    P.createDialog()
     
    3734function P.update()
    3835    P.updateDialog()
    39     if P.showing == false then
    40         return
    41     end
    42 
    43     P.cleanup(false)
    4436end
    4537
    4638function P.createDialog()
    4739
    48     local dialogManager = orxonox.DialogManager:getInstance()
     40    local manager = orxonox.DialogManager:getInstance()
    4941   
     42    ---[[
    5043    root = winMgr:getWindow("orxonox/Dialogue/Inventory")
    51     local dialog = dialogManager:getCurrentDialog()
    52     root:setText(dialog:getQuestion)
     44    local question = orxonox.DialogueManager:getInstance():getquestion()
     45    root:setText(question)
    5346    P.wrapper = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/Dialogue/Inventory/Wrapper")
    5447    P.wrapper:setSize(CEGUI.UVector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
    5548    root:addChildWindow(P.wrapper)
    5649   
    57     acceptButton = winMgr:createWindow("MenuWidgets/Button", "/a2Button")   --a2 da graphik aus version mit 2 knoepfen uebernommen
    58     acceptButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.4, (P.imageHeight-P.textHeight)/2)))
    59     acceptButton:setSize(CEGUI.UVector2(CEGUI.UDim(0.8, 0), CEGUI.UDim(0, P.textHeight)))
    60     acceptButton:setText("accept")
    61     orxonox.GUIManager:subscribeEventHelper(acceptButton, "Clicked", P.name ..".acceptButton_clicked")
    62     P.wrapper:addChildWindow(acceptButton)
    63    
    64     P.answerList = {}                       -- erstellen der tabelle aus AntwortIds und Antworten im Lua
    65     local answers = dialog:getAnswers()
    66     for ans in answers do
    67         P.answerList[ans] = dialog:getAnswer(ans)
    68     end
    69     --todo herausfinden wie antworten in tabelle enzeigen
     50    --]]
     51    detailsButton = winMgr:createWindow("MenuWidgets/Button", "/DetailsButton")
     52    detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.5, (P.imageHeight-P.textHeight)/2)))
     53    detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0.25, 0), CEGUI.UDim(0, P.textHeight)))
     54    detailsButton:setText("say")
     55    orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name ..".Button_clicked")
     56    P.wrapper:addChildWindow(detailsButton)
     57    --]]
     58
    7059end
    7160
    72 
    7361function P.updateDialog()
    74     local dialog = orxonox.DialogManager:getInstance():getDialog()
    75     root:setText(dialog:getQuestion)
    76     --todo: tabellen updaten
     62    --local questionn = orxonox.DialogueManager:getInstance():getquestion()
     63    --root:setText("test")
    7764end
    7865
     
    9885
    9986
    100 function P.acceptButton_clicked(e)
    101     local ending = orxonox.DialogManager:getInstance():getDialog:ending()
     87function P.Button_clicked(e)
     88    --local ending = orxonox.DialogManager:getInstance():theEnd()
    10289   
    103     if ending then
     90    --if ending then
    10491        orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialog")
    10592   
    106     --herausfindne wie tabelleneintrag uebergeben wird
    107     else
    108         P.update()
    109     end
     93   
     94   -- else
     95   --     orxonox.DialogueManager:getInstance():a1clicked()
     96   --     P.update()
     97   -- end
    11098end
    11199
  • code/branches/Dialog_HS17/data/gui/scripts/Dialogue.lua

    r11451 r11612  
    2222    P.detailPickups = {}
    2323    P.pickupsList = {}
     24   
    2425end
    2526
     
    2829    P.createInventory()
    2930    P.showing = true
     31end
    3032
    31 end
    3233
    3334function P.onHide()
Note: See TracChangeset for help on using the changeset viewer.