merging assembler's changes

manavortex [02-16-18 - 08:21]
merging assembler's changes
Filename
IIfA/CharBagSpaceTooltip.lua
IIfA/IIfA.lua
IIfA/IIfA.txt
IIfA/IIfABackpack.lua
IIfA/IIfA_xml_adapter.lua
diff --git a/IIfA/CharBagSpaceTooltip.lua b/IIfA/CharBagSpaceTooltip.lua
index a44dc1a..6b1a73c 100644
--- a/IIfA/CharBagSpaceTooltip.lua
+++ b/IIfA/CharBagSpaceTooltip.lua
@@ -102,6 +102,10 @@ function CharBagFrame:FillCharAndBank()
 	self:SetQty(self.totControl, "spaceMax", spaceMax)
 end

+-- add iteration for house chests
+-- if GetBagSize == 0, you've run out of chests to iterate (break out of loop)
+-- /script for i=BAG_HOUSE_BANK_ONE,BAG_MAX_VALUE do d(i .. GetCollectibleName(GetCollectibleForHouseBankBag(i))) end
+
 function CharBagFrame:RepaintSpaceUsed()
 	-- loop through characters
 	local assets = self.parent.assets
diff --git a/IIfA/IIfA.lua b/IIfA/IIfA.lua
index e8545dd..8e291fa 100644
--- a/IIfA/IIfA.lua
+++ b/IIfA/IIfA.lua
@@ -3,6 +3,7 @@
 --Original Author: Vicster0
 --v0.8
 -- v1.x and 2.x - rewrites by ManaVortex & AssemblerManiac
+-- v3.x - new features mainly by ManaVortex
 --[[
 	Collects inventory data for all characters on a single account
 	including the shared bank and makes this information available
@@ -20,7 +21,7 @@ if IIfA == nil then IIfA = {} end
 --local IIfA = IIfA

 IIfA.name 				= "Inventory Insight"
-IIfA.version 			= "2.20"
+IIfA.version 			= "3.04"
 IIfA.author 			= "AssemblerManiac & manavortex"
 IIfA.defaultAlertSound 	= nil
 IIfA.colorHandler 		= nil
@@ -132,25 +133,25 @@ end

 function IIfA:DebugOut(output, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
 	if not IIfA.data.bDebug then return end
-	if a10 then
+	if a10 then
 		d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10))
-	elseif a9 then
+	elseif a9 then
 		d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7, a8, a9))
-	elseif a8 then
+	elseif a8 then
 		d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7, a8))
-	elseif a7 then
+	elseif a7 then
 		d(zo_strformat(output, a1, a2, a3, a4, a5, a6, a7))
-	elseif a6 then
+	elseif a6 then
 		d(zo_strformat(output, a1, a2, a3, a4, a5, a6))
-	elseif a5 then
+	elseif a5 then
 		d(zo_strformat(output, a1, a2, a3, a4, a5))
-	elseif a4 then
+	elseif a4 then
 		d(zo_strformat(output, a1, a2, a3, a4))
 	elseif a3 then
 		d(zo_strformat(output, a1, a2, a3))
 	elseif a2 then
 		d(zo_strformat(output, a1, a2))
-	elseif a1 then
+	elseif a1 then
 		d(zo_strformat(output, a1))
 	elseif output then
 		d(zo_strformat(output))
diff --git a/IIfA/IIfA.txt b/IIfA/IIfA.txt
index 220bd29..d1e3532 100644
--- a/IIfA/IIfA.txt
+++ b/IIfA/IIfA.txt
@@ -1,6 +1,6 @@
 ## Title: Inventory Insight
 ## Author: manavortex, AssemblerManiac
-## Version: 3.02
+## Version: 3.04
 ## APIVersion: 100022
 ## SavedVariables: IIfA_Settings IIfA_Data
 ## OptionalDependsOn: libFilters pChat
diff --git a/IIfA/IIfABackpack.lua b/IIfA/IIfABackpack.lua
index 00e85d9..4342d05 100644
--- a/IIfA/IIfABackpack.lua
+++ b/IIfA/IIfABackpack.lua
@@ -180,7 +180,6 @@ local function getColoredString(color, s)
 	return c:Colorize(s)
 end
 local function getQualityDict()
-
 	if nil == qualityDictionary then
 		qualityDictionary = {}
 		qualityDictionary["Any"] = 99
@@ -193,6 +192,9 @@ local function getQualityDict()
 	end
 	return qualityDictionary
 end
+function IIfA:getQualityDict()
+	return qualityDictionary or getQualityDict()
+end

 local function matchFilter(itemName, itemLink)
     local ret = true
@@ -743,7 +745,8 @@ function IIfA:SetupBackpack()
 		local comboBox, i

 		IIFA_GUI_Header_Dropdown_Quality.comboBox = IIFA_GUI_Header_Dropdown_Quality.comboBox or ZO_ComboBox_ObjectFromContainer(IIFA_GUI_Header_Dropdown_Quality)
-
+		local qualityDict = getQualityDict()
+
 		local validChoices =  {}
 		table.insert(validChoices, "Any")
 		table.insert(validChoices, getColoredString(ITEM_QUALITY_TRASH, "Junk"))
@@ -765,12 +768,12 @@ function IIfA:SetupBackpack()
 		for i = 1, #validChoices do
 			entry = comboBox:CreateItemEntry(validChoices[i], OnItemSelect)
 			comboBox:AddItem(entry)
-			if getQualityDict()[validChoices[i]] == IIfA:GetInventoryListFilterQuality() then
+			if qualityDict[validChoices[i]] == IIfA:GetInventoryListFilterQuality() then
 				comboBox:SetSelectedItem(validChoices[i])
 			end
 		end

-		return IIFA_GUI_Header_Dropdown
+		-- return IIFA_GUI_Header_Dropdown
 	end

 	IIfA.InventoryListFilter = IIfA.data.in2DefaultInventoryFrameView
diff --git a/IIfA/IIfA_xml_adapter.lua b/IIfA/IIfA_xml_adapter.lua
index 8f69c4b..10b3b1d 100644
--- a/IIfA/IIfA_xml_adapter.lua
+++ b/IIfA/IIfA_xml_adapter.lua
@@ -157,16 +157,23 @@ function IIfA:GuiSetupDropdown(dropdown)
 end

 function IIfA:GuiSetupQualityDropdown(dropdown)
-	local selectedItem = IIfA:GetInventoryListFilterQuality()
-	dropdown.comboBox:SetSelectedItem(selectedItem)
+	local selectedQuality = IIfA:GetInventoryListFilterQuality()
+	local qualityDict = IIfA:getQualityDict()
+
+	for choice, value in pairs(qualityDict) do
+		if value == selectedQuality then
+			dropdown.comboBox:SetSelectedItem(choice)
+			break
+		end
+	end
 end

 -- click functions
 function IIfA:GuiOnFilterButton(control, mouseButton, filterGroup, filterTypes, filterTypeNames)
 	-- identify if this is main or sub filter clicked
-
+
 	local b_isMain = control:GetName():find("Sub") == nil
-
+
 	if mouseButton == MOUSE_BUTTON_INDEX_RIGHT then
 		if b_isMain then
 			IIfA.LastFilterControl = control
@@ -174,10 +181,10 @@ function IIfA:GuiOnFilterButton(control, mouseButton, filterGroup, filterTypes,
 		else
 			IIfA.LastSubFilterControl = control
 			local parentIdx = control:GetParent():GetName():gsub("IIFA_GUI_Header_Subfilter_", "")
-			local parentControl = IIFA_GUI_Header_Filter:GetChild(parentIdx+1)
+			local parentControl = IIFA_GUI_Header_Filter:GetChild(parentIdx+1)
 			return IIfA:GuiOnFilterButton(parentControl, MOUSE_BUTTON_INDEX_LEFT, parentControl.filterText)
 		end
-	end
+	end

 	if b_isMain then
 		if IIfA.LastFilterControl ~= nil then
@@ -488,6 +495,7 @@ function IIfA:RePositionFrame(settings)
 	end
 	IIFA_GUI_Header_Dropdown:SetHidden(bMinimize)
 	IIFA_GUI_Search:SetHidden(bMinimize)
+	IIFA_GUI_Header_Dropdown_Quality:SetHidden(bMinimize)
 	IIFA_GUI_Header_GoldButton:SetHidden(bMinimize)
 	IIFA_GUI_Header_BagButton:SetHidden(bMinimize)
 	IIFA_GUI_Header_SortBar:SetHidden(bMinimize)
@@ -512,6 +520,8 @@ function IIfA:RePositionFrame(settings)
 		IIFA_GUI_Header_Maximize:SetHidden(false)
 	else
    		IIFA_GUI:SetDimensionConstraints(IIfA.minWidth, 300, -1, 1400)
+--		IIfA:SetInventoryListFilterQuality(IIfA:GetInventoryListFilterQuality())
+
 		if settings.docked then
 			-- no resizing handles
 			IIFA_GUI:SetResizeHandleSize(0)
@@ -572,7 +582,7 @@ function IIfA:RePositionFrame(settings)
 	if not settings.hidden then
 		IIfA:GuiResizeScroll()
 		IIfA:RefreshInventoryScroll()
-
+
 	end
 	IIFA_GUI:SetHidden(settings.hidden)
 end