From efcb259979c8f8bb0776c4241123f5ddb9a02e90 Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Mon, 6 Jan 2020 03:29:44 -0800 Subject: [PATCH 01/10] Update wow version compatability --- DruidBarClassic.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DruidBarClassic.toc b/DruidBarClassic.toc index f8c48f1..7782e2b 100644 --- a/DruidBarClassic.toc +++ b/DruidBarClassic.toc @@ -1,4 +1,4 @@ -## Interface: 11302 +## Interface: 11303 ## Title: Druid Bar Classic ## Notes: Shows mana in bear/cat form. ## Current Author: Tek (port to WoW Classic Beta) -- 1.7.9.5 From eb1a323f72440b80a5fed4b70b8a0a2a4acd0126 Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Mon, 6 Jan 2020 03:30:12 -0800 Subject: [PATCH 02/10] Update addon version --- CHANGELOG.md | 4 ++++ DruidBarClassic.toc | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd2169c..435358c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Version History +#### 0.7.3 +Update WoW version compatability to `1.13.3`. + + #### 0.7.2 Prevent addon load when player unit is not a druid. diff --git a/DruidBarClassic.toc b/DruidBarClassic.toc index 7782e2b..8f14c11 100644 --- a/DruidBarClassic.toc +++ b/DruidBarClassic.toc @@ -4,7 +4,7 @@ ## Current Author: Tek (port to WoW Classic Beta) ## Original Authors: SkaDemon (GUI: DiabloHu) ## SavedVariables: DruidBarKey -## Version: 0.7.2 +## Version: 0.7.3 ## X-Curse-Project-ID: 334762 ## X-WoWI-ID: 25036 -- 1.7.9.5 From 4a5754480e3a6f9b011efd55dbdd7779e96f6a3a Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Mon, 6 Jan 2020 03:30:38 -0800 Subject: [PATCH 03/10] Rename a couple functiuons for readability and add comments --- Options.lua | 42 +++++++++++++++++++++++++++--------------- Options.xml | 8 ++++---- 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/Options.lua b/Options.lua index 9b213a1..2704d92 100644 --- a/Options.lua +++ b/Options.lua @@ -2,16 +2,18 @@ function DRUIDBAROptions_OnLoad() UIPanelWindows['DRUIDBAROptionsFrame'] = {area = 'center', pushable = 0}; end +-- Toggles the visibility of the DruidBar options frame function DRUIDBAROptionsFrame_Toggle() if(DRUIDBAROptionsFrame:IsVisible()) then DRUIDBAROptionsFrame:Hide(); else - DRUIDBAR_FrameSet(); DRUIDBAROptionsFrame:Show(); end + renderOptionsFrame(); end -function DRUIDBAROptions_CheckWidth(self) +-- Updates options related to Width +function DRUIDBAROptions_Width(self) if ( DRUIDBAROptionsWidthEditBox:GetText() < "1" ) then DRUIDBAROptionsWidthEditBox:SetText("170"); DruidBarKey.xvar = self:GetNumber(); @@ -26,7 +28,8 @@ function DRUIDBAROptions_CheckWidth(self) end end -function DRUIDBAROptions_CheckHeight(self) +-- Updates options related to Height +function DRUIDBAROptions_Height(self) if ( DRUIDBAROptionsHeightEditBox:GetText() < "1" ) then DRUIDBAROptionsHeightEditBox:SetText("18"); DruidBarKey.yvar = self:GetNumber(); @@ -41,6 +44,7 @@ function DRUIDBAROptions_CheckHeight(self) end end +-- Updates options related to Enabled state of addon function DRUIDBAROptions_Toggle() if(DruidBarKey.Enabled) then DruidBarKey.Enabled = false; @@ -50,53 +54,59 @@ function DRUIDBAROptions_Toggle() -- Incase no other event triggers the redraw, we do this now if not DruidBarUpdateFrame:IsVisible() then DruidBarUpdateFrame:Show(); end end - DRUIDBAR_FrameSet(); + renderOptionsFrame(); end -function DRUIDBAROptions_Vis() +-- Updates options related to Graphics +function DRUIDBAROptions_Graphics() if(DruidBarKey.Graphics) then DruidBarKey.Graphics = false; else DruidBarKey.Graphics = true; end - DRUIDBAR_FrameSet(); + renderOptionsFrame(); end +-- Updates options related to Minimap Button function DRUIDBAROptions_Minimap() if(DruidBarKey.Minimap) then DruidBarKey.Minimap = false; else DruidBarKey.Minimap = true; end - DRUIDBAR_FrameSet(); + renderOptionsFrame(); end +-- Updates options related to Hid in Caster function DRUIDBAROptions_HideInCaster() if(DruidBarKey.HideInCaster) then DruidBarKey.HideInCaster = false; else DruidBarKey.HideInCaster = true; end - DRUIDBAR_FrameSet(); + renderOptionsFrame(); end -function DRUIDBAROptions_Full() +-- Updates options related to +function DRUIDBAROptions_HideWhenFull() if(DruidBarKey.HideWhenFull) then DruidBarKey.HideWhenFull = false; else DruidBarKey.HideWhenFull = true; end - DRUIDBAR_FrameSet(); + renderOptionsFrame(); end +-- Updates options related to display location where we replace the default manabar function DRUIDBAROptions_Replace() DruidBarKey.Replace = true; DruidBarKey.Player = false; DruidBarKey.Custom = false; DruidBarKey.Lock = true; - DRUIDBAR_FrameSet(); + renderOptionsFrame(); end +-- Updates options related to display location where we attach to bottom of player frame function DRUIDBAROptions_Player() DruidBarKey.Replace = false; DruidBarKey.Player = true; @@ -105,9 +115,10 @@ function DRUIDBAROptions_Player() DruidBarKey.xvar = 125; DruidBarKey.yvar = 18; DruidBarKey.Lock = true; - DRUIDBAR_FrameSet(); + renderOptionsFrame(); end +-- Updates options related to display location when bar is customaizable function DRUIDBAROptions_Custom() DruidBarKey.Custom = true; DruidBarKey.Replace = false; @@ -115,16 +126,17 @@ function DRUIDBAROptions_Custom() DruidBarKey.Lock = false; DruidBarKey.xvar = DruidBarKey.tempW; DruidBarKey.yvar = DruidBarKey.tempH; - DRUIDBAR_FrameSet(); + renderOptionsFrame(); end +-- Updates options related to locking bar in place function DRUIDBAROptions_Lock() if(DruidBarKey.Lock) then DruidBarKey.Lock = false; else DruidBarKey.Lock = true; end - DRUIDBAR_FrameSet(); + renderOptionsFrame(); end function DRUIDBAROptions_Text_Initialize() @@ -204,7 +216,7 @@ function DRUIDBAROptions_Percent_OnClick(self) end end -function DRUIDBAR_FrameSet() +function renderOptionsFrame() -- DruidBarKey is not set, get out if not DruidBarKey then return end diff --git a/Options.xml b/Options.xml index deac170..fe0e52d 100644 --- a/Options.xml +++ b/Options.xml @@ -143,7 +143,7 @@ getglobal(self:GetName().."Text"):SetText(DRUIDBAR_OPTIONS_Vis); - DRUIDBAROptions_Vis(); + DRUIDBAROptions_Graphics(); GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); @@ -216,7 +216,7 @@ - DRUIDBAROptions_Full(); + DRUIDBAROptions_HideWhenFull(); @@ -386,7 +386,7 @@ - DRUIDBAROptions_CheckWidth(self); + DRUIDBAROptions_Width(self); @@ -439,7 +439,7 @@ - DRUIDBAROptions_CheckHeight(self); + DRUIDBAROptions_Height(self); -- 1.7.9.5 From c74bb7e05d3f463d7b7f670a654209ba7f2ad016 Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Mon, 6 Jan 2020 04:07:25 -0800 Subject: [PATCH 04/10] Remove last references to Bestform --- Bindings.xml | 5 +---- DruidBar.lua | 2 -- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Bindings.xml b/Bindings.xml index bdcc678..66c86ea 100644 --- a/Bindings.xml +++ b/Bindings.xml @@ -1,5 +1,2 @@ - - DruidBar_ChangeBestForm(); - - \ No newline at end of file + diff --git a/DruidBar.lua b/DruidBar.lua index cc7d3e5..a978582 100644 --- a/DruidBar.lua +++ b/DruidBar.lua @@ -604,8 +604,6 @@ function DruidBar_Enable_ChatCommandHandler(text) DRUIDBAR_FrameSet(); elseif msg[1] == "status" then DruidBar_Status(); - elseif msg[1] == "best" then - DruidBar_ChangeBestForm(); elseif msg[1] == "color" then if tonumber(msg[3]) then if msg[2] == "r" then -- 1.7.9.5 From fbdeeacd324502d11703c9b34a1671da01c6ee11 Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Mon, 6 Jan 2020 04:08:11 -0800 Subject: [PATCH 05/10] Fix draggable functionality --- DruidBar.lua | 7 +++++++ DruidBar.xml | 30 ++---------------------------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/DruidBar.lua b/DruidBar.lua index a978582..1d2e691 100644 --- a/DruidBar.lua +++ b/DruidBar.lua @@ -306,12 +306,19 @@ function DruidBar_MainGraphics() DruidBar_Anchored = nil; end + -- Set the position lock and dragability if DruidBarKey.Lock then dbarShow(DruidBarDontMove); DruidBarFrame:EnableMouse(0); + DruidBarFrame:SetMovable(false) + DruidBarFrame:RegisterForDrag() else dbarHide(DruidBarDontMove); DruidBarFrame:EnableMouse(1); + DruidBarFrame:SetMovable(true) + DruidBarFrame:RegisterForDrag("LeftButton") + DruidBarFrame:SetScript("OnDragStart", DruidBarFrame.StartMoving) + DruidBarFrame:SetScript("OnDragStop", DruidBarFrame.StopMovingOrSizing) end else dbarHide(DruidBarFrame); diff --git a/DruidBar.xml b/DruidBar.xml index 511591e..119813b 100644 --- a/DruidBar.xml +++ b/DruidBar.xml @@ -7,7 +7,7 @@ - + @@ -102,35 +102,9 @@ self:SetFrameLevel("1"); - - if button == "LeftButton" and not self.isMoving then - self:GetParent():StartMoving(); - self.isMoving = true; - end - - - if button == "LeftButton" and self.isMoving then - self:GetParent():StopMovingOrSizing(); - self.isMoving = false; - end - - - if self.isMoving then - self:GetParent():StopMovingOrSizing(); - self.isMoving = false; - end - - - - - self:RegisterForDrag("LeftButton"); - - self:StartMoving(); - self:StopMovingOrSizing(); - @@ -155,7 +129,7 @@ - + -- 1.7.9.5 From c531ae958173aeeeb189a1c99562c33232983015 Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Mon, 6 Jan 2020 04:10:37 -0800 Subject: [PATCH 06/10] Update CHANGELOG --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 435358c..94b7ae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,9 @@ #### 0.7.3 Update WoW version compatability to `1.13.3`. - +Fix on draggable bug. +Little more code cleanup. +Remove last traces of Bestform, R.I.P. #### 0.7.2 Prevent addon load when player unit is not a druid. -- 1.7.9.5 From 81b56db30a25ff575da6524793a15aede4c813a5 Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Mon, 6 Jan 2020 06:34:27 -0800 Subject: [PATCH 07/10] Initialize frame with movable so stored position can bet set on initial render --- DruidBar.xml | 2 +- tash | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 tash diff --git a/DruidBar.xml b/DruidBar.xml index 119813b..a65c630 100644 --- a/DruidBar.xml +++ b/DruidBar.xml @@ -7,7 +7,7 @@ - + diff --git a/tash b/tash new file mode 100644 index 0000000..aebc65f --- /dev/null +++ b/tash @@ -0,0 +1,45 @@ +diff --git a/DruidBar.lua b/DruidBar.lua +index 1d2e691..d7907ed 100644 +--- a/DruidBar.lua ++++ b/DruidBar.lua +@@ -6,12 +6,27 @@ local timer = 0; + local lowregentimer = 0; + local fullmanatimer = 0; + local DruidBar_Anchored = nil; ++-- local DruidBar_MinimapPos = {  ++-- ["minimapPos"] = 90,  ++-- ["hide"] = false,  ++-- }  ++  ++-- local ldb = LibStub:GetLibrary("LibDataBroker-1.1")  ++  ++-- if not ldb:GetDataObjectByName("DruidBarMinimapIcon") then  ++-- ldb:NewDataObject("DruidBarMinimapIcon", {  ++-- type = "data source",  ++-- text = "Druid Bar Classic",  ++-- icon = "Interface\\Icons\\ABILITY_DRUID_DEMORALIZINGROAR",  ++-- OnClick = function (self, button) if button == "LeftButton" then DRUIDBAROptionsFrame_Toggle(); end end  ++-- });  ++-- end  +  + local minimapIconLDB = LibStub("LibDataBroker-1.1"):NewDataObject("DruidBarMinimapIcon", { +- type = "data source", +- text = "Druid Bar Classic", +- icon = "Interface\\Icons\\ABILITY_DRUID_DEMORALIZINGROAR", +- OnClick = function (self, button) if button == "LeftButton" then DRUIDBAROptionsFrame_Toggle(); end end ++ type = "data source",  ++ text = "Druid Bar Classic",  ++ icon = "Interface\\Icons\\ABILITY_DRUID_DEMORALIZINGROAR",  ++ OnClick = function (self, button) if button == "LeftButton" then DRUIDBAROptionsFrame_Toggle(); end end  + }); +  + local DruidBar_MinimapButton = LibStub("LibDBIcon-1.0"); +@@ -31,7 +46,7 @@ function DruidBar_OnLoad() + DBarSpellCatch:SetOwner(DruidBarUpdateFrame, "ANCHOR_NONE"); +  + -- Creating the minimap config icon +- DruidBar_MinimapButton:Register("DruidBarMinimapIcon", minimapIconLDB, DruidBarKey); ++ DruidBar_MinimapButton:Register("DruidBarMinimapIcon", ldb, DruidBar_MinimapPos);  + end + end + function EventRegistration(event) -- 1.7.9.5 From b179cee3efc63e4221903889ecce7c9d656b0245 Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Mon, 6 Jan 2020 07:07:30 -0800 Subject: [PATCH 08/10] Move the creation of minimap button so it loads position from DruidBarKey --- DruidBar.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DruidBar.lua b/DruidBar.lua index 1d2e691..ac5de07 100644 --- a/DruidBar.lua +++ b/DruidBar.lua @@ -29,9 +29,6 @@ function DruidBar_OnLoad() SLASH_DRUIDBARSLASH1 = "/dbar"; SLASH_DRUIDBARSLASH2 = "/druidbar"; DBarSpellCatch:SetOwner(DruidBarUpdateFrame, "ANCHOR_NONE"); - - -- Creating the minimap config icon - DruidBar_MinimapButton:Register("DruidBarMinimapIcon", minimapIconLDB, DruidBarKey); end end function EventRegistration(event) @@ -166,6 +163,9 @@ function Load_Variables(className) ShapeshiftBar_ChangeForm = DruidBar_ChangeForm; shiftload = true; end + + -- Creating the minimap config icon + DruidBar_MinimapButton:Register("DruidBarMinimapIcon", minimapIconLDB, DruidBarKey); end function DruidBar_ReflectionCheck() -- 1.7.9.5 From 9f62a0a4bcf156964b2f1d9f6be7c7fdef76076f Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Mon, 6 Jan 2020 07:15:58 -0800 Subject: [PATCH 09/10] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94b7ae5..bfa924b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Update WoW version compatability to `1.13.3`. Fix on draggable bug. Little more code cleanup. +Fix icon position save. Remove last traces of Bestform, R.I.P. #### 0.7.2 -- 1.7.9.5 From 0d01ff05d8d55efd8cda19d24a85e581ce519ada Mon Sep 17 00:00:00 2001 From: Tek Hudson Date: Mon, 6 Jan 2020 07:23:37 -0800 Subject: [PATCH 10/10] Remove accidently added file --- tash | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 tash diff --git a/tash b/tash deleted file mode 100644 index aebc65f..0000000 --- a/tash +++ /dev/null @@ -1,45 +0,0 @@ -diff --git a/DruidBar.lua b/DruidBar.lua -index 1d2e691..d7907ed 100644 ---- a/DruidBar.lua -+++ b/DruidBar.lua -@@ -6,12 +6,27 @@ local timer = 0; - local lowregentimer = 0; - local fullmanatimer = 0; - local DruidBar_Anchored = nil; -+-- local DruidBar_MinimapPos = {  -+-- ["minimapPos"] = 90,  -+-- ["hide"] = false,  -+-- }  -+  -+-- local ldb = LibStub:GetLibrary("LibDataBroker-1.1")  -+  -+-- if not ldb:GetDataObjectByName("DruidBarMinimapIcon") then  -+-- ldb:NewDataObject("DruidBarMinimapIcon", {  -+-- type = "data source",  -+-- text = "Druid Bar Classic",  -+-- icon = "Interface\\Icons\\ABILITY_DRUID_DEMORALIZINGROAR",  -+-- OnClick = function (self, button) if button == "LeftButton" then DRUIDBAROptionsFrame_Toggle(); end end  -+-- });  -+-- end  -  - local minimapIconLDB = LibStub("LibDataBroker-1.1"):NewDataObject("DruidBarMinimapIcon", { -- type = "data source", -- text = "Druid Bar Classic", -- icon = "Interface\\Icons\\ABILITY_DRUID_DEMORALIZINGROAR", -- OnClick = function (self, button) if button == "LeftButton" then DRUIDBAROptionsFrame_Toggle(); end end -+ type = "data source",  -+ text = "Druid Bar Classic",  -+ icon = "Interface\\Icons\\ABILITY_DRUID_DEMORALIZINGROAR",  -+ OnClick = function (self, button) if button == "LeftButton" then DRUIDBAROptionsFrame_Toggle(); end end  - }); -  - local DruidBar_MinimapButton = LibStub("LibDBIcon-1.0"); -@@ -31,7 +46,7 @@ function DruidBar_OnLoad() - DBarSpellCatch:SetOwner(DruidBarUpdateFrame, "ANCHOR_NONE"); -  - -- Creating the minimap config icon -- DruidBar_MinimapButton:Register("DruidBarMinimapIcon", minimapIconLDB, DruidBarKey); -+ DruidBar_MinimapButton:Register("DruidBarMinimapIcon", ldb, DruidBar_MinimapPos);  - end - end - function EventRegistration(event) -- 1.7.9.5