Changeset 7342 for code/branches/notifications/data
- Timestamp:
- Sep 3, 2010, 9:17:51 PM (14 years ago)
- Location:
- code/branches/notifications/data/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/notifications/data/gui/scripts/NotificationLayer.lua
r7338 r7342 9 9 local root = winMgr:getWindow("orxonox/NotificationLayer/Root") 10 10 local queue = winMgr:createWindow("MenuWidgets/Listbox", "orxonox/NotificationLayer/Root/Queue/" .. name) 11 root:addChildWindow(queue) 12 11 13 queue:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0))) 12 queue:setSize(CEGUI.UVector2(CEGUI.UDim(1 , 0), CEGUI.UDim(0.2, 0)))13 root:addChildWindow(queue) 14 queue:setSize(CEGUI.UVector2(CEGUI.UDim(1.0, 0), CEGUI.UDim(0, P.queueHeightHelper(queue, size)))) 15 14 16 table.insert(P.queueList, queue) 15 17 table.insert(P.nameList, name) … … 35 37 36 38 function P.changePosition(name, xPos, yPos) 37 local queue = P.nameToQueue (name)39 local queue = P.nameToQueueHelper(name) 38 40 if queue == nil then 39 41 cout(0, "Queue is nil!") … … 44 46 45 47 function P.pushNotification(queueName, notification) 46 local queue = P.nameToQueue (queueName)48 local queue = P.nameToQueueHelper(queueName) 47 49 if queue == nil then 48 50 cout(0, "Queue is nil!") … … 59 61 60 62 function P.popNotification(queueName) 61 local queue = P.nameToQueue (queueName)63 local queue = P.nameToQueueHelper(queueName) 62 64 if queue == nil then 63 65 cout(0, "Queue is nil!") … … 69 71 70 72 function P.removeNotification(queueName, index) 71 local queue = P.nameToQueue (queueName)73 local queue = P.nameToQueueHelper(queueName) 72 74 if queue == nil then 73 75 cout(0, "Queue is nil!") … … 79 81 80 82 function P.clearQueue(name) 81 local queue = P.nameToQueue (name)83 local queue = P.nameToQueueHelper(name) 82 84 if queue == nil then 83 85 cout(0, "Queue is nil!") … … 88 90 end 89 91 90 function P.nameToQueue (name)92 function P.nameToQueueHelper(name) 91 93 local queue = nil 92 94 for k,v in pairs(P.nameList) do … … 99 101 end 100 102 103 function P.queueHeightHelper(queue, size) 104 local listbox = CEGUI.toListbox(queue) 105 local item = CEGUI.createListboxTextItem("Text") 106 listbox:addItem(item) 107 local singleItemHeight = listbox:getTotalItemsHeight() 108 local lookAndFeel = CEGUI.WidgetLookManager:getSingleton():getWidgetLook(queue:getLookNFeel()) 109 local formattedArea = lookAndFeel:getNamedArea("ItemRenderingArea"):getArea():getPixelRect(queue) 110 local frameHeight = queue:getUnclippedPixelRect():getHeight() - formattedArea:getHeight() 111 listbox:removeItem(item) 112 return frameHeight + singleItemHeight*size 113 end 114 101 115 return P 102 116 -
code/branches/notifications/data/gui/scripts/SheetManager.lua
r7341 r7342 69 69 70 70 -- Count the number of sheets that don't need input till the first that does. 71 local counter = activeMenuSheets.size 72 while counter > 0 and activeMenuSheets[counter].bNoInput do 73 counter = counter - 1 74 end 71 local counter = noInputSheetCounter() 75 72 -- Pause game control if this is the first menu to be displayed 76 73 -- HUGE HACK? … … 182 179 183 180 -- Count the number of sheets that don't need input till the first that does. 184 local counter = activeMenuSheets.size 185 while counter > 0 and activeMenuSheets[counter].bNoInput do 186 counter = counter - 1 187 end 181 local counter = noInputSheetCounter() 188 182 -- Resume control if the last (non-noInput) menu is hidden 189 183 if counter == 0 then … … 204 198 205 199 -- Count the number of sheets that don't need input till the first that does. 206 local counter = activeMenuSheets.size 207 while counter > 0 and activeMenuSheets[counter].bNoInput do 208 counter = counter - 1 209 end 200 local counter = noInputSheetCounter() 210 201 211 202 -- If the first sheet that needs input is the MainMenu. … … 224 215 end 225 216 217 function noInputSheetCounter() 218 -- Count the number of sheets that don't need input till the first that does. 219 local counter = activeMenuSheets.size 220 while counter > 0 and activeMenuSheets[counter].bNoInput do 221 counter = counter - 1 222 end 223 return counter 224 end 225 226 226 ---------------------- 227 227 --- Initialisation ---
Note: See TracChangeset
for help on using the changeset viewer.