Changeset 11802 for code/branches/cegui0.8_ogre1.9/data/gui/scripts
- Timestamp:
- Feb 24, 2018, 1:49:10 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cegui0.8_ogre1.9/data/gui/scripts/NotificationLayer.lua
r8858 r11802 10 10 function P.onLoad() 11 11 orxonox.NotificationManager:getInstance():loadQueues() 12 P.sampleWindow = winMgr:createWindow("MenuWidgets/StaticText", " orxonox/NotificationLayer/Root/SampleWindow")12 P.sampleWindow = winMgr:createWindow("MenuWidgets/StaticText", "NotificationLayer/Root/SampleWindow") 13 13 end 14 14 15 15 -- Creates a queue in the GUI. 16 16 function P.createQueue(name, size) 17 local root = winMgr:getWindow("orxonox/NotificationLayer/Root")18 17 --local queue = winMgr:createWindow("MenuWidgets/Listbox", "orxonox/NotificationLayer/Root/Queue/" .. name) 19 18 --queue:setProperty("BackgroundColor", "00FFFFFF") -- Set background to be fully transparent. 20 local queue = winMgr:createWindow("MenuWidgets/ScrollablePane", "orxonox/NotificationLayer/Root/Queue/" ..name)19 local queue = winMgr:createWindow("MenuWidgets/ScrollablePane", name) 21 20 queue:setProperty("Alpha", 0.0) 22 21 --queue:setProperty("FrameEnabled", "false") 23 root:addChildWindow(queue)22 P.window:addChild(queue) 24 23 25 24 local queueTuple = … … 38 37 39 38 queue:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0))) 40 queue:setSize(CEGUI.U Vector2(CEGUI.UDim(1.0, 0), CEGUI.UDim(0, P.queueHeightHelper(queueTuple, size))))39 queue:setSize(CEGUI.USize(CEGUI.UDim(1.0, 0), CEGUI.UDim(0, P.queueHeightHelper(queueTuple, size)))) 41 40 42 41 P.queueList[name] = queueTuple -- name access … … 49 48 50 49 if queue ~= nil then 51 queue.window:getParent():removeChild Window(queue.window)50 queue.window:getParent():removeChild(queue.window) 52 51 winMgr:destroyWindow(queue.window) 53 52 end … … 66 65 end 67 66 68 local item = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/Queue/" .. queueName .. "/" ..queue.last)67 local item = winMgr:createWindow("MenuWidgets/StaticText", queue.last) 69 68 item:setText(notification) 70 69 P.setItemFontHelper(item, queue, true) … … 77 76 end 78 77 end 79 queue.window:addChild Window(item)80 item:setSize(CEGUI.U Vector2(CEGUI.UDim(1, 0), CEGUI.UDim(0, itemHeight)))78 queue.window:addChild(item) 79 item:setSize(CEGUI.USize(CEGUI.UDim(1, 0), CEGUI.UDim(0, itemHeight))) 81 80 item:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0))) 82 81 item:setProperty("Alpha", 1.0) … … 102 101 local item = queue.items[queue.first] 103 102 -- Removes the item from the bottom of the queue. 104 queue.window:removeChild Window(item)103 queue.window:removeChild(item) 105 104 winMgr:destroyWindow(item) 106 105 queue.first = queue.first+1 … … 127 126 -- Removes the item. 128 127 local item = queue.items[index] 129 queue.window:removeChild Window(item)128 queue.window:removeChild(item) 130 129 winMgr:destroyWindow(item) 131 130 queue.items[index] = nil … … 159 158 for i=queue.first,queue.last-1 do 160 159 local item = queue.items[i] 161 queue.window:removeChild Window(item)160 queue.window:removeChild(item) 162 161 winMgr:destroyWindow(item) 163 162 end … … 199 198 relativeHeight = 0 200 199 end 201 queueWindow:setSize(CEGUI.U Vector2(CEGUI.UDim(relativeWidth, absoluteWidth), CEGUI.UDim(relativeHeight, absoluteHeigth)))200 queueWindow:setSize(CEGUI.USize(CEGUI.UDim(relativeWidth, absoluteWidth), CEGUI.UDim(relativeHeight, absoluteHeigth))) 202 201 end 203 202 … … 283 282 284 283 function P.itemHeightHelper(queue) 285 local item = winMgr:createWindow("MenuWidgets/StaticText", " orxonox/NotificationLayer/Root/Test/")284 local item = winMgr:createWindow("MenuWidgets/StaticText", "NotificationLayer/Root/Test/") 286 285 item:setText("text") 287 286 P.setItemFontHelper(item, queue, true) 288 queue.window:addChild Window(item)289 item:setSize(CEGUI.U Vector2(CEGUI.UDim(1, 0), CEGUI.UDim(1, 0)))287 queue.window:addChild(item) 288 item:setSize(CEGUI.USize(CEGUI.UDim(1, 0), CEGUI.UDim(1, 0))) 290 289 item:setProperty("FrameEnabled", "false") 291 290 local height = getStaticTextWindowHeight(item) 292 queue.window:removeChild Window(item)291 queue.window:removeChild(item) 293 292 winMgr:destroyWindow(item) 294 293 return height
Note: See TracChangeset
for help on using the changeset viewer.