ty for seeing that darn typo, im actually not looking to add a variable in to call for if the log is enabled, thats something i can easily do in game, im having an issue with setting and remembering minimap icon position. i have been reading alot more and did get my DB to add my character nam and realm to the DB which is something im not trying to do but atleast my DB is adding stuff altho its not the right stuff lol. ill keep at this and see if i get any luck TY all for your help here BTW.
ok with a few more changes im getting my DB to have the correct data, however i dont know how to get my minimap icon to load at the saved position, still reading thru stuff so i may end up getting this one however if someone sees changes i need to make to do this here is my NEW lua file::
Lua Code:
local f = CreateFrame("Frame")
MaggzAutoLog = LibStub("AceAddon-3.0"):NewAddon("MaggzAutoLog")
function MaggzAutoLog:OnInitialize()
self.db = LibStub("AceDB-3.0"):New("MaggzAutoLogDB")
end
local db;
local defaults = {
profile = {
LDBIconStorage = {},
},
};
local malObject = {
type = "launcher",
icon = "Interface\\Addons\\MaggzAutoLog\\disabled",
label = "MaggzAutoLog",
OnClick = function(self, button)
if button == "RightButton" then
LOGSTATE()
end
if button == "LeftButton" then
if LoggingCombat() then
disablelogging()
else
enablelogging()
end
end
end,
OnTooltipShow = function(tooltip)
tooltip:AddLine("|cff00FF00MaggzAutoLog|r");
tooltip:AddLine("hold left mouse button to drag");
tooltip:AddLine("right click to enable/disable logging");
if LoggingCombat() then
tooltip:AddLine("Logging |cff00FF00Enabled|r");
else
tooltip:AddLine("Logging |cffFF0000Disabled|r");
end
end,
};
function updateDB(self, event, database)
db = database.profile;
LibStub("LibDBIcon-1.0"):Refresh("MaggzAutoLogDB", db.LDBIconStorage);
end
local vars = LibStub("AceDB-3.0"):New("MaggzAutoLogDB", defaults);
vars:RegisterCallback("OnProfileChanged", updateDB);
vars:RegisterCallback("OnProfileCopied", updateDB);
vars:RegisterCallback("OnProfileReset", updateDB);
db = vars.profile;
LibStub("LibDataBroker-1.1"):NewDataObject("MaggzAutoLogDB", malObject);
LibStub("LibDBIcon-1.0"):Register("MaggzAutoLog", malObject, db.LDBIconStorage);
still working some things out so it is still a but messy.