WoWInterface SVN oUF_Industrial

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 7 to Rev 6
    Reverse comparison

Rev 7 → Rev 6

Addon.lua
9,11 → 9,14
bgFile = [[Interface\Tooltips\UI-Tooltip-Background]],
tile = true,
tileSize = 16,
--edgeFile = [[Interface\Tooltips\UI-Tooltip-Border]],
edgeFile = '',
edgeSize = 16,
--insets = {left=4,right=4,top=4,bottom=4},
insets = {left=0,right=0,top=0,bottom=0},
edgeSize = 0,
insets = {
left = 0,
right = 0,
top = 0,
bottom = 0
}
}
local framename = 'oUF_Industrial_'
local frames = {}
23,11 → 26,11
local barwidth = 300
 
local healthtexture = bartexture
local healthheight = 20
local healthheight = 30
local healthwidth = barwidth
 
local powertexture = bartexture
local powerheight = 20
local powerheight = 10
local powerwidth = barwidth
 
local textinset = 5
37,11 → 40,9
local raidcolors = _G.RAID_CLASS_COLORS
 
local innerpadding = 1
local elementpadding = 1
local outerpadding = 1
local outerpadding = -1
 
--local buffsize = (healthheight + powerheight + innerpadding*2 + elementpadding)/2
local buffsize = healthheight
local buffsize = (healthheight + powerheight + innerpadding*3)/2
 
local shortclassnames = {
DEATHKNIGHT = 'DK',
60,7 → 61,7
local showMenu
local updateHealth
local updatePower
local updateInfo
local updateHealthInfo
local updatePowerInfo
local createNormalFrame
local createPartyFrame
88,23 → 89,13
return ''
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 formatTextName (unit)
return ('|cff%s%s|r'):format(UnitIsFriend(unit, 'player') == 1 and '00ff00' or 'ff0000', UnitName(unit))
end
 
function formatTextTapped (unit)
if UnitIsTapped(unit) then
if UnitIsTappedByPlayer(unit) then
return '|cff00ff00*|r'
end
return '|cffff0000*|r'
end
return ''
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)
122,9 → 113,9
if unit ~= self.unit then return end
 
local class = select(2, UnitClass(unit))
local color = raidcolors[class]
--local color = raidcolors[class]
 
bar:SetStatusBarColor(color.r, color.g, color.b)
--bar:SetStatusBarColor(color.r, color.g, color.b)
 
if UnitIsDead(unit) then
bar:SetValue(0)
140,17 → 131,18
end
end
 
function updateInfo (self, event, unit)
function updateHealthInfo (self, event, unit)
if unit ~= self.unit then return end
 
local class = formatTextClass(unit)
local level = formatTextLevel(unit)
local name = formatTextName(unit)
local happiness = formatTextHappiness(unit)
local level = formatTextLevel(unit)
local name = formatTextName(unit)
local tapped = formatTextTapped(unit)
 
self.Name:SetText(('%s%s'):format(name, tapped))
self.Info:SetText(('%s %s %s'):format(level, class, happiness))
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)
161,6 → 153,9
end
end
 
function updatePowerInfo ()
end
 
function createNormalFrame (settings, self, unit)
local health = CreateFrame('StatusBar', nil, self)
local power = CreateFrame('StatusBar', nil, self)
181,7 → 176,7
health:SetStatusBarColor(0.75, 0.75, 0.75)
 
health.info:SetPoint(ML, health, ML, textinset, 0)
--health.info:SetWidth(healthwidth/2 - textinset)
health.info:SetWidth(healthwidth/2 - textinset)
health.info:SetJustifyH('LEFT')
health.info:SetFont(textfont, 10)
health.info:SetTextColor(unpack(textcolor))
196,20 → 191,20
health.value:SetShadowOffset(1, -1)
 
-- powerbar
power:SetPoint(TL, health, BL, 0, -elementpadding)
power:SetPoint(TL, health, BL, 0, -innerpadding)
power:SetWidth(powerwidth)
power:SetHeight(powerheight)
power:SetStatusBarTexture(powertexture)
 
power.info:SetPoint(ML, power, ML, textinset, 0)
--power.info:SetWidth(powerwidth/2 - textinset)
power.info:SetWidth(powerwidth/2 - textinset)
power.info:SetJustifyH('LEFT')
power.info:SetFont(textfont, 10)
power.info:SetTextColor(unpack(textcolor))
power.info:SetShadowColor(0, 0, 0)
power.info:SetShadowOffset(1, -1)
 
power.value:SetPoint(MR, power, MR, -textinset, 0)
power.value:SetPoint(MR, health.value, ML, -textinset, 0)
power.value:SetJustifyH('RIGHT')
power.value:SetFont(textfont, 10)
power.value:SetTextColor(unpack(textcolor))
237,19 → 232,19
self:RegisterEvent('UNIT_LOYALTY')
self:RegisterEvent('UNIT_NAME_UPDATE')
 
self.UNIT_LEVEL = updateInfo
self.UNIT_NAME = updateInfo
self.UNIT_HAPPINESS = updateInfo
self.UNIT_CLASSIFICATION_CHANGED = updateInfo
self.UNIT_COMBAT = updateInfo
self.UNIT_FACTION = updateInfo
self.UNIT_FLAGS = updateInfo
self.UNIT_LEVEL = updateInfo
self.UNIT_LOYALTY = updateInfo
self.UNIT_NAME_UPDATE = updateInfo
self.UNIT_LEVEL = updateHealthInfo
self.UNIT_NAME = updateHealthInfo
self.UNIT_HAPPINESS = updateHealthInfo
self.UNIT_CLASSIFICATION_CHANGED = updateHealthInfo
self.UNIT_COMBAT = updateHealthInfo
self.UNIT_FACTION = updateHealthInfo
self.UNIT_FLAGS = updateHealthInfo
self.UNIT_LEVEL = updateHealthInfo
self.UNIT_LOYALTY = updateHealthInfo
self.UNIT_NAME_UPDATE = updateHealthInfo
 
-- buffs
buffs:SetPoint(TR, self, TL, -elementpadding, -elementpadding)
buffs:SetPoint(TR, self, TL)
buffs:SetWidth(barwidth)
buffs:SetHeight(buffsize)
buffs.size = buffsize
258,7 → 253,7
buffs['growth-x'] = ML
buffs['growth-y'] = BC
 
debuffs:SetPoint(TL, self, TR, elementpadding, -elementpadding)
debuffs:SetPoint(TL, self, TR)
debuffs:SetWidth(barwidth)
debuffs:SetHeight(buffsize)
debuffs.size = buffsize
268,13 → 263,10
debuffs['growth-y'] = BC
 
-- leader icon
if unit and not unit:match('pet') then
leader:SetWidth(buffsize)
leader:SetHeight(buffsize)
leader:SetPoint(MC, health, TC)
leader:SetTexture([[Interface\GroupFrame\UI-Group-LeaderIcon]])
self.Leader = leader
end
leader:SetWidth(buffsize)
leader:SetHeight(buffsize)
leader:SetPoint(MC, health, TC)
leader:SetTexture([[Interface\GroupFrame\UI-Group-LeaderIcon]])
 
-- range fading
if not unit then
291,11 → 283,12
self.Info = power.info
self.Buffs = buffs
self.Debuffs = debuffs
self.Leader = leader
end
 
oUF:RegisterStyle('Industrial', setmetatable({
['initial-width'] = healthwidth + innerpadding*2,
['initial-height'] = healthheight + powerheight + innerpadding*2 + elementpadding
['initial-height'] = healthheight + powerheight + innerpadding*3
}, {__call = createNormalFrame}))
 
oUF:RegisterSubTypeMapping('UNIT_LEVEL')
307,7 → 300,7
local targettarget = oUF:Spawn('targettarget', framename..'targettarget')
local party = oUF:Spawn('header', 'oUF_Industrial_party')
 
pet:SetPoint(MC, UIParent, MC, 0, 0)
pet:SetPoint(MC, UIParent, MC, 0, -400)
player:SetPoint(BC, pet, TC, 0, outerpadding)
target:SetPoint(BC, player, TC, 0, outerpadding)
targettarget:SetPoint(BC, target, TC, 0, outerpadding)