Merge pull request #41 from AssemblerManiac/master

manavortex [04-17-18 - 18:27]
Merge pull request #41 from AssemblerManiac/master

set height of main filter dropdown to 2x normal; fix house chest/house tooltip colors; API ver for Live/PTS
Filename
IIfA/CharBagSpaceTooltip.lua
IIfA/IIfA.lua
IIfA/IIfA.txt
IIfA/IIfABackpack.lua
IIfA/IIfAMenu.lua
IIfA/IIfASettingsAdapter.lua
IIfA/IIfATooltip.lua
diff --git a/IIfA/CharBagSpaceTooltip.lua b/IIfA/CharBagSpaceTooltip.lua
index dcb3978..f494e87 100644
--- a/IIfA/CharBagSpaceTooltip.lua
+++ b/IIfA/CharBagSpaceTooltip.lua
@@ -110,11 +110,11 @@ function CharBagFrame:FillCharAndBank()
 		if IsCollectibleUnlocked(GetCollectibleForHouseBankBag(ctr)) then
 			if bInOwnedHouse then
 				tempUsed = GetNumBagUsedSlots(ctr)
-				self.currAssets.houseChestSpace[ctr] = tempUsed
+				self.parent.houseChestSpace[ctr] = tempUsed
 				bFoundData = true
 			else
-				if self.currAssets.houseChestSpace[ctr] ~= nil then
-					tempUsed = self.currAssets.houseChestSpace[ctr]
+				if self.parent.houseChestSpace[ctr] ~= nil then
+					tempUsed = self.parent.houseChestSpace[ctr]
 					bFoundData = true
 				else
 					tempUsed = nil
@@ -135,7 +135,8 @@ function CharBagFrame:FillCharAndBank()
 			end
 		else
 			tControl:SetHeight(0)
-			self.currAssets.houseChestSpace[ctr] = nil
+			tControl:GetNamedChild("charName"):SetText("")
+			self.parent.houseChestSpace[ctr] = nil
 		end
 	end

@@ -241,6 +242,9 @@ function CharBagFrame:Initialize(objectForAssets)
 			self.charControl = tControl
 		else
 			if assets[charId] ~= nil then
+				if assets[charId].houseChestSpace ~= nil then
+					assets[charId].houseChestSpace = nil
+				end
 				if assets[charId].spaceUsed ~= nil then
 					self.totSpaceUsed = self.totSpaceUsed + assets[charId].spaceUsed
 					self.totSpaceMax = self.totSpaceMax + assets[charId].spaceMax
@@ -271,7 +275,7 @@ function CharBagFrame:Initialize(objectForAssets)
 	self.divider2 = tControl

 	self.houseChestControls = {}
-	self.currAssets.houseChestSpace = self.currAssets.houseChestSpace or {}
+	self.parent.houseChestSpace = self.parent.houseChestSpace or {}
 	local ctr
 	prevControl = self.divider2
 	for ctr = BAG_HOUSE_BANK_ONE,BAG_HOUSE_BANK_TEN do
diff --git a/IIfA/IIfA.lua b/IIfA/IIfA.lua
index 0c71482..edce9ef 100644
--- a/IIfA/IIfA.lua
+++ b/IIfA/IIfA.lua
@@ -15,7 +15,7 @@ if IIfA == nil then IIfA = {} end
 --local IIfA = IIfA

 IIfA.name 				= "Inventory Insight"
-IIfA.version 			= "3.16"
+IIfA.version 			= "3.17"
 IIfA.author 			= "AssemblerManiac & manavortex"
 IIfA.defaultAlertSound 	= nil
 IIfA.colorHandler 		= nil
@@ -65,7 +65,7 @@ IIfA.trackedBags = {
 	[BAG_HOUSE_BANK_TEN] 	= true,
 }

-IIfA.dropdownBankNames = {
+IIfA.dropdownLocNames = {
 	"All",
 	"All Banks",
 	"All Guild Banks",
@@ -160,10 +160,10 @@ function IIfA:StatusAlert(message)
 end

 function IIfA:TextColorFixup(settings)
-	-- d("settings.TextColorsCraftBag = " .. settings.TextColorsCraftBag)
+--	d("settings.TextColorsCraftBag = " .. settings.TextColorsCraftBag)
 	if settings.TextColorsToon == nil then
 		if settings.in2TextColors then
-			-- d("old = " .. settings.in2TextColors)
+--			d("old = " .. settings.in2TextColors)
 			self.colorHandlerToon = ZO_ColorDef:New(settings.in2TextColors)
 			self.colorHandlerBank = ZO_ColorDef:New(settings.in2TextColors)
 			self.colorHandlerGBank = ZO_ColorDef:New(settings.in2TextColors)
@@ -171,7 +171,7 @@ function IIfA:TextColorFixup(settings)
 			self.colorHandlerHouseChest = ZO_ColorDef:New(settings.in2TextColors)
 			self.colorHandlerCraftBag = ZO_ColorDef:New(settings.in2TextColors)
 		else
-			-- d("Using default textcolors")
+--			d("Using default textcolors")
 			self.colorHandlerToon = ZO_ColorDef:New(IIFA_COLOR_DEFAULT:ToHex())
 			self.colorHandlerBank = ZO_ColorDef:New(IIFA_COLOR_DEFAULT:ToHex())
 			self.colorHandlerGBank = ZO_ColorDef:New(IIFA_COLOR_DEFAULT:ToHex())
@@ -187,7 +187,7 @@ function IIfA:TextColorFixup(settings)
 		settings.TextColorsCraftBag = self.colorHandlerCraftBag:ToHex()
 		settings.in2TextColors = nil
 	else
-		-- d("using saved textcolors")
+--		d("using saved textcolors")
 		self.colorHandlerToon = ZO_ColorDef:New(settings.TextColorsToon)
 		self.colorHandlerBank = ZO_ColorDef:New(settings.TextColorsBank)
 		self.colorHandlerGBank = ZO_ColorDef:New(settings.TextColorsGBank)
diff --git a/IIfA/IIfA.txt b/IIfA/IIfA.txt
index c52f5ed..ed3335a 100644
--- a/IIfA/IIfA.txt
+++ b/IIfA/IIfA.txt
@@ -1,7 +1,7 @@
 ## Title: Inventory Insight
 ## Author: manavortex, AssemblerManiac
-## Version: 3.16
-## APIVersion: 100022
+## Version: 3.17
+## APIVersion: 100022 100023
 ## SavedVariables: IIfA_Settings IIfA_Data
 ## OptionalDependsOn: libFilters pChat

diff --git a/IIfA/IIfABackpack.lua b/IIfA/IIfABackpack.lua
index f64e755..5a4ff53 100644
--- a/IIfA/IIfABackpack.lua
+++ b/IIfA/IIfABackpack.lua
@@ -588,7 +588,7 @@ function IIfA:GetCharacterList()
 end

 function IIfA:GetAccountInventoryList()
-	local accountInventories = IIfA.dropdownBankNames
+	local accountInventories = IIfA.dropdownLocNames


 -- get character names, will present in same order as character selection screen
@@ -616,7 +616,7 @@ function IIfA:GetAccountInventoryList()
 	end

 	if IIfA.data.b_collectHouses then
-		table.insert(accountInventories, "All Houses")
+		-- table.insert(accountInventories, "All Houses") --  4-11-18 AM - removed duplicate entry, it's in the dropdownLocNames already
 		for idx, houseName in pairs(IIfA:GetTrackedHouseNames()) do
 			table.insert(accountInventories, houseName)
 		end
@@ -731,6 +731,8 @@ function IIfA:SetupBackpack()

 		comboBox:SetSortsItems(false)

+		IIFA_GUI_Header_Dropdown.m_comboBox.m_height = 500		-- normal height is 250, so just double it (will be plenty tall for most users - even Mana)
+
 		local validChoices =  IIfA:GetAccountInventoryList()

 		for i = 1, #validChoices do
diff --git a/IIfA/IIfAMenu.lua b/IIfA/IIfAMenu.lua
index f4decfa..34f61e3 100644
--- a/IIfA/IIfAMenu.lua
+++ b/IIfA/IIfAMenu.lua
@@ -476,7 +476,7 @@ function IIfA:CreateOptionsMenu()
 			type = "dropdown",
 			name =  "Default Inventory Frame View",
 			tooltip =  "The default view (in the dropdown) set when the inventory frame loads",
-			choices = IIfA.dropdownBankNames,
+			choices = IIfA.dropdownLocNames,
 			default = IIfA:GetSettings().in2DefaultInventoryFrameView,
 			getFunc = function() return IIfA:GetSettings().in2DefaultInventoryFrameView end,
 			setFunc = function( value )
diff --git a/IIfA/IIfASettingsAdapter.lua b/IIfA/IIfASettingsAdapter.lua
index 1df25cd..d18b830 100644
--- a/IIfA/IIfASettingsAdapter.lua
+++ b/IIfA/IIfASettingsAdapter.lua
@@ -178,10 +178,10 @@ function IIfA:SetTrackingForHouse(houseCollectibleId, trackIt)
 	houseCollectibleId = houseCollectibleId or GetCollectibleIdForHouse(GetCurrentZoneHouseId())
 	if tonumber(houseCollectibleId) ~= houseCollectibleId then
 		realId = IIfA:GetHouseIdFromName(houseCollectibleId)
-		-- if not realId then d(houseCollectibleId); return end
-		if not realId then return end
+		if not realId then d(houseCollectibleId) return end
 		houseCollectibleId = realId
 	end
+	if houseCollectibleId == 0 then return end
 	IIfA.data.collectHouseData[houseCollectibleId] 	= trackIt
 	IIfA:GetTrackedBags()[houseCollectibleId] 		= trackIt
 	IIfA:RebuildHouseMenuDropdowns()
diff --git a/IIfA/IIfATooltip.lua b/IIfA/IIfATooltip.lua
index 07c2c54..9cf859f 100644
--- a/IIfA/IIfATooltip.lua
+++ b/IIfA/IIfATooltip.lua
@@ -492,9 +492,9 @@ function IIfA:UpdateTooltip(tooltip)
 					elseif location.bagLoc == BAG_GUILDBANK then
 						textOut = IIfA.colorHandlerGBank:Colorize(textOut)
 					elseif location.bagLoc == BAG_HOUSE_BANK_ONE then
-						textOut = IIfA.colorHandlerHouse:Colorize(textOut)
-					elseif location.bagLoc == 99 then
 						textOut = IIfA.colorHandlerHouseChest:Colorize(textOut)
+					elseif location.bagLoc == 99 then
+						textOut = IIfA.colorHandlerHouse:Colorize(textOut)
 					elseif location.bagLoc == BAG_VIRTUAL then
 						textOut = IIfA.colorHandlerCraftBag:Colorize(textOut)
 					end
@@ -566,9 +566,9 @@ function IIfA:UpdateTooltip(tooltip)
 					elseif location.bagLoc == BAG_GUILDBANK then
 						textOut = IIfA.colorHandlerGBank:Colorize(textOut)
 					elseif location.bagLoc == BAG_HOUSE_BANK_ONE then
-						textOut = IIfA.colorHandlerHouse:Colorize(textOut)
-					elseif location.bagLoc == 99 then
 						textOut = IIfA.colorHandlerHouseChest:Colorize(textOut)
+					elseif location.bagLoc == 99 then
+						textOut = IIfA.colorHandlerHouse:Colorize(textOut)
 					elseif location.bagLoc == BAG_VIRTUAL then
 						textOut = IIfA.colorHandlerCraftBag:Colorize(textOut)
 					end
@@ -578,26 +578,3 @@ function IIfA:UpdateTooltip(tooltip)
 		end
 	end
 end
-
-
---[[
-on pts
-/script d("|H1:item:122828:362:50:00000:0:0:0:0:0:0:0:0:0:0:0:38:0:0:0:10000:0|h|h |H1:item:048760:029:04:26848:2:1:0:0:0:0:0:0:0:0:1:06:1:1:0:00053:0|h|h")
-
-
-/script d("Redoran: |H1:item:122627:359:50:0:0:0:0:0:0:0:0:0:0:0:0:48:0:0:0:10000:0|h|h")
-/script d("Buoyant Armiger: |H1:item:126064:358:50:0:0:0:0:0:0:0:0:0:0:0:0:52:0:0:0:10000:0|h|h")
-/script d("MoragTong: |H1:item:45349:308:50:0:0:0:0:0:0:0:0:0:0:0:1:43:0:1:0:10000:0|h|h")
-
-red mountain - no icon, no style text - use get style func to find out what # it really is
-"of the worm" - same issue
-"ebon armory"
-hircine
-withered hand - same problem (of the necromancer)
-
-/script PopupTooltipIIFA_TT_Ext1_StyleIcon.idx=48 PopupTooltipIIFA_TT_Ext1_StyleIcon:SetTexture(IIfA.racialTextures[PopupTooltipIIFA_TT_Ext1_StyleIcon.idx].styleTexture) d(IIfA.racialTextures[PopupTooltipIIFA_TT_Ext1_StyleIcon.idx].styleName ..", "..PopupTooltipIIFA_TT_Ext1_StyleIcon.idx)
-
-/script PopupTooltipIIFA_TT_Ext1_StyleIcon:SetTexture("IIfA/assets/icons/ordinator.dds") PopupTooltipIIFA_TT_Ext1_StyleLabel:SetText("Ordinator")
-
-]]--
-