WoWInterface SVN KuiNameplates

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 115 to Rev 118
    Reverse comparison

Rev 115 → Rev 118

Kui_Nameplates/layout.lua
4,7 → 4,7
]]
 
local addon, ns = ...
local kui = LibStub('Kui-1.0')
local kui = ns.kui
local uiscale, prevuiscale
local loadedGUIDs, loadedNames, targetExists, profile
= {}, {}
14,9 → 14,9
 
-- 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
50,10 → 50,10
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
177,7 → 177,7
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('')
607,7 → 607,14
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
851,14 → 858,14
 
-- 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)
867,7 → 874,7
 
-- 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()
875,7 → 882,7
 
-- 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)
886,7 → 893,7
-- 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
940,17 → 947,17
-- 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
995,7 → 1002,7
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()
 
1015,7 → 1022,7
 
-- 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()
 
1057,12 → 1064,16
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')
]]
 
Kui_Nameplates/config.lua
6,6 → 6,23
 
--------------------------------------------------------------- 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',
49,6 → 66,14
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',
259,6 → 284,22
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
Kui_Nameplates/core.lua
3,8 → 3,11
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 = {
13,7 → 16,8
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)