Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 5, 2010, 12:42:54 PM (14 years ago)
Author:
dafrick
Message:

Started work on edit mode. ConsoleCommand is not yet working.
Some additional cleanup. All the NotificationQueues generated by the NotificationManager now are destroyed upon destruction of the NotificationManager.
Removed NotificationQueue from level files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/notifications/data/gui/scripts/NotificationLayer.lua

    r7351 r7354  
    66P.nameList = {}
    77P.visible = nil
     8P.editMode = false
     9P.editList = {}
    810
    911function P.createQueue(name, size)
    1012    local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
    1113    local queue = winMgr:createWindow("MenuWidgets/Listbox", "orxonox/NotificationLayer/Root/Queue/" .. name)
    12     queue:setProperty("BackgroundColor", "66FFFFFF")
     14    queue:setProperty("BackgroundColor", "00FFFFFF")
    1315    root:addChildWindow(queue)
    1416
     
    123125end
    124126
     127function P.enterEditMode()
     128    P.editMode = true
     129
     130    local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
     131    --Replace all queues with FrameWindows
     132    for k,v in pairs(P.queueList) do
     133        if v ~= nil then
     134            root:removeChildWindow(v)
     135            local frame = winMgr:createWindow("MenuWidgets/FrameWindow", "orxonox/NotificationLayer/Root/EditMode/" .. P.nameList(k))
     136            frame:setArea(v:getArea())
     137            P.editList[k] = frame
     138        end
     139    end
     140end
     141
     142function P.leaveEditMode()
     143    P.editMode = false
     144
     145    local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
     146    --Replace all queues with FrameWindows
     147    for k,v in pairs(P.queueList) do
     148        if v ~= nil then
     149            root:addChildWindow(v)
     150            v:setArea(P.editList[k]:getArea())
     151            winMgr:destroyWindow(P.editList[k])
     152            P.editList[k] = nil
     153        end
     154    end
     155end
     156
     157function P.onHide()
     158    if P.editMode then
     159        P.leaveEditMode()
     160    end
     161end
     162
    125163function P.nameToQueueHelper(name)
    126164    local queue = nil
Note: See TracChangeset for help on using the changeset viewer.