-- Dialogue.lua local P = createMenuSheet("Dialog") P.wrapper = nil P.detailsWindows = {} P.showing = false -- Design parameters P.imageHeight = 50 P.detailImageSize = 100 P.textHeight = 50 P.buttonWidth = 50 function P.onLoad() P.wrapper = nil end function P.onShow() orxonox.CommandExecutor:execute("setTimeFactor 0") P.createDialog() P.showing = true end function P.onHide() orxonox.CommandExecutor:execute("setTimeFactor 1") P.showing = false P.cleanup(true) end function P.update() P.updateDialog() end function P.createDialog() local manager = orxonox.DialogManager:getInstance() ---[[ root = winMgr:getWindow("orxonox/Dialogue/Inventory") local question = orxonox.DialogueManager:getInstance():getquestion() root:setText(question) P.wrapper = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/Dialogue/Inventory/Wrapper") P.wrapper:setSize(CEGUI.UVector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0))) root:addChildWindow(P.wrapper) --]] detailsButton = winMgr:createWindow("MenuWidgets/Button", "/DetailsButton") detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0),CEGUI.UDim(0.5, (P.imageHeight-P.textHeight)/2))) detailsButton:setSize(CEGUI.UVector2(CEGUI.UDim(0.25, 0), CEGUI.UDim(0, P.textHeight))) detailsButton:setText("say") orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name ..".Button_clicked") P.wrapper:addChildWindow(detailsButton) --]] end function P.updateDialog() --local questionn = orxonox.DialogueManager:getInstance():getquestion() --root:setText("test") end function P.cleanup(destroyDetails) if P.wrapper ~= nil then winMgr:destroyWindow(P.wrapper) end --Destroy details windows. if destroyDetails == false then return end for k,v in pairs(P.detailsWindows) do if v ~= nil then P.destroyDetailWindow(k) end end end function P.Button_clicked(e) --local ending = orxonox.DialogManager:getInstance():theEnd() --if ending then orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialog") -- else -- orxonox.DialogueManager:getInstance():a1clicked() -- P.update() -- end end return P