Added toggle for the provisioning sorting for you weird types

Wobin [05-18-14 - 16:05]
Added toggle for the provisioning sorting for you weird types
Made the Shopping List checkmark list who has it marked, and fade if on an alt, like the recipe knowledge checkmarks
Filename
Provisioning.lua
SousChef.lua
diff --git a/Provisioning.lua b/Provisioning.lua
index 661eaef..c0a8ce4 100644
--- a/Provisioning.lua
+++ b/Provisioning.lua
@@ -59,7 +59,7 @@ function SousChef:HookRecipeTreeFunction()
                 SousChef.hookedProvisioningFunction(...)
                 local link = zo_strformat(SI_TOOLTIP_ITEM_NAME, GetRecipeResultItemLink(data.recipeListIndex, data.recipeIndex, LINK_STYLE_BRACKETS))
                 if link then
-                    SousChef:AddNotifier(control, type(SousChef.settings.shoppingList[link]) == "table" and next(SousChef.settings.shoppingList[link]))
+                    SousChef:AddNotifier(control, type(SousChef.settings.shoppingList[link]) == "table" and u.TableKeyConcat(SousChef.settings.shoppingList[link]))
                 end
             end
         end
@@ -67,7 +67,7 @@ function SousChef:HookRecipeTreeFunction()
     PROVISIONER:DirtyRecipeTree()
 end

-function SousChef:getMarkedIcon(row)
+function SousChef:getMarkedIcon(row, marked)
     local rankIcon = SousChef.slotLines[row:GetName()]
     if(not rankIcon) then
         rankIcon =  WINDOW_MANAGER:CreateControl(row:GetName() .. "SousChef", row, CT_TEXTURE)
@@ -76,19 +76,27 @@ function SousChef:getMarkedIcon(row)
         rankIcon:SetDimensions(20, 20)
         rankIcon:SetAnchor(RIGHT, row, LEFT, -10)
         rankIcon:SetMouseEnabled(true)
-        rankIcon:SetHandler("OnMouseEnter", function()
-                                                InitializeTooltip(InformationTooltip, rankIcon, RIGHT, -15, 0)
-                                                InformationTooltip:AddLine("Shopping List")
-                                            end)
         rankIcon:SetHandler("OnMouseExit", function()
                                                 ClearTooltip(InformationTooltip)
                                             end)
+    end
+
+    if marked then
+        rankIcon:SetHandler("OnMouseEnter", function()
+                                        InitializeTooltip(InformationTooltip, rankIcon, RIGHT, -15, 0)
+                                        InformationTooltip:AddLine("Marked by: " .. marked)
+                                    end)
+        if not marked:find(GetUnitName("player")) then
+            rankIcon:SetColor(1,1,1,0.2)
+        else
+            rankIcon:SetColor(1,1,1,1)
+        end
     end
     return rankIcon
 end

 function SousChef:AddNotifier(control, marked)
-    local icon = self:getMarkedIcon(control)
+    local icon = self:getMarkedIcon(control, marked)
     if marked then
         icon:SetHidden(false)
     else
@@ -130,12 +138,14 @@ function SousChef:UnhookRecipeTree()
 end

 function SousChef:HookGetRecipeInfo()
-    SousChef.OldRefreshRecipeTree = ZO_Provisioner.RefreshRecipeTree
-    ZO_Provisioner.RefreshRecipeTree =
-        function()
-            return SousChef.RefreshRecipeTree(PROVISIONER)
-        end

+    if SousChef.settings.sortProvisioningTable then
+        SousChef.OldRefreshRecipeTree = ZO_Provisioner.RefreshRecipeTree
+        ZO_Provisioner.RefreshRecipeTree =
+            function()
+                return SousChef.RefreshRecipeTree(PROVISIONER)
+            end
+    end
     SousChef.OldZO_ProvisionerRow_GetTextColor = ZO_ProvisionerRow_GetTextColor
     ZO_ProvisionerRow_GetTextColor =
         function(self)
diff --git a/SousChef.lua b/SousChef.lua
index 72ba95f..8bb9a6c 100644
--- a/SousChef.lua
+++ b/SousChef.lua
@@ -131,7 +131,10 @@ local function SousChefCreateSettings()
     (NOTE: please file a typo bug report with Zenimax if you find recipes that don't match the results exactly, with the recipe/result names)]],
                         function() return SousChef.settings.experimentalMatch end,
                         function(value) SousChef.settings.experimentalMatch = not SousChef.settings.experimentalMatch end)
-
+	LAM:AddCheckbox(panel, "sortProvisioning", "Sort the Provisioning Table", "Will sort the provisioning table by Rank, Quality, then Name",
+						function() return SousChef.settings.sortProvisioningTable end,
+						function(value) SousChef.settings.sortProvisioningTable = not SousChef.settings.sortProvisioningTable end, true, "Will not sort within ranks, eg 1-20 will be somewhat jumbled")
+
 	LAM:AddHeader(panel, "SousChef_Tooltip", "Tooltip Options")

 	LAM:AddCheckbox(panel, "showOnClickOnly", "Show in Tooltip only on click", "Only show details on a left click to save space (requires /reloadui)",
@@ -224,7 +227,8 @@ local function SousChef_Loaded(eventCode, addOnName)
         showCounts = true,
         shoppingList = {},
         onlyShowShopping = false,
-        qualityChecked = false
+        qualityChecked = false,
+        sortProvisioningTable = true
 	}

     SousChef.settings = ZO_SavedVars:NewAccountWide("SousChef_Settings", 9, GetCVar("Language.2"), defaults)