/trunk/DivinePleaReminder
--[[ |
DivinePleaReminder v1.1, by sigmalmtd |
DivinePleaReminder v1.2b, by sigmalmtd |
A lightweight AddOn for Protection Paladins. Flashes the Divine Plea button when in combat and the buff is inactive. |
]]-- |
DivinePleaReminder = LibStub("AceAddon-3.0"):NewAddon("DivinePleaReminder", "AceEvent-3.0") |
local DIVINE_PLEA = GetSpellInfo(54428) |
function DivinePleaReminder:OnInitialize() |
self.buttons = {} |
self:RegisterEvent("UNIT_AURA", "Update") |
self:RegisterEvent("PLAYER_REGEN_DISABLED", "Update") |
self:RegisterEvent("PLAYER_REGEN_ENABLED", "Update") |
self:RegisterEvent("UNIT_ENTERING_VEHICLE", "Update") |
self:RegisterEvent("UNIT_EXITED_VEHICLE", "Update") |
-- Check all buttons |
for slot = 1, 120 do |
self:CheckButton(nil, slot) |
self:UnregisterEvent("UNIT_AURA") |
self:UnregisterEvent("PLAYER_REGEN_DISABLED") |
self:UnregisterEvent("PLAYER_REGEN_ENABLED") |
self:UnregisterEvent("UNIT_ENTERING_VEHICLE") |
self:UnregisterEvent("UNIT_EXITED_VEHICLE") |
-- Hide and free all textures |
for idx, slot in pairs(self.buttons) do |
UIFrameFlashStop(slot.texture) |
function DivinePleaReminder:CheckButton(eventName, slot) |
local slotType, spellId, spellSubType, parent, texture |
slotType, spellId, spellSubType = GetActionInfo(slot) |
if UnitInVehicle("player") == nil and slotType == "spell" and GetSpellName(spellId, spellSubType) == "Divine Plea" then |
if not UnitInVehicle("player") and slotType == "spell" and GetSpellName(spellId, spellSubType) == DIVINE_PLEA then |
if self.buttons[slot] then |
-- Texture has already been created |
self.buttons[slot].enabled = true |
function DivinePleaReminder:Update() |
local slot, show |
-- Only show the highlight if we're in combat and don't have Divine Plea active |
if not UnitAffectingCombat("player") or UnitAura("player", "Divine Plea") then |
if not UnitAffectingCombat("player") or UnitAura("player", DIVINE_PLEA) or UnitInVehicle("player") then |
show = false |
else |
show = true |
## Title: DivinePleaReminder |
## Notes: A lightweight AddOn for Protection Paladins. Flashes the Divine Plea button when in combat and the buff is inactive. |
## Author: sigmalmtd |
## Version: 1.1 |
## Version: 1.2b |
## X-Category: Paladin |
embeds.xml |
DivinePleaReminder v1.1, by sigmalmtd (Nikolay on Azgalor) |
DivinePleaReminder v1.2b, by sigmalmtd (Nikolay on Azgalor) |
A lightweight AddOn for Protection Paladins. Flashes the Divine Plea button when in combat and the buff is inactive. |
================== |
CHANGELOG |
================== |
v1.2 - Localization |
v1.1 - Fixed bug with vehicles |
v1.0 - Initial Release |