From 6b6727af82f1a417d1015b62e492fca3853030d5 Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Sat, 10 Aug 2019 22:30:43 -0700 Subject: [PATCH] Add Minimap button and option to hide it --- DruidBar.lua | 7 +++ DruidBar.xml | 24 ++++----- Options.lua | 20 ++++++-- Options.xml | 147 ++++++++++++++++++++++++++++++++---------------------- localization.lua | 1 + 5 files changed, 124 insertions(+), 75 deletions(-) diff --git a/DruidBar.lua b/DruidBar.lua index c24ccf8..c4b3a63 100644 --- a/DruidBar.lua +++ b/DruidBar.lua @@ -172,6 +172,7 @@ function Load_Variables(className) DruidBarKey.extra = 0; DruidBarKey.Enabled = true; DruidBarKey.Graphics = true; + DruidBarKey.Minimap = true; DruidBarKey.DontShiftBack = false; DruidBarKey.tempW = 170; DruidBarKey.tempH = 18; @@ -429,6 +430,12 @@ function DruidBar_MainGraphics() if PlayerFrameManaBar:GetWidth() < 100 then PlayerFrameManaBar:SetWidth(120); end + -- If Minimap Icon should show based on settings + if DruidBarKey.Minimap then + DruidBar_MinimapButton:Show(); + else + DruidBar_MinimapButton:Hide(); + end -- If DruidBar should show based on settings if DruidBar_ShouldBeVisible() then -- Render DruidBar diff --git a/DruidBar.xml b/DruidBar.xml index 1e0f49d..c079b81 100644 --- a/DruidBar.xml +++ b/DruidBar.xml @@ -147,28 +147,28 @@ - - + + - + - - - - - + - - + + - + - + + + + + diff --git a/Options.lua b/Options.lua index 4aac886..ea5f512 100644 --- a/Options.lua +++ b/Options.lua @@ -62,6 +62,15 @@ function DRUIDBAROptions_Vis() DRUIDBAR_FrameSet(); end +function DRUIDBAROptions_Minimap() + if(DruidBarKey.Minimap) then + DruidBarKey.Minimap = false; + else + DruidBarKey.Minimap = true; + end + DRUIDBAR_FrameSet(); +end + function DRUIDBAROptions_Replace() DruidBarKey.Replace = true; DruidBarKey.Player = false; @@ -416,10 +425,12 @@ function DRUIDBAR_FrameSet() local gold = {1, 0.82, 0} local grey = {0.5, 0.5, 0.5} - local allDisplayStyleTexts = {DRUIDBAROptionsVisText, DRUIDBAROptionsReplaceText, - DRUIDBAROptionsPlayerText, DRUIDBAROptionsCustomText, DRUIDBAROptionsHideText, - DRUIDBAROptionsFullText, DRUIDBAROptionsLockText, DRUIDBAROptionsTextDropDownText, - DRUIDBAROptionsPercentDropDownText} + local allDisplayStyleTexts = { + DRUIDBAROptionsVisText,DRUIDBAROptionsReplaceText, DRUIDBAROptionsPlayerText, + DRUIDBAROptionsCustomText, DRUIDBAROptionsHideText, DRUIDBAROptionsFullText, + DRUIDBAROptionsLockText, DRUIDBAROptionsTextDropDownText, + DRUIDBAROptionsPercentDropDownText + } -- Check temp width and temp height if not DruidBarKey.tempW then DruidBarKey.tempW = 0; end @@ -428,6 +439,7 @@ function DRUIDBAR_FrameSet() -- Toggle Checkboxes/Buttons DRUIDBAROptionsToggle:SetChecked(DruidBarKey.Enabled); DRUIDBAROptionsVis:SetChecked(DruidBarKey.Graphics); + DRUIDBAROptionsMinimap:SetChecked(DruidBarKey.Minimap); DRUIDBAROptionsReplace:SetChecked(DruidBarKey.Replace); DRUIDBAROptionsPlayer:SetChecked(DruidBarKey.Player); DRUIDBAROptionsCustom:SetChecked(DruidBarKey.Custom); diff --git a/Options.xml b/Options.xml index e3c08b4..2e9e239 100644 --- a/Options.xml +++ b/Options.xml @@ -104,23 +104,26 @@ - - + + + + + + - + - getglobal(self:GetName().."Text"):SetText(DRUIDBAR_OPTIONS_Toggle); + getglobal(self:GetName().."Text"):SetText(DRUIDBAR_OPTIONS_Minimap); - - DRUIDBAROptions_Toggle(); + DRUIDBAROptions_Minimap(); @@ -130,7 +133,7 @@ - + @@ -153,6 +156,29 @@ + + + + + + + + + + + + + + getglobal(self:GetName().."Text"):SetText(DRUIDBAR_OPTIONS_Toggle); + + + + DRUIDBAROptions_Toggle(); + + + + + @@ -195,6 +221,7 @@ + @@ -278,6 +305,59 @@ + + + + + + + + + + + + + getglobal(self:GetName().."Text"):SetText(DRUIDBAR_OPTIONS_Lock); + + + + DRUIDBAROptions_Lock(); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DRUIDBAROptions_Text_OnShow(self); + + + + @@ -384,58 +464,7 @@ - - - - - - - - - - - - - getglobal(self:GetName().."Text"):SetText(DRUIDBAR_OPTIONS_Lock); - - - - DRUIDBAROptions_Lock(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DRUIDBAROptions_Text_OnShow(self); - - - - + diff --git a/localization.lua b/localization.lua index 4820afc..3a426ea 100644 --- a/localization.lua +++ b/localization.lua @@ -38,6 +38,7 @@ DRUIDBAR_OPTIONS_MiscO = "Misc"; DRUIDBAR_OPTIONS_Toggle = "Enable"; DRUIDBAR_OPTIONS_Vis = "Graphics"; DRUIDBAR_OPTIONS_VisTT = "Enable or disable any and all graphical stuff.\nIf you use with other addons like StatusBars or Linoleum, turn it off. If not, leave it on."; +DRUIDBAR_OPTIONS_Minimap = "Show Minimap Button" DRUIDBAR_OPTIONS_Replace = "Replace"; DRUIDBAR_OPTIONS_ReplaceTT = "Replace the Player Frame's mana bar, splitting it into two when shifted."; DRUIDBAR_OPTIONS_Player = "Player Frame"; -- 1.7.9.5