Changeset 11806
- Timestamp:
- Feb 24, 2018, 3:09:05 AM (7 years ago)
- Location:
- code/branches/cegui0.8_ogre1.9/data/gui
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cegui0.8_ogre1.9/data/gui/layouts/Dialog.layout
r11793 r11806 1 1 <?xml version='1.0' encoding='utf-8'?> 2 2 <GUILayout version="4"> 3 <Window name=" Background" type="DefaultWindow">3 <Window name="DialogBackground" type="DefaultWindow"> 4 4 <Property name="InheritsAlpha" value="False" /> 5 5 <Property name="MaxSize" value="{{1,0},{1,0}}" /> … … 8 8 <Property name="Alpha" value="0.8" /> 9 9 <Property name="InheritsAlpha" value="False" /> 10 <Property name="HorzFormatting" value=" HorzCentred" />10 <Property name="HorzFormatting" value="CentreAligned" /> 11 11 <Property name="MaxSize" value="{{1,0},{1,0}}" /> 12 12 <Property name="VertFormatting" value="TopAligned" /> … … 23 23 <Property name="InheritsAlpha" value="False" /> 24 24 <Property name="MaxSize" value="{{1,0},{1,0}}" /> 25 <Property name="HorzFormatting" value=" HorzCentred" />25 <Property name="HorzFormatting" value="CentreAligned" /> 26 26 <Property name="VertFormatting" value="TopAligned" /> 27 27 <Property name="Area" value="{{0.3,0},{0.05,0},{0.95,0},{0.45,0}}" /> … … 40 40 <Property name="InheritsAlpha" value="False" /> 41 41 <Property name="HorzFormatting" value="WordWrapLeftAligned" /> 42 <Property name="VertFormatting" value=" CentreAligned" />42 <Property name="VertFormatting" value="TopAligned" /> 43 43 <Property name="MaxSize" value="{{1,0},{1,0}}" /> 44 44 <Property name="Area" value="{{0,0},{0,0},{1,0},{1,0}}" /> … … 49 49 <Property name="MaxSize" value="{{1,0},{1,0}}" /> 50 50 <Property name="Area" value="{{0.05,0},{0.5,0},{0.95,0},{0.85,0}}" /> 51 <Event function="Dialog.answer_changed" name=" ItemSelectionChanged" />51 <Event function="Dialog.answer_changed" name="SelectionChanged" /> 52 52 </Window> 53 53 <Window name="SayButton" type="MenuWidgets/Button"> -
code/branches/cegui0.8_ogre1.9/data/gui/layouts/DockingDialog.layout
r11793 r11806 1 1 <?xml version='1.0' encoding='utf-8'?> 2 2 <GUILayout version="4"> 3 <Window name=" Background" type="MenuWidgets/StaticImage">3 <Window name="DockingBackground" type="MenuWidgets/StaticImage"> 4 4 <Property name="FrameEnabled" value="False" /> 5 5 <Property name="InheritsAlpha" value="False" /> … … 11 11 <Property name="Alpha" value="0.8" /> 12 12 <Property name="InheritsAlpha" value="False" /> 13 <Property name="HorzFormatting" value=" HorzCentred" />13 <Property name="HorzFormatting" value="CentreAligned" /> 14 14 <Property name="MaxSize" value="{{1,0},{1,0}}" /> 15 15 <Property name="VertFormatting" value="TopAligned" /> -
code/branches/cegui0.8_ogre1.9/data/gui/layouts/PickupInventory.layout
r11793 r11806 1 1 <?xml version='1.0' encoding='utf-8'?> 2 2 <GUILayout version="4"> 3 <Window name=" Background" type="DefaultWindow">3 <Window name="PickupInventoryBackground" type="DefaultWindow"> 4 4 <Property name="InheritsAlpha" value="False" /> 5 5 <Property name="MaxSize" value="{{1,0},{1,0}}" /> … … 9 9 <Property name="Alpha" value="0.8" /> 10 10 <Property name="InheritsAlpha" value="False" /> 11 <Property name="HorzFormatting" value=" HorzCentred" />11 <Property name="HorzFormatting" value="CentreAligned" /> 12 12 <Property name="MaxSize" value="{{1,0},{1,0}}" /> 13 13 <Property name="VertFormatting" value="TopAligned" /> … … 17 17 <Property name="InheritsAlpha" value="False" /> 18 18 <Property name="MaxSize" value="{{1,0},{1,0}}" /> 19 <Property name="HorzFormatting" value=" HorzCentred" />19 <Property name="HorzFormatting" value="CentreAligned" /> 20 20 <Property name="VertFormatting" value="TopAligned" /> 21 21 <Property name="Area" value="{{0.05,0},{0.15,0},{0.95,0},{0.92,0}}" /> -
code/branches/cegui0.8_ogre1.9/data/gui/layouts/QuestGUI.layout
r11793 r11806 1 1 <?xml version='1.0' encoding='utf-8'?> 2 2 <GUILayout version="4"> 3 <Window name=" Background" type="DefaultWindow">3 <Window name="QuestBackground" type="DefaultWindow"> 4 4 <Property name="InheritsAlpha" value="False" /> 5 5 <Property name="Area" value="{{0,0},{0,0},{1,0},{1,0}}" /> … … 24 24 <Window name="QuestsList" type="MenuWidgets/Listbox"> 25 25 <Property name="Area" value="{{0,0},{0,30},{1,0},{1,0}}" /> 26 <Event function="QuestGUI.changeQuest_clicked" name=" ItemSelectionChanged" />26 <Event function="QuestGUI.changeQuest_clicked" name="SelectionChanged" /> 27 27 </Window> 28 28 </Window> … … 50 50 <Property name="Area" value="{{0,0},{0,0},{1,0},{1,0}}" /> 51 51 <Property name="InheritsAlpha" value="False" /> 52 <Event function="QuestGUI.changeToSubquest_clicked" name=" ItemSelectionChanged" />52 <Event function="QuestGUI.changeToSubquest_clicked" name="SelectionChanged" /> 53 53 </Window> 54 54 <Window name="Hints" type="MenuWidgets/StaticText"> -
code/branches/cegui0.8_ogre1.9/data/gui/layouts/UndockingDialog.layout
r11793 r11806 1 1 <?xml version='1.0' encoding='utf-8'?> 2 2 <GUILayout version="4"> 3 <Window name=" Background" type="MenuWidgets/StaticImage">3 <Window name="UndockingBackground" type="MenuWidgets/StaticImage"> 4 4 <Property name="FrameEnabled" value="False" /> 5 5 <Property name="InheritsAlpha" value="False" /> … … 11 11 <Property name="Alpha" value="0.8" /> 12 12 <Property name="InheritsAlpha" value="False" /> 13 <Property name="HorzFormatting" value=" HorzCentred" />13 <Property name="HorzFormatting" value="CentreAligned" /> 14 14 <Property name="MaxSize" value="{{1,0},{1,0}}" /> 15 15 <Property name="VertFormatting" value="TopAligned" /> -
code/branches/cegui0.8_ogre1.9/data/gui/scripts/Dialog.lua
r11783 r11806 32 32 33 33 34 local personfield = winMgr:getWindow("orxonox/Dialog/Person")34 local personfield = P.window:getChild("Options/Person") 35 35 local person = manager:getPerson() 36 36 personfield:setText(person) 37 37 38 local questionfield = winMgr:getWindow("orxonox/Dialog/Question")38 local questionfield = P.window:getChild("Options/QuestionWrapper/QuestionPane/Question") 39 39 local question = manager:getQuestion() 40 40 questionfield:setText(question) 41 41 42 local listboxwindow = winMgr:getWindow("orxonox/AnsListbox")42 local listboxwindow = P.window:getChild("Options/AnsListbox") 43 43 CEGUI.toListbox(listboxwindow):resetList() 44 44 … … 52 52 for k,v in pairs(ansList) do 53 53 item = CEGUI.createListboxTextItem(v) 54 item:setSelectionBrushImage(menuImageSet , "MultiListSelectionBrush")54 item:setSelectionBrushImage(menuImageSet .. "/MultiListSelectionBrush") 55 55 CEGUI.toListbox(listboxwindow):addItem(item) 56 56 end … … 61 61 manager:update(P.choice) 62 62 63 local questionfield = winMgr:getWindow("orxonox/Dialog/Question")63 local questionfield = P.window:getChild("Options/QuestionWrapper/QuestionPane/Question") 64 64 local question = manager:getQuestion() 65 65 questionfield:setText(question) 66 66 67 local listboxwindow = winMgr:getWindow("orxonox/AnsListbox")67 local listboxwindow = P.window:getChild("Options/AnsListbox") 68 68 listboxwindow:resetList() 69 69 … … 77 77 for k,v in pairs(ansList) do 78 78 item = CEGUI.createListboxTextItem(v) 79 item:setSelectionBrushImage(menuImageSet , "MultiListSelectionBrush")79 item:setSelectionBrushImage(menuImageSet .. "/MultiListSelectionBrush") 80 80 CEGUI.toListbox(listboxwindow):addItem(item) 81 81 end … … 85 85 86 86 function P.answer_changed(e) --wird aufgerufen falls Auswahl geaendert wird und setzt enstprechenden Indexparameter 87 listboxwindow = winMgr:getWindow("orxonox/AnsListbox")87 listboxwindow = P.window:getChild("Options/AnsListbox") 88 88 selection = listboxwindow:getFirstSelectedItem() 89 89 if selection ~= nil then -
code/branches/cegui0.8_ogre1.9/data/gui/scripts/DockingDialog.lua
r11795 r11806 9 9 --button are arranged in a 1x2 matrix 10 10 P:setButton(1, 1, { 11 ["button"] = winMgr:getWindow("orxonox/Docking/DockButton"),11 ["button"] = P.window:getChild("DockButton"), 12 12 ["callback"] = P.dockButton_clicked 13 13 }) 14 14 15 15 P:setButton(1, 2, { 16 ["button"] = winMgr:getWindow("orxonox/Docking/CancelButton"),16 ["button"] = P.window:getChild("CancelButton"), 17 17 ["callback"] = P.cancelButton_clicked 18 18 }) … … 37 37 end 38 38 39 local listbox = CEGUI.toListbox( winMgr:getWindow("orxonox/Docking/Docks"))39 local listbox = CEGUI.toListbox(P.window:getChild("Title/Docks")) 40 40 listbox:resetList() 41 41 … … 51 51 52 52 function P.dockButton_clicked(e) 53 local listbox = CEGUI.toListbox( winMgr:getWindow("orxonox/Docking/Docks"))53 local listbox = CEGUI.toListbox(P.window:getChild("Title/Docks")) 54 54 local choice = listbox:getFirstSelectedItem() 55 55 if choice ~= nil then -
code/branches/cegui0.8_ogre1.9/data/gui/scripts/InGameMenu.lua
r11052 r11806 9 9 --button are arranged in a 5x1 matrix, the left lower item is nil 10 10 P:setButton(1, 1, { 11 ["button"] = winMgr:getWindow("orxonox/InGameMenu_ReturnButton"),11 ["button"] = P.window:getChild("InGameMenu_ReturnButton"), 12 12 ["callback"] = P.button_return_clicked 13 13 }) 14 14 15 15 P:setButton(2, 1, { 16 ["button"] = winMgr:getWindow("orxonox/InGameMenu_ReloadLevelButton"),16 ["button"] = P.window:getChild("InGameMenu_ReloadLevelButton"), 17 17 ["callback"] = P.button_reloadLevel_clicked 18 18 }) 19 19 20 20 P:setButton(3, 1, { 21 ["button"] = winMgr:getWindow("orxonox/InGameMenu_MainMenuButton"),21 ["button"] = P.window:getChild("InGameMenu_MainMenuButton"), 22 22 ["callback"] = P.button_mainmenu_clicked 23 23 }) 24 24 25 25 P:setButton(4, 1, { 26 ["button"] = winMgr:getWindow("orxonox/InGameMenu_SettingsButton"),26 ["button"] = P.window:getChild("InGameMenu_SettingsButton"), 27 27 ["callback"] = P.button_settings_clicked 28 28 }) 29 29 30 30 P:setButton(5, 1, { 31 ["button"] = winMgr:getWindow("orxonox/InGameMenu_QuitButton"),31 ["button"] = P.window:getChild("InGameMenu_QuitButton"), 32 32 ["callback"] = P.button_quit_clicked 33 33 }) -
code/branches/cegui0.8_ogre1.9/data/gui/scripts/PickupInventory.lua
r11795 r11806 43 43 local pickup = P.detailPickups[k] 44 44 if pickup ~= nil and pickup ~= 0 then 45 local useButton = winMgr:getWindow("orxonox/PickupInventory/Details" .. k .. "/UseButton")46 local dropButton = winMgr:getWindow("orxonox/PickupInventory/Details" .. k .. "/DropButton")45 local useButton = P.window:getChild("Details" .. k .. "/Wrapper/UseButton") 46 local dropButton = P.window:getChild("Details" .. k .. "/Wrapper/DropButton") 47 47 if orxonox.PickupManager:getInstance():isValidPickup(pickup.pickup) == false then 48 48 useButton:setEnabled(false) … … 83 83 local pickupManager = orxonox.PickupManager:getInstance() 84 84 85 local root = winMgr:getWindow("orxonox/PickupInventory/Inventory")86 P.wrapper = winMgr:createWindow("MenuWidgets/ScrollablePane", " orxonox/PickupInventory/Inventory/Wrapper")87 P.wrapper:setSize(CEGUI.U Vector2(CEGUI.UDim(1,0),CEGUI.UDim(1,0)))88 root:addChild Window(P.wrapper)85 local root = P.window:getChild("PickupInventory/Wrapper/Inventory") 86 P.wrapper = winMgr:createWindow("MenuWidgets/ScrollablePane", "Wrapper") 87 P.wrapper:setSize(CEGUI.USize(CEGUI.UDim(1,0),CEGUI.UDim(1,0))) 88 root:addChild(P.wrapper) 89 89 90 90 P.pickupsList = {} … … 98 98 local window = P.createPickupEntry(counter, pickup) 99 99 window:setYPosition(CEGUI.UDim(0,offset)) 100 offset = offset + window:getHeight():asAbsolute(1)101 P.wrapper:addChild Window(window)100 offset = offset + P.imageHeight 101 P.wrapper:addChild(window) 102 102 counter = counter + 1 103 103 end … … 108 108 local representation = orxonox.PickupManager:getInstance():getRepresentation(pickup.representationName) 109 109 110 local name = " orxonox/PickupInventory/Box/Pickup" .. index110 local name = "Pickup" .. index 111 111 112 112 local item = winMgr:createWindow("MenuWidgets/StaticText", name) 113 item:setSize(CEGUI.U Vector2(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight)))113 item:setSize(CEGUI.USize(CEGUI.UDim(1, 0), CEGUI.UDim(0, P.imageHeight))) 114 114 item:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0))) 115 115 116 local image = winMgr:createWindow("MenuWidgets/StaticImage", name .. "/Image")116 local image = winMgr:createWindow("MenuWidgets/StaticImage", "Image") 117 117 image:setProperty("Image", "PickupInventory/" .. representation:getInventoryRepresentation()) 118 118 image:setProperty("BackgroundEnabled", "set:False") 119 119 image:setProperty("FrameEnabled", "set:True") 120 image:setSize(CEGUI.U Vector2(CEGUI.UDim(0, P.imageHeight), CEGUI.UDim(0, P.imageHeight)))121 item:addChild Window(image)122 123 local title = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Title")120 image:setSize(CEGUI.USize(CEGUI.UDim(0, P.imageHeight), CEGUI.UDim(0, P.imageHeight))) 121 item:addChild(image) 122 123 local title = winMgr:createWindow("MenuWidgets/StaticText", "Title") 124 124 title:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.imageHeight+5), CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2))) 125 title:setSize(CEGUI.U Vector2(CEGUI.UDim(0.3, 0), CEGUI.UDim(0, P.textHeight)))125 title:setSize(CEGUI.USize(CEGUI.UDim(0.3, 0), CEGUI.UDim(0, P.textHeight))) 126 126 title:setText(representation:getPickupName()) 127 127 title:setProperty("FrameEnabled", "set:False") 128 item:addChild Window(title)129 130 local useButton = winMgr:createWindow("MenuWidgets/Button", name .. "/UseButton")128 item:addChild(title) 129 130 local useButton = winMgr:createWindow("MenuWidgets/Button", "UseButton") 131 131 useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+10),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2))) 132 useButton:setSize(CEGUI.U Vector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))132 useButton:setSize(CEGUI.USize(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight))) 133 133 if pickup.inUse == false then 134 134 useButton:setText("use") … … 143 143 end 144 144 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseUnuseButton_clicked") 145 item:addChild Window(useButton)146 147 local dropButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DropButton")145 item:addChild(useButton) 146 147 local dropButton = winMgr:createWindow("MenuWidgets/Button", "DropButton") 148 148 dropButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+15+P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2))) 149 dropButton:setSize(CEGUI.U Vector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))149 dropButton:setSize(CEGUI.USize(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight))) 150 150 dropButton:setText("drop") 151 151 orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropButton_clicked") 152 item:addChild Window(dropButton)153 154 local detailsButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DetailsButton")152 item:addChild(dropButton) 153 154 local detailsButton = winMgr:createWindow("MenuWidgets/Button", "DetailsButton") 155 155 detailsButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0.3, P.imageHeight+20+2*P.buttonWidth),CEGUI.UDim(0, (P.imageHeight-P.textHeight)/2))) 156 detailsButton:setSize(CEGUI.U Vector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))156 detailsButton:setSize(CEGUI.USize(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight))) 157 157 detailsButton:setText("details") 158 158 orxonox.GUIManager:subscribeEventHelper(detailsButton, "Clicked", P.name .. ".InventoryDetailsButton_clicked") 159 item:addChild Window(detailsButton)159 item:addChild(detailsButton) 160 160 161 161 return item … … 180 180 function P.windowToPickupHelper(e) 181 181 local we = CEGUI.toWindowEventArgs(e) 182 local name = we.window:getName ()182 local name = we.window:getNamePath() 183 183 184 184 local match = string.gmatch(name, "%d+") … … 193 193 194 194 local index = P.getNewDetailNumber() 195 local name = " orxonox/PickupInventory/Details" .. index195 local name = "Details" .. index 196 196 197 197 local window = winMgr:createWindow("MenuWidgets/FrameWindow", name) 198 window:setSize(CEGUI.U Vector2(CEGUI.UDim(0.5,0),CEGUI.UDim(0.4,0)))198 window:setSize(CEGUI.USize(CEGUI.UDim(0.5,0),CEGUI.UDim(0.4,0))) 199 199 orxonox.GUIManager:subscribeEventHelper(window, "CloseClicked", P.name .. ".closeDetailWindow") 200 200 201 local root = winMgr:getWindow("orxonox/PickupInventory/Background") 202 root:addChildWindow(window) 203 204 local wrapper = winMgr:createWindow("DefaultWindow", name .. "/Wrapper") 205 wrapper:setSize(CEGUI.UVector2(CEGUI.UDim(1, -20),CEGUI.UDim(1, -50))) 201 P.window:addChild(window) 202 203 local wrapper = winMgr:createWindow("DefaultWindow", "Wrapper") 204 wrapper:setSize(CEGUI.USize(CEGUI.UDim(1, -20),CEGUI.UDim(1, -50))) 206 205 wrapper:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 10),CEGUI.UDim(0, 40))) 207 window:addChild Window(wrapper)208 209 local title = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Title")206 window:addChild(wrapper) 207 208 local title = winMgr:createWindow("MenuWidgets/StaticText", "Title") 210 209 title:setText(representation:getPickupName()) 211 210 title:setHeight(CEGUI.UDim(0, P.textHeight)) 212 211 title:setProperty("FrameEnabled", "set:False") 213 212 title:setProperty("BackgroundEnabled", "set:False") 214 wrapper:addChild Window(title)215 216 local image = winMgr:createWindow("MenuWidgets/StaticImage", name .. "/Image")213 wrapper:addChild(title) 214 215 local image = winMgr:createWindow("MenuWidgets/StaticImage", "Image") 217 216 image:setProperty("Image", "PickupInventory/" .. representation:getInventoryRepresentation()) 218 217 image:setProperty("BackgroundEnabled", "set:False") 219 218 image:setProperty("FrameEnabled", "set:True") 220 image:setSize(CEGUI.U Vector2(CEGUI.UDim(0, P.detailImageSize), CEGUI.UDim(0, P.detailImageSize)))219 image:setSize(CEGUI.USize(CEGUI.UDim(0, P.detailImageSize), CEGUI.UDim(0, P.detailImageSize))) 221 220 image:setYPosition(CEGUI.UDim(0, P.textHeight + 5)) 222 wrapper:addChild Window(image)223 224 local box = winMgr:createWindow("MenuWidgets/ScrollablePane", name .. "/Description")225 box:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, -1*(P.detailImageSize + 10)),CEGUI.UDim(1, -(P.textHeight + 5 + P.textHeight + 20))))221 wrapper:addChild(image) 222 223 local box = winMgr:createWindow("MenuWidgets/ScrollablePane", "Description") 224 box:setSize(CEGUI.USize(CEGUI.UDim(1.0, -1*(P.detailImageSize + 10)),CEGUI.UDim(1, -(P.textHeight + 5 + P.textHeight + 20)))) 226 225 box:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize + 10),CEGUI.UDim(0, P.textHeight + 5))) 227 local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Text")226 local description = winMgr:createWindow("MenuWidgets/StaticText", "Text") 228 227 description:setText(representation:getPickupDescription()) 229 228 description:setProperty("HorzFormatting", "WordWrapLeftAligned") 230 229 description:setProperty("VertFormatting", "TopAligned") 231 box:addChild Window(description)232 wrapper:addChild Window(box)233 234 local useButton = winMgr:createWindow("MenuWidgets/Button", name .. "/UseButton")230 box:addChild(description) 231 wrapper:addChild(box) 232 233 local useButton = winMgr:createWindow("MenuWidgets/Button", "UseButton") 235 234 useButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize+10),CEGUI.UDim(1, -40))) 236 useButton:setSize(CEGUI.U Vector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))235 useButton:setSize(CEGUI.USize(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight))) 237 236 if pickup.inUse == false then 238 237 useButton:setText("use") … … 247 246 end 248 247 orxonox.GUIManager:subscribeEventHelper(useButton, "Clicked", P.name .. ".InventoryUseUnuseDetailButton_clicked") 249 wrapper:addChild Window(useButton)250 251 local dropButton = winMgr:createWindow("MenuWidgets/Button", name .. "/DropButton")248 wrapper:addChild(useButton) 249 250 local dropButton = winMgr:createWindow("MenuWidgets/Button", "DropButton") 252 251 dropButton:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.detailImageSize+10+P.buttonWidth+10),CEGUI.UDim(1, -40))) 253 dropButton:setSize(CEGUI.U Vector2(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight)))252 dropButton:setSize(CEGUI.USize(CEGUI.UDim(0, P.buttonWidth), CEGUI.UDim(0, P.textHeight))) 254 253 dropButton:setText("drop") 255 254 orxonox.GUIManager:subscribeEventHelper(dropButton, "Clicked", P.name .. ".InventoryDropDetailButton_clicked") 256 wrapper:addChild Window(dropButton)255 wrapper:addChild(dropButton) 257 256 258 257 P.detailsWindows[index] = window … … 311 310 --Get some numbers from the window 312 311 local we = CEGUI.toWindowEventArgs(e) 313 local name = we.window:getName ()312 local name = we.window:getNamePath() 314 313 local match = string.gmatch(name, "%d+") 315 314 local detailNr = tonumber(match()) -
code/branches/cegui0.8_ogre1.9/data/gui/scripts/QuestGUI.lua
r11795 r11806 40 40 -- selectQuest is a pointer to a quest that should be selected, if it is nil the first quest is selected. 41 41 function P.loadQuestsList(selectQuest) 42 local list = CEGUI.toListbox( winMgr:getWindow("orxonox/QuestGUI/QuestsList"))42 local list = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList")) 43 43 P.clearQuestList() 44 44 … … 124 124 -- Load title and description 125 125 local description = P.questManager:getDescription(quest) 126 local titleWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Title")126 local titleWindow = P.window:getChild("MainWindow/Title") 127 127 titleWindow:setText(description:getTitle()) 128 local descriptionWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Description")128 local descriptionWindow = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Description") 129 129 descriptionWindow:setText(description:getDescription()) 130 descriptionWindow:setSize(CEGUI.U Vector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))130 descriptionWindow:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0))) 131 131 descriptionWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, P.borderSize))) 132 132 local height = getStaticTextWindowHeight(descriptionWindow) … … 135 135 136 136 -- Load subquests 137 local list = CEGUI.toListbox( winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))137 local list = CEGUI.toListbox(P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/SubquestsList")) 138 138 local numQuests = P.questManager:getNumSubQuests(quest, P.player) 139 139 local i = 0 … … 150 150 height = height+P.frameHeigth 151 151 end 152 list:setSize(CEGUI.U Vector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, height)))152 list:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, height))) 153 153 list:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, offset))) 154 154 offset = offset + height + P.borderSize 155 155 156 156 -- Load hints 157 local hintsWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Hints")157 local hintsWindow = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Hints") 158 158 hintsWindow:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderSize), CEGUI.UDim(0, offset))) 159 hintsWindow:setSize(CEGUI.U Vector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, 0)))159 hintsWindow:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(0, 0))) 160 160 height = P.titleHeight 161 161 local numHints = P.questManager:getNumHints(quest, P.player) … … 173 173 174 174 -- Set the size of the wrapper 175 local window = winMgr:getWindow("orxonox/QuestGUI/Quest/Wrapper")176 window:setSize(CEGUI.U Vector2(CEGUI.UDim(1, -P.borderSize-P.scrollbarWidth), CEGUI.UDim(0,offset+P.borderSize)))175 local window = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper") 176 window:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize-P.scrollbarWidth), CEGUI.UDim(0,offset+P.borderSize))) 177 177 end 178 178 end … … 181 181 function P.clearQuest() 182 182 -- clear title 183 local titleWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Title")183 local titleWindow = P.window:getChild("MainWindow/Title") 184 184 titleWindow:setText("no Quests") 185 185 186 186 -- clear description 187 local descriptionWindow = winMgr:getWindow("orxonox/QuestGUI/Quest/Description")187 local descriptionWindow = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Description") 188 188 descriptionWindow:setText("There is currently no quest that can be displayed.") 189 189 190 190 -- clear list fo subquests 191 local list = CEGUI.toListbox( winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))191 local list = CEGUI.toListbox(P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/SubquestsList")) 192 192 list:resetList() 193 193 list:setHeight(CEGUI.UDim(0, 0)) … … 195 195 196 196 -- clear hints 197 local hints = winMgr:getWindow("orxonox/QuestGUI/Quest/Hints")197 local hints = P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/Hints") 198 198 local numChildren = hints:getChildCount()-2 -- TODO: HACK 199 199 local i = 0 200 200 while i < numChildren do 201 local hint = hints:getChild(" orxonox/QuestGUI/Quest/Hints/" .. i)201 local hint = hints:getChild("" .. i) 202 202 if hint ~= nil then 203 hints:removeChild Window(hint)203 hints:removeChild(hint) 204 204 winMgr:destroyWindow(hint) 205 205 end 206 206 i = i+1 207 207 end 208 hints:setSize(CEGUI.U Vector2(CEGUI.UDim(1, -P.scrollbarWidth-P.borderSize), CEGUI.UDim(0, 0)))208 hints:setSize(CEGUI.USize(CEGUI.UDim(1, -P.scrollbarWidth-P.borderSize), CEGUI.UDim(0, 0))) 209 209 end 210 210 211 211 -- Clear the quests list 212 212 function P.clearQuestList() 213 local list = CEGUI.toListbox( winMgr:getWindow("orxonox/QuestGUI/QuestsList"))213 local list = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList")) 214 214 list:resetList() 215 215 P.quests = {} … … 253 253 function P.insertHint(hintsWindow, hint, index, offset) 254 254 -- Create the window for the hint. 255 local window = winMgr:createWindow("MenuWidgets/StaticText", " orxonox/QuestGUI/Quest/Hints/" .. index)255 local window = winMgr:createWindow("MenuWidgets/StaticText", "" .. index) 256 256 window:setProperty("HorzFormatting", "WordWrapLeftAligned") 257 257 window:setProperty("VertFormatting", "TopAligned") 258 258 window:setProperty("FrameEnabled", "false") 259 259 window:setID(index) 260 hintsWindow:addChild Window(window)260 hintsWindow:addChild(window) 261 261 local description = P.questManager:getDescription(hint) 262 262 window:setText(description:getDescription()) 263 window:setSize(CEGUI.U Vector2(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0)))263 window:setSize(CEGUI.USize(CEGUI.UDim(1, -P.borderSize), CEGUI.UDim(1, 0))) 264 264 local height = getStaticTextWindowHeight(window) 265 265 window:setHeight(CEGUI.UDim(0, height)) … … 286 286 -- Change to a new quest. 287 287 function P.changeQuest_clicked(e) 288 local list = CEGUI.toListbox( winMgr:getWindow("orxonox/QuestGUI/QuestsList"))288 local list = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList")) 289 289 local choice = list:getFirstSelectedItem() 290 290 if choice ~= nil then … … 299 299 -- Change to a new subquest. 300 300 function P.changeToSubquest_clicked(e) 301 local list = CEGUI.toListbox( winMgr:getWindow("orxonox/QuestGUI/Quest/SubquestsList"))302 local questsList = CEGUI.toListbox( winMgr:getWindow("orxonox/QuestGUI/QuestsList"))301 local list = CEGUI.toListbox(P.window:getChild("MainWindow/RightPanel/ScrollWrapper/Wrapper/SubquestsList")) 302 local questsList = CEGUI.toListbox(P.window:getChild("MainWindow/LeftPanel/QuestsList")) 303 303 local choice = list:getFirstSelectedItem() 304 304 if choice ~= nil then … … 328 328 329 329 local questWindow = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/QuestGUI/Quests") 330 questWindow:setSize(CEGUI.U Vector2(CEGUI.UDim(1, 0),CEGUI.UDim(1, 0)))330 questWindow:setSize(CEGUI.USize(CEGUI.UDim(1, 0),CEGUI.UDim(1, 0))) 331 331 332 332 -- Iterate through all root-quests. … … 348 348 node:setText(orxonox.QuestManager:getInstance():getDescription(parent):getTitle()) 349 349 node:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.indentWidth*depth), CEGUI.UDim(0, P.buttonHeight*index))) 350 node:setSize(CEGUI.U Vector2(CEGUI.UDim(1, -P.indentWidth*depth-P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))350 node:setSize(CEGUI.USize(CEGUI.UDim(1, -P.indentWidth*depth-P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight))) 351 351 orxonox.GUIManager:subscribeEventHelper(node, "Clicked", P.name .. ".openDetails_clicked") 352 root:addChild Window(node)352 root:addChild(node) 353 353 354 354 table.insert(P.quests, parent) … … 389 389 --Get some numbers from the window 390 390 local we = CEGUI.toWindowEventArgs(e) 391 local name = we.window:getName ()391 local name = we.window:getNamePath() 392 392 local match = string.gmatch(name, "%d+") 393 393 local questNr = tonumber(match()) … … 397 397 398 398 local details = winMgr:createWindow("MenuWidgets/FrameWindow", name) 399 details:setSize(CEGUI.U Vector2(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))399 details:setSize(CEGUI.USize(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0))) 400 400 details:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0), CEGUI.UDim(0.1, 0))) 401 401 details:setText(orxonox.QuestManager:getInstance():getDescription(quest):getTitle()) … … 408 408 name = name .. "/Scrollable" 409 409 local window = winMgr:createWindow("MenuWidgets/ScrollablePane", name) 410 window:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))410 window:setSize(CEGUI.USize(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight))) 411 411 window:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderWidth), CEGUI.UDim(0, P.titleHeight))) 412 details:addChild Window(window)412 details:addChild(window) 413 413 414 414 local offset = 0 415 415 416 416 local status = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Status") 417 window:addChild Window(status)417 window:addChild(status) 418 418 status:setProperty("HorzFormatting", "WordWrapLeftAligned") 419 419 status:setProperty("VertFormatting", "TopAligned") … … 426 426 end 427 427 status:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset))) 428 status:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))428 status:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0))) 429 429 local height = getStaticTextWindowHeight(status) 430 430 status:setHeight(CEGUI.UDim(0, height)) … … 432 432 433 433 local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title") 434 window:addChild Window(descriptionTitle)435 descriptionTitle:setProperty("HorzFormatting", " HorzCentred")434 window:addChild(descriptionTitle) 435 descriptionTitle:setProperty("HorzFormatting", "CentreAligned") 436 436 descriptionTitle:setProperty("VertFormatting", "TopAligned") 437 437 descriptionTitle:setText("Description:") 438 438 descriptionTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset))) 439 descriptionTitle:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))439 descriptionTitle:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0))) 440 440 height = getStaticTextWindowHeight(descriptionTitle) 441 441 descriptionTitle:setHeight(CEGUI.UDim(0, height)) … … 443 443 444 444 local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description") 445 window:addChild Window(description)445 window:addChild(description) 446 446 description:setProperty("HorzFormatting", "WordWrapLeftAligned") 447 447 description:setProperty("VertFormatting", "TopAligned") 448 448 description:setText(orxonox.QuestManager:getInstance():getDescription(quest):getDescription()) 449 449 description:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset))) 450 description:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))450 description:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0))) 451 451 height = getStaticTextWindowHeight(description) 452 452 description:setHeight(CEGUI.UDim(0, height)) … … 457 457 if numHints > 0 then 458 458 local hintsTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Hints/Title") 459 window:addChild Window(hintsTitle)460 hintsTitle:setProperty("HorzFormatting", " HorzCentred")459 window:addChild(hintsTitle) 460 hintsTitle:setProperty("HorzFormatting", "CentreAligned") 461 461 hintsTitle:setProperty("VertFormatting", "TopAligned") 462 462 hintsTitle:setText("Hints:") 463 463 hintsTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset))) 464 hintsTitle:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))464 hintsTitle:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0))) 465 465 height = getStaticTextWindowHeight(hintsTitle) 466 466 hintsTitle:setHeight(CEGUI.UDim(0, height)) … … 475 475 node:setText(orxonox.QuestManager:getInstance():getDescription(hint):getTitle()) 476 476 node:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset))) 477 node:setSize(CEGUI.U Vector2(CEGUI.UDim(1, -P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight)))478 window:addChild Window(node)477 node:setSize(CEGUI.USize(CEGUI.UDim(1, -P.scrollbarWidth), CEGUI.UDim(0, P.buttonHeight))) 478 window:addChild(node) 479 479 offset = offset + P.buttonHeight 480 480 … … 483 483 end 484 484 485 local window = winMgr:getWindow("orxonox/QuestGUI/Background")486 window:addChild Window(details)485 local window = P.window:getChild("orxonox/QuestGUI/Background") 486 window:addChild(details) 487 487 end 488 488 … … 499 499 function P.closeDetails_clicked(e) 500 500 local we = CEGUI.toWindowEventArgs(e) 501 local name = we.window:getName ()501 local name = we.window:getNamePath() 502 502 local match = string.gmatch(name, "%d+") 503 503 match() … … 511 511 --Get some numbers from the window 512 512 local we = CEGUI.toWindowEventArgs(e) 513 local name = we.window:getName ()513 local name = we.window:getNamePath() 514 514 local match = string.gmatch(name, "%d+") 515 515 match() … … 521 521 522 522 local details = winMgr:createWindow("MenuWidgets/FrameWindow", name) 523 details:setSize(CEGUI.U Vector2(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0)))523 details:setSize(CEGUI.USize(CEGUI.UDim(0.7, 0), CEGUI.UDim(0.7, 0))) 524 524 details:setPosition(CEGUI.UVector2(CEGUI.UDim(0.1, 0), CEGUI.UDim(0.1, 0))) 525 525 details:setText(orxonox.QuestManager:getInstance():getDescription(hint):getTitle()) … … 532 532 name = name .. "/Scrollable" 533 533 local window = winMgr:createWindow("MenuWidgets/ScrollablePane", name) 534 window:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight)))534 window:setSize(CEGUI.USize(CEGUI.UDim(1.0, -2*P.borderWidth),CEGUI.UDim(1.0, -P.titleHeight))) 535 535 window:setPosition(CEGUI.UVector2(CEGUI.UDim(0, P.borderWidth), CEGUI.UDim(0, P.titleHeight))) 536 details:addChild Window(window)536 details:addChild(window) 537 537 538 538 local offset = 0 539 539 540 540 local descriptionTitle = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description/Title") 541 window:addChild Window(descriptionTitle)542 descriptionTitle:setProperty("HorzFormatting", " HorzCentred")541 window:addChild(descriptionTitle) 542 descriptionTitle:setProperty("HorzFormatting", "CentreAligned") 543 543 descriptionTitle:setProperty("VertFormatting", "TopAligned") 544 544 descriptionTitle:setText("Description:") 545 545 descriptionTitle:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset))) 546 descriptionTitle:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))546 descriptionTitle:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0))) 547 547 height = getStaticTextWindowHeight(descriptionTitle) 548 548 descriptionTitle:setHeight(CEGUI.UDim(0, height)) … … 550 550 551 551 local description = winMgr:createWindow("MenuWidgets/StaticText", name .. "/Description") 552 window:addChild Window(description)552 window:addChild(description) 553 553 description:setProperty("HorzFormatting", "WordWrapLeftAligned") 554 554 description:setProperty("VertFormatting", "TopAligned") 555 555 description:setText(orxonox.QuestManager:getInstance():getDescription(hint):getDescription()) 556 556 description:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, offset))) 557 description:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0)))557 description:setSize(CEGUI.USize(CEGUI.UDim(1.0, -P.scrollbarWidth), CEGUI.UDim(1.0, 0))) 558 558 height = getStaticTextWindowHeight(description) 559 559 description:setHeight(CEGUI.UDim(0, height)) 560 560 561 local window = winMgr:getWindow("orxonox/QuestGUI/Background")562 window:addChild Window(details)561 local window = P.window:getChild("orxonox/QuestGUI/Background") 562 window:addChild(details) 563 563 end 564 564 565 565 function P.closeHintDetails_clicked(e) 566 566 local we = CEGUI.toWindowEventArgs(e) 567 local name = we.window:getName ()567 local name = we.window:getNamePath() 568 568 local match = string.gmatch(name, "%d+") 569 569 match() -
code/branches/cegui0.8_ogre1.9/data/gui/scripts/UndockingDialog.lua
r11795 r11806 9 9 --button are arranged in a 1x2 matrix 10 10 P:setButton(1, 1, { 11 ["button"] = winMgr:getWindow("orxonox/Undocking/DockButton"),11 ["button"] = P.window:getChild("DockButton"), 12 12 ["callback"] = P.undockButton_clicked 13 13 }) 14 14 15 15 P:setButton(1, 2, { 16 ["button"] = winMgr:getWindow("orxonox/Undocking/CancelButton"),16 ["button"] = P.window:getChild("CancelButton"), 17 17 ["callback"] = P.cancelButton_clicked 18 18 }) … … 37 37 end 38 38 39 local listbox = CEGUI.toListbox( winMgr:getWindow("orxonox/Undocking/Docks"))39 local listbox = CEGUI.toListbox(P.window:getChild("Title/Docks")) 40 40 listbox:resetList() 41 41 … … 51 51 52 52 function P.undockButton_clicked(e) 53 local listbox = CEGUI.toListbox( winMgr:getWindow("orxonox/Undocking/Docks"))53 local listbox = CEGUI.toListbox(P.window:getChild("Title/Docks")) 54 54 local choice = listbox:getFirstSelectedItem() 55 55 if choice ~= nil then
Note: See TracChangeset
for help on using the changeset viewer.