Quantcast

FIXED: GroupTools updated to reflect changes to Blizzard API.

F16Gaming [09-03-12 - 17:02]
FIXED: GroupTools updated to reflect changes to Blizzard API.
Filename
CommandManager.lua
GroupTools.lua
locales/enUS.lua
locales/svSE.lua
diff --git a/CommandManager.lua b/CommandManager.lua
index 7ca5765..f257d1e 100644
--- a/CommandManager.lua
+++ b/CommandManager.lua
@@ -1034,6 +1034,8 @@ CM:Register({"dungeondifficulty", "dungeondiff", "dd"}, PM.Access.Groups.User.Le
 		diff = GT.Difficulty.Dungeon.Normal
 	elseif diff:match("^h") then
 		diff = GT.Difficulty.Dungeon.Heroic
+	elseif diff:match("^c") then
+		diff = GT.Difficulty.Dungeon.Challenge
 	elseif tonumber(diff) then
 		diff = tonumber(diff)
 	else
diff --git a/GroupTools.lua b/GroupTools.lua
index 58f85d1..24d66c6 100644
--- a/GroupTools.lua
+++ b/GroupTools.lua
@@ -32,9 +32,9 @@ local GetRaidRosterInfo = GetRaidRosterInfo
 local UnitIsGroupLeader = UnitIsGroupLeader
 local GetNumGroupMembers = GetNumGroupMembers
 local UnitIsGroupAssistant = UnitIsGroupAssistant
-local GetDungeonDifficulty = GetDungeonDifficulty
-local SetDungeonDifficulty = SetDungeonDifficulty
 local GetNumSubGroupMembers = GetNumSubgroupMembers
+local GetDungeonDifficultyID = GetDungeonDifficultyID
+local SetDungeonDifficultyID = SetDungeonDifficultyID

 local C = Command
 local L = C.LocaleManager
@@ -53,8 +53,10 @@ C.GroupTools = {
 		Dungeon = {
 			[1] = "GT_DUNGEON_NORMAL",
 			[2] = "GT_DUNGEON_HEROIC",
+			[3] = "GT_DUNGEON_CHALLENGE",
 			Normal = 1,
-			Heroic = 2
+			Heroic = 2,
+			Challenge = 3
 		},
 		Raid = {
 			[1] = "GT_RAID_N10",
@@ -203,13 +205,13 @@ function GT:SetDungeonDifficulty(diff)
 	diff = tonumber(diff)
 	if not diff then return false, "GT_DIFF_INVALID", {tostring(diff)} end
 	if not CET:HasValue(self.Difficulty.Dungeon, diff) then return false, "GT_DIFF_INVALID", {tostring(diff)} end
-	if diff == GetDungeonDifficulty() then return false, "GT_DD_DUPE", {self:GetFriendlyDungeonDifficulty(diff)} end
-	SetDungeonDifficulty(diff)
+	if diff == GetDungeonDifficultyID() then return false, "GT_DD_DUPE", {self:GetFriendlyDungeonDifficulty(diff)} end
+	SetDungeonDifficultyID(diff)
 	return "GT_DD_SUCCESS", {self:GetFriendlyDungeonDifficulty(diff)}
 end

 function GT:GetDungeonDifficultyString(diff)
-	return self.Difficulty.Dungeon[tonumber(diff) or GetDungeonDifficulty()]
+	return self.Difficulty.Dungeon[tonumber(diff) or GetDungeonDifficultyID()]
 end

 --- Get a string representation of the dungeon difficulty.
@@ -217,7 +219,7 @@ end
 -- @return String representation of dungeon difficulty.
 --
 function GT:GetFriendlyDungeonDifficulty(diff)
-	return L(self.Difficulty.Dungeon[tonumber(diff) or GetDungeonDifficulty()])
+	return L(self.Difficulty.Dungeon[tonumber(diff) or GetDungeonDifficultyID()])
 end

 --- Set the raid difficulty.
diff --git a/locales/enUS.lua b/locales/enUS.lua
index bf601d1..142bccb 100644
--- a/locales/enUS.lua
+++ b/locales/enUS.lua
@@ -672,6 +672,7 @@ local L = {

 	GT_DUNGEON_NORMAL = "Normal",
 	GT_DUNGEON_HEROIC = "Heroic",
+	GT_DUNGEON_CHALLENGE = "Challenge",
 	GT_RAID_N10 = "Normal (10)",
 	GT_RAID_N25 = "Normal (25)",
 	GT_RAID_H10 = "Heroic (10)",
diff --git a/locales/svSE.lua b/locales/svSE.lua
index 1527aaa..cd9e0c6 100644
--- a/locales/svSE.lua
+++ b/locales/svSE.lua
@@ -672,6 +672,7 @@ local L = {

 	GT_DUNGEON_NORMAL = "Normal",
 	GT_DUNGEON_HEROIC = "Heroic",
+	GT_DUNGEON_CHALLENGE = "Challenge",
 	GT_RAID_N10 = "Normal (10)",
 	GT_RAID_N25 = "Normal (25)",
 	GT_RAID_H10 = "Heroic (10)",