Garkin 0.2 release

Sasky [06-20-14 - 21:11]
Garkin 0.2 release

Adds Promise object, settings
Filename
LAddMin.lua
LAddMin.txt
LibAddonMenu-1.0.txt
diff --git a/LAddMin.lua b/LAddMin.lua
index 322f55e..897da76 100644
--- a/LAddMin.lua
+++ b/LAddMin.lua
@@ -1,5 +1,5 @@
 -------------------------------------------------------------------------------
--- LAddMin v0.1
+-- LAddMin v0.2
 -------------------------------------------------------------------------------
 --
 -- Copyright (c) 2014 Ales Machat (Garkin)
@@ -34,248 +34,429 @@ local LAM1 = LibStub("LibAddonMenu-1.0")
 local LAM2 = LibStub("LibAddonMenu-2.0")

 -------------------------------------------------------------------------------
--- Library replacement --------------------------------------------------------
+-- Local variables ------------------------------------------------------------
 -------------------------------------------------------------------------------
-local FAKE_LAM1 = setmetatable ({}, { __index = LAM1 })
-LibStub.libs["LibAddonMenu-1.0"] = FAKE_LAM1
-LibStub.minors["LibAddonMenu-1.0"] = 999
-
-local settingsTable = {}
+local sv
 local panelIDs = {}
+local settingsTable = {}
+local invalidAddons = {
+   ["Rainbow Config"] = true,
+}
+-- local missedPanelIDs = {}
+-- local lastID = 1000
+
+-------------------------------------------------------------------------------
+-- Delayed calls object, author Sasky (http://www.esoui.com/forums/member.php?u=2586)
+-------------------------------------------------------------------------------
+local Promise = {}
+setmetatable(Promise, {
+   __index = function(self, key)
+      self:__preSave(key)
+      return (self.__save)
+   end,
+   __call = function (cls, ...)
+      return cls.__new(...)
+   end
+})
+function Promise:__new()
+   local o = setmetatable({}, {
+      __index = Promise,
+      __call = function (cls, ...)
+         return cls:__execute(...)
+      end
+   })
+   o.callList = {}
+   o.nextKey = nil

-local excludeList = {
-   "_mainPanel",
-   "_optionsRestacker",
-   "_vicstersAddons",
-   "X4D_LibAntiSpam_CPL",
-   "X4D_Chat_CPL",
-   "SCA",
-   "|cFF2222Wykkyd's|r ConfigPanel",
-   "FTC_SettingsPanel",
-   "SousChefMenu",
-   "SpamFilter_OptionsPanel",
-   "Undiscovered_OptionsPanel",
-   "Azurah_SettingsMenu",
-   "Srendarr_SettingsMenu",
-   "pCHAT_OPTIONS",
- }
+   return o
+end
+
+function Promise:__preSave(key)
+   self.nextKey = key
+end
+
+function Promise:__save(...)
+   if self.nextKey == nil then return end
+
+   table.insert(self.callList, {
+      func = self.nextKey,
+      narg = select('#', ...),
+      varargs = {...}
+   })
+   self.nextKey = nil
+end
+
+MISSED_CALLS = {}
+function Promise:__execute(obj)
+   for k,v in ipairs(self.callList) do
+      table.insert(MISSED_CALLS, k .. ":" .. v.func .. "(" .. table.concat(v.varargs,",") .. ")")
+      obj[v.func](v.func, unpack(v.varargs))
+   end
+end

 -------------------------------------------------------------------------------
--- FAKE_LAM1 functions --------------------------------------------------------
+-- Library replacement --------------------------------------------------------
 -------------------------------------------------------------------------------
-do
-   -- LAM1:CreateControlPanel(controlPanelID, controlPanelName)
-   function FAKE_LAM1:CreateControlPanel(controlPanelID, controlPanelName)
-      local name = controlPanelName:gsub("|[cC]%w%w%w%w%w%w",""):gsub("|[rR]","")
-
-      for i,v in ipairs(excludeList) do
-         if controlPanelID == v then
-            return LAM1:CreateControlPanel(controlPanelID, name)
+--catch calls from addons which creates menu before saved variables are available (Rainbow Reticle)
+-- local MissedLamCalls = Promise()
+-- LibStub.libs["LibAddonMenu-1.0"] = setmetatable({}, { __index = MissedLamCalls })
+-- local LAM = LibStub:NewLibrary("LibAddonMenu-1.0", 999)
+-- function LAM:CreateControlPanel(controlPanelID, controlPanelName)
+--    local name = controlPanelName:gsub("|[cC]%w%w%w%w%w%w",""):gsub("|[rR]","")
+--
+--    if missedPanelIDs[name] ~= nil then
+--       return missedPanelIDs[name]
+--    end
+--
+--    lastID = lastID + 1
+--    missedPanelIDs[name] = lastID
+--
+--    MissedLamCalls:CreateControlPanel(controlPanelID, controlPanelName)
+--
+--    return lastID
+-- end
+
+--LAM 1.0 to 2.0 interface
+FAKE_LAM1 = setmetatable ({}, { __index = LAM1 })
+LibStub.libs["LibAddonMenu-1.0"] = FAKE_LAM1
+LibStub.minors["LibAddonMenu-1.0"] = 999
+-- LAM1:CreateControlPanel(controlPanelID, controlPanelName)
+function FAKE_LAM1:CreateControlPanel(controlPanelID, controlPanelName)
+   local name = controlPanelName:gsub("|[cC]%w%w%w%w%w%w",""):gsub("|[rR]","")
+
+   if sv == nil then
+      if not invalidAddons[name] then
+         invalidAddons[name] = false
+         return LAM1:CreateControlPanel(controlPanelID, name)
+      end
+   else
+      if not sv.enabled[name] then
+         if sv.enabled[name] == nil then
+            sv.enabled[name] = false
          end
+         return LAM1:CreateControlPanel(controlPanelID, name)
       end
+   end

-      if panelIDs[name] ~= nil then
-         return panelIDs[name]
-      end
+   if panelIDs[name] ~= nil then
+      return panelIDs[name]
+   end

-      local panelID = #settingsTable + 1001
-      panelIDs[name] = panelID
+   local panelID = #settingsTable + 1001
+   panelIDs[name] = panelID

-      local panelTable = {
-         name = name,
-         displayName = controlPanelName,
-         controls = {},
-      }
+   local panelTable = {
+      name = name,
+      displayName = controlPanelName,
+      controls = {},
+   }

-      settingsTable[panelID - 1000] = panelTable
+   settingsTable[panelID - 1000] = panelTable

-      LAM2:RegisterAddonPanel(controlPanelID, panelTable)
-      LAM2:RegisterOptionControls(controlPanelID, panelTable.controls)
+   LAM2:RegisterAddonPanel(controlPanelID, panelTable)
+   LAM2:RegisterOptionControls(controlPanelID, panelTable.controls)

-      return panelID
+   return panelID
+end
+-- LAM1:AddHeader(panelID, controlName, text)
+function FAKE_LAM1:AddHeader(panelID, controlName, text)
+   if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
+      return LAM1:AddHeader(panelID, controlName, text)
    end
-   -- LAM1:AddHeader(panelID, controlName, text)
-   function FAKE_LAM1:AddHeader(panelID, controlName, text)
-      if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
-         return LAM1:AddHeader(panelID, controlName, text)
-      end

-      local controlTable = {
-         type = "header",
-         name = text,
-         reference = controlName,
-      }
+   local controlTable = {
+      type = "header",
+      name = text,
+      reference = controlName .. "_LAddMin",
+      controlName = controlName,
+   }
+
+   local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
+   table.insert(tab, controlTable)

-      local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
-      table.insert(tab, controlTable)
+   _G[controlName] = Promise()

-      return tab[#tab]
+   return _G[controlName]
+end
+-- LAM1:AddSlider(panelID, controlName, text, tooltip, minValue, maxValue, step, getFunc, setFunc, warning, warningText)
+function FAKE_LAM1:AddSlider(panelID, controlName, text, tooltip, minValue, maxValue, step, getFunc, setFunc, warning, warningText)
+   if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
+      return LAM1:AddSlider(panelID, controlName, text, tooltip, minValue, maxValue, step, getFunc, setFunc, warning, warningText)
    end
-   -- LAM1:AddSlider(panelID, controlName, text, tooltip, minValue, maxValue, step, getFunc, setFunc, warning, warningText)
-   function FAKE_LAM1:AddSlider(panelID, controlName, text, tooltip, minValue, maxValue, step, getFunc, setFunc, warning, warningText)
-      if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
-         return LAM1:AddSlider(panelID, controlName, text, tooltip, minValue, maxValue, step, getFunc, setFunc, warning, warningText)
-      end

-      local controlTable = {
-         type = "slider",
-         name = text,
-         tooltip = tooltip,
-         min = minValue,
-         max = maxValue,
-         step = step,
-         getFunc = getFunc,
-         setFunc = setFunc,
-         warning = warningText,
-         reference = controlName,
-      }
+   local controlTable = {
+      type = "slider",
+      name = text,
+      tooltip = tooltip,
+      min = minValue,
+      max = maxValue,
+      step = step,
+      getFunc = getFunc,
+      setFunc = setFunc,
+      warning = warningText,
+      reference = controlName .. "_LAddMin",
+      controlName = controlName,
+   }
+
+   local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
+   table.insert(tab, controlTable)
+
+   _G[controlName] = Promise()
+
+   return _G[controlName]
+end
+-- LAM1:AddDropdown(panelID, controlName, text, tooltip, validChoices, getFunc, setFunc, warning, warningText)
+function FAKE_LAM1:AddDropdown(panelID, controlName, text, tooltip, validChoices, getFunc, setFunc, warning, warningText)
+   if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
+      return LAM1:AddDropdown(panelID, controlName, text, tooltip, validChoices, getFunc, setFunc, warning, warningText)
+   end
+
+   local controlTable = {
+      type = "dropdown",
+      name = text,
+      tooltip = tooltip,
+      choices = validChoices,
+      getFunc = getFunc,
+      setFunc = setFunc,
+      warning = warningText,
+      reference = controlName .. "_LAddMin",
+      controlName = controlName,
+   }

-      local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
-      table.insert(tab, controlTable)
+   local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
+   table.insert(tab, controlTable)

-      return tab[#tab]
+   _G[controlName] = Promise()
+
+   return _G[controlName]
+end
+-- LAM1:AddCheckbox(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
+function FAKE_LAM1:AddCheckbox(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
+   if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
+      return LAM1:AddCheckbox(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
    end
-   -- LAM1:AddDropdown(panelID, controlName, text, tooltip, validChoices, getFunc, setFunc, warning, warningText)
-   function FAKE_LAM1:AddDropdown(panelID, controlName, text, tooltip, validChoices, getFunc, setFunc, warning, warningText)
-      if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
-         return LAM1:AddDropdown(panelID, controlName, text, tooltip, validChoices, getFunc, setFunc, warning, warningText)
-      end

-      local controlTable = {
-         type = "dropdown",
-         name = text,
-         tooltip = tooltip,
-         choices = validChoices,
-         getFunc = getFunc,
-         setFunc = setFunc,
-         warning = warningText,
-         reference = controlName,
-      }
+   local controlTable = {
+      type = "checkbox",
+      name = text,
+      tooltip = tooltip,
+      getFunc = getFunc,
+      setFunc = setFunc,
+      warning = warningText,
+      reference = controlName .. "_LAddMin",
+      controlName = controlName,
+   }

-      local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
-      table.insert(tab, controlTable)
+   local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
+   table.insert(tab, controlTable)

-      return tab[#tab]
+   _G[controlName] = Promise()
+
+   return _G[controlName]
+end
+-- LAM1:AddColorPicker(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
+function FAKE_LAM1:AddColorPicker(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
+   if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
+      return LAM1:AddColorPicker(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
    end
-   -- LAM1:AddCheckbox(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
-   function FAKE_LAM1:AddCheckbox(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
-      if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
-         return LAM1:AddCheckbox(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
-      end

-      local controlTable = {
-         type = "checkbox",
-         name = text,
-         tooltip = tooltip,
-         getFunc = getFunc,
-         setFunc = setFunc,
-         warning = warningText,
-         reference = controlName,
-      }
+   local controlTable = {
+      type = "colorpicker",
+      name = text,
+      tooltip = tooltip,
+      getFunc = getFunc,
+      setFunc = setFunc,
+      warning = warningText,
+      reference = controlName .. "_LAddMin",
+      controlName = controlName,
+   }

-      local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
-      table.insert(tab, controlTable)
+   local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
+   table.insert(tab, controlTable)

-      return tab[#tab]
+   _G[controlName] = Promise()
+
+   return _G[controlName]
+end
+-- LAM1:AddEditBox(panelID, controlName, text, tooltip, isMultiLine, getFunc, setFunc, warning, warningText)
+function FAKE_LAM1:AddEditBox(panelID, controlName, text, tooltip, isMultiLine, getFunc, setFunc, warning, warningText)
+   if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
+      return LAM1:AddEditBox(panelID, controlName, text, tooltip, isMultiLine, getFunc, setFunc, warning, warningText)
    end
-   -- LAM1:AddColorPicker(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
-   function FAKE_LAM1:AddColorPicker(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
-      if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
-         return LAM1:AddColorPicker(panelID, controlName, text, tooltip, getFunc, setFunc, warning, warningText)
-      end

-      local controlTable = {
-         type = "colorpicker",
-         name = text,
-         tooltip = tooltip,
-         getFunc = getFunc,
-         setFunc = setFunc,
-         warning = warningText,
-         reference = controlName,
-      }
+   local controlTable = {
+      type = "editbox",
+      name = text,
+      tooltip = tooltip,
+      getFunc = getFunc,
+      setFunc = setFunc,
+      isMultiline = isMultiLine,
+      warning = warningText,
+      reference = controlName .. "_LAddMin",
+      controlName = controlName,
+   }
+
+   local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
+   table.insert(tab, controlTable)
+
+   local missedCalls = Promise()
+   _G[controlName] = missedCalls
+   missedCalls.additionalObjects = {}
+   _G[controlName].edit = Promise()
+   table.insert(missedCalls.additionalObjects, { edit = _G[controlName].edit })
+
+   return _G[controlName]
+end
+-- LAM1:AddButton(panelID, controlName, text, tooltip, onClick, warning, warningText)
+function FAKE_LAM1:AddButton(panelID, controlName, text, tooltip, onClick, warning, warningText)
+   if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
+      return LAM1:AddButton(panelID, controlName, text, tooltip, onClick, warning, warningText)
+   end
+
+   local controlTable = {
+      type = "button",
+      name = text,
+      tooltip = tooltip,
+      func = onClick,
+      warning = warningText,
+      reference = controlName .. "_LAddMin",
+      controlName = controlName,
+   }
+
+   local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
+   table.insert(tab, controlTable)

-      local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
-      table.insert(tab, controlTable)
+   _G[controlName] = Promise()

-      return tab[#tab]
+   return _G[controlName]
+end
+-- LAM1:AddDescription(panelID, controlName, text, titleText)
+function FAKE_LAM1:AddDescription(panelID, controlName, text, titleText)
+   if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
+      return LAM1:AddDescription(panelID, controlName, text, titleText)
    end
-   -- LAM1:AddEditBox(panelID, controlName, text, tooltip, isMultiLine, getFunc, setFunc, warning, warningText)
-   function FAKE_LAM1:AddEditBox(panelID, controlName, text, tooltip, isMultiLine, getFunc, setFunc, warning, warningText)
-      if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
-         return LAM1:AddEditBox(panelID, controlName, text, tooltip, isMultiLine, getFunc, setFunc, warning, warningText)
-      end

-      local controlTable = {
-         type = "editbox",
-         name = text,
-         tooltip = tooltip,
-         getFunc = getFunc,
-         setFunc = setFunc,
-         isMultiline = isMultiLine,
-         warning = warningText,
-         reference = controlName,
-      }
+   local controlTable = {
+      type = "description",
+      title = titleText,
+      text = text,
+      reference = controlName .. "_LAddMin",
+      controlName = controlName,
+   }
+
+   local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
+   table.insert(tab, controlTable)

-      local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
-      table.insert(tab, controlTable)
+   _G[controlName] = Promise()

-      return tab[#tab]
+   return _G[controlName]
+end
+-- LAM1:AddSubMenu(panelID, controlName, text, tooltip)
+function FAKE_LAM1:AddSubMenu(panelID, controlName, text, tooltip)
+   if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
+      return LAM1:AddSubMenu(panelID, controlName, text, tooltip)
    end
-   -- LAM1:AddButton(panelID, controlName, text, tooltip, onClick, warning, warningText)
-   function FAKE_LAM1:AddButton(panelID, controlName, text, tooltip, onClick, warning, warningText)
-      if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
-         return LAM1:AddButton(panelID, controlName, text, tooltip, onClick, warning, warningText)
-      end

-      local controlTable = {
-         type = "button",
-         name = text,
-         tooltip = tooltip,
-         func = onClick,
-         warning = warningText,
-         reference = controlName,
-      }
+   local controlTable = {
+      type = "submenu",
+      name = text,
+      tooltip = tooltip,
+      reference = controlName .. "_LAddMin",
+      controlName = controlName,
+      controls = {},
+   }
+
+   _G[controlName] = controlTable.controls
+
+   local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
+   table.insert(tab, controlTable)
+
+   return _G[controlName]
+end

-      local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
-      table.insert(tab, controlTable)

-      return tab[#tab]
-   end
-   -- LAM1:AddDescription(panelID, controlName, text, titleText)
-   function FAKE_LAM1:AddDescription(panelID, controlName, text, titleText)
-      if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
-         return LAM1:AddDescription(panelID, controlName, text, titleText)
+-------------------------------------------------------------------------------
+-- Local functions ------------------------------------------------------------
+-------------------------------------------------------------------------------
+local function DelayedCalls(panel)
+   local panelID = panelIDs[panel:GetName()]
+   if panelID then
+      for i,controlTable in ipairs(settingsTable[panelID - 1000].controls) do
+         local missedCalls = _G[controlTable.controlName]
+         _G[controlTable.controlName] = _G[controlTable.reference]
+
+         missedCalls(_G[controlTable.controlName])
+
+         for key, missedCall in pairs(missedCalls.additionalObjects) do
+            if key == "edit" then
+               _G[controlTable.controlName][key] = _G[controlTable.controlName].editbox
+               missedCall(_G[controlTable.controlName][key])
+            else
+               missedCall(_G[controlTable.controlName][key])
+            end
+         end
+
+         _G[controlTable.reference] = nil
+         missedCalls = nil
       end
+   end
+end

-      local controlTable = {
-         type = "description",
-         title = titleText,
-         text = text,
-         reference = controlName,
+local function CreateSettingsMenu()
+   local panel = {
+      name = "L'AddonMinder",
+      displayName = "|cFFFFB0L'AddonMinder|r",
+      author = "Garkin",
+      version = "0.2",
+      registerForRefresh = true,
+      registerForDefaults = true
+   }
+   LAM2:RegisterAddonPanel("LAddMin_Panel", panel)
+
+   local addonNames = {}
+   for name in pairs(sv.enabled) do
+      table.insert(addonNames, name)
+   end
+   table.sort(addonNames)
+
+   local controlTable = {}
+   for _,name in ipairs(addonNames) do
+      local checkbox = {
+         type = "checkbox",
+         name = name,
+         getFunc = function() return sv.enabled[name] end,
+         setFunc = function(value) sv.enabled[name] = value end,
+         default = false
       }
+      table.insert(controlTable, checkbox)
+   end

-      local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
-      table.insert(tab, controlTable)
-
-      return tab[#tab]
+   local text = {}
+   for name in pairs(invalidAddons) do
+      table.insert(text, name)
    end
-   -- LAM1:AddSubMenu(panelID, controlName, text, tooltip)
-   function FAKE_LAM1:AddSubMenu(panelID, controlName, text, tooltip)
-      if type(panelID) == "userdata" or (type(panelID) == "number" and panelID < 1000) then
-         return LAM1:AddSubMenu(panelID, controlName, text, tooltip)
-      end
+   if #text > 0 then
+      table.insert(controlTable, { type = "description", title = "Invalid addons:", text = table.concat(text, "\n- ") })
+   end
+
+   table.insert(controlTable, { type = "button", name = GetString(SI_ADDON_MANAGER_RELOAD), func = function() ReloadUI("ingame") end } )
+
+   LAM2:RegisterOptionControls("LAddMin_Panel", controlTable)
+end

-      local controlTable = {
-         type = "submenu",
-         name = text,
-         tooltip = tooltip,
-         reference = controlName,
-         controls = {},
-      }
+local function OnAddonLoaded(code, addon)
+   if addon ~= "LAddMin" then return end

-      local tab = type(panelID) == "table" and panelID or settingsTable[panelID - 1000].controls
-      table.insert(tab, controlTable)
+   sv = ZO_SavedVars:NewAccountWide("LAddMin_SavedVariables", 1, "Addons", { enabled = {} })
+
+--    LibStub.libs["LibAddonMenu-1.0"] = FAKE_LAM1
+--    MissedLamCalls(FAKE_LAM1)

-      return tab[#tab].controls
-   end
+   CreateSettingsMenu()
+
+   CALLBACK_MANAGER:RegisterCallback("LAM-PanelControlsCreated", DelayedCalls)
+
+   EVENT_MANAGER:UnregisterForEvent(addon, code)
 end
+
+EVENT_MANAGER:RegisterForEvent("LAddMin", EVENT_ADD_ON_LOADED, OnAddonLoaded)
diff --git a/LAddMin.txt b/LAddMin.txt
index 5aa7723..e26949b 100644
--- a/LAddMin.txt
+++ b/LAddMin.txt
@@ -1,10 +1,13 @@
-## Title: |cFFFFB0LAddMin|r 0.1 - By |c00C000Garkin|r
-## Version: 0.1
+## Title: |cFFFFB0L'AddonMinder|r 0.2 - By |c00C000Garkin|r
+## Version: 0.2
 ## Author: Garkin
 ## APIVersion: 100004
+## SavedVariables: LAddMin_SavedVariables

 Libs\LibStub\LibStub.lua
+
 Libs\LibAddonMenu-1.0\LibAddonMenu-1.0.lua
+
 Libs\LibAddonMenu-2.0\LibAddonMenu-2.0.lua
 Libs\LibAddonMenu-2.0\controls\panel.lua
 Libs\LibAddonMenu-2.0\controls\submenu.lua
diff --git a/LibAddonMenu-1.0.txt b/LibAddonMenu-1.0.txt
index 2347272..98cad4c 100644
--- a/LibAddonMenu-1.0.txt
+++ b/LibAddonMenu-1.0.txt
@@ -1,4 +1,5 @@
-## Title: |cFFFFB0LAddMin loader|r 0.1
+## Title: |cFFFFB0L'AddonMinder loader|r
+## Version: 0.1
 ## APIVersion: 100004
 ## DependsOn: LAddMin