Quantcast

Localized socket colors

Kevin Lyles [08-10-10 - 07:49]
Localized socket colors
Filename
Locales/enUS/gems.lua
WeightsWatcher.lua
diff --git a/Locales/enUS/gems.lua b/Locales/enUS/gems.lua
index 7ec2bfa..a8b9ccb 100644
--- a/Locales/enUS/gems.lua
+++ b/Locales/enUS/gems.lua
@@ -582,3 +582,24 @@ ww_gemColorDisplayNames = {
 	["yellow"] = "Yellow",
 	["N/A"] = "N/A",
 }
+
+ww_localizedSocketColors = {
+	["blue"] = "blue",
+	["meta"] = "meta",
+	["prismatic"] = "prismatic",
+	["red"] = "red",
+	["yellow"] = "yellow",
+}
+
+ww_englishSocketColors = {}
+for k, v in pairs(ww_localizedSocketColors) do
+	ww_englishSocketColors[v] = k
+end
+
+ww_socketColorDisplayNames = {
+	[ww_localizedSocketColors["blue"]] = "Blue",
+	[ww_localizedSocketColors["meta"]] = "Meta",
+	[ww_localizedSocketColors["prismatic"]] = "Prismatic",
+	[ww_localizedSocketColors["red"]] = "Red",
+	[ww_localizedSocketColors["yellow"]] = "Yellow",
+}
diff --git a/WeightsWatcher.lua b/WeightsWatcher.lua
index 24f8644..ec667be 100644
--- a/WeightsWatcher.lua
+++ b/WeightsWatcher.lua
@@ -55,7 +55,7 @@ ww_itemCacheMetatable = {
 		if #(sockets) > 0 then
 			socketBonusActive = true
 			for i = 1, #(sockets) do
-				if not gemStats[i] or not WeightsWatcher.matchesSocket(gemStats[i][1][1], sockets[i]) then
+				if not gemStats[i] or not WeightsWatcher.matchesSocket(gemStats[i][1][1], ww_englishSocketColors[sockets[i]]) then
 					socketBonusActive = false
 					break
 				end
@@ -129,6 +129,7 @@ ww_weightIdealCacheWeightMetatable = {
 		local bestGems, bestGemsIgnoreSocket = {}, {}
 		local gemScore, gemScoreIgnoreSocket = socketBonusWeight, 0
 		for _, color in pairs(itemStats.sockets) do
+			color = ww_englishSocketColors[color]
 			table.insert(bestGems, tbl.bestGems[color])
 			gemScore = gemScore + tbl.bestGems[color .. "Score"]
 			if breakSocketColors and color ~= "meta" then
@@ -638,7 +639,7 @@ function WeightsWatcher.displayItemStats(tooltip, ttname)
 			if #(bareItemInfo.sockets) > 0 then
 				tooltip:AddLine("Sockets:")
 				for _, stat in pairs(bareItemInfo.sockets) do
-					tooltip:AddLine("  " .. stat)
+					tooltip:AddLine("  " .. ww_socketColorDisplayNames[stat])
 				end
 				if bareItemInfo.socketBonusStat then
 					if itemInfo.socketBonusActive then