WoWInterface SVN oUF_Industrial

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 29 to Rev 30
    Reverse comparison

Rev 29 → Rev 30

trunk/Addon.lua
41,7 → 41,6
 
local show_menu
local unit_class
local unit_happiness
local unit_level
local unit_name
local unit_tapped
49,8 → 48,6
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)
89,18 → 86,12
return ''
end
 
function update_health (frame)
local unit = frame.unit
local health = UnitHealth(unit)
frame.Health:SetValue(health)
frame.Health.value:SetText(health)
function update_health (frame, event, unit, bar, min, max)
bar.value:SetText(min)
end
 
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 '')
function update_power (frame, event, unit, bar, min, max)
bar.value:SetText(min > 0 and min or '')
end
 
function update_name (frame)
125,6 → 116,7
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')
173,6 → 165,12
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
225,14 → 223,13
background:SetAllPoints(frame)
background:SetTexture(0, 0, 0, 1)
 
frame:SetScript('OnUpdate', frame_onupdate)
 
frame.Health = health
frame.OverrideUpdateHealth = nothing
frame.PostUpdateHealth = update_health
frame.Power = power
frame.OverrideUpdatePower = nothing
frame.PostUpdatePower = update_power
frame.Name = health.info
frame.Info = power.info
frame.Castbar = castbar
frame.Buffs = buffs
frame.Debuffs = debuffs
frame.Leader = rlicon
266,7 → 263,6
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)
276,12 → 272,6
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)
298,8 → 288,6
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)