3 local min, ceil = math.min, math.ceil;
4 local GetSpellCharges = GetSpellCharges;
5 local GetTime = GetTime;
6 local CTimerAfter = C_Timer.After;
8 local frame = CreateFrame("Frame", "OmaBres", UIParent);
11 local charges, maxCharges, start, duration = GetSpellCharges(20484); -- Rebirth
14 local remain = duration - (GetTime() - start);
20 frame.charge:SetText(charges);
21 frame.cd:SetCooldown(start, duration);
22 CTimerAfter(min(ceil(remain), 5), tick);
30 frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", 580, 0);
33 frame.base = frame:CreateTexture(nil, "BACKGROUND");
34 frame.base:SetAllPoints();
35 frame.base:SetColorTexture(0, 0, 0, 0.5);
36 frame.icon = frame:CreateTexture(nil, "BORDER");
37 frame.icon:SetPoint("TOPLEFT", frame.base, "TOPLEFT", 1, -1);
38 frame.icon:SetPoint("BOTTOMRIGHT", frame.base, "BOTTOMRIGHT", -1, 1);
39 frame.icon:SetTexCoord(0.07, 0.93, 0.07, 0.93);
40 frame.icon:SetTexture(136080); -- Rebirth
41 frame.charge = frame:CreateFontString(nil, "OVERLAY", "NumberFontNormalLarge");
42 frame.charge:SetPoint("BOTTOMRIGHT");
43 frame.cd = CreateFrame("Cooldown", "OmaBresCD", frame, "CooldownFrameTemplate");
44 frame.cd:SetAllPoints();
45 frame:UnregisterAllEvents();
49 frame:SetScript("OnEvent", function(self, event)
52 frame:RegisterEvent("PLAYER_LOGIN");