/trunk
]] |
local addon, ns = ... |
local kui = LibStub('Kui-1.0') |
local kui = ns.kui |
local uiscale, prevuiscale |
local loadedGUIDs, loadedNames, targetExists, profile |
= {}, {} |
-- Custom reaction colours |
ns.r = { |
{ .7, .2, .1 }, -- hated |
{ 1, .8, 0 }, -- neutral |
{ .2, .6, .1 }, -- friendly |
{ .7, .2, .1 }, -- hated |
{ 1, .8, 0 }, -- neutral |
{ .2, .6, .1 }, -- friendly |
} |
-- combat log events to listen to for cast warnings/healing |
end |
local r, g, b = self.oldHealth:GetStatusBarColor() |
if self.health.reset or |
r ~= self.health.r or |
g ~= self.health.g or |
b ~= self.health.b |
if self.health.reset or |
r ~= self.health.r or |
g ~= self.health.g or |
b ~= self.health.b |
then |
-- store the default colour |
self.health.r, self.health.g, self.health.b = r, g, b |
local blue = (1 - (1 / 5) * self.points) |
self:SetText(self.points) |
self:SetFont(kui.m.f.yanone, size, 'OUTLINE') |
self:SetFont(profile.general.font, size, 'OUTLINE') |
self:SetTextColor(1, 1, blue) |
elseif self:GetText() then |
self:SetText('') |
else |
self.nametext:SetText(nil) |
end |
if self.friend then |
self.isfriend:SetText('friendly') |
else |
self.isfriend:SetText('not friendly') |
end |
]] |
-- [end debug] |
end |
-- Update sizes of child frames, fonts and the position of .bg in this nameplate |
-- health text ------------------------------------------------------------- |
frame.health.p = kui.CreateFontString(frame.overlay, { |
font = kui.m.f.yanone, size = fontSizes.large, outline = "OUTLINE" }) |
font = profile.general.font, size = fontSizes.large, outline = "OUTLINE" }) |
frame.health.p:SetJustifyH('RIGHT') |
frame.health.p:SetPoint('BOTTOMRIGHT', frame.health, 'TOPRIGHT', -2, uiscale and -(3/uiscale) or -3) |
if profile.hp.showalt then |
frame.health.mo = kui.CreateFontString(frame.overlay, { |
font = kui.m.f.yanone, size = fontSizes.small, outline = "OUTLINE" }) |
font = profile.general.font, size = fontSizes.small, outline = "OUTLINE" }) |
frame.health.mo:SetJustifyH('RIGHT') |
frame.health.mo:SetPoint('BOTTOMRIGHT', frame.health, -2, uiscale and -(3/uiscale) or -3) |
-- level text -------------------------------------------------------------- |
frame.level = kui.CreateFontString(frame.level, { reset = true, |
font = kui.m.f.yanone, size = fontSizes.name, outline = 'OUTLINE' }) |
font = profile.general.font, size = fontSizes.name, outline = 'OUTLINE' }) |
frame.level:SetParent(frame.overlay) |
frame.level:ClearAllPoints() |
-- name text --------------------------------------------------------------- |
frame.name = kui.CreateFontString(frame.overlay, { |
font = kui.m.f.yanone, size = fontSizes.name, outline = 'OUTLINE' }) |
font = profile.general.font, size = fontSizes.name, outline = 'OUTLINE' }) |
frame.name:SetJustifyH('LEFT') |
frame.name:SetHeight(8) |
-- combo point text -------------------------------------------------------- |
if profile.general.combopoints then |
frame.cp = kui.CreateFontString(frame.health, |
{ font = kui.m.f.yanone, size = fontSizes.combopoints, outline = 'OUTLINE', shadow = true }) |
{ font = profile.general.font, size = fontSizes.combopoints, outline = 'OUTLINE', shadow = true }) |
frame.cp:SetPoint('LEFT', frame.health, 'RIGHT', 5, 1) |
frame.cp.Update = ComboPointsUpdate |
-- cast bar text ------------------------------------------------------- |
if profile.castbar.spellname then |
frame.castbar.name = kui.CreateFontString(frame.castbar, { |
font = kui.m.f.yanone, size = fontSizes.name, outline = "OUTLINE" }) |
font = profile.general.font, size = fontSizes.name, outline = "OUTLINE" }) |
frame.castbar.name:SetPoint('TOPLEFT', frame.castbar, 'BOTTOMLEFT', 2, -2) |
end |
if profile.castbar.casttime then |
frame.castbar.max = kui.CreateFontString(frame.castbar, { |
font = kui.m.f.yanone, size = fontSizes.name, outline = "OUTLINE" }) |
font = profile.general.font, size = fontSizes.name, outline = "OUTLINE" }) |
frame.castbar.max:SetPoint('TOPRIGHT', frame.castbar, 'BOTTOMRIGHT', -2, -1) |
frame.castbar.curr = kui.CreateFontString(frame.castbar, { |
font = kui.m.f.yanone, size = fontSizes.small, outline = "OUTLINE" }) |
font = profile.general.font, size = fontSizes.small, outline = "OUTLINE" }) |
frame.castbar.curr:SetAlpha(.5) |
frame.castbar.curr:SetPoint('TOPRIGHT', frame.castbar.max, 'TOPLEFT', -1, -1) |
end |
if profile.castbar.warnings then |
-- casting spell name |
frame.castWarning = kui.CreateFontString(frame.overlay, { |
font = kui.m.f.yanone, size = fontSizes.spellname, outline = 'OUTLINE' }) |
font = profile.general.font, size = fontSizes.spellname, outline = 'OUTLINE' }) |
frame.castWarning:SetPoint('BOTTOMLEFT', frame.level, 'TOPLEFT', 0, 1) |
frame.castWarning:Hide() |
-- incoming healing |
frame.incWarning = kui.CreateFontString(frame.overlay, { |
font = kui.m.f.yanone, size = fontSizes.small, outline = 'OUTLINE' }) |
font = profile.general.font, size = fontSizes.small, outline = 'OUTLINE' }) |
frame.incWarning:SetPoint('BOTTOMRIGHT', frame.health.p, 'TOPRIGHT', 1) |
frame.incWarning:Hide() |
frame:SetBackdrop({bgFile=kui.m.t.solid}) |
frame:SetBackdropColor(1, 1, 1, .5) |
frame.isfriend = kui.CreateFontString(frame, { |
font = profile.general.font, size = 10, outline = 'OUTLINE' }) |
frame.isfriend:SetPoint('BOTTOM', frame, 'TOP') |
frame.guidtext = kui.CreateFontString(frame, { |
font = kui.m.f.yanone, size = 10, outline = "OUTLINE" }) |
font = profile.general.font, size = 10, outline = "OUTLINE" }) |
frame.guidtext:SetPoint('TOP', frame, 'BOTTOM') |
frame.nametext = kui.CreateFontString(frame, { |
font = kui.m.f.yanone, size = 10, outline = "OUTLINE" }) |
font = profile.general.font, size = 10, outline = "OUTLINE" }) |
frame.nametext:SetPoint('TOP', frame.guidtext, 'BOTTOM') |
]] |
--------------------------------------------------------------- Options table -- |
do |
local fontSelection = { |
'Yanone Kaffeesatz', |
'Accidental Presidency', |
'Standard font (Friz Quadrata)', |
'Chat font (Arial Narrow)', |
'Morpheus', |
'Skurri', |
} |
local fontSelectionValues = { |
kui.m.f.yanone, |
kui.m.f.accid, |
STANDARD_TEXT_FONT, |
select(1, DEFAULT_CHAT_FRAME:GetFont()), |
'Fonts\\MORPHEUS.ttf', |
'Fonts\\skurri.ttf', |
} |
local handler = {} |
local options = { |
name = 'Kui Nameplates', |
type = 'toggle', |
order = 3 |
}, |
font = { |
name = 'Font', |
desc = 'The font used for all text on frames', |
type = 'select', |
get = 'GetFont', |
set = 'SetFont', |
values = fontSelection |
}, |
fontscale = { |
name = 'Font scale', |
desc = 'The scale of all fonts displayed on nameplates', |
end |
end |
function handler:GetFont(info) |
local path = ns.db.profile[info[1]][info[#info]] |
for id, thisPath in pairs(fontSelectionValues) do |
if path == thisPath then |
return id |
end |
end |
return 1 |
end |
function handler:SetFont(info, val) |
ns.db.profile[info[1]][info[#info]] = fontSelectionValues[val] |
end |
AceConfig:RegisterOptionsTable('kuinameplates', options) |
AceConfigDialog:AddToBlizOptions('kuinameplates', 'Kui Nameplates') |
end |
Kesava-Auchindoun EU |
]] |
local addon, ns = ... |
local kui = LibStub('Kui-1.0') |
LibStub('AceAddon-3.0'):NewAddon(ns, 'KuiNameplates') |
ns.kui = kui |
-------------------------------------------------------------- Default config -- |
local defaults = { |
profile = { |
highlight = true, -- highlight plates on mouse-over |
combopoints = true, -- display combo points |
fixaa = true, -- attempt to make plates appear sharper (with some drawbacks) |
fontscale = 1.0 -- the scale of all displayed font sizes |
font = kui.m.f.yanone, -- the font used for all text |
fontscale = 1.0, -- the scale of all displayed font sizes |
}, |
fade = { |
smooth = true, -- smoothy fade plates (fading is instant if disabled) |