Changeset 11642 for code/branches/Dialog_HS17/data/gui
- Timestamp:
- Dec 7, 2017, 9:25:39 AM (7 years ago)
- Location:
- code/branches/Dialog_HS17/data/gui
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/Dialog_HS17/data/gui/layouts/Dialog.layout
r11579 r11642 2 2 3 3 <GUILayout > 4 <Window Type="DefaultWindow" Name="orxonox/Dialog ue/Background" >4 <Window Type="DefaultWindow" Name="orxonox/Dialog/Background" > 5 5 <Property Name="InheritsAlpha" Value="False" /> 6 6 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 7 7 <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" /> 8 <Window Type="MenuWidgets/StaticText" Name="orxonox/Dialog ue/Inventory" >8 <Window Type="MenuWidgets/StaticText" Name="orxonox/Dialog/Options" > 9 9 <Property Name="Alpha" Value="0.8" /> 10 10 <Property Name="InheritsAlpha" Value="False" /> … … 13 13 <Property Name="VertFormatting" Value="TopAligned" /> 14 14 <Property Name="UnifiedAreaRect" Value="{{0.15,0},{0.15,0},{0.85,0},{0.8,0}}" /> 15 <Window Type="MenuWidgets/StaticText" Name="orxonox/Dialogue/Wrapper" > 16 <Property Name="TextColours" Value="FF4444FF" /> 15 16 <Window Type="MenuWidgets/StaticText" Name="orxonox/Dialog/Person" > 17 <Property Name="Alpha" Value="0.8" /> 17 18 <Property Name="InheritsAlpha" Value="False" /> 19 <Property Name="HorzFormatting" Value="LeftAligned" /> 18 20 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 21 <Property Name="VertFormatting" Value="CentreAligned" /> 22 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.05,0},{0.25,0},{0.15,0}}" /> 23 </Window> 24 <Window Type="MenuWidgets/StaticText" Name="orxonox/Dialog/Question" > 25 <Property Name="Alpha" Value="0.8" /> 26 <Property Name="InheritsAlpha" Value="False" /> 27 <Property Name="HorzFormatting" Value="LeftAligned" /> 28 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 29 <Property Name="VertFormatting" Value="CentreAligned" /> 30 <Property Name="UnifiedAreaRect" Value="{{0.3,0},{0.05,0},{0.95,0},{0.15,0}}" /> 31 </Window> 32 33 <Window Type="MenuWidgets/StaticText" Name="orxonox/DialogAns" > 34 <Property Name="InheritsAlpha" Value="False" /> 19 35 <Property Name="HorzFormatting" Value="HorzCentred" /> 36 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 20 37 <Property Name="VertFormatting" Value="TopAligned" /> 21 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.15,0},{0.95,0},{0.92,0}}" /> 22 <Window Type="MenuWidgets/TabControl" Name="orxonox/SingleplayerTabControl" > 23 <Property Name="TabHeight" Value="{0,26.4388}" /> 38 <Property Name="UnifiedAreaRect" Value="{{0.604166,0},{0.15,0},{0.958333,0},{0.636,0}}" /> 39 <Window Type="MenuWidgets/Listbox" Name="orxonox/AnsListbox" > 24 40 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 25 <Property Name=" TabPanePosition" Value="Top" />26 < Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.1,0},{0,95,0},{0.925,0}}" />41 <Property Name="UnifiedAreaRect" Value="{{0.05,0},{0.225,0},{0.95,0},{0.92,0}}" /> 42 <Event Name="ItemSelectionChanged" Function="Dialog.answer_changed" /> 27 43 </Window> 44 </Window> 45 <Window Type="MenuWidgets/Button" Name="orxonox/SayButton" > 46 <Property Name="Text" Value="Say" /> 47 <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" /> 48 <Property Name="UnifiedAreaRect" Value="{{0.425,0},{0.9,0},{0.575,0},{0.975,0}}" /> 49 <Event Name="Clicked" Function="Dialog.Button_clicked"/> 28 50 </Window> 29 51 </Window> -
code/branches/Dialog_HS17/data/gui/scripts/Dialog.lua
r11612 r11642 5 5 P.wrapper = nil 6 6 P.detailsWindows = {} 7 8 7 P.showing = false 9 8 … … 32 31 end 33 32 34 function P.update()35 P.updateDialog()36 end37 38 33 function P.createDialog() 39 34 40 35 local manager = orxonox.DialogManager:getInstance() 41 36 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)49 37 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") 50 55 --]] 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() 58 57 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 59 67 end 60 68 61 69 function 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) 76 end 77 78 function P.answer_changed(e) 79 -- body 64 80 end 65 81 … … 86 102 87 103 function 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") 89 106 90 --if ending then107 if ending then 91 108 orxonox.CommandExecutor:execute("OrxonoxOverlay toggleVisibility Dialog") 92 109 93 110 94 -- else 95 -- orxonox.DialogueManager:getInstance():a1clicked() 96 -- P.update() 97 -- end 111 else 112 P.updateDialog(index) 113 end 98 114 end 99 115
Note: See TracChangeset
for help on using the changeset viewer.