diff --git a/2/3/4/5/6/7/ElvUI/Layout/Layout.lua b/2/3/4/5/6/7/ElvUI/Layout/Layout.lua
index 151d58d..9cb20f3 100644
--- a/2/3/4/5/6/7/ElvUI/Layout/Layout.lua
+++ b/2/3/4/5/6/7/ElvUI/Layout/Layout.lua
@@ -371,6 +371,48 @@ function LO:CreateMinimapPanels()
RightMiniPanel:Hide()
end
+ local configtoggle = CreateFrame("Button", "ElvConfigToggle", Minimap.backdrop)
+ if E.db.general.reminder.position == "LEFT" then
+ configtoggle:SetPoint("TOPRIGHT", lminipanel, "TOPLEFT", (E.PixelMode and 1 or -1), 0);
+ configtoggle:SetPoint("BOTTOMRIGHT", lminipanel, "BOTTOMLEFT", (E.PixelMode and 1 or -1), 0);
+ else
+ configtoggle:SetPoint("TOPLEFT", rminipanel, "TOPRIGHT", (E.PixelMode and -1 or 1), 0);
+ configtoggle:SetPoint("BOTTOMLEFT", rminipanel, "BOTTOMRIGHT", (E.PixelMode and -1 or 1), 0);
+ end
+
+ configtoggle:RegisterForClicks("AnyUp")
+ configtoggle:SetWidth(E.RBRWidth)
+ E:SetTemplate(configtoggle, E.db.datatexts.panelTransparency and "Transparent" or "Default", true)
+
+ configtoggle.text = configtoggle:CreateFontString(nil, "OVERLAY")
+ E:FontTemplate(configtoggle.text, E.LSM:Fetch("font", E.db.datatexts.font), E.db.datatexts.fontSize, E.db.datatexts.fontOutline)
+ configtoggle.text:SetText("C")
+ configtoggle.text:SetPoint("CENTER", 0, 0)
+ configtoggle.text:SetJustifyH("CENTER")
+
+ configtoggle:SetScript("OnClick", function(_, btn)
+ if btn == "LeftButton" then
+ E:ToggleConfig()
+ else
+ E:BGStats()
+ end
+ end)
+
+ configtoggle:SetScript("OnEnter", function()
+ GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT", 0, -4)
+ GameTooltip:ClearLines()
+ GameTooltip:AddDoubleLine(L["Left Click:"], L["Toggle Configuration"], 1, 1, 1)
+
+ if E.db.datatexts.battleground then
+ GameTooltip:AddDoubleLine(L["Right Click:"], L["Show BG Texts"], 1, 1, 1)
+ end
+ GameTooltip:Show()
+ end)
+
+ configtoggle:SetScript("OnLeave", function()
+ GameTooltip:Hide()
+ end)
+
local f = CreateFrame("Frame", "BottomMiniPanel", Minimap.backdrop)
f:SetPoint("BOTTOM", Minimap, "BOTTOM")
f:SetWidth(75)
diff --git a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/DataTexts.lua b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/DataTexts.lua
index 450068d..7a682a3 100644
--- a/2/3/4/5/6/7/ElvUI/Modules/DataTexts/DataTexts.lua
+++ b/2/3/4/5/6/7/ElvUI/Modules/DataTexts/DataTexts.lua
@@ -235,6 +235,9 @@ function DT:LoadDataTexts()
local inInstance, instanceType = IsInInstance()
local fontTemplate = LSM:Fetch("font", self.db.font)
+ if ElvConfigToggle then
+ E:FontTemplate(ElvConfigToggle.text, fontTemplate, self.db.fontSize, self.db.fontOutline)
+ end
for panelName, panel in pairs(DT.RegisteredPanels) do
for i = 1, panel.numPoints do
local pointIndex = DT.PointLocation[i]
diff --git a/2/3/4/5/6/7/ElvUI/Modules/Maps/Minimap.lua b/2/3/4/5/6/7/ElvUI/Modules/Maps/Minimap.lua
index afa0126..807333f 100644
--- a/2/3/4/5/6/7/ElvUI/Modules/Maps/Minimap.lua
+++ b/2/3/4/5/6/7/ElvUI/Modules/Maps/Minimap.lua
@@ -116,6 +116,12 @@ function M:UpdateSettings()
E.MinimapWidth = E.MinimapSize
E.MinimapHeight = E.MinimapSize
+ if E.db.general.reminder.enable then
+ E.RBRWidth = (E.MinimapHeight + ((E.Border - E.Spacing*3) * 5) + E.Border*2) / 6
+ else
+ E.RBRWidth = 0
+ end
+
if E.private.general.minimap.enable then
Minimap:SetScale(E.MinimapSize / 140)
end
@@ -241,6 +247,15 @@ function M:UpdateSettings()
MiniMapInstanceDifficulty:SetPoint(pos, Minimap, pos, x, y)
MiniMapInstanceDifficulty:SetScale(scale)
end
+
+ if ElvConfigToggle then
+ if E.db.general.reminder.enable and E.db.datatexts.minimapPanels and E.private.general.minimap.enable then
+ ElvConfigToggle:Show()
+ ElvConfigToggle:SetWidth(E.RBRWidth)
+ else
+ ElvConfigToggle:Hide()
+ end
+ end
end
local function MinimapPostDrag()
diff --git a/2/3/4/5/6/7/ElvUI/Modules/Misc/Load_Misc.xml b/2/3/4/5/6/7/ElvUI/Modules/Misc/Load_Misc.xml
index e1d4220..81a057e 100644
--- a/2/3/4/5/6/7/ElvUI/Modules/Misc/Load_Misc.xml
+++ b/2/3/4/5/6/7/ElvUI/Modules/Misc/Load_Misc.xml
@@ -2,4 +2,5 @@
+
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Modules/Misc/RaidBuffReminder.lua b/2/3/4/5/6/7/ElvUI/Modules/Misc/RaidBuffReminder.lua
new file mode 100644
index 0000000..0cb6417
--- /dev/null
+++ b/2/3/4/5/6/7/ElvUI/Modules/Misc/RaidBuffReminder.lua
@@ -0,0 +1,318 @@
+local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
+local RB = E:NewModule("ReminderBuffs", "AceEvent-3.0");
+local LSM = LibStub("LibSharedMedia-3.0");
+
+--Cache global variables
+--Lua functions
+local ipairs = ipairs
+--WoW API / Variables
+local GetPlayerBuff = GetPlayerBuff
+local GetPlayerBuffName = GetPlayerBuffName
+local GetPlayerBuffTexture = GetPlayerBuffTexture
+local GetPlayerBuffTimeLeft = GetPlayerBuffTimeLeft
+local GetSpellInfo = GetSpellInfo
+local GetTime = GetTime
+local UnitBuff = UnitBuff
+
+local BUFF_MAX_DISPLAY = BUFF_MAX_DISPLAY
+
+E.ReminderBuffs = RB
+
+RB.Spell1Buffs = {
+ -- 17638, -- Flask of Chromatic Resistance
+ -- 17637, -- Flask of Supreme Power
+ -- 17635, -- Flask of the Titans
+ -- 17636, -- Flask of Distilled Wisdom
+
+ -- 11450, -- Elixir of Greater Defense
+ -- 3171, -- Elixir of Wisdom
+ -- 3230, -- Elixir of Fortitude
+ -- 11467, -- Elixir of Greater Agility
+ -- 11406, -- Elixir of Demonslaying
+}
+
+RB.Spell2Buffs = {
+ -- 43706, -- +23 Spellcrit (Skullfish Soup Buff)
+ -- 33257, -- +30 Stamina
+ -- 33256, -- +20 Strength
+ -- 33259, -- +40 AP
+ -- 33261, -- +20 Agility
+ -- 33263, -- +23 Spelldmg
+ -- 33265, -- +8 MP5
+ -- 33268, -- +44 Addheal
+ -- 35272, -- +20 Stamina
+ -- 33254, -- +20 Stamina
+ -- 43764, -- +20 Meleehit
+ -- 45619, -- +8 Spellresist
+}
+
+RB.Spell3Buffs = {
+ -- 21850, -- Gift of the Wild
+ -- 16878, -- Mark of the Wild
+}
+
+RB.Spell4Buffs = {
+ -- 25898, -- Greater Blessing of Kings
+ -- 20217, -- Blessing of Kings
+}
+
+RB.CasterSpell5Buffs = {
+ -- 23028, -- Arcane Brilliance
+ -- 16876, -- Arcane Intellect
+}
+
+RB.MeleeSpell5Buffs = {
+ -- 21564, -- Prayer of Fortitude
+ -- 23948, -- Power Word: Fortitude
+ -- 22440, -- Commanding Shout
+}
+
+RB.CasterSpell6Buffs = {
+ -- 25918, -- Greater Blessing of Wisdom
+ -- 25290, -- Blessing of Wisdom
+ -- 10494, -- Mana Spring
+}
+
+RB.MeleeSpell6Buffs = {
+ -- 25291, -- Greater Blessing of Might
+ -- 27140, -- Blessing of Might
+ -- 25289, -- Battle Shout
+}
+
+function RB:CheckFilterForActiveBuff(filter)
+ local spellName, buffIndex, untilCancelled
+
+ for _, spellID in ipairs(filter) do
+ spellName = GetSpellName(spellID, BOOKTYPE_SPELL)
+
+ if spellName then
+ for i = 1, BUFF_MAX_DISPLAY do
+ buffIndex, untilCancelled = GetPlayerBuff(i)
+
+ if buffIndex ~= 0 then
+ if spellName == GetPlayerBuffName(buffIndex) then
+ return true, buffIndex, GetPlayerBuffTexture(buffIndex), untilCancelled, GetPlayerBuffTimeLeft(buffIndex), GetPlayerBuffName(buffIndex), spellID
+ end
+ end
+ end
+ end
+ end
+
+ return false
+end
+
+function RB:GetDurationForBuffName(buffName)
+ local _, name, duration
+ for i = 1, BUFF_MAX_DISPLAY do
+ name, _, _, _, duration = UnitBuff("player", i)
+ if name == buffName and duration then
+ return duration
+ end
+ end
+ return nil
+end
+
+function RB:Button_OnUpdate(elapsed)
+ local timeLeft = GetPlayerBuffTimeLeft(self.index)
+
+ if self.nextUpdate > 0 then
+ self.nextUpdate = self.nextUpdate - elapsed
+ return
+ end
+
+ if timeLeft <= 0 then
+ self.timer:SetText("")
+ self:SetScript("OnUpdate", nil)
+ return
+ end
+
+ local timerValue, formatID
+ timerValue, formatID, self.nextUpdate = E:GetTimeInfo(timeLeft, 4)
+ self.timer:SetFormattedText(("%s%s|r"):format(E.TimeColors[formatID], E.TimeFormats[formatID][1]), timerValue)
+end
+
+function RB:Update()
+ for i = 1, 6 do
+ local button = self.frame[i]
+ local hasBuff, index, texture, untilCancelled, timeLeft, buffName, spellID = self:CheckFilterForActiveBuff(self["Spell"..i.."Buffs"])
+
+ if hasBuff then
+ button.index = index
+ button.t:SetTexture(texture)
+
+ if (untilCancelled == 1 or not timeLeft) or not E.db.general.reminder.durations then
+ button.t:SetAlpha(E.db.general.reminder.reverse and 1 or 0.3)
+ button:SetScript("OnUpdate", nil)
+ button.timer:SetText(nil)
+ CooldownFrame_SetTimer(button.cd, 0, 0, 0)
+ else
+ button.nextUpdate = 0
+ button.t:SetAlpha(1)
+
+ local duration = self:GetDurationForBuffName(buffName) or ElvCharacterDB.ReminderDuration[spellID]
+ if duration then
+ CooldownFrame_SetTimer(button.cd, GetTime() - (duration - timeLeft), duration, 1)
+ ElvCharacterDB.ReminderDuration[spellID] = duration
+ else
+ CooldownFrame_SetTimer(button.cd, 0, 0, 0)
+ end
+ button:SetScript("OnUpdate", self.Button_OnUpdate)
+ end
+ else
+ button.index = nil
+ CooldownFrame_SetTimer(button.cd, 0, 0, 0)
+ button.t:SetAlpha(E.db.general.reminder.reverse and 0.3 or 1)
+ button:SetScript("OnUpdate", nil)
+ button.timer:SetText(nil)
+ button.t:SetTexture(self.DefaultIcons[i])
+ end
+ end
+end
+
+function RB:CreateButton()
+ local button = CreateFrame("Button", nil, ElvUI_ReminderBuffs)
+ E:SetTemplate(button, "Default")
+
+ button.t = button:CreateTexture(nil, "OVERLAY")
+ button.t:SetTexCoord(unpack(E.TexCoords))
+ E:SetInside(button.t)
+ button.t:SetTexture("Interface\\Icons\\INV_Misc_QuestionMark")
+
+ button.timer = button:CreateFontString(nil, "OVERLAY")
+ button.timer:SetPoint("CENTER", 0, 0)
+
+ button.cd = CreateFrame("Button", nil, button, "CooldownFrameTemplate")
+ E:SetInside(button.cd)
+ button.cd.noOCC = true
+ button.cd.noCooldownCount = true
+
+ return button
+end
+
+function RB:UpdateSettings(isCallback)
+ local font = LSM:Fetch("font", E.db.general.reminder.font)
+
+ local frame = self.frame
+ frame:SetWidth(E.RBRWidth)
+
+ self:UpdateDefaultIcons()
+
+ for i = 1, 6 do
+ local button = self.frame[i]
+ button:SetWidth(E.RBRWidth)
+ button:SetHeight(E.RBRWidth)
+
+ button:ClearAllPoints()
+ if i == 1 then
+ button:SetPoint("TOP", ElvUI_ReminderBuffs, "TOP", 0, 0)
+ elseif i == 6 then
+ button:SetPoint("BOTTOM", ElvUI_ReminderBuffs, "BOTTOM", 0, 0)
+ else
+ button:SetPoint("TOP", frame[i - 1], "BOTTOM", 0, E.Border - E.Spacing*3)
+ end
+
+ if E.db.general.reminder.durations then
+ button.cd:SetAlpha(1)
+ else
+ button.cd:SetAlpha(0)
+ end
+
+ E:FontTemplate(button.timer, font, E.db.general.reminder.fontSize, E.db.general.reminder.fontOutline)
+ -- button.cd:SetReverse(E.db.general.reminder.reverse)
+ -- if E.db.general.reminder.reverse then
+ -- button.timer:SetParent(button)
+ -- else
+ -- button.timer:SetParent(button.cd)
+ -- end
+ end
+
+ if not isCallback then
+ if E.db.general.reminder.enable then
+ RB:Enable()
+ else
+ RB:Disable()
+ end
+ else
+ self:Update()
+ end
+end
+
+function RB:UpdatePosition()
+ Minimap:ClearAllPoints()
+ ElvConfigToggle:ClearAllPoints()
+ ElvUI_ReminderBuffs:ClearAllPoints()
+
+ if E.db.general.reminder.position == "LEFT" then
+ Minimap:SetPoint("TOPRIGHT", MMHolder, "TOPRIGHT", -E.Border, -E.Border)
+ ElvConfigToggle:SetPoint("TOPRIGHT", LeftMiniPanel, "TOPLEFT", E.Border - E.Spacing*3, 0)
+ ElvConfigToggle:SetPoint("BOTTOMRIGHT", LeftMiniPanel, "BOTTOMLEFT", E.Border - E.Spacing*3, 0)
+ ElvUI_ReminderBuffs:SetPoint("TOPRIGHT", Minimap.backdrop, "TOPLEFT", E.Border - E.Spacing*3, 0)
+ ElvUI_ReminderBuffs:SetPoint("BOTTOMRIGHT", Minimap.backdrop, "BOTTOMLEFT", E.Border - E.Spacing*3, 0)
+ else
+ Minimap:SetPoint("TOPLEFT", MMHolder, "TOPLEFT", E.Border, -E.Border)
+ ElvConfigToggle:SetPoint("TOPLEFT", RightMiniPanel, "TOPRIGHT", -E.Border + E.Spacing*3, 0)
+ ElvConfigToggle:SetPoint("BOTTOMLEFT", RightMiniPanel, "BOTTOMRIGHT", -E.Border + E.Spacing*3, 0)
+ ElvUI_ReminderBuffs:SetPoint("TOPLEFT", Minimap.backdrop, "TOPRIGHT", -E.Border + E.Spacing*3, 0)
+ ElvUI_ReminderBuffs:SetPoint("BOTTOMLEFT", Minimap.backdrop, "BOTTOMRIGHT", -E.Border + E.Spacing*3, 0)
+ end
+end
+
+function RB:UpdateDefaultIcons()
+ self.DefaultIcons = {
+ [1] = "Interface\\Icons\\INV_Potion_97",
+ [2] = "Interface\\Icons\\Spell_Misc_Food",
+ [3] = "Interface\\Icons\\Spell_Nature_Regeneration",
+ [4] = "Interface\\Icons\\Spell_Magic_GreaterBlessingofKings",
+ [5] = (E.Role == "Caster" and "Interface\\Icons\\Spell_Holy_MagicalSentry") or "Interface\\Icons\\Spell_Holy_WordFortitude",
+ [6] = (E.Role == "Caster" and "Interface\\Icons\\Spell_Holy_GreaterBlessingofWisdom") or "Interface\\Icons\\Ability_Warrior_BattleShout"
+ }
+
+ if E.Role == "Caster" then
+ self.Spell5Buffs = self.CasterSpell5Buffs
+ self.Spell6Buffs = self.CasterSpell6Buffs
+ else
+ self.Spell5Buffs = self.MeleeSpell5Buffs
+ self.Spell6Buffs = self.MeleeSpell6Buffs
+ end
+end
+
+function RB:Enable()
+ ElvUI_ReminderBuffs:Show()
+ self:RegisterEvent("PLAYER_AURAS_CHANGED", "Update")
+ E.RegisterCallback(self, "RoleChanged", "UpdateSettings")
+ self:Update()
+end
+
+function RB:Disable()
+ ElvUI_ReminderBuffs:Hide()
+ self:UnregisterEvent("PLAYER_AURAS_CHANGED")
+ E.UnregisterCallback(self, "RoleChanged", "UpdateSettings")
+end
+
+function RB:Initialize()
+ if not E.private.general.minimap.enable then return end
+
+ self.db = E.db.general.reminder
+
+ if not ElvCharacterDB.ReminderDuration then
+ ElvCharacterDB.ReminderDuration = {}
+ end
+
+ local frame = CreateFrame("Frame", "ElvUI_ReminderBuffs", Minimap)
+ frame:SetWidth(E.RBRWidth)
+ self.frame = frame
+
+ self:UpdatePosition()
+
+ for i = 1, 6 do
+ frame[i] = self:CreateButton()
+ end
+
+ self:UpdateSettings()
+end
+
+local function InitializeCallback()
+ RB:Initialize()
+end
+
+E:RegisterModule(RB:GetName(), InitializeCallback)
\ No newline at end of file
diff --git a/2/3/4/5/6/7/ElvUI/Settings/Profile.lua b/2/3/4/5/6/7/ElvUI/Settings/Profile.lua
index 97e2aa1..2bb6910 100644
--- a/2/3/4/5/6/7/ElvUI/Settings/Profile.lua
+++ b/2/3/4/5/6/7/ElvUI/Settings/Profile.lua
@@ -76,6 +76,15 @@ P["general"] = {
},
}
},
+ ["reminder"] = {
+ ["enable"] = false,
+ ["durations"] = true,
+ ["reverse"] = true,
+ ["position"] = "RIGHT",
+ ["font"] = "Homespun",
+ ["fontSize"] = 10,
+ ["fontOutline"] = "MONOCHROMEOUTLINE"
+ },
}
-- Data Bars