WoWInterface SVN KuiNameplates

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 110 to Rev 113
    Reverse comparison

Rev 110 → Rev 113

Kui_Nameplates/core.lua
54,16 → 54,16
 
The default patterns and their meanings are:
 
Friendly: =:m;<:d
Meaning: When at max health, display max health (=:max)
When below max health, display health deficit (<:deficit)
Friendly: =:m;<:d;
Meaning: When at max health, display max health (=:m;)
When below max health, display health deficit (<:d;)
 
Hostile: <:p
Hostile: <:p;
Meaning: When below max health, display health as a percentage.
Otherwise, display nothing.
]]
friendly = '=:m;<:d', -- health display pattern for friendly units
hostile = '<:p', -- health display pattern for hostile/neutral units
friendly = '=:m;<:d;', -- health display pattern for friendly units
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
smooth = true -- smoothly animate health bar changes
Kui_Nameplates/layout.lua
34,6 → 34,12
local strsplit, pairs, ipairs, unpack
= strsplit, pairs, ipairs, unpack
 
local function SetFontSize(fontstring, size)
-- helper function for setting a FontString's font size
local font, _, flags = fontstring:GetFont()
fontstring:SetFont(font, size, flags)
end
 
------------------------------------------------------------- Frame functions --
-- set colour of health bar according to reaction/threat
local function SetHealthColour(self)
534,13 → 540,13
end
end
------------------------------------------------------------ Target stuff --
if targetExists and
self.defaultAlpha == 1 and
self.name.text == UnitName('target')
if targetExists and
self.defaultAlpha == 1 and
self.name.text == UnitName('target')
then
-- this frame is targetted
-- this frame is targeted
if not self.target then
-- the frame just became targetted
-- the frame just became targeted
self.target = true
self:StoreGUID(UnitGUID('target'))
 
597,13 → 603,10
]]
end
 
local function SetFontSize(fontstring, size)
local font, _, flags = fontstring:GetFont()
fontstring:SetFont(font, size, flags)
end
 
-- Update sizes of child frames, fonts and the position of .bg in this nameplate
-- To be used when UIScale is changed (i.e. hardly ever)
-- TODO I don't think I actually use this at the moment
local function UpdateScales(self)
-- all this for what is hopefully not a common occurrence
self.carrier:SetScale(uiscale)
self.carrier:SetSize(self:GetWidth()/uiscale, self:GetHeight()/uiscale)
 
676,7 → 679,6
end
 
function ns.f:InitFrame(frame)
-- TODO: this is just a tad long
frame.init = true
 
local healthBar, castBar = frame:GetChildren()
746,13 → 748,14
 
self.parent = parent
 
do -- using CENTER breaks pixel-perfectness with oddly sized frames
-- .. so we're doing it manually
local w,h = parent:GetSize()
x = floor((w / 2) - (sizes.width / 2))
y = floor((h / 2) - (sizes.height / 2))
end
-- using CENTER breaks pixel-perfectness with oddly sized frames
-- .. so we have to align frames manually.
local w,h = parent:GetSize()
local x,y
 
x = floor((w / 2) - (sizes.width / 2))
y = floor((h / 2) - (sizes.height / 2))
 
-- border ------------------------------------------------------------------
--frame.bg = (frame.carrier and frame.carrier or frame):CreateTexture(nil, 'BACKGROUND')
frame.bg:SetParent(parent)
1233,8 → 1236,8
if not f.SetIncomingWarning then return end
local spName, spSch = select(13, ...)
 
if event == 'SPELL_HEAL' or
event == 'SPELL_PERIODIC_HEAL'
if event == 'SPELL_HEAL' or
event == 'SPELL_PERIODIC_HEAL'
then
-- display heal warning
local amount = select(15, ...)
1257,9 → 1260,9
= CreateFrame('Frame'), {}, GetFramerate, math.min, math.max, math.abs
 
function ns.SetValueSmooth(self, value)
local _, max = self:GetMinMaxValues()
local _, maxv = self:GetMinMaxValues()
 
if value == self:GetValue() or (self.prevMax and self.prevMax ~= max) then
if value == self:GetValue() or (self.prevMax and self.prevMax ~= maxv) then
-- finished smoothing/max health updated
smoothing[self] = nil
self:OrigSetValue(value)
1267,7 → 1270,7
smoothing[self] = value
end
 
self.prevMax = max
self.prevMax = maxv
end
 
f:SetScript('OnUpdate', function()
1327,7 → 1330,7
end
end
 
do -- events for custom cast bar
do -- events for custom cast bar
local castEvents = {
['UNIT_SPELLCAST_START'] = true,
['UNIT_SPELLCAST_FAILED'] = true,
1352,7 → 1355,7
end
 
------------------------------------------------------- Event ... registerers --
-- needs access to castEvents
-- here as it needs access to castEvents
function ns.ToggleCastbar(io)
if io then
for event,_ in pairs(castEvents) do
1410,7 → 1413,7
icon = 16
}, {
combopoints = 13,
large = 11,
large = 10, -- TODO this was 11, test at 10
spellname = 10,
name = 9,
small = 8,