Fixed leaking globals and wrong vars + libAddonMenu

Baertram [06-03-18 - 17:55]
Fixed leaking globals and wrong vars + libAddonMenu

Fixed leaking globals and wrong vars + libAddonMenu
Filename
.gitignore
IIfA/IIfABackpack.lua
IIfA/IIfADataCollection.lua
IIfA/IIfASettingsAdapter.lua
IIfA/IIfATooltip.lua
IIfA/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..3fa3560
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,6 @@
+
+*.iml
+IIfA/.idea/dictionaries/P.xml
+IIfA/.idea/misc.xml
+IIfA/.idea/modules.xml
+IIfA/.idea/workspace.xml
diff --git a/IIfA/IIfABackpack.lua b/IIfA/IIfABackpack.lua
index bd3aeca..0d95a20 100644
--- a/IIfA/IIfABackpack.lua
+++ b/IIfA/IIfABackpack.lua
@@ -802,7 +802,7 @@ p("OnChestSelect '<<1>>' - <<2>>", choiceText, choice)

 		local comboBox = IIFA_GUI_Header_Dropdown_Quality.comboBox

-		function OnItemSelect(_, choiceText, choice)
+		local function OnItemSelect(_, choiceText, choice)
 			IIfA:SetInventoryListFilterQuality(getQualityDict()[choiceText])
 			PlaySound(SOUNDS.POSITIVE_CLICK)
 		end
diff --git a/IIfA/IIfADataCollection.lua b/IIfA/IIfADataCollection.lua
index a871a69..6e726fa 100644
--- a/IIfA/IIfADataCollection.lua
+++ b/IIfA/IIfADataCollection.lua
@@ -328,7 +328,7 @@ function IIfA:RescanHouse(houseCollectibleId)
 	local function getAllPlacedFurniture()
 		local ret = {}
 		 while(true) do
-			furnitureId = GetNextPlacedHousingFurnitureId(furnitureId)
+			local furnitureId = GetNextPlacedHousingFurnitureId(furnitureId)
 			if(not furnitureId) then return ret end
 			local itemLink = GetPlacedFurnitureLink(furnitureId, LINK_STYLE_BRACKETS)
 			if not ret[itemLink] then
@@ -452,7 +452,7 @@ function IIfA:EvalBagItem(bagId, slotId, fromXfer, qty, itemLink, itemName, loca
 	-- item count is either passed or we have to get it from bag/slot ID or item link
 	local bAddQty = false
 	if qty ~= nil then bAddQty = true end
-	itemCount = qty or getItemCount(bagId, slotId, itemLink)
+	local itemCount = qty or getItemCount(bagId, slotId, itemLink)

 	--p("trying to save <<1>> x<<2>>", itemLink, itemCount)

diff --git a/IIfA/IIfASettingsAdapter.lua b/IIfA/IIfASettingsAdapter.lua
index b0b9219..1bb55f6 100644
--- a/IIfA/IIfASettingsAdapter.lua
+++ b/IIfA/IIfASettingsAdapter.lua
@@ -178,7 +178,7 @@ end
 function IIfA:SetTrackingForHouse(houseCollectibleId, trackIt)
 	houseCollectibleId = houseCollectibleId or GetCollectibleIdForHouse(GetCurrentZoneHouseId())
 	if tonumber(houseCollectibleId) ~= houseCollectibleId then
-		realId = IIfA:GetHouseIdFromName(houseCollectibleId)
+		local realId = IIfA:GetHouseIdFromName(houseCollectibleId)
 		if not realId then d(houseCollectibleId) return end
 		houseCollectibleId = realId
 	end
diff --git a/IIfA/IIfATooltip.lua b/IIfA/IIfATooltip.lua
index be0fc16..b01fc0b 100644
--- a/IIfA/IIfATooltip.lua
+++ b/IIfA/IIfATooltip.lua
@@ -18,7 +18,7 @@ function IIfA:Tooltip_AddDivider(tooltipControl)

     if divider then
 		-- AM - new code
-		local Div1
+		local div1
 		div1 = tooltipControl:GetNamedChild("Divider1")
 		if div1 then
 --			d(div1:GetTextureFileName() .. " / " .. divider:GetTextureFileName())
diff --git a/IIfA/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua b/IIfA/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
index 3c4ab31..7a88896 100644
--- a/IIfA/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
+++ b/IIfA/libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
@@ -4,7 +4,7 @@


 --Register LAM with LibStub
-local MAJOR, MINOR = "LibAddonMenu-2.0", 25
+local MAJOR, MINOR = "LibAddonMenu-2.0", 26
 local lam, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
 if not lam then return end --the same or newer version of this lib is already loaded into memory

@@ -409,9 +409,31 @@ local localization = {
         RELOAD_DIALOG_RELOAD_BUTTON = "Przeładuj",
         RELOAD_DIALOG_DISCARD_BUTTON = "Porzuć",
     },
+    kr = { -- provided by p.walker
+        PANEL_NAME = "蝠盜蠨",
+        VERSION = "纄訄: <<X:1>>",
+        WEBSITE = "裹芬襴钸 縩紸",
+        PANEL_INFO_FONT = "EsoKR/fonts/Univers57.otf|14|soft-shadow-thin",
+        RELOAD_UI_WARNING = "襴 茤訕襄 绀溽靘籴 風滼筼 訁袩靘瀰褄靴 UI 苈穜滠遨襴 靄袔革瓈瓤.",
+        RELOAD_DIALOG_TITLE = "UI 苈穜滠遨 靄袔",
+        RELOAD_DIALOG_TEXT = "绀溽瘜 茤訕 謑 UI 苈穜滠遨襄 靄袔穜靘璔 芬靭襴 覈蒵瓈瓤. 诀瀈 苈穜滠遨靘蓜溠蒵瓈灌? 蝄瓈籴 绀溽襄 迨莌靘蓜溠蒵瓈灌?",
+        RELOAD_DIALOG_RELOAD_BUTTON = "苈穜滠遨",
+        RELOAD_DIALOG_DISCARD_BUTTON = "绀溽迨莌",
+    },
+    br = { -- provided by mlsevero
+        PANEL_NAME = "Addons",
+        AUTHOR = string.format("%s: <<X:1>>", GetString(SI_ADDON_MANAGER_AUTHOR)), -- "Autor: <<X:1>>"
+        VERSION = "Versão: <<X:1>>",
+        WEBSITE = "Visite o Website",
+        RELOAD_UI_WARNING = "Mudanças nessa configuração requer a releitura da UI para ter efeito.",
+        RELOAD_DIALOG_TITLE = "Releitura da UI requerida",
+        RELOAD_DIALOG_TEXT = "Algumas mudanças requerem a releitura da UI para ter efeito. Você deseja reler agora ou descartar as mudanças?",
+        RELOAD_DIALOG_RELOAD_BUTTON = "Relê",
+        RELOAD_DIALOG_DISCARD_BUTTON = "Descarta",
+    },
 }

-util.L = ZO_ShallowTableCopy(localization[GetCVar("Language.2")], localization["en"])
+util.L = ZO_ShallowTableCopy(localization[GetCVar("Language.2")] or {}, localization["en"])
 util.GetTooltipText = GetStringFromValue -- deprecated, use util.GetStringFromValue instead
 util.GetStringFromValue = GetStringFromValue
 util.GetDefaultValue = GetDefaultValue