[287280] = {1, "buff1"}, -- Glimmer of Light
[194384] = {1, "buff1"}, -- Atonement
[61295] = {1, "buff1"}, -- Riptide
+ [53563] = {1, "buff2"}, -- Beacon of Light
+ [156910] = {1, "buff2"}, -- Beacon of Faith
+ [200025] = {1, "buff2"}, -- Beacon of Virtue
-- Tank defensives
[6940] = {1, "tankcd"}, -- Blessing of Sacrifice
[33206] = {1, "tankcd"}, -- Pain Suppression
function addon.RegisterEvents(frame)
frame:RegisterEvent("PLAYER_ENTERING_WORLD");
frame:RegisterEvent("RAID_TARGET_UPDATE");
+ if frame.unit == "player" then frame:RegisterEvent("PLAYER_ALIVE") end
if frame.unit == "focus" then frame:RegisterEvent("PLAYER_FOCUS_CHANGED") end
+ if frame.unit == "target" then frame:RegisterEvent("PLAYER_TARGET_CHANGED") end
if not frame.nonraid then
frame:RegisterEvent("PLAYER_REGEN_DISABLED");
frame:RegisterEvent("READY_CHECK");
frame:RegisterUnitEvent("UNIT_ENTERED_VEHICLE", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_EXITED_VEHICLE", frame.unit, displayed);
frame:RegisterUnitEvent("UNIT_PET", frame.unit, displayed);
- if frame.unit ~= "player" then
+ if frame.unit == "focus" or frame.unit == "target" then
+ frame:RegisterUnitEvent("UNIT_TARGETABLE_CHANGED", frame.unit, displayed);
+ end
+ if not frame.nonraid or frame.unit ~= "player" then
frame:RegisterUnitEvent("UNIT_NAME_UPDATE", frame.unit, displayed);
end
if not frame.nonraid then
frame.stacks = {};
frame.heal = {};
frame.buff1 = {};
+ frame.buff2 = {};
addon.SetAuras(frame.unit, frame.guid);
end
end,
["UPDATE_ALL_BARS"] = function(frame)
updateVehicle(frame);
updateRaidMarker(frame, frame.displayed);
- if frame.unit ~= "player" then
+ if not frame.nonraid or frame.unit ~= "player" then
updateName(frame, frame.unit);
end
if not frame.nonraid then
frame.stacks = {};
frame.heal = {};
frame.buff1 = {};
+ frame.buff2 = {};
addon.SetAuras(frame.unit, frame.guid);
end
end,
eventFuncs["GROUP_ROSTER_UPDATE"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["PLAYER_ENTERING_WORLD"] = eventFuncs["UPDATE_ALL_BARS"];
eventFuncs["PLAYER_FOCUS_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
+eventFuncs["PLAYER_TARGET_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
+eventFuncs["UNIT_TARGETABLE_CHANGED"] = eventFuncs["UPDATE_ALL_BARS"];
+eventFuncs["PLAYER_ALIVE"] = eventFuncs["UPDATE_ALL_BARS"];
function addon.UnitEvent(self, event)
return eventFuncs[event](self);
f.tankcd = {}; -- tank CD auras
f.stacks = {}; -- stacking aura tracking
f.buff1 = {}; -- custom buff indicator 1
+ f.buff2 = {}; -- custom buff indicator 2
f.incoming = {}; -- incoming ability indicator
f.rounds = 0;
-- set up periodic updates
f.ready:SetPoint("TOPLEFT", f, "BOTTOMLEFT", 1, 15);
f.ready:SetPoint("BOTTOMRIGHT", f, "BOTTOMLEFT", 15, 1);
f.ready:Hide();
- f.defensive = f:CreateTexture(nil, "OVERLAY");
- f.defensive:SetPoint("TOPLEFT", f.background, "TOPLEFT", 1, -1);
- f.defensive:SetWidth(6);
- f.defensive:SetHeight(6);
- f.defensive:SetColorTexture(1, 0.3, 0);
- f.defensive:Hide();
f.buffind1 = f:CreateTexture(nil, "OVERLAY");
f.buffind1:SetPoint("TOPRIGHT", f.background, "TOPRIGHT", -1, -1);
f.buffind1:SetWidth(6);
f.buffind1:SetHeight(6);
f.buffind1:SetColorTexture(0.8, 0.1, 0.1);
f.buffind1:Hide();
+ f.buffind2 = f:CreateTexture(nil, "OVERLAY");
+ f.buffind2:SetPoint("TOPLEFT", f.background, "TOPLEFT", 1, -1);
+ f.buffind2:SetWidth(4);
+ f.buffind2:SetHeight(4);
+ f.buffind2:SetColorTexture(0.8, 0.7, 0.1);
+ f.buffind2:Hide();
+ f.defensive = f:CreateTexture(nil, "OVERLAY", nil, 1);
+ f.defensive:SetPoint("TOPLEFT", f.background, "TOPLEFT", 1, -1);
+ f.defensive:SetWidth(6);
+ f.defensive:SetHeight(6);
+ f.defensive:SetColorTexture(1, 0.3, 0);
+ f.defensive:Hide();
f.targeticon = f:CreateTexture(nil, "OVERLAY");
f.targeticon:SetPoint("CENTER", f, "TOP", 0, -1);
f.targeticon:SetWidth(12);
end
end
+local uf_hidden = false;
+local function hideBlizzardUnitFrames()
+ if uf_hidden then return end
+ uf_hidden = true;
+
+ local frames = {
+ PlayerFrame, PaladinPowerBarFrame, WarlockPowerFrame,
+ PlayerFrameAlternateManaBar,
+ };
+ --local frames = {PlayerFrame, TargetFrame, TargetFrameToT, PetFrame,
+ -- PlayerFrameAlternateManaBar, ComboFrame, PriestBarFrame, RuneFrame,
+ -- WarlockPowerFrame, MonkHarmonyBarFrame, PaladinPowerBarFrame,
+ -- MageArcaneChargesFrame, CastingBarFrame, PetCastingBarFrame};
+ --for i = 1,MAX_BOSS_FRAMES do
+ -- table.insert(frames, _G["Boss"..i.."TargetFrame"]);
+ -- table.insert(frames, _G["Boss"..i.."TargetFrameHealthBar"]);
+ -- table.insert(frames, _G["Boss"..i.."TargetFrameManaBar"]);
+ -- -- keep boss frame powerBarAlt
+ --end
+ for _, frame in pairs(frames) do
+ frame:UnregisterAllEvents();
+ if frame.healthbar then frame.healthbar:UnregisterAllEvents() end
+ if frame.manabar then frame.manabar:UnregisterAllEvents() end
+ if frame.spellbar then frame.spellbar:UnregisterAllEvents() end
+ --if frame.powerBarAlt then frame.powerBarAlt:UnregisterAllEvents() end
+ frame:Hide();
+ end
+
+ -- from ShadowedUF, re-register vehicle events for default auras
+ PlayerFrame:RegisterEvent("PLAYER_ENTERING_WORLD");
+ PlayerFrame:RegisterEvent("UNIT_ENTERING_VEHICLE");
+ PlayerFrame:RegisterEvent("UNIT_ENTERED_VEHICLE");
+ PlayerFrame:RegisterEvent("UNIT_EXITING_VEHICLE");
+ PlayerFrame:RegisterEvent("UNIT_EXITED_VEHICLE");
+ PlayerFrame:SetMovable(true);
+ PlayerFrame:SetUserPlaced(true);
+ PlayerFrame:SetDontSavePosition(true);
+ CastingBarFrame:ClearAllPoints();
+ CastingBarFrame:SetPoint("BOTTOM", UIParent, "CENTER", -300, -146);
+end
+
local hider = CreateFrame("Frame");
hider:Hide();
hider:RegisterEvent("PLAYER_LOGIN");
hideBlizzardRaidButton();
elseif event == "PLAYER_LOGIN" then
hideBlizzardRaid();
+ hideBlizzardUnitFrames();
end
end);
local unpack = unpack;
local format = string.format;
local CFrame = CreateFrame("Frame", "kehysPlayerInit", UIParent);
+local CTimerAfter = C_Timer.After;
-local barTexture = "Interface\\AddOns\\OmaRF\\images\\minimalist";
+local barTexture = "Interface\\AddOns\\kehys\\images\\minimalist";
local vehicletoggle = [=[
if newstate == "vehicle" then
self:SetAttribute("displayed", self:GetAttribute("vehicle"));
]=]
local updater = nil;
-function addon.PlayerFrame(parent, width, height, update, event)
+local function initPlayer(parent, width, height, update, event)
assert(type(parent) == "table", "Player frame creation missing parent!");
assert(type(width) == "number", "Player frame creation missing width!");
assert(type(height) == "number", "Player frame creation missing height!");
local f = CreateFrame("Button", "kehysPlayer", parent,
"SecureUnitButtonTemplate,SecureHandlerStateTemplate");
f:Hide();
- f:SetPoint("CENTER", parent, "CENTER", 10, 10);
+ f:SetPoint("CENTER", parent, "CENTER", -300, -178);
f:SetWidth(width);
f:SetHeight(height);
f.barwidth = width - 2; -- 1px padding
f:SetAttribute("unit", "player");
f:SetAttribute("displayed", "player");
f:SetAttribute("vehicle", "vehicle");
+ f.unit = "player";
+ f.displayed = "player";
+ f.vehicle = "vehicle"
f.nonraid = true;
f.prev = {};
- -- empty, just to be able to use general updater
- f.alert = {};
- f.heal = {};
- f.tankcd = {};
- f.stacks = {};
- f.buff1 = {};
- f.incoming = {};
updater = function()
CTimerAfter(0.1, updater);
update(f);
end
f:SetScript("OnEvent", event);
+ f:RegisterForClicks("AnyDown");
f:SetAttribute("*type1", "target");
f:SetAttribute("*type2", "togglemenu");
f:SetAttribute("toggleForVehicle", true);
-- create visuals
f.base = f:CreateTexture(nil, "BACKGROUND");
f.base:SetAllPoints();
- f.base:SetColorTexture(1, 1, 1);
- f.base:SetVertexColor(unpack(addon.Colors.Base));
- f.background = f:CreateTexture(nil, "BACKGROUND", nil, 2);
+ f.base:SetColorTexture(0, 0, 0, 0.5);
+ f.background = f:CreateTexture(nil, "BACKGROUND", nil, 1);
f.background:SetPoint("TOPLEFT", f, "TOPLEFT", 1, -1);
f.background:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", -1, 1);
- f.background:SetColorTexture(0.7, 0.7, 0.7);
f.health = f:CreateTexture(nil, "BORDER");
f.health:SetPoint("TOPLEFT", f.background, "TOPLEFT");
- f.health:SetPoint("BOTTOMLEFT", f.background, "LEFT", 0, 1);
+ f.health:SetPoint("BOTTOMLEFT", f.background, "LEFT", 0, -height/8);
f.health:SetTexture(barTexture);
- f.health:SetVertexColor(0.3, 0.3, 0.3);
+ f.health:SetVertexColor(0.8, 0.8, 0.8);
f.health:Hide();
f.mana = f:CreateTexture(nil, "BORDER");
- f.mana:SetPoint("TOPLEFT", f.background, "LEFT", 0, -1);
+ f.mana:SetPoint("TOPLEFT", f.background, "LEFT", 0, -height/8);
f.mana:SetPoint("BOTTOMLEFT", f.background, "BOTTOMLEFT");
f.mana:SetTexture(barTexture);
- f.mana:SetVertexColor(0.3, 0.4, 0.7);
+ f.mana:SetVertexColor(0.1, 0.5, 0.9);
f.mana:Hide();
f.manatext = f:CreateFontString(nil, "ARTWORK", "GameFontHighlight");
- f.manatext:SetPoint("RIGHT", frame.background, "RIGHT", -2, -height/4);
+ f.manatext:SetPoint("BOTTOMRIGHT", f.background, "BOTTOMRIGHT", -2, 4);
f.manatext:Hide();
f.shield = f:CreateTexture(nil, "BORDER");
f.shield:SetPoint("TOPLEFT", f.health, "TOPRIGHT");
f.shield:Hide();
f.shieldhl = f:CreateTexture(nil, "ARTWORK");
f.shieldhl:SetPoint("TOPLEFT", f, "TOPRIGHT", -2, 0);
- f.shieldhl:SetPoint("BOTTOMRIGHT", f, "RIGHT");
+ f.shieldhl:SetPoint("BOTTOMRIGHT", f, "RIGHT", 0, -height/8);
f.shieldhl:SetColorTexture(0.5, 0.8, 1);
f.shieldhl:Hide();
f.healpred = f:CreateTexture(nil, "ARTWORK");
f.targeticon:SetHeight(12);
f.targeticon:SetTexture("Interface\\TARGETINGFRAME\\UI-RaidTargetingIcons");
f.targeticon:Hide();
+ f.status = f:CreateTexture(nil, "OVERLAY");
+ f.status:SetPoint("TOPLEFT", f.background, "BOTTOMLEFT", -8, 8);
+ f.status:SetPoint("BOTTOMRIGHT", f.background, "BOTTOMLEFT", 8, -8);
+ f.status:SetTexture("Interface\\CHARACTERFRAME\\UI-StateIcon");
+ f.status:Hide();
- registerEvents(f);
- registerUnitEvents(f);
+ addon.RegisterEvents(f);
+ addon.RegisterUnitEvents(f);
event(f, "UPDATE_ALL_BARS");
updater();
- f.Show();
+ f:Show();
end
CFrame:SetScript("OnEvent", function(self)
CFrame:SetPoint("CENTER", nil, "CENTER");
CFrame:SetWidth(2);
CFrame:SetHeight(2);
- initPlayer(self, 180, 100, addon.FrameUpdate, addon.UnitEvent);
+ initPlayer(self, 160, 48, addon.FrameUpdate, addon.UnitEvent);
end);
CFrame:RegisterEvent("PLAYER_LOGIN");
local UnitGetIncomingHeals, UnitGetTotalAbsorbs = UnitGetIncomingHeals, UnitGetTotalAbsorbs;
local UnitIsDeadOrGhost, UnitIsConnected = UnitIsDeadOrGhost, UnitIsConnected;
local UnitGetTotalHealAbsorbs = UnitGetTotalHealAbsorbs;
-local IsResting = IsResting;
+local InCombatLockdown, IsResting = InCombatLockdown, IsResting;
local dispelcolor = addon.Colors.OverlayColorDispel;
local charmcolor = addon.Colors.OverlayColorCharm;
[315176] = true, -- Grasping Tendrils
};
+local powerColors = {
+ [Enum.PowerType.Mana] = {0.1, 0.5, 0.9},
+ [Enum.PowerType.Rage] = {1, 0, 0},
+ [Enum.PowerType.Focus] = {1, 0.5, 0},
+ [Enum.PowerType.Energy] = {1, 0.8, 0},
+ [Enum.PowerType.RunicPower] = {0.8, 0, 0.2},
+};
+
function addon.FrameUpdate(frame)
assert(type(frame) == "table", "FrameUpdate received invalid frame parameter!");
elseif UnitIsDND(unit) then
frame.text:SetText("dnd");
if not frame.text:IsShown() then frame.text:Show() end
- elseif frame.nonraid and frame.unit == "player" and IsResting() then
- frame.text:SetText("zzz");
- if not frame.text:IsShown() then frame.text:Show() end
else
if frame.text:IsShown() then frame.text:Hide() end
end
+ if frame.nonraid and frame.unit == "player" then
+ if InCombatLockdown() then
+ frame.status:SetTexCoord(0.5, 1, 0, 0.484375);
+ frame.status:Show();
+ elseif IsResting() then
+ frame.status:SetTexCoord(0, 0.5, 0, 0.421875);
+ frame.status:Show();
+ elseif frame.status:IsShown() then
+ frame.status:Hide();
+ end
+ end
-- TODO incoming res, maybe just with events?
-- health
local current, hmax = UnitHealth(unit), UnitHealthMax(unit);
-- mana, if present
if frame.mana ~= nil then
local current, max = UnitPower(unit), UnitPowerMax(unit);
+ local ptype = UnitPowerType(unit);
+ if frame.mana.ptype ~= ptype then
+ frame.mana.ptype = ptype;
+ frame.mana:SetVertexColor(unpack(powerColors[ptype]));
+ end
if frame.prev.mana ~= current or frame.prev.mmax ~= max then
frame.prev.mana = current;
frame.prev.mmax = max;
else
local percent = current/max;
frame.mana:SetWidth(percent*width);
- frame.manatext:SetText(format("%d", percent*100));
+ frame.manatext:SetText(format("%d", percent*100+0.5));
if not frame.mana:IsShown() then frame.mana:Show() end
if not frame.manatext:IsShown() then frame.manatext:Show() end
end
frame.rounds = 0;
end
end
- -- tank CD marker
- if next(frame.tankcd) then
- if not frame.defensive:IsShown() then frame.defensive:Show() end
- elseif frame.defensive:IsShown() then
- frame.defensive:Hide();
- end
- -- aura stacks
- if next(frame.stacks) then
- local _, amount = next(frame.stacks);
- frame.stack:SetText(amount);
- if not frame.stack:IsShown() then frame.stack:Show() end
- elseif frame.stack:IsShown() then
- frame.stack:Hide();
- end
- -- custom buff indicator 1
- if next(frame.buff1) then
- if not frame.buffind1:IsShown() then frame.buffind1:Show() end
- elseif frame.buffind1:IsShown() then
- frame.buffind1:Hide();
- end
- -- incoming ability
- if next(frame.incoming) then
- if not frame.glow:IsShown() then frame.glow:Show() end
- elseif frame.glow:IsShown() then
- frame.glow:Hide();
- end
- -- overlays
- if next(frame.alert) then
- -- major
- if frame.overlay.color ~= majorcolor then
- frame.overlay:SetVertexColor(unpack(majorcolor));
- frame.overlay.color = majorcolor;
- if not frame.overlay:IsShown() then frame.overlay:Show() end
+ if not frame.nonraid then
+ -- tank CD marker
+ if next(frame.tankcd) then
+ if not frame.defensive:IsShown() then frame.defensive:Show() end
+ elseif frame.defensive:IsShown() then
+ frame.defensive:Hide();
end
- elseif frame.overlay ~= nil then
- local _, _, _, _, _, _, _, _, _, spellid = UnitDebuff(unit, 1, "RAID");
- if UnitIsCharmed(unit) and frame.unit == frame.displayed then
- -- charmed
- if frame.overlay.color ~= charmcolor then
- frame.overlay:SetVertexColor(unpack(charmcolor));
- frame.overlay.color = charmcolor;
- if not frame.overlay:IsShown() then frame.overlay:Show() end
- end
- elseif spellid ~= nil and not ignoredAuras[spellid] then
- -- dispellable
- if frame.overlay.color ~= dispelcolor then
- frame.overlay:SetVertexColor(unpack(dispelcolor));
- frame.overlay.color = dispelcolor;
- if not frame.overlay:IsShown() then frame.overlay:Show() end
- end
- elseif next(frame.heal) then
- -- major heals needed
- if frame.overlay.color ~= healcolor then
- frame.overlay:SetVertexColor(unpack(healcolor));
- frame.overlay.color = healcolor;
+ -- aura stacks
+ if next(frame.stacks) then
+ local _, amount = next(frame.stacks);
+ frame.stack:SetText(amount);
+ if not frame.stack:IsShown() then frame.stack:Show() end
+ elseif frame.stack:IsShown() then
+ frame.stack:Hide();
+ end
+ -- custom buff indicator 1
+ if next(frame.buff1) then
+ if not frame.buffind1:IsShown() then frame.buffind1:Show() end
+ elseif frame.buffind1:IsShown() then
+ frame.buffind1:Hide();
+ end
+ -- custom buff indicator 2
+ if next(frame.buff2) then
+ if not frame.buffind2:IsShown() then frame.buffind2:Show() end
+ elseif frame.buffind2:IsShown() then
+ frame.buffind2:Hide();
+ end
+ -- incoming ability
+ if next(frame.incoming) then
+ if not frame.glow:IsShown() then frame.glow:Show() end
+ elseif frame.glow:IsShown() then
+ frame.glow:Hide();
+ end
+ -- overlays
+ if next(frame.alert) then
+ -- major
+ if frame.overlay.color ~= majorcolor then
+ frame.overlay:SetVertexColor(unpack(majorcolor));
+ frame.overlay.color = majorcolor;
if not frame.overlay:IsShown() then frame.overlay:Show() end
end
else
- if frame.overlay.color ~= nil then
- frame.overlay.color = nil;
- if frame.overlay:IsShown() then frame.overlay:Hide() end
+ local _, _, _, _, _, _, _, _, _, spellid = UnitDebuff(unit, 1, "RAID");
+ if UnitIsCharmed(unit) and frame.unit == frame.displayed then
+ -- charmed
+ if frame.overlay.color ~= charmcolor then
+ frame.overlay:SetVertexColor(unpack(charmcolor));
+ frame.overlay.color = charmcolor;
+ if not frame.overlay:IsShown() then frame.overlay:Show() end
+ end
+ elseif spellid ~= nil and not ignoredAuras[spellid] then
+ -- dispellable
+ if frame.overlay.color ~= dispelcolor then
+ frame.overlay:SetVertexColor(unpack(dispelcolor));
+ frame.overlay.color = dispelcolor;
+ if not frame.overlay:IsShown() then frame.overlay:Show() end
+ end
+ elseif next(frame.heal) then
+ -- major heals needed
+ if frame.overlay.color ~= healcolor then
+ frame.overlay:SetVertexColor(unpack(healcolor));
+ frame.overlay.color = healcolor;
+ if not frame.overlay:IsShown() then frame.overlay:Show() end
+ end
+ else
+ if frame.overlay.color ~= nil then
+ frame.overlay.color = nil;
+ if frame.overlay:IsShown() then frame.overlay:Hide() end
+ end
end
end
end