/run SetScale(5)
Вид для печати
подгоните пожалуйста рабочий Icicle
как называется аддон который отслеживает овер и сбив кастов?
интерапт бар
Небольшой набросок , доделать сортировку , при хайде и будет ок , ушло около 5 минут на это ...
PHP код:
local UI, C, M = select(2, ...):unpack();
local cd = UI:NewModule("cd")
local db = {
["DEATHKNIGHT"] = {
[select(1, GetSpellInfo(56222))] = 8,
[select(1, GetSpellInfo(49576))] = 25,
[select(1, GetSpellInfo(45524))] = 15,
}
}
cooldowns = {
["target"] = {},
}
local function OnUpdate(self, elapsed)
self.elapsed = self.elapsed + elapsed
if self.elapsed > self.cd then
self:Hide()
self.elapsed = 0
else
self.timeText:SetText(format("%.1f", self.cd - self.elapsed))
end
end
local function CreateTimer()
local t = CreateFrame("frame", nil, UIParent);
t.elapsed = 0
t:Hide();
t:SetFrameStrata("MEDIUM");
t:SetClampedToScreen(true);
t:SetScript("OnUpdate", OnUpdate)
-- icon
local ti = t:CreateTexture(nil, "BORDER");
ti:SetAllPoints();
ti:SetTexCoord(0.07, 0.93, 0.07, 0.93);
t.icon = ti;
local tt = t:CreateFontString(nil, "OVERLAY");
tt:SetFont("Fonts\\FRIZQT__.TTF", 11, "OUTLINE")
tt:SetPoint("BOTTOM", t, 0, 1);
tt:SetJustifyH("RIGHT");
t.timeText = tt;
return t;
end
local tmp = {}
local i = 1;
local function RegisterCD(unit, spell)
local class = select(2, UnitClass(unit));
local cd = db[class][spell];
local icon = select(3, GetSpellInfo(spell))
if not cooldowns[unit][spell] then
local timer = CreateTimer()
timer:SetSize(50, 50)
-- timer:SetPoint("CENTER")
timer.icon:SetTexture(icon)
timer.cd = cd
timer.unit = unit
timer:Show()
cooldowns[unit][spell] = timer
tmp[i] = timer
i=i+1
else
cooldowns[unit][spell]:Show()
end
end
function cd:UNIT_SPELLCAST_SUCCEEDED(unit, spell)
if unit~="target" then return end
RegisterCD(unit, spell)
table.sort(tmp, function(a, b) return a.elapsed>b.elapsed end)
for i = 1, #tmp do
if i == 1 then
tmp[i]:SetPoint("CENTER")
else
tmp[i]:SetPoint("LEFT", tmp[i-1], "RIGHT")
end
end
end
cd:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")
Небольшой набросок , доделать сортировку , при хайде и будет ок , ушло около 5 минут на это ...
Интеррапт бар он фиговый , много спелов не влепишь , да и появляться они будут в разных кусках экрана если много добавить ... примитивно довольно ... даже еще примитивнее этого кода недоделанного)PHP код:
local UI, C, M = select(2, ...):unpack();
local cd = UI:NewModule("cd")
local db = {
["DEATHKNIGHT"] = {
[select(1, GetSpellInfo(56222))] = 8,
[select(1, GetSpellInfo(49576))] = 25,
[select(1, GetSpellInfo(45524))] = 15,
}
}
cooldowns = {
["target"] = {},
}
local function OnUpdate(self, elapsed)
self.elapsed = self.elapsed + elapsed
if self.elapsed > self.cd then
self:Hide()
self.elapsed = 0
else
self.timeText:SetText(format("%.1f", self.cd - self.elapsed))
end
end
local function CreateTimer()
local t = CreateFrame("frame", nil, UIParent);
t.elapsed = 0
t:Hide();
t:SetFrameStrata("MEDIUM");
t:SetClampedToScreen(true);
t:SetScript("OnUpdate", OnUpdate)
-- icon
local ti = t:CreateTexture(nil, "BORDER");
ti:SetAllPoints();
ti:SetTexCoord(0.07, 0.93, 0.07, 0.93);
t.icon = ti;
local tt = t:CreateFontString(nil, "OVERLAY");
tt:SetFont("Fonts\\FRIZQT__.TTF", 11, "OUTLINE")
tt:SetPoint("BOTTOM", t, 0, 1);
tt:SetJustifyH("RIGHT");
t.timeText = tt;
return t;
end
local tmp = {}
local i = 1;
local function RegisterCD(unit, spell)
local class = select(2, UnitClass(unit));
local cd = db[class][spell];
local icon = select(3, GetSpellInfo(spell))
if not cooldowns[unit][spell] then
local timer = CreateTimer()
timer:SetSize(50, 50)
-- timer:SetPoint("CENTER")
timer.icon:SetTexture(icon)
timer.cd = cd
timer.unit = unit
timer:Show()
cooldowns[unit][spell] = timer
tmp[i] = timer
i=i+1
else
cooldowns[unit][spell]:Show()
end
end
function cd:UNIT_SPELLCAST_SUCCEEDED(unit, spell)
if unit~="target" then return end
RegisterCD(unit, spell)
table.sort(tmp, function(a, b) return a.elapsed>b.elapsed end)
for i = 1, #tmp do
if i == 1 then
tmp[i]:SetPoint("CENTER")
else
tmp[i]:SetPoint("LEFT", tmp[i-1], "RIGHT")
end
end
end
cd:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED")