Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 11802


Ignore:
Timestamp:
Feb 24, 2018, 1:49:10 AM (6 years ago)
Author:
landauf
Message:

migrated NotificationLayer.lua to cegui 0.8

Location:
code/branches/cegui0.8_ogre1.9
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cegui0.8_ogre1.9/data/gui/scripts/NotificationLayer.lua

    r8858 r11802  
    1010function P.onLoad()
    1111    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")
    1313end
    1414
    1515-- Creates a queue in the GUI.
    1616function P.createQueue(name, size)
    17     local root = winMgr:getWindow("orxonox/NotificationLayer/Root")
    1817    --local queue = winMgr:createWindow("MenuWidgets/Listbox", "orxonox/NotificationLayer/Root/Queue/" .. name)
    1918    --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)
    2120    queue:setProperty("Alpha", 0.0)
    2221    --queue:setProperty("FrameEnabled", "false")
    23     root:addChildWindow(queue)
     22    P.window:addChild(queue)
    2423
    2524    local queueTuple =
     
    3837   
    3938    queue:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0)))
    40     queue:setSize(CEGUI.UVector2(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))))
    4140
    4241    P.queueList[name] = queueTuple -- name access
     
    4948
    5049    if queue ~= nil then
    51         queue.window:getParent():removeChildWindow(queue.window)
     50        queue.window:getParent():removeChild(queue.window)
    5251        winMgr:destroyWindow(queue.window)
    5352    end
     
    6665    end
    6766
    68     local item = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/Queue/" .. queueName .. "/" .. queue.last)
     67    local item = winMgr:createWindow("MenuWidgets/StaticText", queue.last)
    6968    item:setText(notification)
    7069    P.setItemFontHelper(item, queue, true)
     
    7776        end
    7877    end
    79     queue.window:addChildWindow(item)
    80     item:setSize(CEGUI.UVector2(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)))
    8180    item:setPosition(CEGUI.UVector2(CEGUI.UDim(0, 0), CEGUI.UDim(0, 0)))
    8281    item:setProperty("Alpha", 1.0)
     
    102101    local item = queue.items[queue.first]
    103102    -- Removes the item from the bottom of the queue.
    104     queue.window:removeChildWindow(item)
     103    queue.window:removeChild(item)
    105104    winMgr:destroyWindow(item)
    106105    queue.first = queue.first+1
     
    127126    -- Removes the item.
    128127    local item = queue.items[index]
    129     queue.window:removeChildWindow(item)
     128    queue.window:removeChild(item)
    130129    winMgr:destroyWindow(item)
    131130    queue.items[index] = nil
     
    159158    for i=queue.first,queue.last-1 do
    160159        local item = queue.items[i]
    161         queue.window:removeChildWindow(item)
     160        queue.window:removeChild(item)
    162161        winMgr:destroyWindow(item)
    163162    end
     
    199198        relativeHeight = 0
    200199    end
    201     queueWindow:setSize(CEGUI.UVector2(CEGUI.UDim(relativeWidth, absoluteWidth), CEGUI.UDim(relativeHeight, absoluteHeigth)))
     200    queueWindow:setSize(CEGUI.USize(CEGUI.UDim(relativeWidth, absoluteWidth), CEGUI.UDim(relativeHeight, absoluteHeigth)))
    202201end
    203202
     
    283282
    284283function P.itemHeightHelper(queue)
    285     local item = winMgr:createWindow("MenuWidgets/StaticText", "orxonox/NotificationLayer/Root/Test/")
     284    local item = winMgr:createWindow("MenuWidgets/StaticText", "NotificationLayer/Root/Test/")
    286285    item:setText("text")
    287286    P.setItemFontHelper(item, queue, true)
    288     queue.window:addChildWindow(item)
    289     item:setSize(CEGUI.UVector2(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)))
    290289    item:setProperty("FrameEnabled", "false")
    291290    local height = getStaticTextWindowHeight(item)
    292     queue.window:removeChildWindow(item)
     291    queue.window:removeChild(item)
    293292    winMgr:destroyWindow(item)
    294293    return height
  • code/branches/cegui0.8_ogre1.9/data/levels/AnihilationThreat.oxw

    r10262 r11802  
    4747    fontSize="23"
    4848    fontColor="0.8, 0.5, 0.2, 0.8"
    49     alignment="HorzCentred"
     49    alignment="CentreAligned"
    5050    displaySize="0.6, 0, 0, 0"
    5151    />
  • code/branches/cegui0.8_ogre1.9/data/levels/ArrowLevel.oxw

    r11783 r11802  
    3636    fontSize="23"
    3737    fontColor="0.3, 1, 0.2, 0.8"
    38     alignment="HorzCentred"
     38    alignment="CentreAligned"
    3939    displaySize="0.6, 0, 0, 0"
    4040    />
  • code/branches/cegui0.8_ogre1.9/data/levels/ProtectBoss.oxw

    r11783 r11802  
    3636    fontSize="16"
    3737    fontColor="0.3, 1, 0.2, 0.8"
    38     alignment="HorzCentred"
     38    alignment="CentreAligned"
    3939    displaySize="0.6, 0, 0, 0"
    4040  />
  • code/branches/cegui0.8_ogre1.9/data/levels/expeditionSector.oxw

    r11795 r11802  
    3535        fontSize="15"
    3636        fontColor="0.3, 1, 0.2, 0.8"
    37         alignment="HorzCentred"
     37        alignment="CentreAligned"
    3838        displaySize="0.7, 0, 0, 0"
    3939    />
  • code/branches/cegui0.8_ogre1.9/data/levels/iJohnVane_TriptoArea51.oxw

    r11052 r11802  
    3737    fontSize="23"
    3838    fontColor="0.3, 1, 0.2, 0.8"
    39     alignment="HorzCentred"
     39    alignment="CentreAligned"
    4040    displaySize="0.6, 0, 0, 0"
    4141    />
  • code/branches/cegui0.8_ogre1.9/data/levels/iiJohnVane_Area51UnderFire.oxw

    r11795 r11802  
    5151    fontSize="23"
    5252    fontColor="0.3, 1, 0.2, 0.8"
    53     alignment="HorzCentred"
     53    alignment="CentreAligned"
    5454    displaySize="0.6, 0, 0, 0"
    5555    />
  • code/branches/cegui0.8_ogre1.9/data/levels/iiiJohnVane_EscapeTheBastards.oxw

    r11795 r11802  
    6060    fontSize="23"
    6161    fontColor="0.3, 1, 0.2, 0.8"
    62     alignment="HorzCentred"
     62    alignment="CentreAligned"
    6363    displaySize="0.6, 0, 0, 0"
    6464    />
  • code/branches/cegui0.8_ogre1.9/data/levels/includes/notifications.oxi

    r8706 r11802  
    1616    fontSize="24"
    1717    fontColor="1, 1, 0, 0.8"
    18     alignment="HorzCentred"
     18    alignment="CentreAligned"
    1919    displaySize="0.6, 0, 0, 0"
    2020/>
  • code/branches/cegui0.8_ogre1.9/data/levels/kecks.oxw

    r11795 r11802  
    4141    fontSize="23"
    4242    fontColor="0.3, 1, 0.2, 0.8"
    43     alignment="HorzCentred"
     43    alignment="CentreAligned"
    4444    displaySize="0.6, 0, 0, 0"
    4545    />
  • code/branches/cegui0.8_ogre1.9/data/levels/maxim.oxw

    r9939 r11802  
    3838    fontSize="23"
    3939    fontColor="0.3, 1, 0.2, 0.8"
    40     alignment="HorzCentred"
     40    alignment="CentreAligned"
    4141    displaySize="0.6, 0, 0, 0"
    4242    />
  • code/branches/cegui0.8_ogre1.9/data/levels/missionOne.oxw

    r11795 r11802  
    3737    fontSize="23"
    3838    fontColor="0.3, 1, 0.2, 0.8"
    39     alignment="HorzCentred"
     39    alignment="CentreAligned"
    4040    displaySize="0.6, 0, 0, 0"
    4141    />
  • code/branches/cegui0.8_ogre1.9/data/levels/notifications.oxw

    r11052 r11802  
    2727      fontSize="23"
    2828      fontColor="0.3, 1, 0.2, 0.8"
    29       alignment="HorzCentred"
     29      alignment="CentreAligned"
    3030      displaySize="0.6, 0, 0, 0"
    3131      />
  • code/branches/cegui0.8_ogre1.9/data/levels/presentationFS11.oxw

    r11795 r11802  
    3838    fontSize="24"
    3939    fontColor="0.3, 1, 0.2, 0.8"
    40     alignment="HorzCentred"
     40    alignment="CentreAligned"
    4141    displaySize="0.6, 0, 0, 0"
    4242    />
  • code/branches/cegui0.8_ogre1.9/data/levels/presentationHS11.oxw

    r9348 r11802  
    3737    fontSize="23"
    3838    fontColor="0.3, 1, 0.2, 0.8"
    39     alignment="HorzCentred"
     39    alignment="CentreAligned"
    4040    displaySize="0.6, 0, 0, 0"
    4141    />
  • code/branches/cegui0.8_ogre1.9/data/levels/presentationHS12.oxw

    r11795 r11802  
    4848    fontSize="24"
    4949    fontColor="0.3, 1, 0.2, 0.8"
    50     alignment="HorzCentred"
     50    alignment="CentreAligned"
    5151    displaySize="0.6, 0, 0, 0"
    5252    />
  • code/branches/cegui0.8_ogre1.9/data/levels/shuttleAttack.oxw

    r11795 r11802  
    3636        fontSize="15"
    3737        fontColor="0.3, 1, 0.2, 0.8"
    38         alignment="HorzCentred"
     38        alignment="CentreAligned"
    3939        displaySize="0.7, 0, 0, 0"
    4040    />
  • code/branches/cegui0.8_ogre1.9/data/levels/shuttleRetaliation.oxw

    r11795 r11802  
    3535        fontSize="15"
    3636        fontColor="0.3, 1, 0.2, 0.8"
    37         alignment="HorzCentred"
     37        alignment="CentreAligned"
    3838        displaySize="0.7, 0, 0, 0"
    3939    />
  • code/branches/cegui0.8_ogre1.9/src/modules/notifications/NotificationManager.cc

    r11071 r11802  
    421421        infoQueue->setFontSize(24);
    422422        infoQueue->setFontColor(Vector4(1.0, 1.0, 0.0, 0.8));
    423         infoQueue->setAlignment("HorzCentred");
     423        infoQueue->setAlignment("CentreAligned");
    424424        infoQueue->setDisplaySize(Vector2(0.6, 0.0));*/
    425425    }
Note: See TracChangeset for help on using the changeset viewer.