Quantcast

Version 0.4 release

Tek Hudson [08-10-19 - 21:29]
Version 0.4 release
Filename
DruidBar.lua
DruidBarClassic.toc
README.md
localization.lua
diff --git a/DruidBar.lua b/DruidBar.lua
index b33d888..c24ccf8 100644
--- a/DruidBar.lua
+++ b/DruidBar.lua
@@ -114,6 +114,53 @@ function DruidBar_OnEvent(self, event,...)
 	end
 end

+function DruidBar_OnUpdate(self, elapsed)
+	if className and className == "DRUID" and DruidBarKey.Enabled then
+		timer = (timer or 0) + elapsed;
+		if not notyet then
+			DruidBar_MaxManaScript();
+			for i = 1, GetNumShapeshiftForms() do
+				local icon = GetShapeshiftFormInfo(i);
+				if icon == "Interface\\Icons\\Ability_Druid_AquaticForm" then aquaformid = i; end
+				if icon == "Interface\\Icons\\Ability_Druid_TravelForm" then travelformid = i; end
+			end
+			notyet = true;
+		end
+
+		if lowregentimer > 0 then
+			lowregentimer = lowregentimer - elapsed;
+			if lowregentimer <= 0 then lowregentimer = 0; end
+		end
+
+		if UnitPowerType("player") ~= 0 then
+			fullmanatimer = fullmanatimer + elapsed;
+			if fullmanatimer > 6 and floor((DruidBarKey.currentmana*100) / DruidBarKey.maxmana) > 90 then
+				DruidBarKey.currentmana = DruidBarKey.maxmana;
+			end
+		end
+
+		-- Graphics ON
+		if DruidBarKey.Graphics then
+			if DruidBarKey.Replace then
+				DruidBar_ReplaceGraphics();
+			else
+				DruidBarMana:SetMinMaxValues(0, DruidBarKey.maxmana);
+				DruidBarMana:SetValue(DruidBarKey.currentmana);
+				if timer > 2 then DruidBar_ColorAndStrataAndTexture(); timer = 0; end
+				DruidBar_MainGraphics();
+			end
+		--Graphics OFF
+		else
+			dbarhide(DruidBarFrame);
+			dbarhide(DruidBarReplaceText);
+			if PlayerFrameManaBar:GetWidth() < 100 then PlayerFrameManaBar:SetWidth(120); end
+		end
+	else
+		dbarhide(DruidBarFrame);
+		dbarhide(DruidBarUpdateFrame);
+	end
+end
+
 function Load_Variables(className)
 	-- Populate primary data store 'DruidBarKey'
 	if not DruidBarKey then
@@ -193,53 +240,6 @@ function Load_Variables(className)
 	end
 end

-function DruidBar_OnUpdate(self, elapsed)
-	if className and className == "DRUID" and DruidBarKey.Enabled then
-		timer = (timer or 0) + elapsed;
-		if not notyet then
-			DruidBar_MaxManaScript();
-			for i = 1, GetNumShapeshiftForms() do
-				local icon = GetShapeshiftFormInfo(i);
-				if icon == "Interface\\Icons\\Ability_Druid_AquaticForm" then aquaformid = i; end
-				if icon == "Interface\\Icons\\Ability_Druid_TravelForm" then travelformid = i; end
-			end
-			notyet = true;
-		end
-
-		if lowregentimer > 0 then
-			lowregentimer = lowregentimer - elapsed;
-			if lowregentimer <= 0 then lowregentimer = 0; end
-		end
-
-		if UnitPowerType("player") ~= 0 then
-			fullmanatimer = fullmanatimer + elapsed;
-			if fullmanatimer > 6 and floor((DruidBarKey.currentmana*100) / DruidBarKey.maxmana) > 90 then
-				DruidBarKey.currentmana = DruidBarKey.maxmana;
-			end
-		end
-
-		-- Graphics ON
-		if DruidBarKey.Graphics then
-			if DruidBarKey.Replace then
-				DruidBar_ReplaceGraphics();
-			else
-				DruidBarMana:SetMinMaxValues(0, DruidBarKey.maxmana);
-				DruidBarMana:SetValue(DruidBarKey.currentmana);
-				if timer > 2 then DruidBar_ColorAndStrataAndTexture(); timer = 0; end
-				DruidBar_MainGraphics();
-			end
-		--Graphics OFF
-		else
-			dbarhide(DruidBarFrame);
-			dbarhide(DruidBarReplaceText);
-			if PlayerFrameManaBar:GetWidth() < 100 then PlayerFrameManaBar:SetWidth(120); end
-		end
-	else
-		dbarhide(DruidBarFrame);
-		dbarhide(DruidBarUpdateFrame);
-	end
-end
-
 function DruidBar_ReflectionCheck()
 	local managain = 0;
 	local j = 1;
@@ -650,7 +650,13 @@ function DruidBar_Print(msg,r,g,b,frame,id,unknown4th)
 	end
 end

-function DruidBar_Toggle(tog, str) if tog then DruidBar_Print(str.." off"); return nil; else DruidBar_Print(str.." on"); return true; end end
+function DruidBar_Toggle(tog, str)
+	if tog then DruidBar_Print(str.." off");
+		return nil;
+	else DruidBar_Print(str.." on");
+		return true;
+	end
+end

 function DruidBar_Enable_ChatCommandHandler(text)
 	local msg = TextParse(text);
diff --git a/DruidBarClassic.toc b/DruidBarClassic.toc
index e276782..bfad5f3 100644
--- a/DruidBarClassic.toc
+++ b/DruidBarClassic.toc
@@ -4,5 +4,5 @@
 ## Current Author: Tek (port to WoW Classic Beta)
 ## Original Authors: SkaDemon (GUI: DiabloHu)
 ## SavedVariables: DruidBarKey
-## Version: 0.3
+## Version: 0.4
 DruidBar.xml
diff --git a/README.md b/README.md
index 0c92ef5..e4888dc 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@ There are 2 available /druidbar or /dbar and either may recieve a number of para

 * Vis: This will enable or disable any and all graphical stuff. if you use with other addons like StatusBars or Linoleum, turn it off. If not, leave it on ^^

-* Width (#): This will let you set the width of the bar. Default is 160px.
+* Width (#): This will let you set the width of the bar. Default is 170px.

 * height (#): This will let you set the height of the bar. Default is 18px.

@@ -66,6 +66,10 @@ Discord: https://discord.gg/b5sPQnu

 ## Version History

+### 0.4
+Add minimap icon.
+Clean up UI to resolve frame under manabar.
+
 #### 0.3
 Prepair for classic release.
 Update TOC to work with launcher version listed.
diff --git a/localization.lua b/localization.lua
index ddf0931..4820afc 100644
--- a/localization.lua
+++ b/localization.lua
@@ -89,7 +89,7 @@ DRUIDBAR_OPTIONS_ColorBack = "Bg Color";
 DRUIDBAR_OPTIONS_ColorBorder = "Border Color";
 DRUIDBAR_OPTIONS_Message_Mana = "Mana Bar";
 DRUIDBAR_OPTIONS_Message_border = "Bar Border";
-DRUIDBAR_OPTIONS_Version = "|cff9d9d9dDruid Bar Classic v0.3\nby Tek|r";
+DRUIDBAR_OPTIONS_Version = "|cff9d9d9dDruid Bar Classic v0.4\nby Tek|r";


 if ( GetLocale() == "frFR" ) then