Quantcast

Fixed disabling individual frames.

Taracque [09-03-12 - 09:05]
Fixed disabling individual frames.

Also check runic power needs for Frost Strike, Rune Strike and Death
Coil.
Filename
DKCrutch.lua
DKCrutch.toc
DKCrutch_GUI.lua
locales/enUS.lua
diff --git a/DKCrutch.lua b/DKCrutch.lua
index 491c437..b143642 100644
--- a/DKCrutch.lua
+++ b/DKCrutch.lua
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- DKCrutch 0.5.2
+-- DKCrutch 0.5.3
 --
 -- Death Knight rune tracker and ability advisor
 -------------------------------------------------------------------------------
@@ -8,7 +8,7 @@ DKCrutch = {Locals = {}}

 local L = DKCrutch.Locals

-DKCrutch.versionNumber = '0.5.2'
+DKCrutch.versionNumber = '0.5.3'
 DKCrutch.talent = ""
 DKCrutch.isEnabled = false
 DKCrutch.talentUnsure = true
@@ -553,7 +553,10 @@ function DKCrutch:AdviseBloodAbility()
 	-- Rune Strike if available
 	cd = DKCrutch:GetSpellCooldownRemaining(DKCrutch.SpellList["Rune Strike"])
 	if (cd) and (cd<=1) and (IsUsableSpell(DKCrutch.SpellList["Rune Strike"])) then
-		return "Rune Strike"
+		local _, _, _, cost = GetSpellInfo(DKCrutch.SpellList["Rune Strike"])
+		if (UnitPower("player", 6) >= cost) then
+			return "Rune Strike"
+		end
 	end

 	return ""
@@ -660,7 +663,10 @@ function DKCrutch:AdviseFrostAbility()

 	-- Frost Strike
 	if (fscd) and (fscd <= 1) and (IsUsableSpell(DKCrutch.SpellList["Frost Strike"])) then
-		return "Frost Strike"
+		local _, _, _, cost = GetSpellInfo(DKCrutch.SpellList["Frost Strike"])
+		if (UnitPower("player", 6) >= cost) then
+			return "Frost Strike"
+		end
 	end

 	-- Howling Blast
@@ -791,7 +797,10 @@ function DKCrutch:AdviseUnholyAbility()

 	-- Death Coil
 	if (dscd) and (dccd <= 1) and (IsUsableSpell(DKCrutch.SpellList["Death Coil"])) then
-		return "Death Coil"
+		local _, _, _, cost = GetSpellInfo(DKCrutch.SpellList["Death Coil"])
+		if (UnitPower("player", 6) >= cost) then
+			return "Death Coil"
+		end
 	end

 	-- Empower Rune Weapon
@@ -873,6 +882,11 @@ function DKCrutch:Update()
 			if (d) and (d>0) then
 				DKCrutch.cooldownFrame:SetCooldown(s, d)
 			end
+		else
+			if (DKCrutch.lastSpell ~= "") then
+				DKCrutch.advisorFrame.texture:SetTexture( "" )
+				DKCrutch.lastSpell = spell
+			end
 		end
 	end
 	if (not DKCrutchDB.runicDisabled) then
diff --git a/DKCrutch.toc b/DKCrutch.toc
index e4f23dd..fa099b1 100644
--- a/DKCrutch.toc
+++ b/DKCrutch.toc
@@ -2,7 +2,7 @@
 ## Title: DKCrutch
 ## Notes: Death Knight rune tracker and rotation helper
 ## Author: Taracque, Dgrovs of Arathor
-## Version: 0.5.2
+## Version: 0.5.3
 ## SavedVariables: DKCrutchDB
 ## OptionalDeps:
 ## Dependencies:
diff --git a/DKCrutch_GUI.lua b/DKCrutch_GUI.lua
index 81fafbf..d5775c8 100644
--- a/DKCrutch_GUI.lua
+++ b/DKCrutch_GUI.lua
@@ -150,12 +150,28 @@ function DKCrutch:ApplySettings()
 			DKCrutch.displayFrame:Show()
 			if (not DKCrutchDB.advisorDisabled) then
 				DKCrutch.advisorFrame:Show()
+			else
+				DKCrutch.advisorFrame:Hide()
 			end
 			if (not DKCrutchDB.procDisabled) then
 				DKCrutch.procFrame:Show()
+			else
+				DKCrutch.procFrame:Hide()
+			end
+			if (not DKCrutchDB.runicDisabled) then
+				DKCrutch.runicFrame:Show()
+			else
+				DKCrutch.runicFrame:Hide()
 			end
 			if (not DKCrutchDB.weaponDisabled) then
 				DKCrutch.weaponFrame:Show()
+			else
+				DKCrutch.weaponFrame:Hide()
+			end
+			if (not DKCrutchDB.runeDisabled) then
+				DKCrutch.displayFrame:Show()
+			else
+				DKCrutch.displayFrame:Hide()
 			end
 		end
 	else
@@ -210,7 +226,7 @@ function DKCrutch:CreateConfig()
 	EnableBtn:SetPoint('TOPLEFT', 10, -8)

 	local LockBtn = DKCrutch:CreateCheckButton(L.CONFIG_LOCK_FRAMES, DKCrutch.configPanel, DKCrutchDB, "locked", false)
-	LockBtn:SetPoint('TOPLEFT', 10, -58)
+	LockBtn:SetPoint('TOPLEFT', 10, -38)

 	local Scale = DKCrutch:CreateSlider(L.CONFIG_SPELL_ADV_SCALE, DKCrutch.configPanel, .25, 3, .1)
 	Scale:SetScript('OnShow', function(self)
@@ -246,7 +262,7 @@ function DKCrutch:CreateConfig()
 	Alpha:Show()

 	local advisorDisableBtn = DKCrutch:CreateCheckButton(L.CONFIG_DISABLE_ADVISOR, DKCrutch.configPanel, DKCrutchDB, "advisorDisabled", false)
-	advisorDisableBtn:SetPoint('TOPLEFT', 10, -158)
+	advisorDisableBtn:SetPoint('TOPLEFT', 10, -118)

 	local RuneScale = DKCrutch:CreateSlider(L.CONFIG_RUNE_TRACKER_SCALE, DKCrutch.configPanel, .25, 3, .1)
 	RuneScale:SetScript('OnShow', function(self)
@@ -261,7 +277,7 @@ function DKCrutch:CreateConfig()
 			DKCrutch.displayFrame:SetScale(value)
 		end
 	end)
-	RuneScale:SetPoint("TOPLEFT",10,-138)
+	RuneScale:SetPoint("TOPLEFT",10,-158)
 	RuneScale:Show()

 	local RuneAlpha = DKCrutch:CreateSlider(L.CONFIG_RUNE_TRACKER_ALPHA, DKCrutch.configPanel, .0, 1, .1)
@@ -277,8 +293,12 @@ function DKCrutch:CreateConfig()
 			DKCrutch.displayFrame:SetAlpha(value)
 		end
 	end)
-	RuneAlpha:SetPoint("TOPLEFT",200,-138)
+	RuneAlpha:SetPoint("TOPLEFT",200,-158)
 	RuneAlpha:Show()
+
+	local runeDisableBtn = DKCrutch:CreateCheckButton(L.CONFIG_DISABLE_RUNE, DKCrutch.configPanel, DKCrutchDB, "runeDisabled", false)
+	runeDisableBtn:SetPoint('TOPLEFT', 10, -178)
+

 	local procScale = DKCrutch:CreateSlider(L.CONFIG_PROC_SCALE, DKCrutch.configPanel, .25, 3, .1)
 	procScale:SetScript('OnShow', function(self)
@@ -293,7 +313,7 @@ function DKCrutch:CreateConfig()
 			DKCrutch.procFrame:SetScale(value)
 		end
 	end)
-	procScale:SetPoint("TOPLEFT",10,-198)
+	procScale:SetPoint("TOPLEFT",10,-218)
 	procScale:Show()

 	local procAlpha = DKCrutch:CreateSlider(L.CONFIG_PROC_ALPHA, DKCrutch.configPanel, .0, 1, .1)
@@ -309,11 +329,11 @@ function DKCrutch:CreateConfig()
 			DKCrutch.procFrame:SetAlpha(value)
 		end
 	end)
-	procAlpha:SetPoint("TOPLEFT",200,-198)
+	procAlpha:SetPoint("TOPLEFT",200,-218)
 	procAlpha:Show()

 	local procDisableBtn = DKCrutch:CreateCheckButton(L.CONFIG_DISABLE_PROC, DKCrutch.configPanel, DKCrutchDB, "procDisabled", false)
-	procDisableBtn:SetPoint('TOPLEFT', 10, -218)
+	procDisableBtn:SetPoint('TOPLEFT', 10, -238)

 	local runicScale = DKCrutch:CreateSlider(L.CONFIG_RUNIC_SCALE, DKCrutch.configPanel, .25, 3, .1)
 	runicScale:SetScript('OnShow', function(self)
@@ -329,7 +349,7 @@ function DKCrutch:CreateConfig()

 		end
 	end)
-	runicScale:SetPoint("TOPLEFT",10,-258)
+	runicScale:SetPoint("TOPLEFT",10,-278)
 	runicScale:Show()

 	local runicAlpha = DKCrutch:CreateSlider(L.CONFIG_RUNIC_ALPHA, DKCrutch.configPanel, .0, 1, .1)
@@ -345,11 +365,11 @@ function DKCrutch:CreateConfig()
 			DKCrutch.runicFrame:SetAlpha(value)
 		end
 	end)
-	runicAlpha:SetPoint("TOPLEFT",200,-258)
+	runicAlpha:SetPoint("TOPLEFT",200,-278)
 	runicAlpha:Show()

 	local runicDisableBtn = DKCrutch:CreateCheckButton(L.CONFIG_DISABLE_RUNIC, DKCrutch.configPanel, DKCrutchDB, "runicDisabled", false)
-	runicDisableBtn:SetPoint('TOPLEFT', 10, -278)
+	runicDisableBtn:SetPoint('TOPLEFT', 10, -298)

 	local debuffScale = DKCrutch:CreateSlider(L.CONFIG_DEBUFF_SCALE, DKCrutch.configPanel, .25, 3, .1)
 	debuffScale:SetScript('OnShow', function(self)
@@ -365,7 +385,7 @@ function DKCrutch:CreateConfig()

 		end
 	end)
-	debuffScale:SetPoint("TOPLEFT",10,-318)
+	debuffScale:SetPoint("TOPLEFT",10,-338)
 	debuffScale:Show()

 	local debuffAlpha = DKCrutch:CreateSlider(L.CONFIG_DEBUFF_ALPHA, DKCrutch.configPanel, .0, 1, .1)
@@ -381,11 +401,11 @@ function DKCrutch:CreateConfig()
 			DKCrutch.debuffFrame:SetAlpha(value)
 		end
 	end)
-	debuffAlpha:SetPoint("TOPLEFT",200,-318)
+	debuffAlpha:SetPoint("TOPLEFT",200,-338)
 	debuffAlpha:Show()

 	local debuffDisableBtn = DKCrutch:CreateCheckButton(L.CONFIG_DISABLE_DEBUFF, DKCrutch.configPanel, DKCrutchDB, "debuffDisabled", false)
-	debuffDisableBtn:SetPoint('TOPLEFT', 10, -338)
+	debuffDisableBtn:SetPoint('TOPLEFT', 10, -358)

 	local weaponScale = DKCrutch:CreateSlider(L.CONFIG_WEAPON_SCALE, DKCrutch.configPanel, .25, 3, .1)
 	weaponScale:SetScript('OnShow', function(self)
@@ -400,7 +420,7 @@ function DKCrutch:CreateConfig()
 			DKCrutch.weaponFrame:SetScale(value)
 		end
 	end)
-	weaponScale:SetPoint("TOPLEFT",10,-378)
+	weaponScale:SetPoint("TOPLEFT",10,-398)
 	weaponScale:Show()

 	local weaponAlpha = DKCrutch:CreateSlider(L.CONFIG_WEAPON_ALPHA, DKCrutch.configPanel, .0, 1, .1)
@@ -416,11 +436,11 @@ function DKCrutch:CreateConfig()
 			DKCrutch.weaponFrame:SetAlpha(value)
 		end
 	end)
-	weaponAlpha:SetPoint("TOPLEFT",200,-378)
+	weaponAlpha:SetPoint("TOPLEFT",200,-398)
 	weaponAlpha:Show()

 	local weaponDisableBtn = DKCrutch:CreateCheckButton(L.CONFIG_DISABLE_WEAPON, DKCrutch.configPanel, DKCrutchDB, "weaponDisabled", false)
-	weaponDisableBtn:SetPoint('TOPLEFT', 10, -398)
+	weaponDisableBtn:SetPoint('TOPLEFT', 10, -418)

 	local ResetBtn = DKCrutch:CreateButton(L.CONFIG_RESET_POSITIONS, DKCrutch.configPanel)
 	ResetBtn:SetWidth(160)
diff --git a/locales/enUS.lua b/locales/enUS.lua
index 6c755c9..af547c2 100644
--- a/locales/enUS.lua
+++ b/locales/enUS.lua
@@ -11,6 +11,7 @@ if GetLocale() then
 	L.CONFIG_DISABLE_ADVISOR = "Disable advisor"
 	L.CONFIG_RUNE_TRACKER_SCALE = "Rune tracker scale"
 	L.CONFIG_RUNE_TRACKER_ALPHA = "Rune tracker alpha"
+	L.CONFIG_DISABLE_RUNE = "Disable Rune tracker"
 	L.CONFIG_RESET_POSITIONS = "Reset frame positions"
 	L.CONFIG_PROC_SCALE = "Proc tracker scale"
 	L.CONFIG_PROC_ALPHA = "Proc tracker alpha"
@@ -21,7 +22,7 @@ if GetLocale() then
 	L.CONFIG_DEBUFF_SCALE = "Debuff tracker scale"
 	L.CONFIG_DEBUFF_ALPHA = "Debuff tracker alpha"
 	L.CONFIG_DISABLE_DEBUFF = "Disable debuff tracker"
-	L.CONFIG_WEAPON_SCALE = "Runeforge tracker scale"
-	L.CONFIG_WEAPON_ALPHA = "Runeforge tracker alpha"
-	L.CONFIG_DISABLE_WEAPON = "Disable Runeforge tracker"
+	L.CONFIG_WEAPON_SCALE = "Weapon proc tracker scale"
+	L.CONFIG_WEAPON_ALPHA = "Weapon proc tracker alpha"
+	L.CONFIG_DISABLE_WEAPON = "Disable weapon proc tracker"
 end
\ No newline at end of file