WoWInterface SVN oUF_Industrial

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 5 to Rev 6
    Reverse comparison

Rev 5 → Rev 6

Addon.lua
18,11 → 18,6
bottom = 0
}
}
local happinesstext = {
':<',
':|',
':3'
}
local framename = 'oUF_Industrial_'
local frames = {}
 
45,12 → 40,10
local raidcolors = _G.RAID_CLASS_COLORS
 
local innerpadding = 1
local outerpadding = 1
local outerpadding = -1
 
local buffsize = (healthheight + powerheight + innerpadding*3)/2
 
local pethappiness = {':<',':|',':3'}
 
local shortclassnames = {
DEATHKNIGHT = 'DK',
DRUID = 'DR',
71,11 → 64,13
local updateHealthInfo
local updatePowerInfo
local createNormalFrame
local createPartyFrame
 
-- text display
local formatTextClass
local formatTextHappiness
local formatTextLevel
local formatTextName
local formatTextRace
local formatTextTapped
 
86,6 → 81,23
return ('|cff%02X%02X%02X%s|r'):format(color.r*255, color.g*255, color.b*255, shortclassnames[class])
end
 
function formatTextHappiness (unit)
local pethappiness = {':<',':|',':3'}
if unit == pet then
return GetPetHappiness() and pethappiness[GetPetHappiness()]
end
return ''
end
 
function formatTextName (unit)
return ('|cff%s%s|r'):format(UnitIsFriend(unit, 'player') == 1 and '00ff00' or 'ff0000', UnitName(unit))
end
 
function formatTextLevel (unit)
local color = GetDifficultyColor(UnitLevel(unit))
return ('|cff%02X%02X%02X%s|r'):format(color.r*255, color.g*255, color.b*255, UnitLevel(unit))
end
 
function showMenu (self)
local unit = self.unit:sub(1, -2)
local cunit = self.unit:gsub("(.)", string.upper, 1)
119,6 → 131,20
end
end
 
function updateHealthInfo (self, event, unit)
if unit ~= self.unit then return end
 
local level = formatTextLevel(unit)
local name = formatTextName(unit)
local happiness = formatTextHappiness(unit)
 
if happiness ~= '' then
happiness = happiness .. ' '
end
 
self.Name:SetText(('%s %s %s%s'):format(level, formatTextClass(unit), happiness, name))
end
 
function updatePower (self, event, unit, bar, min, max)
if min == 0 then
bar.value:SetText(0)
127,20 → 153,6
end
end
 
function updateHealthInfo (self, event, unit)
if unit ~= self.unit then return end
 
local level = UnitLevel(unit)
local name = UnitName(unit)
local happiness = ' '
 
if unit == 'pet' then
happpiness = GetPetHappiness() and happinesstext[GetPetHappiness()]..' '
end
 
self.Name:SetText(('%s %s %s%s'):format(level, formatTextClass(unit), happiness, name:sub(1, 20)))
end
 
function updatePowerInfo ()
end
 
149,7 → 161,7
local power = CreateFrame('StatusBar', nil, self)
local buffs = CreateFrame('Frame', nil, self)
local debuffs = CreateFrame('Frame', nil, self)
local leader = self:CreateTexture(nil, 'OVERLAY')
local leader = health:CreateTexture(nil, 'OVERLAY')
health.info = health:CreateFontString(nil, 'OVERLAY')
health.value = health:CreateFontString(nil, 'OVERLAY')
power.info = power:CreateFontString(nil, 'OVERLAY')