/trunk
------------------------------------------------------------------------ init -- |
function addon:OnInitialize() |
if not _G['KuiNameplatesFilesLoaded-150'] then |
print('|cffff3333KuiNameplates was not loaded correctly. If you installed this update while WoW was running, you must fully restart WoW for it to recognise new files (reloading the UI or logging out and back in will not work). Otherwise, please try redownloading the addon.') |
end |
self.db = LibStub('AceDB-3.0'):New('KuiNameplatesGDB', defaults) |
-- enable ace3 profiles |
local LSM = LibStub('LibSharedMedia-3.0') |
local kn = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') |
--KuiNameplatesDebug=true |
-- frame to run OnUpdate |
kn.f = CreateFrame('Frame') |
-- store size as a key of kn.fontSizes so that it can be recalled & scaled |
-- correctly. Used by SetFontSize. |
local sizeKey |
obj = obj or {} |
obj.mono = profile.fonts.options.monochrome |
obj.outline = profile.fonts.options.outline |
obj.size = obj.size or 'name' |
if type(obj.size) == 'string' then |
sizeKey = obj.size |
------------------------------------------------------- Frame script handlers -- |
local function OnFrameShow(self) |
if self.carrier then |
self.carrier.DoShow = true |
end |
-- reset name |
self.name.text = self.oldName:GetText() |
self.name:SetText(self.name.text) |
self:UpdateFrame() |
self:UpdateFrameCritical() |
-- force health update |
OnHealthValueChanged(self.oldHealth, self.oldHealth:GetValue()) |
self:SetGlowColour() |
if self.carrier then |
-- TODO TEST only show players |
--[[if self.friend and self.player then |
self.carrier.DoShow = true |
else |
self.carrier.DoShow = nil |
self.carrier:Hide() |
end]] |
self.carrier.DoShow = true |
end |
kn:SendMessage('KuiNameplates_PostShow', self) |
end |
frame:SetBackdrop({bgFile=kui.m.t.solid}) |
frame:SetBackdropColor(1, 1, 1, .5) |
frame.isfriend = frame:CreateFontString(frame, { |
font = kn.font, size = 10, outline = 'OUTLINE' }) |
frame.isfriend = frame:CreateFontString(frame.overlay) |
frame.isfriend:SetPoint('BOTTOM', frame, 'TOP') |
frame.guidtext = frame:CreateFontString(frame, { |
font = kn.font, size = 10, outline = "OUTLINE" }) |
frame.guidtext = frame:CreateFontString(frame.overlay) |
frame.guidtext:SetPoint('TOP', frame, 'BOTTOM') |
frame.nametext = frame:CreateFontString(frame, { |
font = kn.font, size = 10, outline = "OUTLINE" }) |
frame.nametext = frame:CreateFontString(frame.overlay) |
frame.nametext:SetPoint('TOP', frame.guidtext, 'BOTTOM') |
end |
end) |
end |
-- enable packed modules |
--[[ |
if profile.castbar.enabled and modules.castbar then |
modules.castbar:Enable() |
end |
if profile.castbar.warnings and modules.warnings then |
modules.warnings:Enable() |
end |
if profile.general.combopoints and modules.combopoints then |
modules.combopoints:Enable() |
end]] |
self.f:SetScript('OnUpdate', self.f.OnUpdate) |
self.f:SetScript('OnUpdate', self.f.OnUpdate) |
self:RegisterEvent('PLAYER_TARGET_CHANGED') |
self.ToggleCombatEvents(profile.general.combat) |
end |
local addon = LibStub('AceAddon-3.0'):GetAddon('KuiNameplates') |
local kui = LibStub('Kui-1.0') |
_G['KuiNameplatesFilesLoaded-150'] = true |
------------------------------------------------------------------ Background -- |
function addon:CreateBackground(frame) |
-- frame glow |