Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 2, 2011, 1:58:12 PM (13 years ago)
Author:
dafrick
Message:

Notification text alignment can be set per queue.

File:
1 edited

Legend:

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

    r8377 r8378  
    3232        ["fontSize"]  = 12,
    3333        ["fontColor"] = "FFFFFFFF",
     34        ["alignment"] = "LeftAligned",
    3435        ["items"]     = {},
    3536        ["first"]     = 1,
     
    7980    item:setProperty("BackgroundEnabled", "false")
    8081    item:setProperty("FrameEnabled", "false")
     82    item:setProperty("HorzFormatting", queue.alignment)
    8183    queue.items[queue.last] = item
    8284    queue.last = queue.last+1
     
    215217end
    216218
     219function P.changeQueueAlignment(queueName, alignment)
     220    local queue = P.queueList[queueName]
     221    local queueWindow = queue.window
     222    if queueWindow == nil then
     223        return
     224    end
     225   
     226    queue.alignment = alignment
     227    local item = nil
     228    for i=queue.first,queue.last-1 do
     229        item = queue.items[i]
     230        item:setProperty("HorzFormatting", queue.alignment)
     231    end
     232end
     233
    217234-- Helper function to set the font size and color of a item of a queue.
    218235-- The parameters are (in order) 'the ListboxItem', 'the queue table', 'whether color should be changed as well'
     
    228245    if changeColor then
    229246        item:setProperty("TextColours", "tl:" .. queue.fontColor .. " tr:" .. queue.fontColor .. " bl:" .. queue.fontColor .. " br:" .. queue.fontColor .. "")
    230         cout(0, "tl:[" .. queue.fontColor .. "] tr:[" .. queue.fontColor .. "] bl:[" .. queue.fontColor .. "] br:[" .. queue.fontColor .. "]")
    231247    end
    232248end
Note: See TracChangeset for help on using the changeset viewer.