Quantcast

localization fix to docks

Steven Jackson [07-18-14 - 14:48]
localization fix to docks
Filename
Interface/AddOns/SVUI/packages/dock/common/toolbar.lua
diff --git a/Interface/AddOns/SVUI/packages/dock/common/toolbar.lua b/Interface/AddOns/SVUI/packages/dock/common/toolbar.lua
index 8b7e4a4..da4d3b2 100644
--- a/Interface/AddOns/SVUI/packages/dock/common/toolbar.lua
+++ b/Interface/AddOns/SVUI/packages/dock/common/toolbar.lua
@@ -24,21 +24,18 @@ MOD.DefaultWindow = false
 local tinsert, wipe, pairs, ipairs, unpack, pcall, select = tinsert, table.wipe, pairs, ipairs, unpack, pcall, select;
 local format, gsub, strfind, strmatch, tonumber = format, gsub, strfind, strmatch, tonumber;
 local TOOL_DATA = {
-	["Alchemy"] 		= {0,0.25,0,0.25}, 					-- PRO-ALCHEMY
-    ["Archaeology"] 	= {0.25,0.5,0,0.25,"Survey"}, 		-- PRO-ARCHAELOGY
-    ["Blacksmithing"] 	= {0.5,0.75,0,0.25}, 				-- PRO-BLACKSMITH
-    ["Cooking"] 		= {0.75,1,0,0.25,"Cooking Fire"}, 	-- PRO-COOKING
-    ["Enchanting"] 		= {0,0.25,0.25,0.5,"Disenchant"}, 	-- PRO-ENCHANTING
-    ["Engineering"] 	= {0.25,0.5,0.25,0.5}, 				-- PRO-ENGINEERING
-    ["First Aid"] 		= {0.5,0.75,0.25,0.5}, 				-- PRO-FIRSTAID
-    ["Herbalism"] 		= {0.75,1,0.25,0.5,"Lifeblood"}, 	-- PRO-HERBALISM
-    ["Inscription"] 	= {0,0.25,0.5,0.75,"Milling"}, 		-- PRO-INSCRIPTION
-    ["Jewelcrafting"] 	= {0.25,0.5,0.5,0.75,"Prospecting"},-- PRO-JEWELCRAFTING
-    ["Leatherworking"] 	= {0.5,0.75,0.5,0.75}, 				-- PRO-LEATHERWORKING
-    ["Mining"] 			= {0.75,1,0.5,0.75}, 				-- PRO-MINING
-    ["Skinning"] 		= {0,0.25,0.75,1}, 					-- PRO-SKINNING
-    ["Tailoring"] 		= {0.25,0.5,0.75,1}, 				-- PRO-TAILORING
-    ["Default"] 		= {0.5,0.75,0,0.25}
+	[171] 	= {0,0.25,0,0.25}, 					-- PRO-ALCHEMY
+    [794] 	= {0.25,0.5,0,0.25,"Survey"}, 		-- PRO-ARCHAELOGY
+    [164] 	= {0.5,0.75,0,0.25}, 				-- PRO-BLACKSMITH
+    [184] 	= {0.75,1,0,0.25,"Cooking Fire"}, 	-- PRO-COOKING
+    [333] 	= {0,0.25,0.25,0.5,"Disenchant"}, 	-- PRO-ENCHANTING
+    [202] 	= {0.25,0.5,0.25,0.5}, 				-- PRO-ENGINEERING
+    [129] 	= {0.5,0.75,0.25,0.5}, 				-- PRO-FIRSTAID
+    [773] 	= {0,0.25,0.5,0.75,"Milling"}, 		-- PRO-INSCRIPTION
+    [755] 	= {0.25,0.5,0.5,0.75,"Prospecting"},-- PRO-JEWELCRAFTING
+    [165] 	= {0.5,0.75,0.5,0.75}, 				-- PRO-LEATHERWORKING
+    [186] 	= {0.75,1,0.5,0.75}, 				-- PRO-MINING
+    [197] 	= {0.25,0.5,0.75,1}, 				-- PRO-TAILORING
 }
 --[[
 ##########################################################
@@ -264,9 +261,10 @@ do
 		SuperDockMacroBar:Size(width, height)
 	end

-	local function CreateMacroToolButton(proName, itemID, size)
+	local function CreateMacroToolButton(proName, proID, itemID, size)
 		if proName == "Mining" then proName = "Smelting" end
-		local data = TOOL_DATA[proName] or TOOL_DATA["Default"]
+		local data = TOOL_DATA[proID]
+		if(not data) then return end
 		local button = CreateFrame("Button", ("%s_MacroBarButton"):format(itemID), SuperDockMacroBar, "SecureActionButtonTemplate")
 		button:Size(size, size)
 		AddMacroTool(button)
@@ -333,37 +331,30 @@ do
 			hearth.ExtraSpell = "Zen Pilgrimage"
 		end

-		local proName
-		local prof1, prof2, archaeology, _, cooking, firstAid = GetProfessions();
-
+		local proName, proID
+		local prof1, prof2, archaeology, _, cooking, firstAid = GetProfessions()
 		if(firstAid ~= nil) then
-			proName, _ = GetProfessionInfo(firstAid)
-			if(proName ~= "Herbalism" and proName ~= "Skinning") then
-				CreateMacroToolButton(proName, firstAid, size)
-			end
+			proName, _, _, _, _, _, proID = GetProfessionInfo(firstAid)
+			CreateMacroToolButton(proName, proID, firstAid, size)
 		end
 		if(archaeology ~= nil) then
-			proName, _ = GetProfessionInfo(archaeology)
-			if(proName ~= "Herbalism" and proName ~= "Skinning") then
-				CreateMacroToolButton(proName, archaeology, size)
-			end
+			proName, _, _, _, _, _, proID = GetProfessionInfo(archaeology)
+			CreateMacroToolButton(proName, proID, archaeology, size)
 		end
 		if(cooking ~= nil) then
-			proName, _ = GetProfessionInfo(cooking)
-			if(proName ~= "Herbalism" and proName ~= "Skinning") then
-				CreateMacroToolButton(proName, cooking, size)
-			end
+			proName, _, _, _, _, _, proID = GetProfessionInfo(cooking)
+			CreateMacroToolButton(proName, proID, cooking, size)
 		end
 		if(prof2 ~= nil) then
-			proName, _ = GetProfessionInfo(prof2)
-			if(proName ~= "Herbalism" and proName ~= "Skinning") then
-				CreateMacroToolButton(proName, prof2, size)
+			proName, _, _, _, _, _, proID = GetProfessionInfo(prof2)
+			if(proID ~= 182 and proID ~= 393) then
+				CreateMacroToolButton(proName, proID, prof2, size)
 			end
 		end
 		if(prof1 ~= nil) then
-			proName, _ = GetProfessionInfo(prof1)
-			if(proName ~= "Herbalism" and proName ~= "Skinning") then
-				CreateMacroToolButton(proName, prof1, size)
+			proName, _, _, _, _, _, proID = GetProfessionInfo(prof1)
+			if(proID ~= 182 and proID ~= 393) then
+				CreateMacroToolButton(proName, proID, prof1, size)
 			end
 		end