View Single Post
03-22-24, 11:56 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,894
LibDBIcon has dependancies on LibStub and LibCallBackHandler. Those should both be included in your addon (lib folder) and .toc (or other .XML include file eg. embeds.xml) in case the user doesn't have another addon that does include them (libs aren't automatically included or loaded).

Frame names are also added to the global table and should also be unique "CodgerAddonFrame" instead of "MyAddonFrame". If it has a name (and is unique) you can use it in your show/hide code

Lua Code:
  1. OnClick = function(self, button)
  2.         if button == "LeftButton" then
  3.             CodgerAddonFrame:SetShown(not CodgerAddonFrame:IsShown()) -- toggle show/hide
  4.         elseif button == "RightButton" then
  5.             print("Right click not configured")
  6.         end
  7.     end,

Edit: Missed the "MyAddon" in:
Code:
local icon = LibDBIcon:Register("MyAddon", {
It should also be unique (like the name of your addon folder).
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 03-22-24 at 12:23 PM.
  Reply With Quote