/trunk
return color and ('|cff%02X%02X%02X%s|r'):format(color.r*255, color.g*255, color.b*255, shortclassnames[class]) or '' |
end |
function unit_happiness (unit) |
local happiness = GetPetHappiness() |
if unit == 'pet' and happiness then |
return pethappiness[happiness] |
end |
return '' |
end |
function unit_level (unit) |
local color = GetDifficultyColor(UnitLevel(unit)) |
return color and ('|cff%02X%02X%02X%s|r'):format(color.r*255, color.g*255, color.b*255, UnitLevel(unit)) |
local unit = frame.unit |
if not UnitExists(unit) then return end |
frame.Name:SetText(('%s %s %s%s %s'):format( |
frame.Name:SetText(('%s %s %s%s'):format( |
unit_level(unit), |
unit_class(unit), |
unit_name(unit), |
unit_tapped(unit), |
unit_happiness(unit) |
)) |
end |
local debuffs = CreateFrame('Frame', nil, frame) |
local leader = health:CreateTexture(nil, 'OVERLAY') |
local threat = frame:CreateTexture() |
local happiness = frame:CreateTexture() |
health.info = health:CreateFontString(nil, 'OVERLAY') |
health.value = health:CreateFontString(nil, 'OVERLAY') |
power.info = power:CreateFontString(nil, 'OVERLAY') |
frame:SetScript('OnUpdate', frame_onupdate) |
-- out of range fading |
if unit and unit:match('party') or unit:match('raid') then |
frame.Range = true |
frame.inRangeAlpha = 1 |
frame.outsideRangeAlpha = 0.5 |
end |
frame.Health = health |
frame.OverrideUpdateHealth = nothing |
frame.Power = power |
frame.Threat = threat |
end |
function create_pet_unitframe(frame, unit) |
create_unitframe(frame, unit) |
local happiness = frame:CreateTexture() |
happiness:SetPoint(MC, frame, BR) |
happiness:SetWidth(16) |
happiness:SetHeight(16) |
frame.Happiness = happiness |
end |
function create_party_unitframe (frame, unit) |
create_unitframe(frame, unit) |
-- out of range fading |
frame.Range = true |
frame.inRangeAlpha = 1 |
frame.outsideRangeAlpha = 0.5 |
local buffs = frame.Buffs |
local w = bar_width |
local h = buffs.size |
local n = math.floor(w / h) |
end |
oUF:RegisterStyle('Industrial', create_unitframe) |
oUF:RegisterStyle('Industrial-pet', create_pet_unitframe) |
oUF:RegisterStyle('Industrial-party', create_party_unitframe) |
oUF:SetActiveStyle('Industrial-pet') |
local pet = oUF:Spawn('pet', frame_name..'pet') |
oUF:SetActiveStyle('Industrial') |
local pet = oUF:Spawn('pet', frame_name..'pet') |
local player = oUF:Spawn('player', frame_name..'player') |
local target = oUF:Spawn('target', frame_name..'target') |
local targettarget = oUF:Spawn('targettarget', frame_name..'targettarget') |