/trunk
local show_menu |
local unit_class |
local unit_happiness |
local unit_level |
local unit_name |
local unit_tapped |
local update_power |
local update_name |
local create_unitframe |
local nothing = function(...) end |
local frame_onupdate |
function show_menu (frame) |
local unit = frame.unit:sub(1, -2) |
return '' |
end |
function update_health (frame, event, unit, bar, min, max) |
bar.value:SetText(min) |
function update_health (frame) |
local unit = frame.unit |
local health = UnitHealth(unit) |
frame.Health:SetValue(health) |
frame.Health.value:SetText(health) |
end |
function update_power (frame, event, unit, bar, min, max) |
bar.value:SetText(min > 0 and min or '') |
function update_power (frame) |
local unit = frame.unit |
local power = UnitMana(unit) |
frame.Power:SetValue(power) |
frame.Power.value:SetText(power > 0 and power or '') |
end |
function update_name (frame) |
local ricon = health:CreateTexture() |
local mlicon = health:CreateTexture() |
local threat = health:CreateTexture() |
local castbar = CreateFrame('StatusBar', nil, health) |
health.info = health:CreateFontString(nil, 'OVERLAY') |
health.value = health:CreateFontString(nil, 'OVERLAY') |
power.info = power:CreateFontString(nil, 'OVERLAY') |
power.value:SetShadowColor(0, 0, 0) |
power.value:SetShadowOffset(1, -1) |
-- castbar |
castbar:SetAllPoints(health) |
castbar:SetToplevel(true) |
castbar:SetStatusBarTexture(health_texture) |
castbar:SetStatusBarColor(128/255, 255/255, 0, 0.5) |
-- buffs |
local h = health_height + spacing + power_height |
local s = h / 2 |
background:SetAllPoints(frame) |
background:SetTexture(0, 0, 0, 1) |
frame:SetScript('OnUpdate', frame_onupdate) |
frame.Health = health |
frame.PostUpdateHealth = update_health |
frame.OverrideUpdateHealth = nothing |
frame.Power = power |
frame.PostUpdatePower = update_power |
frame.OverrideUpdatePower = nothing |
frame.Name = health.info |
frame.Info = power.info |
frame.Castbar = castbar |
frame.Buffs = buffs |
frame.Debuffs = debuffs |
frame.Leader = rlicon |
local h = buffs.size |
local n = math.floor(w / h) |
print(w, h, n) |
buffs:SetPoint(TC, frame, BC, 0, -padding / 2) |
buffs:SetWidth(w) |
buffs:SetHeight(h) |
buffs['growth-y'] = BC |
end |
function frame_onupdate (frame, elapsed) |
update_health(frame) |
update_power(frame) |
update_name(frame) |
end |
oUF:RegisterStyle('Industrial', create_unitframe) |
oUF:RegisterStyle('Industrial-pet', create_pet_unitframe) |
oUF:RegisterStyle('Industrial-party', create_party_unitframe) |
local party3 = oUF:Spawn('party3', frame_name..'party3') |
local party4 = oUF:Spawn('party4', frame_name..'party4') |
targettarget:SetScript('OnUpdate', frame_onupdate) |
pet:SetPoint(MC, UIParent, MC, 0, -300) |
player:SetPoint(BC, pet, TC, 0, margin) |
target:SetPoint(BC, player, TC, 0, margin) |