/branches
**************************************************************************************** |
LibAboutPanel |
File date: 2010-12-01T19:31:23Z |
Project version: v1.51 |
File date: 2010-10-15T16:36:15Z |
Project version: v1.5 |
Author: Tekkub, Ackis |
-- Get the localized version of notes if it exists or fall back to the english one. |
local notes = GetAddOnMetadata(frame.addonname, notefield) or GetAddOnMetadata(frame.addonname, "Notes") |
if not frame.about_title then |
frame.about_title = frame:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge") |
end |
local title = frame.about_title |
local title = frame:CreateFontString(nil, "ARTWORK", "GameFontNormalLarge") |
title:SetPoint("TOPLEFT", 16, -16) |
title:SetText(frame.parent and (frame.parent.." - " .. L["About"]) or frame.name) |
if not frame.about_subtitle then |
frame.about_subtitle = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") |
end |
local subtitle = frame.about_subtitle |
local subtitle = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") |
subtitle:SetHeight(32) |
subtitle:SetPoint("TOPLEFT", title, "BOTTOMLEFT", 0, -8) |
subtitle:SetPoint("RIGHT", frame, -32, 0) |
for _,field in pairs(fields) do |
local val = GetAddOnMetadata(frame.addonname, field) |
if val then |
if not frame[field .. "_title"] then |
frame[field .. "_title"] = frame:CreateFontString(nil, "ARTWORK", "GameFontNormalSmall") |
end |
local title = frame[field .. "_title"] |
local title = frame:CreateFontString(nil, "ARTWORK", "GameFontNormalSmall") |
title:SetWidth(75) |
if not anchor then |
title:SetPoint("TOPLEFT", subtitle, "BOTTOMLEFT", -2, -12) |
else |
title:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", 0, -10) |
end |
if not anchor then title:SetPoint("TOPLEFT", subtitle, "BOTTOMLEFT", -2, -12) |
else title:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", 0, -10) end |
title:SetJustifyH("RIGHT") |
title:SetText(field:gsub("X%-", "")) |
if not frame[field .. "_detail"] then |
frame[field .. "_detail"] = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") |
end |
local detail = frame[field .. "_detail"] |
local detail = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall") |
detail:SetHeight(32) |
detail:SetPoint("LEFT", title, "RIGHT", 4, 0) |
detail:SetPoint("RIGHT", frame, -16, 0) |