View Single Post
03/15/18, 03:13 PM   #5
Phuein
 
Phuein's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 132
Originally Posted by Dolgubon View Post
Go into the lam files, and open the controls folder. Open panel.Lua and the files of the other controls you are using. There should be a comment at the start, make sure you have all the required fields. Also make sure the table is in the correct format
I edited the example code that comes with it. It all seems correct. I tried simplifying it to make sure it's none of my code making trouble, too. Could it be an issue with the order of the code? Couldn't figure it out. I copied the LibStub.lua file to my main directory and use it in my addon, not sure if that's good practice either:
Code:
local wm = GetWindowManager()
local em = EVENT_MANAGER

local LAM = LibStub("LibAddonMenu-2.0")
Here's my code chunk:

Code:
local panelData = {
    type = "panel",
    name = "Junkee",
    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"
    },
}

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()
			})

		LAM:RegisterAddonPanel("Junkee", panelData)
		LAM:RegisterOptionControls("Junkee", optionsTable)
	end
end
I don't see any issues. Must be missing something.
  Reply With Quote