/trunk
bottom = 0 |
} |
} |
local happinesstext = { |
':<', |
':|', |
':3' |
} |
local framename = 'oUF_Industrial_' |
local frames = {} |
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', |
local updateHealthInfo |
local updatePowerInfo |
local createNormalFrame |
local createPartyFrame |
-- text display |
local formatTextClass |
local formatTextHappiness |
local formatTextLevel |
local formatTextName |
local formatTextRace |
local formatTextTapped |
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) |
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) |
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 |
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') |