WoWInterface SVN zz_DaVis

Compare Revisions

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

Rev 5 → Rev 6

zz_DaVis/core.lua
36,9 → 36,62
['SPELL'] = {},
}
local last = f
local units = {}
units[#units+1] = CreateFrame("Button",name..'player',f, "SecureUnitButtonTemplate")
units[#units]:SetAttribute("unit","playertarget")
for a = 1,4 do
unit = "party"..a.."target"
local b = CreateFrame("Button",name..unit,f, "SecureUnitButtonTemplate")
b:SetAttribute("unit",unit)
units[#units+1] = b
end
 
local a = 0
local w = 40
local healers = {}
local function updateHealth(self, event, unit)
if(event=="UNIT_TARGET") then
unit = unit.."target"
end
if(UnitIsUnit(self:GetAttribute("unit"), unit)) then
local h = UnitHealth(unit)
local m = UnitHealthMax(unit)
local p = h / (m/100)
self['text']:SetText(addon['colorize'](format("%.0f%%",p),healers[UnitName(unit)] and "00ff00" or "ffffff"))
end
end
for _, u in pairs(units) do
u:SetWidth(w)
u:SetHeight(20)
u:ClearAllPoints()
u:SetPoint("BOTTOMLEFT",f,"TOPLEFT",a,0)
u:SetBackdrop({
bgFile = "Interface/Tooltips/UI-Tooltip-Background",
tile = true,
tileSize = 1,
edgeSize = 4,
insets = { left = 0, right = 0, top = 0, 0 }
})
u:SetBackdropBorderColor(1,1,1,1)
u:SetBackdropColor(0,0,0,.5)
u:RegisterEvent("UNIT_HEALTH")
u:RegisterEvent("UNIT_TARGET")
u:HookScript("OnEvent", updateHealth)
local c = u:CreateFontString(nil,"OVERLAY","CombatLogFont")
c:ClearAllPoints()
c:SetAllPoints(u)
c:SetJustifyH("CENTER")
c:SetText("100")
u['text'] = c
ClickCastFrames = ClickCastFrames or {}
ClickCastFrames[u] = true
RegisterUnitWatch(u)
a = a + w
end
local function valchange(self)
local a = tonumber(self:GetValue())==0 and self:Hide() or self:Show()
end
local c = 1
for k,v in pairs(bars) do
for a,b in pairs(v) do
b:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar")
47,13 → 100,15
b:SetWidth(200)
b:SetHeight(10)
b:SetScript("OnValueChanged", valchange)
b:SetPoint("BOTTOMLEFT",last,"TOPLEFT")
b:SetPoint(c==1 and "TOPLEFT" or "BOTTOMLEFT",last,"TOPLEFT",0,c==1 and -80 or 0)
texts[k][a] = b:CreateFontString(nil, "OVERLAY", "TextStatusBarText")
texts[k][a]:ClearAllPoints()
texts[k][a]:SetAllPoints(b)
texts[k][a]:SetText(a.." 0")
last = b
c = nil
end
 
end
bars['SWING']['amount']:SetStatusBarColor(1, 1, 0)
bars['SWING']['resisted']:SetStatusBarColor(.2, .8, .3)
104,20 → 159,15
sp = {strsplit("_",data[3])}
if(guid == data[9]) then
if(sp[1] and sp[#sp] == "DAMAGE") then
dmginc[sp[1]] = dmginc[sp[1]] or {
local offset = sp[1] == 'SWING' and 13 or 16
local isPhysical = bit.band(data[15],0x1)
local store = isPhysical>0 and "SWING" or "SPELL"
dmginc[store] = dmginc[store] or {
['amount'] = 0,
['resisted'] = 0,
['blocked'] = 0,
['absorbed'] = 0,
 
}
 
local offset = 16
if(sp[1] == 'SWING') then
offset = 13
end
local isPhysical = bit.band(data[15],0x1)
local store = isPhysical>0 and "SWING" or "SPELL"
dmginc[store]['amount'] = dmginc[store]['amount'] + tonumber(data[offset] or 0)
dmginc[store]['resisted'] = dmginc[store]['resisted'] + tonumber(data[offset+3] or 0)
dmginc[store]['blocked'] = dmginc[store]['blocked'] + tonumber(data[offset+4] or 0)
128,6 → 178,7
if(sp[#sp] == "HEAL") then
local isHostile = bit.band(data[11],COMBATLOG_OBJECT_REACTION_HOSTILE)
if(isHostile>0) then
healers[data[6]] = true
print("Healalarm", data[6],data[14])
end
end