First of all, thanks so much for the release of this addon. It's quite wonderful! I was curious however if it was possible to code a LoadOnDemand option into the addon? I tried doing so myself, but I was getting errors once I loaded the addon up (moving windows around and so forth). I assumed that the process would not be easy, but not impossible. Looking at the Carbonite.lua file, I quickly gave up, as the author has intentionally made it difficult to modify & read. Any insight would be greatly appreciated!! By the way, here is the code I used for my LOD addon.
Code:
## Interface: 30100
## Title: |cff99ccffCarbonite LOD|r
## Author: kneeki
## Email: [email protected]
## Notes: Forces the addon Carbonite to a Load on Demand state.
## Version: 3.1.x
Core.lua
Code:
local CarboniteLOD = CreateFrame('Frame', 'CarboniteLOD', UIParent)
local CarboniteLOD_Loaded = false
CarboniteLOD:RegisterEvent("ADDON_LOADED")
CarboniteLOD:SetScript("OnEvent", function() CarboniteLOD:OnEvent(event, arg1) end)
function CarboniteLOD:OnEvent(event, arg1)
if (event == "ADDON_LOADED" and arg1 == "CarboniteLOD") then
-- Add the slash commands
SlashCmdList["CARBONITELOD"] = function()
if CarboniteLOD_Loaded == false then
UIParentLoadAddOn("Carbonite")
print("Attempted to load the 'Carbonite' addon into game memory.")
CarboniteLOD_Loaded = true
end
end
SLASH_CARBONITELOD1 = "/loadcarbonite"
print('asdf')
end
end
Oh, by the way. I of course changed the Carbonite.toc file's LOD state to: '## LoadOnDemand: 1' and removed the DEFAULTSTATE.