Changeset 11612 for code/branches/Dialog_HS17/data/gui
- Timestamp:
- Nov 30, 2017, 3:35:25 PM (7 years ago)
- 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 3 2 4 3 local P = createMenuSheet("Dialog") 5 4 6 5 P.wrapper = nil 7 P.answerList = {} 8 P.scrollbarWidht = 13 9 P.selectedAnswer = {} 6 P.detailsWindows = {} 10 7 11 8 P.showing = false … … 14 11 P.imageHeight = 50 15 12 P.detailImageSize = 100 16 P.textHeight = 3017 P.buttonWidth = 8513 P.textHeight = 50 14 P.buttonWidth = 50 18 15 19 16 function P.onLoad() 20 17 P.wrapper = nil 21 22 18 end 23 19 24 20 function P.onShow() 21 25 22 orxonox.CommandExecutor:execute("setTimeFactor 0") 26 23 P.createDialog() … … 37 34 function P.update() 38 35 P.updateDialog() 39 if P.showing == false then40 return41 end42 43 P.cleanup(false)44 36 end 45 37 46 38 function P.createDialog() 47 39 48 local dialogManager = orxonox.DialogManager:getInstance()40 local manager = orxonox.DialogManager:getInstance() 49 41 42 ---[[ 50 43 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) 53 46 P.wrapper = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/Dialogue/Inventory/Wrapper") 54 47 P.wrapper:setSize(CEGUI.UVector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0))) 55 48 root:addChildWindow(P.wrapper) 56 49 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 70 59 end 71 60 72 73 61 function 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") 77 64 end 78 65 … … 98 85 99 86 100 function P. acceptButton_clicked(e)101 local ending = orxonox.DialogManager:getInstance():getDialog:ending()87 function P.Button_clicked(e) 88 --local ending = orxonox.DialogManager:getInstance():theEnd() 102 89 103 if ending then90 --if ending then 104 91 orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialog") 105 92 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 110 98 end 111 99 -
code/branches/Dialog_HS17/data/gui/scripts/Dialogue.lua
r11451 r11612 22 22 P.detailPickups = {} 23 23 P.pickupsList = {} 24 24 25 end 25 26 … … 28 29 P.createInventory() 29 30 P.showing = true 31 end 30 32 31 end32 33 33 34 function P.onHide()
Note: See TracChangeset
for help on using the changeset viewer.