Merge pull request #58 from AssemblerManiac/master

manavortex [06-30-18 - 14:06]
Merge pull request #58 from AssemblerManiac/master

FCOIS tweaks; code conform (tabs/spaces/align/etc)
Filename
IIfA/Bindings.xml
IIfA/CharBagSpaceTooltip.lua
IIfA/CharCurrencyTooltip.lua
IIfA/IIfA.lua
IIfA/IIfA.txt
IIfA/IIfABackpack.lua
IIfA/IIfADataCollection.lua
IIfA/IIfAEvents.lua
IIfA/IIfAMenu.lua
IIfA/IIfASceneFuncs.lua
IIfA/IIfASettingsAdapter.lua
IIfA/IIfATooltip.lua
IIfA/IIfA_xml_adapter.lua
diff --git a/IIfA/Bindings.xml b/IIfA/Bindings.xml
index 3a0e42c..1b01158 100644
--- a/IIfA/Bindings.xml
+++ b/IIfA/Bindings.xml
@@ -1,9 +1,9 @@
 <Bindings>
-  <Layer name="SI_KEYBINDINGS_CATEGORY_GENERAL">
-    <Category name="Inventory Insight">
-      <Action name="TOGGLE_INVENTORY_FRAME">
-        <Down>IIfA:ToggleInventoryFrame()</Down>
-      </Action>
-    </Category>
-  </Layer>
+	<Layer name="SI_KEYBINDINGS_CATEGORY_GENERAL">
+		<Category name="Inventory Insight">
+			<Action name="TOGGLE_INVENTORY_FRAME">
+				<Down>IIfA:ToggleInventoryFrame()</Down>
+			</Action>
+		</Category>
+	</Layer>
 </Bindings>
diff --git a/IIfA/CharBagSpaceTooltip.lua b/IIfA/CharBagSpaceTooltip.lua
index 21c6bf7..7d809e4 100644
--- a/IIfA/CharBagSpaceTooltip.lua
+++ b/IIfA/CharBagSpaceTooltip.lua
@@ -258,8 +258,8 @@ function CharBagFrame:Initialize(objectForAssets)

 	tControl = CreateControlFromVirtual("IIFA_GUI_Bag_Row_Divider1", self.frame, "ZO_Options_Divider")
 	tControl:SetDimensions(288, 3)
-    tControl:SetAnchor(TOPLEFT, prevControl, BOTTOMLEFT, 0, 0)
-    tControl:SetAlpha(1)
+	tControl:SetAnchor(TOPLEFT, prevControl, BOTTOMLEFT, 0, 0)
+	tControl:SetAlpha(1)
 	self.divider1 = tControl

 	tControl = CreateControlFromVirtual("IIFA_GUI_Bag_Row_Bank", self.frame, "IIFA_CharBagRow")
@@ -269,8 +269,8 @@ function CharBagFrame:Initialize(objectForAssets)

 	tControl = CreateControlFromVirtual("IIFA_GUI_Bag_Row_Divider2", self.frame, "ZO_Options_Divider")
 	tControl:SetDimensions(288, 3)
-    tControl:SetAnchor(TOPLEFT, self.bankControl, BOTTOMLEFT, 0, 0)
-    tControl:SetAlpha(1)
+	tControl:SetAnchor(TOPLEFT, self.bankControl, BOTTOMLEFT, 0, 0)
+	tControl:SetAlpha(1)
 	self.divider2 = tControl

 	self.houseChestControls = {}
@@ -287,8 +287,8 @@ function CharBagFrame:Initialize(objectForAssets)

 	tControl = CreateControlFromVirtual("IIFA_GUI_Bag_Row_Divider3", self.frame, "ZO_Options_Divider")
 	tControl:SetDimensions(288, 0)
-    tControl:SetAnchor(TOPLEFT, prevControl, BOTTOMLEFT, 0, 0)
-    tControl:SetAlpha(1)
+	tControl:SetAnchor(TOPLEFT, prevControl, BOTTOMLEFT, 0, 0)
+	tControl:SetAlpha(1)
 	self.divider3 = tControl

 	tControl = CreateControlFromVirtual("IIFA_GUI_Bag_Row_Tots", self.frame, "IIFA_CharBagRow")
diff --git a/IIfA/CharCurrencyTooltip.lua b/IIfA/CharCurrencyTooltip.lua
index f73b757..ffb6841 100644
--- a/IIfA/CharCurrencyTooltip.lua
+++ b/IIfA/CharCurrencyTooltip.lua
@@ -38,7 +38,7 @@ function CharCurrencyFrame:FillCharAndBank()
 	self:SetQty(self.charControl, "qtyTV", CURT_TELVAR_STONES, tv)
 	self:SetQty(self.charControl, "qtyAP", CURT_ALLIANCE_POINTS, ap)
 	self:SetQty(self.charControl, "qtyWV", CURT_WRIT_VOUCHERS, wv)
-
+
 	local bankedMoney = GetBankedCurrencyAmount(CURT_MONEY)
 	local bankedTelVarStones = GetBankedCurrencyAmount(CURT_TELVAR_STONES)
 	local bankedAlliancePoints = GetBankedCurrencyAmount(CURT_ALLIANCE_POINTS)
@@ -71,7 +71,7 @@ function CharCurrencyFrame:Initialize(objectForAssets)
 	local tControl
 	local prevControl = self.frame
 	local currId = GetCurrentCharacterId()
-
+
 	local iconSize = 18
 	prevControl:GetNamedChild("CURT_MONEY"):SetTexture(GetCurrencyKeyboardIcon(CURT_MONEY))
 	prevControl:GetNamedChild("CURT_MONEY"):SetDimensions(iconSize, iconSize)
@@ -164,26 +164,26 @@ function CharCurrencyFrame:Initialize(objectForAssets)

 	tControl = CreateControlFromVirtual("IIFA_GUI_AssetsGrid_Row_Divider1", self.frame, "ZO_Options_Divider")
 	tControl:SetDimensions(490, 3)
-    tControl:SetAnchor(TOPLEFT, prevControl, BOTTOMLEFT, 0, 0)
-    tControl:SetAlpha(1)
-	self.divider1 = tControl
+	tControl:SetAnchor(TOPLEFT, prevControl, BOTTOMLEFT, 0, 0)
+	tControl:SetAlpha(1)
+	self.divider1 = tControl

 	tControl = CreateControlFromVirtual("IIFA_GUI_AssetsGrid_Row_Bank", self.frame, "IIFA_CharCurrencyRow")
 	tControl:GetNamedChild("charName"):SetText(GetString(SI_CURRENCYLOCATION1))
 	tControl:SetAnchor(TOPLEFT, self.divider1, BOTTOMLEFT, 0, 0)
 	self.bankControl = tControl
-
+
 	tControl = CreateControlFromVirtual("IIFA_GUI_AssetsGrid_Row_Divider2", self.frame, "ZO_Options_Divider")
 	tControl:SetDimensions(490, 3)
-    tControl:SetAnchor(TOPLEFT, self.bankControl, BOTTOMLEFT, 0, 0)
-    tControl:SetAlpha(1)
+	tControl:SetAnchor(TOPLEFT, self.bankControl, BOTTOMLEFT, 0, 0)
+	tControl:SetAlpha(1)
 	self.divider2 = tControl

 	tControl = CreateControlFromVirtual("IIFA_GUI_AssetsGrid_Row_Tots", self.frame, "IIFA_CharCurrencyRow")
 	tControl:GetNamedChild("charName"):SetText("Totals")
 	tControl:SetAnchor(TOPLEFT, self.divider2, BOTTOMLEFT, 0, 0)
 	self.totControl = tControl
-
+

 	self.frame:SetHeight((GetNumCharacters() + 4) * 26)	-- numchars + 4 represents # chars + bank + total + title and col titles

diff --git a/IIfA/IIfA.lua b/IIfA/IIfA.lua
index 1a369e9..dc92d80 100644
--- a/IIfA/IIfA.lua
+++ b/IIfA/IIfA.lua
@@ -7,7 +7,7 @@
 	Collects inventory data for all characters on a single account including the shared bank and makes this information available
 	on tooltips across the entire account providing the playerwith useful insight into their account wide inventory.
 DISCLAIMER
-	This Add-on is not created by, affiliated with or sponsored by ZeniMax Media Inc. or its affiliates. The Elder Scrolls® and related
+	This Add-on is not created by, affiliated with or sponsored by ZeniMax Media Inc. or its affiliates. The Elder Scrolls and related
 	logos are registered trademarks or trademarks of ZeniMax Media Inc. in the United States and/or other countries. All rights reserved."
 ]]
 ------------------------------------------------------------------
@@ -84,14 +84,14 @@ IIfA.dropdownLocNames = {
 function IIfA_SlashCommands(cmd)

 	if (cmd == IIfA.EMPTY_STRING) then
-    	d("[IIfA]:Please find the majority of options in the addon settings section of the menu under Inventory Insight.")
-    	d(" ")
-    	d("[IIfA]:Usage - ")
-    	d("	/IIfA [options]")
-    	d(" 	")
-    	d("	Options")
-    	d("		debug - Enables debug functionality for the IIfA addon.")
-    	d("		run - Runs the IIfA data collector.")
+		d("[IIfA]:Please find the majority of options in the addon settings section of the menu under Inventory Insight.")
+		d(" ")
+		d("[IIfA]:Usage - ")
+		d("	/IIfA [options]")
+		d(" 	")
+		d("	Options")
+		d("		debug - Enables debug functionality for the IIfA addon.")
+		d("		run - Runs the IIfA data collector.")
 		d("		color - Opens the color picker dialog to set tooltip text color.")
 		d("		toggle - Show/Hide IIfA")
 		return
@@ -375,7 +375,7 @@ function IIfA_onLoad(eventCode, addOnName)


 	-- 2-9-17 AM - convert saved data names into proper language for this session
-    local lang = GetCVar("language.2")
+	local lang = GetCVar("language.2")
 	if IIfA.data.lastLang == nil or IIfA.data.lastLang ~= lang then
 		IIfA:RenameItems()
 		IIfA.data.lastLang = lang
@@ -400,12 +400,12 @@ function IIfA_onLoad(eventCode, addOnName)
 		IIfA.data.bFilterOnSetNameToo = false
 	end

-        --Other addons: FCOItemSaver
+	-- Other addons: FCOItemSaver
 	if ObjSettings.FCOISshowMarkerIcons == nil then
 		ObjSettings.FCOISshowMarkerIcons = false
 		IIfA.data.FCOISshowMarkerIcons = false
-	end
-
+	end
+
 	if IIfA.data.guildBanks == nil then
 		IIfA.data.guildBanks = {}
 		local i
@@ -431,11 +431,11 @@ function IIfA_onLoad(eventCode, addOnName)
 	IIfA.LastFilterControl = IIFA_GUI_Header_Filter_Button0

 	-- save off anchors for the ListHolder
-	local _, point, relTo, relPoint, offsX, offsY = IIFA_GUI_ListHolder:GetAnchor(0)
-	IIFA_GUI_ListHolder.savedAnchor1 = {point, relTo, relPoint, offsX, offsY}
+	--local _, point, relTo, relPoint, offsX, offsY, constrains = IIFA_GUI_ListHolder:GetAnchor(0)
+	--IIFA_GUI_ListHolder.savedAnchor1 = {point, relTo, relPoint, offsX, offsY, constrains}

-	_, point, relTo, relPoint, offsX, offsY = IIFA_GUI_ListHolder:GetAnchor(1)
-	IIFA_GUI_ListHolder.savedAnchor2 = {point, relTo, relPoint, offsX, offsY}
+	--_, point, relTo, relPoint, offsX, offsY, constrains = IIFA_GUI_ListHolder:GetAnchor(1)
+	--IIFA_GUI_ListHolder.savedAnchor2 = {point, relTo, relPoint, offsX, offsY, constrains}

 	IIfA:TextColorFixup(IIfA:GetSettings())

@@ -453,7 +453,7 @@ function IIfA_onLoad(eventCode, addOnName)
 	-- manavortex, Feb. 22 2018: drop dbv2 support
 	if nil ~= IIfA.data.DBv2 then IIfA.data.DBv2 = nil end

-	-- keep EU and US items apart
+	-- store EU and US items separately
 	local worldName = GetWorldName():gsub(" Megaserver", IIfA.EMPTY_STRING)
 	IIfA.data[worldName] = IIfA.data[worldName] or {}
 	if IIfA.data[worldName].DBv3 == nil then
diff --git a/IIfA/IIfA.txt b/IIfA/IIfA.txt
index 3d76d64..c86ab24 100644
--- a/IIfA/IIfA.txt
+++ b/IIfA/IIfA.txt
@@ -49,7 +49,7 @@ plugins/FCOIS/IIfA_FCOIS.lua

 ; DISCLOSURE:
 ; This Add-on is not created by, affiliated with or sponsored by ZeniMax
-; Media Inc. or its affiliates. The Elder Scrolls® and related logos are
+; Media Inc. or its affiliates. The Elder Scrolls and related logos are
 ; registered trademarks or trademarks of ZeniMax Media Inc. in the United
 ; States and/or other countries. All rights reserved.
 ; You can read the full terms at https://account.elderscrollsonline.com/add-on-terms
diff --git a/IIfA/IIfABackpack.lua b/IIfA/IIfABackpack.lua
index 31f536d..ec06de8 100644
--- a/IIfA/IIfABackpack.lua
+++ b/IIfA/IIfABackpack.lua
@@ -15,16 +15,16 @@ local function p(...) IIfA:DebugOut(...) end
 -- this is for the buttons
 local function enableFilterButton(num)
 	local buttonName = "Button"..num
-    local button = IIFA_GUI_Header_Filter:GetNamedChild(buttonName)
-    if button then
-        button:SetState(BSTATE_PRESSED)
-    end
+	local button = IIFA_GUI_Header_Filter:GetNamedChild(buttonName)
+	if button then
+		button:SetState(BSTATE_PRESSED)
+	end
 end
 local function disableFilterButton(num)
-    local button = IIFA_GUI_Header_Filter:GetNamedChild("Button"..num)
-    if button then
-        button:SetState(BSTATE_NORMAL)
-    end
+	local button = IIFA_GUI_Header_Filter:GetNamedChild("Button"..num)
+	if button then
+		button:SetState(BSTATE_NORMAL)
+	end
 end

 function IIfA:GetActiveFilter()
@@ -160,7 +160,8 @@ local function DoesInventoryMatchList(locationName, location)
 		end
 	end
 end
---@Baetram:
+
+--@Baertram:
 --Made the function global to be used in other addons like FCOItemSaver
 function IIfA:DoesInventoryMatchList(locationName, location)
 	return DoesInventoryMatchList(locationName, location)
@@ -201,14 +202,14 @@ function IIfA:getQualityDict()
 end

 local function matchFilter(itemName, itemLink)
-    local ret = true
+	local ret = true
 	local itemMatch = false
 	local hasSetInfo, setName

 	local searchFilter = IIfA.searchFilter
 	-- 17-7-30 AM - moved lowercasing to when it's created, one less call to lowercase for every item

-    local name = string.lower(itemName) or IIfA.EMPTY_STRING
+	local name = string.lower(itemName) or IIfA.EMPTY_STRING

 	-- text filter takes precedence
 	-- 3-6-17 AM - you're either filtering on a set name, or not - much less confusing (hopefully)
@@ -320,7 +321,7 @@ local function matchFilter(itemName, itemLink)
 			ret = ret and IsItemLinkStolen(itemLink)
 		end
 	end
-    return ret
+	return ret
 end
 local function matchQuality(itemQuality)
 	local quality = IIfA.InventoryListFilterQuality
@@ -407,8 +408,8 @@ function IIfA:UpdateScrollDataLinesData()
 				if not dbItem.itemName or #dbItem.itemName == 0 then
 					p("Filling in missing itemName/Quality")
 					dbItem.itemName = GetItemLinkName(itemLink)
-                    dbItem.itemQuality = GetItemLinkQuality(itemLink)
-                end
+					dbItem.itemQuality = GetItemLinkQuality(itemLink)
+				end
 				tempDataLine = {
 					link = itemLink,
 					qty = itemCount,
@@ -637,7 +638,7 @@ function IIfA:GetAccountInventoryList()
 		end
 	end

-	--house banks
+	-- house item inventories
 	if IIfA.data.b_collectHouses then
 		-- 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
@@ -734,6 +735,7 @@ end
 -- general note for popup menus
 -- example here http://www.esoui.com/downloads/info1146-LibCustomMenu.html
 -- AddCustomSubMenuItem(mytext, entries, myfont, normalColor, highlightColor, itemYPad)
+
 function IIfA:SetupBackpack()

 	local function createInventoryDropdown()
@@ -762,8 +764,8 @@ p("OnChestSelect '<<1>>' - <<2>>", choiceText, choice)
 				if cName == self.EMPTY_STRING then
 					cName = GetCollectibleName(cId)
 				end
-                		--remove gender specific characters from house bank chest name
-                		cName = zo_strformat("<<C:1>>", cName)
+				--remove gender specific characters from house bank chest name
+				cName = zo_strformat("<<C:1>>", cName)
 				if cName == choiceText then
 					IIfA:SetInventoryListFilter("Housing Storage", ctr)
 					break
@@ -795,8 +797,8 @@ p("OnChestSelect '<<1>>' - <<2>>", choiceText, choice)
 				if cName == self.EMPTY_STRING then
 					cName = GetCollectibleName(cId)
 				end
-                		--remove gender specific characters from house bank chest name
-                		cName = zo_strformat("<<C:1>>", cName)
+				--remove gender specific characters from house bank chest name
+				cName = zo_strformat("<<C:1>>", cName)
 				entry = comboBox:CreateItemEntry(cName, OnChestSelect)
 				comboBox:AddItem(entry)
 			end
@@ -1023,7 +1025,7 @@ function IIfA:FilterByItemName(control)
 	IIFA_GUI_SearchBox:SetText(itemName)
 	IIFA_GUI_SearchBoxText:SetHidden(true)
 	IIfA.bFilterOnSetName = false
-    IIfA:RefreshInventoryScroll()
+	IIfA:RefreshInventoryScroll()

 end

@@ -1048,7 +1050,7 @@ function IIfA:FilterByItemSet(control)
 	IIFA_GUI_SearchBox:SetText(setName)
 	IIFA_GUI_SearchBoxText:SetHidden(true)
 	IIfA.bFilterOnSetName = true
-    IIfA:RefreshInventoryScroll()
+	IIfA:RefreshInventoryScroll()

 end

diff --git a/IIfA/IIfADataCollection.lua b/IIfA/IIfADataCollection.lua
index 8a420e6..c34b239 100644
--- a/IIfA/IIfADataCollection.lua
+++ b/IIfA/IIfADataCollection.lua
@@ -50,7 +50,7 @@ function IIfA:DeleteGuildData(name)
 			if guildName == name then
 				IIfA.data.guildBanks[name] = nil
 			end
-        end
+		end
 		IIfA:ClearUnowned()
 	end
 end
@@ -304,15 +304,11 @@ function IIfA:GuildBankAddRemove(eventID, slotId)
 	end)
 end

-function IIfA:IgnoreHouse(houseCollectibleId)
-    houseCollectibleId = houseCollectibleId or GetCollectibleIdForHouse(GetCurrentZoneHouseId())
-end
 function IIfA:RescanHouse(houseCollectibleId)

 	houseCollectibleId = houseCollectibleId or GetCollectibleIdForHouse(GetCurrentZoneHouseId())
 	if not houseCollectibleId or not IIfA.trackedBags[houseCollectibleId] then return end
-
-    -- if GetHouseCategoryType(GetCurrentZoneHouseId()) == HOUSE_CATEGORY_TYPE_NOTABLE then return end
+
 	IIfA.data.collectHouseData[houseCollectibleId] = IIfA.data.collectHouseData[houseCollectibleId] or IIfA:GetHouseTracking()

 	if not IIfA.data.collectHouseData[houseCollectibleId] then
@@ -323,12 +319,12 @@ function IIfA:RescanHouse(houseCollectibleId)
 		IIfA.trackedBags[houseCollectibleId] = true
 	end

-    -- TODO: Debug this
+	-- TODO: Debug this
 	--- stuff them all into an array
 	local function getAllPlacedFurniture()
 		local ret = {}
-        local counter = 1
-        local furnitureId = nil
+		local counter = 1
+		local furnitureId = nil
 		 while(true) do
 			furnitureId = GetNextPlacedHousingFurnitureId(furnitureId)
 			if (not furnitureId or counter > 10000 ) then return ret end
@@ -336,29 +332,28 @@ function IIfA:RescanHouse(houseCollectibleId)
 			-- if not ret[itemLink] then
 				-- ret[itemLink] = 1
 			-- else
-            ret[itemLink] = ( ret[itemLink] or 1 ) + 1
+			ret[itemLink] = ( ret[itemLink] or 1 ) + 1
 			-- end
-            counter = counter + 1
+			counter = counter + 1
 		end
-        return ret
+		return ret
 	end
-
-    IIfA.getAllPlacedFurniture = getAllPlacedFurniture
+	IIfA.getAllPlacedFurniture = getAllPlacedFurniture

 	-- call with libAsync to avoid lag
 	task:Call(function()
 		-- clear and re-create, faster than conditionally updating
 		IIfA:ClearLocationData(houseCollectibleId)
-
-
+
 	end):Then(function()  -- TODO - can this go again? Having it in here at least prevented the crash
-        local placedFurniture = getAllPlacedFurniture()
+		local placedFurniture = getAllPlacedFurniture()
 		for itemLink, itemCount in pairs(placedFurniture) do
 			-- (bagId, slotId, fromXfer, itemCount, itemLink, itemName, locationID)
 			p("furniture item <<1>> x<<2>>", itemLink, itemCount)
 			IIfA:EvalBagItem(houseCollectibleId, tonumber(IIfA_GetItemID(itemLink)), false, itemCount, itemLink, GetItemLinkName(itemLink), houseCollectibleId)
 		end
 	end)
+
 end

 -- try to read item name from bag/slot - if that's empty, we read it from item link
@@ -435,17 +430,17 @@ function IIfA:TableCount(tbl)
 	return cnt
 end

---@Baetram:
+--@Baertram:
 -- Added for other addons like FCOItemSaver to get the item instance or the unique ID
 -->Returns itemInstance or uniqueId as 1st return value
 -->Returns a boolean value as 2nd retun value: true if the bagId should build an itemInstance or unique ID / false if not
 local function getItemInstanceOrUniqueId(bagId, slotIndex, itemLink)
-    local itemInstanceOrUniqueId = 0
-    local isBagToBuildItemInstanceOrUniqueId = false
-    if FCOIS == nil or FCOIS.getItemInstanceOrUniqueId == nil then return 0, false end
-    --Call function within addon FCOItemSaver, file FCOIS_OtherAddons.lua -> IIfA section
-    itemInstanceOrUniqueId, isBagToBuildItemInstanceOrUniqueId = FCOIS.getItemInstanceOrUniqueId(bagId, slotIndex, itemLink)
-    return itemInstanceOrUniqueId, isBagToBuildItemInstanceOrUniqueId
+	local itemInstanceOrUniqueId = 0
+	local isBagToBuildItemInstanceOrUniqueId = false
+	if FCOIS == nil or FCOIS.getItemInstanceOrUniqueId == nil then return 0, false end
+	--Call function within addon FCOItemSaver, file FCOIS_OtherAddons.lua -> IIfA section
+	itemInstanceOrUniqueId, isBagToBuildItemInstanceOrUniqueId = FCOIS.getItemInstanceOrUniqueId(bagId, slotIndex, itemLink)
+	return itemInstanceOrUniqueId, isBagToBuildItemInstanceOrUniqueId
 end

 function IIfA:EvalBagItem(bagId, slotId, fromXfer, qty, itemLink, itemName, locationID)
@@ -476,7 +471,7 @@ function IIfA:EvalBagItem(bagId, slotId, fromXfer, qty, itemLink, itemName, loca

 	local itemCount = qty or getItemCount(bagId, slotId, itemLink)

-    --@Baetram:
+	--@Baertram:
 	--Item instance/unique id  (needed for other addons like FCOItemSaver to (un)mark items via that id)
 	local itemInstanceOrUniqueId, isBagToBuildItemInstanceOrUniqueId = getItemInstanceOrUniqueId(bagId, slotId, itemLink)
 	if isBagToBuildItemInstanceOrUniqueId then
@@ -543,12 +538,7 @@ function IIfA:EvalBagItem(bagId, slotId, fromXfer, qty, itemLink, itemName, loca
 				DBitem.locations[location].bagSlot = {}
 				DBitem.locations[location].bagSlot[slotId] = itemCount
 			end
-        end
-        --@Baetram:
-        --Added for other addons like FCOItemSaver. Only needed for non-account wide bags!
-        if isBagToBuildItemInstanceOrUniqueId then
-            DBitem.itemInstanceOrUniqueId = itemInstanceOrUniqueId
-        end
+		end
 	else
 		DBv3[itemKey] = {}
 		DBv3[itemKey].filterType = itemFilterType
@@ -559,14 +549,15 @@ function IIfA:EvalBagItem(bagId, slotId, fromXfer, qty, itemLink, itemName, loca
 		DBv3[itemKey].locations[location].bagID = bagId
 		DBv3[itemKey].locations[location].bagSlot = {}
 		DBv3[itemKey].locations[location].bagSlot[slotId] = itemCount
-        --@Baetram:
-        --Added for other addons like FCOItemSaver. Only needed for non-account wide bags!
-        if isBagToBuildItemInstanceOrUniqueId then
-            DBv3[itemKey].itemInstanceOrUniqueId = itemInstanceOrUniqueId
-        end
 		DBitem = DBv3[itemKey]
 	end

+	--@Baertram:
+	--Added for other addons like FCOItemSaver. Only needed for non-account wide bags!
+	if isBagToBuildItemInstanceOrUniqueId then
+		DBitem.itemInstanceOrUniqueId = itemInstanceOrUniqueId
+	end
+
 	if nil ~= location and DBitem.locations and DBitem.locations[location] and IIfA:TableCount(DBitem.locations[location].bagSlot) == 0 then
 		p("Zapping location=<<1>>, bag=<<2>>, slot=<<3>>", location, bagId, slotId)
 		DBitem.locations[location] = nil
@@ -736,9 +727,10 @@ function IIfA:ClearLocationData(location, bagID)		-- if loc is characterid, bagI
 	local itemLocation = nil
 	local LocationCount = 0
 	local itemName, itemData
-
-    local bChar = (bagID == nil and nil) or location == IIfA.currentCharacterId
-
+	local bChar = nil
+	if bagID ~= nil then
+		bChar = location == IIfA.currentCharacterId
+	end

 	if(DBv3)then
 		p(zo_strformat("IIfA:ClearLocationData(<<1>>, <<2>>)", location, bagID))
@@ -764,40 +756,40 @@ end
 -- written by SirInsidiator
 --[[
 local function RewriteItemLink(itemLink)
-    local requiredLevel = select(6, ZO_LinkHandler_ParseLink(itemLink))
-    requiredLevel = tonumber(requiredLevel)
-    local trueRequiredLevel = GetItemLinkRequiredLevel(itemLink)
+	local requiredLevel = select(6, ZO_LinkHandler_ParseLink(itemLink))
+	requiredLevel = tonumber(requiredLevel)
+	local trueRequiredLevel = GetItemLinkRequiredLevel(itemLink)

-    itemLink = string.gsub(itemLink, "|H(%d):item:(.*)" , "|H0:item:%2")
+	itemLink = string.gsub(itemLink, "|H(%d):item:(.*)" , "|H0:item:%2")

-    if requiredLevel ~= trueRequiredLevel then
-        itemLink = string.gsub(itemLink, "|H0:item:(%d+):(%d+):(%d+)(.*)" , "|H0:item:%1:%2:".. trueRequiredLevel .."%4")
-    end
+	if requiredLevel ~= trueRequiredLevel then
+		itemLink = string.gsub(itemLink, "|H0:item:(%d+):(%d+):(%d+)(.*)" , "|H0:item:%1:%2:".. trueRequiredLevel .."%4")
+	end

-    return itemLink
+	return itemLink
 end

 local function GetItemIdentifier(itemLink)
-    local itemType = GetItemLinkItemType(itemLink)
-    local data = {zo_strsplit(":", itemLink:match("|H(.-)|h.-|h"))}
-    local itemId = data[3]
-    local level = GetItemLinkRequiredLevel(itemLink)
-    local cp = GetItemLinkRequiredChampionPoints(itemLink)
+	local itemType = GetItemLinkItemType(itemLink)
+	local data = {zo_strsplit(":", itemLink:match("|H(.-)|h.-|h"))}
+	local itemId = data[3]
+	local level = GetItemLinkRequiredLevel(itemLink)
+	local cp = GetItemLinkRequiredChampionPoints(itemLink)
 --	local results
 --	results.itemId = itemId
 --	results.itemType = itemType
 --	results.level = level
 --	results.cp = cp
-    if(itemType == ITEMTYPE_WEAPON or itemType == ITEMTYPE_ARMOR) then
-        local trait = GetItemLinkTraitInfo(itemLink)
-        return string.format("%s,%s,%d,%d,%d", itemId, data[4], trait, level, cp)
-    elseif(itemType == ITEMTYPE_POISON or itemType == ITEMTYPE_POTION) then
-        return string.format("%s,%d,%d,%s", itemId, level, cp, data[23])
+	if(itemType == ITEMTYPE_WEAPON or itemType == ITEMTYPE_ARMOR) then
+		local trait = GetItemLinkTraitInfo(itemLink)
+		return string.format("%s,%s,%d,%d,%d", itemId, data[4], trait, level, cp)
+	elseif(itemType == ITEMTYPE_POISON or itemType == ITEMTYPE_POTION) then
+		return string.format("%s,%d,%d,%s", itemId, level, cp, data[23])
 --    elseif(hasDifferentQualities[itemType]) then
 --        return string.format("%s,%s", itemId, data[4])
-    else
-        return itemId
-    end
+	else
+		return itemId
+	end
 end
 --]]
 function IIfA:RenameItems()
diff --git a/IIfA/IIfAEvents.lua b/IIfA/IIfAEvents.lua
index b190a01..ae7e0ea 100644
--- a/IIfA/IIfAEvents.lua
+++ b/IIfA/IIfAEvents.lua
@@ -57,20 +57,20 @@ IIfA:DebugOut("InventorySlotUpdate raw bagId/slotNum=<<1>>/<<2>>, Item='<<3>>',
 	-- once a bunch of items comes in, this will be created for each, but only the last one stays alive
 	-- so once all the items are finished coming in, it'll only need to update the shown list one time
 	local callbackName = "IIfA_RefreshInventoryScroll"
-    local function Update()
-        EVENT_MANAGER:UnregisterForUpdate(callbackName)
+	local function Update()
+		EVENT_MANAGER:UnregisterForUpdate(callbackName)
 		if IIFA_GUI:IsControlHidden() then
 			return
 		else
 			IIfA:RefreshInventoryScroll()
 		end
-    end
+	end

-    --cancel previously scheduled update if any
-    EVENT_MANAGER:UnregisterForUpdate(callbackName)
-    --register a new one
+	--cancel previously scheduled update if any
+	EVENT_MANAGER:UnregisterForUpdate(callbackName)
+	--register a new one
 	if not IIFA_GUI:IsControlHidden() then		-- only update the frame if it's shown
-    	EVENT_MANAGER:RegisterForUpdate(callbackName, 250, Update)
+		EVENT_MANAGER:RegisterForUpdate(callbackName, 250, Update)
 	end
 end

diff --git a/IIfA/IIfAMenu.lua b/IIfA/IIfAMenu.lua
index 6f8a99c..0a5e6cc 100644
--- a/IIfA/IIfAMenu.lua
+++ b/IIfA/IIfAMenu.lua
@@ -587,32 +587,36 @@ function IIfA:CreateOptionsMenu()
 			getFunc = function() return IIfA:GetSceneVisible("trade") end,
 			setFunc = function(value) IIfA:SetSceneVisible("trade", value) end,
 		},
-
-		--Other addons
-		{
-		    type = "header",
-		    name = "Other addons",
-		},
-
-		--FCOItemSaver
-		{
-			type = "submenu",
-			name = "FCOItemSaver",
-			tooltip = "Manage settings for the addon FCOItemSaver within IIfA",
-			controls = {
-				{
-				    type = "checkbox",
-				    name = "Show marker icons",
-				    tooltip = "Shows FCOIS marker icons within the inventory frame rows",
-				    getFunc = function() return IIfA:GetSettings().FCOISshowMarkerIcons end,
-				    setFunc = function(value) IIfA:GetSettings().FCOISshowMarkerIcons = value end,
-				},
-			},
-		},

 	-- options data end
 	}

+	if FCOIS then
+		optionsData[#optionsData + 1] =
+			--Other addons
+			{
+				type = "header",
+				name = "Other addons",
+			}
+		optionsData[#optionsData + 1] =
+			--FCOItemSaver
+			{
+				type = "submenu",
+				name = "FCOItemSaver",
+				tooltip = "Manage settings for the addon FCOItemSaver within IIfA",
+				controls = {
+					{
+						type = "checkbox",
+						name = "Show marker icons",
+						tooltip = "Shows FCOIS marker icons within the inventory frame rows",
+						getFunc = function() return IIfA:GetSettings().FCOISshowMarkerIcons end,
+						setFunc = function(value) IIfA:GetSettings().FCOISshowMarkerIcons = value end,
+					},
+				},
+			}
+	end
+
+
 	-- run through list of options, find one with empty controls, add in the submenu for guild banks options
 	local i, data
 	for i, data in ipairs(optionsData) do
diff --git a/IIfA/IIfASceneFuncs.lua b/IIfA/IIfASceneFuncs.lua
index 8999738..2c7e99f 100644
--- a/IIfA/IIfASceneFuncs.lua
+++ b/IIfA/IIfASceneFuncs.lua
@@ -116,14 +116,14 @@ function IIfA:SaveFrameInfo(calledFrom)

 	local settings = IIfA:GetSceneSettings(sceneName)

-    settings.hidden = IIFA_GUI:IsControlHidden()
+	settings.hidden = IIFA_GUI:IsControlHidden()

 	if (not settings.docked and (calledFrom == "onMoveStop" or calledFrom == "onResizeStop")) then
-    	settings.lastX	= IIFA_GUI:GetLeft()
-    	settings.lastY	= IIFA_GUI:GetTop()
+		settings.lastX	= IIFA_GUI:GetLeft()
+		settings.lastY	= IIFA_GUI:GetTop()
 		if not settings.minimized then
 			settings.width	= IIFA_GUI:GetWidth()
-    		settings.height	= IIFA_GUI:GetHeight()
+			settings.height	= IIFA_GUI:GetHeight()
 		end
 	end
 end
@@ -136,7 +136,7 @@ function IIfA:ToggleInventoryFrame()
 		-- get current camera mode so when we toggle off, we put it back to where it was (maybe, can think of some weird circumstances where it might screw it up)
 		SetGameCameraUIMode(true)
 		IIfA:GuiResizeScroll()
-    	IIfA:RefreshInventoryScroll()
+		IIfA:RefreshInventoryScroll()
 	end
 	if not IIfA.data.dontFocusSearch then
 		IIFA_GUI_SearchBox:TakeFocus()
diff --git a/IIfA/IIfASettingsAdapter.lua b/IIfA/IIfASettingsAdapter.lua
index 7143a8b..3e913c9 100644
--- a/IIfA/IIfASettingsAdapter.lua
+++ b/IIfA/IIfASettingsAdapter.lua
@@ -1,8 +1,8 @@
 local IIfA = IIfA
 IIfA.houseNameToIdTbl = {}

-local task 			= IIfA.task or LibStub("LibAsync"):Create("IIfA_DataCollection")
-IIfA.task			= task
+local task 	= IIfA.task or LibStub("LibAsync"):Create("IIfA_DataCollection")
+IIfA.task	= task

 function IIfA:IsCharacterInventoryIgnored()
 	return IIfA.data.ignoredCharInventories[IIfA.currentCharacterId] or false
@@ -58,7 +58,7 @@ end
 function IIfA:SetSetNameFilterOnly(value)
 	IIfA.bFilterOnSetName = not IIfA.bFilterOnSetName
 	IIFA_GUI_Search_SetNameOnly:SetState((IIfA.bFilterOnSetName and BSTATE_PRESSED) or BSTATE_NORMAL)
-    IIfA:RefreshInventoryScroll()
+	IIfA:RefreshInventoryScroll()
 end

 function IIfA:GetFocusSearchOnToggle()
@@ -137,9 +137,9 @@ end
 function IIfA:GetTrackingWithHouseNames()
 	local ret = {}
 	for collectibleId, trackIt in pairs(IIfA.data.collectHouseData) do
-        local collectibleName = GetCollectibleName(collectibleId)
-        --remove gender specific characters from house name
-        collectibleName = zo_strformat("<<C:1>>", collectibleName)
+		local collectibleName = GetCollectibleName(collectibleId)
+		--remove gender specific characters from house name
+		collectibleName = zo_strformat("<<C:1>>", collectibleName)
 		ret[collectibleName] = true
 	end
 	return ret
@@ -151,7 +151,7 @@ function IIfA:RebuildHouseMenuDropdowns()
 	for collectibleId, trackIt in pairs(IIfA.data.collectHouseData) do
 		local collectibleName = GetCollectibleName(collectibleId)
 		--remove gender specific characters from house name
-        collectibleName = zo_strformat("<<C:1>>", collectibleName)
+		collectibleName = zo_strformat("<<C:1>>", collectibleName)
 		-- cache house name for lookup
 		IIfA.houseNameToIdTbl[collectibleName] = collectibleId
 		local targetTable = (trackIt and tracked) or ignored
diff --git a/IIfA/IIfATooltip.lua b/IIfA/IIfATooltip.lua
index b01fc0b..9d58c86 100644
--- a/IIfA/IIfATooltip.lua
+++ b/IIfA/IIfATooltip.lua
@@ -10,13 +10,13 @@ end

 -- 2018-3-22 AM - duplicate ZO_Tooltip_AddDivider so we can set the color of our divider to match whatever is popped up (stolen or not)
 function IIfA:Tooltip_AddDivider(tooltipControl)
-    if not tooltipControl.dividerPool then
-        tooltipControl.dividerPool = ZO_ControlPool:New("ZO_BaseTooltipDivider", tooltipControl, "Divider")
-    end
+	if not tooltipControl.dividerPool then
+		tooltipControl.dividerPool = ZO_ControlPool:New("ZO_BaseTooltipDivider", tooltipControl, "Divider")
+	end

-    local divider = tooltipControl.dividerPool:AcquireObject()
+	local divider = tooltipControl.dividerPool:AcquireObject()

-    if divider then
+	if divider then
 		-- AM - new code
 		local div1
 		div1 = tooltipControl:GetNamedChild("Divider1")
@@ -25,9 +25,9 @@ function IIfA:Tooltip_AddDivider(tooltipControl)
 			divider:SetTexture(div1:GetTextureFileName())
 		end
 		-- AM - end new code
-        tooltipControl:AddControl(divider)
-        divider:SetAnchor(CENTER)
-    end
+		tooltipControl:AddControl(divider)
+		divider:SetAnchor(CENTER)
+	end
 end


@@ -383,16 +383,16 @@ function IIfA:getMouseoverLink()
 	elseif name:sub(1, 44) == "ZO_TradingHouseItemPaneSearchResultsContents" then
 		data = mouseOverControl.dataEntry
 		if data then data = data.data end
-	    -- The only thing with 0 time remaining should be guild tabards, no
-    	-- stats on those!
-    	if not data or data.timeRemaining == 0 then return nil end
+		-- The only thing with 0 time remaining should be guild tabards, no
+		-- stats on those!
+		if not data or data.timeRemaining == 0 then return nil end
 		return GetTradingHouseSearchResultItemLink(data.slotIndex)

 	elseif name == "ZO_TradingHousePostedItemsListContents" then
 		return GetTradingHouseListingItemLink(mouseOverControl.dataEntry.data.slotIndex)

   	elseif name == 'ZO_TradingHouseLeftPanePostItemFormInfo' then
-    	if mouseOverControl.slotIndex and mouseOverControl.bagId then
+		if mouseOverControl.slotIndex and mouseOverControl.bagId then
 			return GetItemLink(mouseOverControl.bagId, mouseOverControl.slotIndex)
 		end
 	elseif name == 'ZO_ClaimLevelUpRewardsScreen_KeyboardListScrollChild' then
diff --git a/IIfA/IIfA_xml_adapter.lua b/IIfA/IIfA_xml_adapter.lua
index c04e0c7..3cad34a 100644
--- a/IIfA/IIfA_xml_adapter.lua
+++ b/IIfA/IIfA_xml_adapter.lua
@@ -282,14 +282,14 @@ function IIfA:GuiOnSearchboxText(control)
 	local text = control:GetText()
 	IIFA_GUI_SearchBoxText:SetHidden(text ~= nil and text > IIfA.EMPTY_STRING)
 	IIfA.searchFilter = zo_strlower(text)
-    IIfA:RefreshInventoryScroll()
+	IIfA:RefreshInventoryScroll()
 end

 function IIfA:GuiOnSearchBoxClear(control)
 	IIFA_GUI_SearchBox:SetText(IIfA.EMPTY_STRING)
 	IIFA_GUI_SearchBoxText:SetHidden(false)
 	IIfA.searchFilter = IIfA.EMPTY_STRING
-    IIfA:RefreshInventoryScroll()
+	IIfA:RefreshInventoryScroll()
 end