/trunk
local frame_name = 'oUF_Industrial_' |
local padding = 5 |
local spacing = 5 |
local margin = 1 |
local translucency = 0.5 |
local padding = 0 |
local spacing = 0 |
local margin = 0 |
local translucency = 1 |
local bar_width = 300 - padding * 2 |
local bar_width = 359 - padding * 2 |
local bar_texture = [[Interface\AddOns\oUF_Industrial\media\textures\statusbar]] |
local health_width = bar_width |
local health_height = 25 |
local health_texture = bar_texture |
--local health_color = {0.25, 0.25, 0.25, translucency + translucency/2} |
local health_color = {0.5, 0.5, 0.5, translucency + translucency / 2} |
local power_width = bar_width |
local power_height = 5 |
local power_height = 3 |
local power_texture = bar_texture |
--local power_color = {128/255, 255/255, 0, translucency + translucency/2} |
local power_color = {0.25, 0.5, 1, translucency + translucency / 2} |
local cast_color = {1, 1, 0, translucency + translucency / 2} |
local text_inset = 3 |
local text_font = _G.GameFontNormal:GetFont() |
local text_color = {1, 1, 1} |
return '' |
end |
function unit_threat (unit) |
if UnitIsEnemy('player', unit) then |
local threat_percent = select(3, UnitDetailedThreatSituation('player', 'target')) |
if threat_percent then |
return math.ceil(threat_percent) .. '%' |
else |
return '' |
end |
else |
return '' |
end |
end |
function update_health (frame, event, unit, bar, min, max) |
bar.value:SetText(min) |
update_name(frame) |
local unit = frame.unit |
if not UnitExists(unit) then return end |
frame.Name:SetText(('%s %s %s%s'):format( |
frame.Name:SetText(('%s %s %s%s %s'):format( |
unit_level(unit), |
unit_class(unit), |
unit_name(unit), |
unit_tapped(unit) |
unit_tapped(unit), |
unit_threat(unit) |
)) |
end |
health:SetWidth(health_width) |
health:SetHeight(health_height) |
health:SetStatusBarTexture(health_texture) |
health:SetStatusBarColor(0.25, 0.25, 0.25, translucency + translucency/2) |
health:SetStatusBarColor(unpack(health_color)) |
health.info:SetPoint(ML, health, ML, text_inset, 0) |
health.info:SetJustifyH('LEFT') |
power:SetWidth(power_width) |
power:SetHeight(power_height) |
power:SetStatusBarTexture(power_texture) |
power:SetStatusBarColor(128/255, 255/255, 0, translucency + translucency/2) |
power:SetStatusBarColor(unpack(power_color)) |
power.info:SetPoint(ML, power, ML, text_inset, 0) |
power.info:SetJustifyH('LEFT') |
power.value:SetShadowOffset(1, -1) |
-- castbar |
--[[castbar.Icon:SetPoint(ML, power, ML) |
castbar.Icon:SetWidth(power:GetHeight()) |
castbar.Icon:SetHeight(power:GetHeight())]] |
--[[castbar:SetPoint(TL, castbar.Icon, TR) |
castbar:SetPoint(BL, castbar.Icon, BR) |
castbar:SetPoint(TR, power, TR) |
castbar:SetPoint(BR, power, BR)]] |
castbar:SetAllPoints(power) |
castbar:SetToplevel(true) |
castbar:SetStatusBarTexture(health_texture) |
--castbar:SetStatusBarColor(128/255, 255/255, 0, 0.5) |
castbar:SetStatusBarColor(0.25, 0.5, 1) |
castbar:SetStatusBarColor(unpack(cast_color)) |
-- buffs |
local size = 16 |
local height = health_height + spacing + power_height |
local width = health_width / 2 |
local number = math.floor(width / size) * 2 -- times two for two lines vertically |
local width = health_width |
local number = math.floor(width / height) |
buffs:SetPoint(TR, frame, TL, -padding / 2, -padding) |
buffs:SetWidth(width) |
buffs:SetHeight(height) |
buffs.size = size |
buffs.size = height |
buffs.num = number |
buffs.initialAnchor = TR |
buffs['growth-x'] = 'LEFT' |
debuffs:SetPoint(ML, frame, MR, padding / 2, -padding) |
debuffs:SetWidth(width) |
debuffs:SetHeight(height) |
debuffs.size = size |
debuffs.size = height |
debuffs.num = number |
debuffs.initialAnchor = TL |
debuffs['growth-x'] = 'RIGHT' |
oUF:RegisterStyle('Industrial', create_unitframe) |
oUF:RegisterStyle('Industrial-pet', create_pet_unitframe) |
oUF:RegisterStyle('Industrial-party', create_party_unitframe) |
--oUF:RegisterStyle('Industrial-party', create_party_unitframe) |
oUF:SetActiveStyle('Industrial-pet') |
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') |
oUF:SetActiveStyle('Industrial-party') |
local party1 = oUF:Spawn('party1', frame_name..'party1') |
local party2 = oUF:Spawn('party2', frame_name..'party2') |
local party3 = oUF:Spawn('party3', frame_name..'party3') |
local party4 = oUF:Spawn('party4', frame_name..'party4') |
--oUF:SetActiveStyle('Industrial-party') |
--local party1 = oUF:Spawn('party1', frame_name..'party1') |
--local party2 = oUF:Spawn('party2', frame_name..'party2') |
--local party3 = oUF:Spawn('party3', frame_name..'party3') |
--local party4 = oUF:Spawn('party4', frame_name..'party4') |
targettarget:SetScript('OnUpdate', target_onupdate) |
pet:SetPoint(MC, UIParent, MC, 0, -300) |
pet:SetPoint(MC, UIParent, MC, 0, -305) |
player:SetPoint(BC, pet, TC, 0, margin) |
target:SetPoint(BC, player, TC, 0, margin) |
targettarget:SetPoint(BC, target, TC, 0, margin) |
party1:SetPoint(ML, UIParent, ML) |
party2:SetPoint(TC, party1, BC, 0, -18) |
party3:SetPoint(TC, party2, BC, 0, -18) |
party4:SetPoint(TC, party3, BC, 0, -18) |
--party1:SetPoint(ML, UIParent, ML) |
--party2:SetPoint(TC, party1, BC, 0, -18) |
--party3:SetPoint(TC, party2, BC, 0, -18) |
--party4:SetPoint(TC, party3, BC, 0, -18) |