Quantcast

Fixes in elemental rotation, elemental and restoration config panels are fixed.

Taracque [01-04-13 - 17:09]
Fixes in elemental rotation, elemental and restoration config panels are fixed.
Filename
Ele_GUI.lua
Localization_enUS.lua
modules/elemental.lua
modules/restoration.lua
diff --git a/Ele_GUI.lua b/Ele_GUI.lua
index 23db971..20a98cd 100755
--- a/Ele_GUI.lua
+++ b/Ele_GUI.lua
@@ -411,7 +411,7 @@ function Elementarist:CreateConfig()
 			local vposition = -40;
 			if (Elementarist[i].Configuration) then
 				local childPanel = CreateFrame( "Frame", "ElementaristConfigPanel" .. i, Elementarist.configPanel );
-				childPanel.name = i;
+				childPanel.name = i:gsub("^%l", string.upper);
 				for i2,v2 in pairs(Elementarist[i].Configuration) do
 					if (v2.type == "DropDown") then
 						local dropDown = Elementarist:CreateDropDownMenu(v2.label, childPanel, ElementaristDB, i2, v2.options, 200);
@@ -419,7 +419,7 @@ function Elementarist:CreateConfig()
 						vposition = vposition - 30;
 					end
 					if (v2.type == "CheckBox") then
-						local checkBox = Elementarist:CreateDropDownMenu(v2.label, childPanel, ElementaristDB, i2, v2.options, 200);
+						local checkBox = Elementarist:CreateCheckButton(v2.label, childPanel, ElementaristDB, i2, false);
 						checkBox:SetPoint('TOPLEFT', 10, vposition);
 						vposition = vposition - 30;
 					end
diff --git a/Localization_enUS.lua b/Localization_enUS.lua
index af18cfa..5975468 100755
--- a/Localization_enUS.lua
+++ b/Localization_enUS.lua
@@ -36,4 +36,6 @@ if GetLocale() then
 	L.CONFIG_LAYOUT = "Layout:"
 	L.LAYOUT_GROW = "Growing icons"
 	L.LAYOUT_RIGHTTOLEFT = "Right to left"
+	L.CONFIG_ENABLE_HS_TOTEM = "Show Healing Stream Totem"
+	L.CONFIG_ENABLE_SEARING_TOTEM = "Show Searing Totem"
 end
\ No newline at end of file
diff --git a/modules/elemental.lua b/modules/elemental.lua
index 380ff6d..733cb03 100755
--- a/modules/elemental.lua
+++ b/modules/elemental.lua
@@ -8,13 +8,17 @@ Elementarist.elemental = {
 			["type"]	= "DropDown",
 			["label"]	=	L.CONFIG_BEHAVIOR,
 			["options"]	= {
-				["text"]	=	L.BEHAVIOR_KEEP_FS_UP,
-				["text"]	=	L.BEHAVIOR_FS_BEFORE_LVB
+				{text	=	L.BEHAVIOR_KEEP_FS_UP},
+				{text	=	L.BEHAVIOR_FS_BEFORE_LVB}
 			}
 		},
 		["EnableEQ"] = {
 			["type"]	=	"CheckBox",
 			["label"]	=	L.CONFIG_ENABLE_EQ_SPELL
+		},
+		["ShowHealingStream"] = {
+			["type"]	=	"CheckBox",
+			["label"]	=	L.CONFIG_ENABLE_HS_TOTEM
 		}
 	};
 	Initialize = function(self)
@@ -140,6 +144,7 @@ Elementarist.elemental = {
 			end
 		end

+		-- Lava Burst if not on Cooldown
 		local ascendance, _, _, _, _, _, ascendanceExp = Elementarist:hasBuff("player",Elementarist.SpellList["AscendanceElementalBuff"]);
 		if (ascendance == nil) then
 			ascendanceExp = 0
@@ -164,6 +169,21 @@ Elementarist.elemental = {
 			end
 		end

+		-- if Tier6 talent is Elemental Blast use it
+		if (Elementarist.tier6Talent == 18) then
+			if (
+				(exspell1 ~= Elementarist.SpellList["Elemental Blast"]) and
+				(exspell2 ~= Elementarist.SpellList["Elemental Blast"]) and
+				(IsSpellInRange(Elementarist.SpellList["Elemental Blast"], "target") == 1) and
+				(Elementarist.SpellList["Elemental Blast"] ~= spellInCast)
+			) then
+				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Elemental Blast"])
+				if ((d - timeshift) <= 0) then
+					return Elementarist.SpellList["Elemental Blast"]
+				end
+			end
+		end
+
 		-- Earth shock if Lightning Shield count >=7 and not on cd, and FS debuff remaining > FS cooldown, or FS debuff remaining between FS and FS cd + 2sec and LS count>=5
 		if ( (exspell1 ~= Elementarist.SpellList["Earth Shock"]) and (exspell2 ~= Elementarist.SpellList["Earth Shock"]) and (exspell1 ~= Elementarist.SpellList["Flame Shock"]) and (exspell2 ~= Elementarist.SpellList["Flame Shock"]) ) then
 			if ( (fsExpiration - GetTime() - timeshift) > Elementarist.lastShockCD ) then
@@ -179,22 +199,7 @@ Elementarist.elemental = {
 				end
 			end
 		end
-
-		-- if Tier6 talent is Elemental Blast use it
-		if (Elementarist.tier6Talent == 18) then
-			if (
-				(exspell1 ~= Elementarist.SpellList["Elemental Blast"]) and
-				(exspell2 ~= Elementarist.SpellList["Elemental Blast"]) and
-				(IsSpellInRange(Elementarist.SpellList["Elemental Blast"], "target") == 1) and
-				(Elementarist.SpellList["Elemental Blast"] ~= spellInCast)
-			) then
-				d = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Elemental Blast"])
-				if ((d - timeshift) <= 0) then
-					return Elementarist.SpellList["Elemental Blast"]
-				end
-			end
-		end
-
+
 		-- otherwise lightning bolt
 		if IsSpellInRange(Elementarist.SpellList["Lightning Bolt"], "target") == 1 then
 			return Elementarist.SpellList["Lightning Bolt"]
@@ -263,7 +268,7 @@ Elementarist.elemental = {
 		end

 		-- Healing Stream Totem
-		if Elementarist:SpellAvailable(Elementarist.SpellList["Healing Stream Totem"]) then
+		if (ElementaristDB.ShowHealingStream) and (Elementarist:SpellAvailable(Elementarist.SpellList["Healing Stream Totem"])) then
 			local haveWaterTotem,waterTotemName,_,_ = GetTotemInfo(3)
 			if (waterTotemName == "") then
 				e = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Healing Stream Totem"]);
diff --git a/modules/restoration.lua b/modules/restoration.lua
index 17d01b7..000a912 100755
--- a/modules/restoration.lua
+++ b/modules/restoration.lua
@@ -3,6 +3,12 @@ local L = Elementarist.Locals;
 Elementarist:RegisterModule("restoration");

 Elementarist.restoration = {
+	["Configuration"] = {
+		["ShowSearingTotem"] = {
+			["type"]	=	"CheckBox",
+			["label"]	=	L.CONFIG_ENABLE_SEARING_TOTEM
+		}
+	};
 	Initialize = function(self)
 		Elementarist:LoadSpells({
 			["Healing Wave"] = GetSpellInfo(331),
@@ -136,6 +142,27 @@ Elementarist.restoration = {
 			timeshift = 0
 		end

+		-- check current spell
+		local spellInCast, _, _, _, sICstartTime, sICendTime = UnitCastingInfo("player")
+		if (spellInCast) then
+			if ( (sICendTime - sICstartTime) / 1000 ) < Elementarist.lastBaseGCD then
+				sICendTime = sICstartTime + (Elementarist.lastBaseGCD * 1000)
+			end
+			timeshift = timeshift + (sICendTime / 1000) - GetTime()
+		else
+			-- no spell in cast, check global cd via Flametongue Weapon
+			if (Elementarist.SpellList["Flametongue Weapon"]) then
+				local ftcd = Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flametongue Weapon"])
+				if (ftcd) then
+					timeshift = timeshift + Elementarist:GetSpellCooldownRemaining(Elementarist.SpellList["Flametongue Weapon"])
+				else
+					timeshift = timeshift + Elementarist.lastBaseGCD
+				end
+			else
+				timeshift = timeshift + Elementarist.lastBaseGCD
+			end
+		end
+
 		-- Earth Shield, if not known
 		if (not Elementarist.auraCooldowns["0"]) or (not Elementarist.auraCooldowns["0"].charges) or (Elementarist.auraCooldowns["0"].charges == 0) then
 			if (exspell1 ~= Elementarist.SpellList["Earth Shield"]) and (exspell2 ~= Elementarist.SpellList["Earth Shield"]) then
@@ -234,7 +261,7 @@ Elementarist.restoration = {
 		end

 		-- Searing Totem
-		if Elementarist:SpellAvailable(Elementarist.SpellList["Searing Totem"]) then
+		if (ElementaristDB.ShowSearingTotem) and (Elementarist:SpellAvailable(Elementarist.SpellList["Searing Totem"])) then
 			local haveFireTotem,fireTotemName,_,_ = GetTotemInfo(1)
 			if (fireTotemName == "") then
 				-- no fire totem