I redid it with the instructions more carefully, fixing my .txt file and how I add the LAM module. I followed the ZAM Stats module on how they load and use it, every part. Still same error. The menu is loaded, but when I interact with Inventory it errors.
Code:
## OptionalDependsOn: LibAddonMenu-2.0
bindings.xml
keystrip.lua
localizations.lua
LibStub\LibStub.lua
LibAddonMenu-2.0\LibAddonMenu-2.0.lua
LibAddonMenu-2.0\controls\panel.lua
LibAddonMenu-2.0\controls\submenu.lua
LibAddonMenu-2.0\controls\button.lua
LibAddonMenu-2.0\controls\checkbox.lua
LibAddonMenu-2.0\controls\colorpicker.lua
LibAddonMenu-2.0\controls\custom.lua
LibAddonMenu-2.0\controls\description.lua
LibAddonMenu-2.0\controls\dropdown.lua
LibAddonMenu-2.0\controls\editbox.lua
LibAddonMenu-2.0\controls\header.lua
LibAddonMenu-2.0\controls\slider.lua
LibAddonMenu-2.0\controls\texture.lua
LibAddonMenu-2.0\controls\iconpicker.lua
LibAddonMenu-2.0\controls\divider.lua
Junkee.lua
Code:
-- Add menu with options.
local panelData = {
type = "panel",
name = "Junkee",
author = "Seerah",
version = "1.1.3",
displayName = "Junkee Settings",
registerForRefresh = true,
registerForDefaults = true,
}
local optionsTable = {
[1] = {
type = "checkbox",
name = "Display Keybindings",
tooltip = "Display the addon's keybindings when opening the Inventory. " ..
"They appear on the bottom left.",
getFunc = function() return Junkee.visible end,
setFunc = function(v) Junkee.visible = v end,
width = "full", --or "half",
default = true
},
}
local function LoadMenu()
LAM:RegisterAddonPanel("Junkee", panelData)
LAM:RegisterOptionControls("Junkee", optionsTable)
end
Junkee.Loaded = function(eventCode, addonName)
if (Junkee.name == addonName) then
registerHooks()
-- Load saved variables.
Junkee.savedVars = ZO_SavedVars:New("JunkeeAddonSavedVariables", 1, nil,
{
visible = Junkee.visible,
firstRun = true -- OnActivated()
})
LoadMenu()
end
end
em:RegisterForEvent(Junkee.name, EVENT_ADD_ON_LOADED, Junkee.Loaded)