Added in alt character view. Will show a faded tick if an alt character knows the recipe and you have 'unknown' set on

Wobin [04-11-14 - 11:50]
Added in alt character view. Will show a faded tick if an alt character knows the recipe and you have 'unknown' set on
Filename
SousChef.lua
diff --git a/SousChef.lua b/SousChef.lua
index 0ad5e85..b8a6ae8 100644
--- a/SousChef.lua
+++ b/SousChef.lua
@@ -34,6 +34,7 @@ end

 local function MatchInGlobalCookbook(bag, slot)
 	return settings.Cookbook[GetItemName(bag,slot):lower():gsub(" ", "")]
+end

 local function AddRankToSlot(row, isGrid)
 	local bagId = row.dataEntry.data.bagId
@@ -71,8 +72,8 @@ local function AddRankToSlot(row, isGrid)
 			   (not match and settings.checkKnown == "unknown")then
 				rankIcon:SetTexture(CANLEARN)
 				rankIcon:SetHidden(false)
-				if not match and gmatch and settings.checkKnown == "unknown" then
-					rankIcon:SetColor(1,1,1,0.5)
+				if not match and gmatch and settings.checkKnown == "unknown" and settings.markAlt then
+					rankIcon:SetColor(1,1,1,0.2)
 				else
 					rankIcon:SetColor(1,1,1,1)
 				end
@@ -138,6 +139,7 @@ local function ParseRecipes()
 		for recipeIndex = 1, count do
 			if GetRecipeInfo(listIndex, recipeIndex) then
 				Cookbook[(GetRecipeResultItemInfo(listIndex, recipeIndex)):gsub(" ",""):lower() .. "recipe"] = true
+				settings.Cookbook[(GetRecipeResultItemInfo(listIndex, recipeIndex)):gsub(" ",""):lower() .. "recipe"] = true
 				local _, _, ingredientCount, level = GetRecipeInfo(listIndex, recipeIndex)
 				for ingredientIndex = 1, ingredientCount do
 					local link = GetItemID(GetRecipeIngredientItemLink(listIndex, recipeIndex, ingredientIndex, LINK_STYLE_NORMAL))
@@ -158,9 +160,9 @@ local function SousChefCreateSettings()
 						"How do you want Sous Chef to indicate your knowledge of a recipe?",
 						{"known", "unknown"}, function() return settings.checkKnown end,
 						function(self,valueString) settings.checkKnown = valueString end)
-	LAM:AddCheckBox(panel, "markAltKnows", "Indicate if an alt knows the recipe on unknown recipes. Will only work if the above setting is set to 'unknown'",
+	LAM:AddCheckbox(panel, "markAltKnows", "Alternate Character Check", "Indicate if an alt knows the recipe on unknown recipes. Will only work if the above setting is set to 'unknown'",
 						function() return settings.markAlt end,
-						function() settings.markAlt = not settings.markAlt end)
+						function(value) settings.markAlt = not settings.markAlt end)
 	LAM:AddColorPicker(panel, "setColour", "Indicator colour",
 						"Allows you to set the colour of the indicator",
 						function() return settings.colour[1], settings.colour[2], settings.colour[3] end,
@@ -174,15 +176,17 @@ local function SousChef_Loaded(eventCode, addOnName)
 	if(addOnName ~= "SousChef") then
         return
     end
-	d("Loading Sous Chef")
+
 	local defaults = {
 		watching = true,
 		checkKnown = "unknown",
-		markAlt = false,
-		colour = {1, 1, 1}
+		markAlt = false,
+		colour = {1, 1, 1},
+		Cookbook = {}
 	}
-
-	settings = ZO_SavedVars:New("SousChef_Settings", 1, nil, defaults)
+
+	--settings = ZO_SavedVars:New("SousChef_Settings", 1, nil, defaults)
+	settings = ZO_SavedVars:NewAccountWide("SousChef_Settings", 1, "Cookbook", defaults)

     SLASH_COMMANDS["/SousChef"] = function()
     	settings.watching = not settings.watching
@@ -203,7 +207,7 @@ local function SousChef_Loaded(eventCode, addOnName)
 	SCCookbook = Cookbook
 	SCPantry = Pantry
 	SCslotList = slotList
-	SCsettings = settings
+	SCsettings = settings
 	end