WoWInterface SVN KuiNameplates

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 120 to Rev 121
    Reverse comparison

Rev 120 → Rev 121

Kui_Nameplates/layout.lua
1,6 → 1,8
--[[
Kui Nameplates
Kesava-Auchindoun
 
TODO make option for friendly/enemy name text colour (defaults to white)
]]
 
local addon, ns = ...
15,6 → 17,7
{ .7, .2, .1 }, -- hated
{ 1, .8, 0 }, -- neutral
{ .2, .6, .1 }, -- friendly
{ .5, .5, .5 }, -- tapped
}
 
-- combat log events to listen to for cast warnings/healing
73,6 → 76,15
elseif (r + g) > 1.8 and b == 0 then
-- neutral NPC
r, g, b = unpack(ns.r[2])
elseif b > .9 and (r+g) > 1.06 and (r+g) < 1.1 then
-- tapped NPC
if profile.hp.tapped then
-- use grey...
r, g, b = unpack(ns.r[4])
else
-- or don't change
r, g, b = self.health:GetStatusBarColor()
end
end
-- enemy player, use default UI colour
 
227,7 → 239,7
 
---------------------------------------------------- Update health bar & text --
local function OnHealthValueChanged(oldBar, curr)
local frame = oldBar:GetParent()
local frame = oldBar:GetParent():GetParent()
local min, max = oldBar:GetMinMaxValues()
local deficit, big, sml, condition, display, pattern, rules
= max - curr, '', ''
412,7 → 424,7
 
if profile.general.fixaa and uiscale then
------------------------------------------------------------ Position --
local x, y = select(4, self:GetPoint())
local x, y = select(4, self.firstChild:GetPoint())
x = x / uiscale
y = y / uiscale
 
683,22 → 695,27
 
function ns.f:IsNameplate(frame)
if frame:GetName() and string.find(frame:GetName(), '^NamePlate%d') then
local overlayRegion = select(2, frame:GetRegions())
return (overlayRegion and overlayRegion:GetObjectType() == 'Texture')
--local healthbar = select(2, frame:GetChildren());
--local overlay = select(2, healthbar:GetRegions());
--return (overlayRegion and overlayRegion:GetObjectType() == 'Texture')
return true
end
end
 
function ns.f:InitFrame(frame)
frame.init = true
 
local healthBar, castBar = frame:GetChildren()
local overlayChild, nameTextChild = frame:GetChildren()
local healthBar, castBar = overlayChild:GetChildren()
 
local _, castbarOverlay, shieldedRegion, spellIconRegion
= castBar:GetRegions()
 
local nameTextRegion = nameTextChild:GetRegions()
local
glowRegion, overlayRegion, highlightRegion, nameTextRegion,
levelTextRegion, bossIconRegion, raidIconRegion, stateIconRegion
= frame:GetRegions()
glowRegion, overlayRegion, highlightRegion, levelTextRegion,
bossIconRegion, raidIconRegion, stateIconRegion
= overlayChild:GetRegions()
 
highlightRegion:SetTexture(nil)
bossIconRegion:SetTexture(nil)
711,6 → 728,8
castbarOverlay.Show = function() return end
castBar:SetScript('OnShow', function() castBar:Hide() end)
 
frame.firstChild = overlayChild
 
frame.bg = overlayRegion
frame.glow = glowRegion
frame.boss = bossIconRegion
Kui_Nameplates/Kui_Nameplates.toc
1,4 → 1,4
## Interface: 50001
## Interface: 50100
## Author: Kesava
## Title: |cff9900ffKui|r Nameplates
## Notes: Prettier, lightweight, configurable nameplates.
Kui_Nameplates/config.lua
138,19 → 138,25
type = 'toggle',
order = 3
},
tapped = {
name = 'Use tapped colour',
desc = 'Give tapped units a grey health bar',
type = 'toggle',
order = 4
},
friendly = {
name = 'Friendly health format',
desc = 'The health display pattern for friendly units',
type = 'input',
pattern = '([<=]:[dmcp];)',
order = 4
order = 5
},
hostile = {
name = 'Hostile health format',
desc = 'The health display pattern for hostile or neutral units',
type = 'input',
pattern = '([<=]:[dmcp];)',
order = 5
order = 6
}
}
},
Kui_Nameplates/lib/Kui/main.lua
1,6 → 1,4
local addon, ns = ...
 
local MAJOR, MINOR = 'Kui-1.0', 1
local MAJOR, MINOR = 'Kui-1.0', 2
local kui = LibStub:NewLibrary(MAJOR, MINOR)
 
if not kui then
30,6 → 28,13
yanone = media .. 'f\\yanone.ttf',
},
}
------------------------------------------------------------------ var tables --
local ct = { -- classification table
elite = { '+', 'elite' },
rare = { 'r', 'rare' },
rareelite = { 'r+', 'rare elite' },
worldboss = { 'b', 'boss' }
}
 
------------------------------------------------------------------- functions --
kui.GetClassColour = function(class, str)
83,28 → 88,22
end
end
 
kui.UnitLevel = function(unit)
level, cl = UnitLevel(unit), UnitClassification(unit)
l = level
kui.UnitLevel = function(unit, long)
local level, classification =
UnitLevel(unit), UnitClassification(unit)
local diff = GetQuestDifficultyColor(level <= 0 and 999 or level)
 
if l < 0 then
level = '??'
l = 999
if ct[classification] then
classification = long and ct[classification][2] or ct[classification][1]
else
classification = ''
end
 
if cl == 'elite' then
cl = '+'
elseif cl == 'rareelite' then
cl = 'r+'
elseif cl == 'rare' then
cl = 'r'
elseif cl == 'worldboss' then
cl = 'b'
else
cl = ''
if level == -1 then
level = '??'
end
 
return level, cl, GetQuestDifficultyColor(l)
return level, classification, diff
end
 
kui.CreateFontString = function(parent, args)
Kui_Nameplates/core.lua
44,6 → 44,7
hostile = '<:p;', -- health display pattern for hostile/neutral units
showalt = true, -- show alternate (contextual) health values as well as main values
mouseover = false, -- hide health values until you mouse over or target the plate
tapped = true, -- use grey health bar colour for tapped units
smooth = true -- smoothly animate health bar changes
},
castbar = {