Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 7, 2017, 9:25:39 AM (7 years ago)
Author:
kuchlert
Message:

erste version bei der listenauswahl funktioniert

File:
1 edited

Legend:

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

    r11612 r11642  
    55P.wrapper = nil
    66P.detailsWindows = {}
    7 
    87P.showing = false
    98
     
    3231end
    3332
    34 function P.update()
    35     P.updateDialog()
    36 end
    37 
    3833function P.createDialog()
    3934
    4035    local manager = orxonox.DialogManager:getInstance()
    4136   
    42     ---[[
    43     root = winMgr:getWindow("orxonox/Dialogue/Inventory")
    44     local question = orxonox.DialogueManager:getInstance():getquestion()
    45     root:setText(question)
    46     P.wrapper = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/Dialogue/Inventory/Wrapper")
    47     P.wrapper:setSize(CEGUI.UVector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))
    48     root:addChildWindow(P.wrapper)
    4937   
     38    local personfield = winMgr:getWindow("orxonox/Dialog/Person")
     39    local person = manager:getPerson()
     40    personfield:setText(person)
     41
     42    local questionfiled = winMgr:getWindow("orxonox/Dialog/Question")
     43    local question = manager:getQuestion()
     44    questionfiled:setText(question)
     45
     46    listboxwindow = winMgr:getWindow("orxonox/AnsListbox")
     47
     48    local themeList = {}
     49    --[[
     50    table.insert(themeList, "Default")
     51    table.insert(themeList, "Drum n' Bass")
     52    table.insert(themeList, "8-Bit Style")
     53    table.insert(themeList, "Corny Jazz")
     54    table.insert(themeList, "Metal")
    5055    --]]
    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     --]]
     56    local anssize = manager:getSize()
    5857
     58    for index = 0, anssize -1, 1 do
     59        table.insert(themeList, manager:getAnswer(index))
     60    end 
     61
     62    for k,v in pairs(themeList) do
     63        item = CEGUI.createListboxTextItem(v)
     64        item:setSelectionBrushImage(menuImageSet, "MultiListSelectionBrush")
     65        CEGUI.toListbox(listboxwindow):addItem(item)
     66    end
    5967end
    6068
    6169function P.updateDialog()
    62     --local questionn = orxonox.DialogueManager:getInstance():getquestion()
    63     --root:setText("test")
     70    local manager = orxonox.DialogManager:getInstance()
     71    --manager:update()
     72
     73    local questionfiled = winMgr:getWindow("orxonox/Dialog/Question")
     74    local question = manager:getQuestion()
     75    questionfiled:setText(question)
     76end
     77
     78function P.answer_changed(e)
     79    -- body
    6480end
    6581
     
    86102
    87103function P.Button_clicked(e)
    88     --local ending = orxonox.DialogManager:getInstance():theEnd()
     104    local ending = orxonox.DialogManager:getInstance():endtest()
     105    orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialog")
    89106   
    90     --if ending then
     107    if ending then
    91108        orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialog")
    92109   
    93110   
    94    -- else
    95    --     orxonox.DialogueManager:getInstance():a1clicked()
    96    --     P.update()
    97    -- end
     111    else
     112        P.updateDialog(index)
     113    end
    98114end
    99115
Note: See TracChangeset for help on using the changeset viewer.