Fixed errors regarding showing checkmark and parsing cookbook

Wobin [04-10-14 - 13:15]
Fixed errors regarding showing checkmark and parsing cookbook
Filename
SousChef.lua
diff --git a/SousChef.lua b/SousChef.lua
index ea5821b..31815d8 100644
--- a/SousChef.lua
+++ b/SousChef.lua
@@ -58,12 +58,14 @@ local function AddRankToSlot(row, isGrid)
 		end
 	else
 		if GetItemType(bagId, slotIndex) == ITEMTYPE_RECIPE then
-			if Cookbook[GetItemName(bagId, slotIndex):lower():gsub(" ","")] and settings.checkKnown == "known" then
+			if (Cookbook[GetItemName(bagId, slotIndex):lower():gsub(" ","")] and settings.checkKnown == "known") or
+			   (not Cookbook[GetItemName(bagId, slotIndex):lower():gsub(" ","")] and settings.checkKnown == "unknown")then
 				rankIcon:SetColor(1,1,1)
 				rankIcon:SetTexture(CANLEARN)
 				rankIcon:SetHidden(false)
 			end
 		end
+
 	end
 end

@@ -80,7 +82,7 @@ local function CheckNow(self)
     end
 end

-local bufferTime = 50 --ms
+local bufferTime = 100 --ms
 local elapsedTime = 0

 function SousChefOnUpdate()
@@ -119,10 +121,10 @@ end
 local function ParseRecipes()
 	local lists = GetNumRecipeLists()
 	for listIndex = 1, lists do
-		local name, count = GetRecipeListInfo(i)
+		local name, count = GetRecipeListInfo(listIndex)
 		for recipeIndex = 1, count do
 			if GetRecipeInfo(listIndex, recipeIndex) then
-				Cookbook[(GetRecipeResultItemInfo(listIndex, recipeIndex)):gsub(" ","") .. "recipe"] = true
+				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,7 +160,7 @@ local function SousChef_Loaded(eventCode, addOnName)
 	d("Loading Sous Chef")
 	local defaults = {
 		watching = true,
-		checkKnown = "known",
+		checkKnown = "unknown",
 		colour = {1, 1, 1}
 	}

@@ -178,6 +180,14 @@ local function SousChef_Loaded(eventCode, addOnName)
     		end
     	end
 	end
+	SLASH_COMMANDS["/SousDebug"] = function()
+	d("Debug mode on")
+	SCCookbook = Cookbook
+	SCPantry = Pantry
+	SCslotList = slotList
+	SCsettings = settings
+	end
+

 	SousChefCreateSettings()