From 944895cad6f63ad02106a517e4c883ae0aafdc49 Mon Sep 17 00:00:00 2001 From: Crum Date: Fri, 22 Dec 2017 19:46:29 -0600 Subject: [PATCH] load RaidBuffReminders module (NOT FINISHED) --- 2/3/4/5/6/7/ElvUI/Layout/Layout.lua | 42 +++ .../6/7/ElvUI/Modules/DataTexts/DataTexts.lua | 3 + 2/3/4/5/6/7/ElvUI/Modules/Maps/Minimap.lua | 15 + 2/3/4/5/6/7/ElvUI/Modules/Misc/Load_Misc.xml | 1 + .../7/ElvUI/Modules/Misc/RaidBuffReminder.lua | 318 ++++++++++++++++++ 2/3/4/5/6/7/ElvUI/Settings/Profile.lua | 9 + 6 files changed, 388 insertions(+) create mode 100644 2/3/4/5/6/7/ElvUI/Modules/Misc/RaidBuffReminder.lua 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 @@