WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Carbonite Archive (https://www.wowinterface.com/forums/forumdisplay.php?f=158)
-   -   Carbonite Load on Demand (https://www.wowinterface.com/forums/showthread.php?t=22589)

kneeki 04-20-09 04:01 PM

Carbonite Load on Demand
 
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.

carboniteaddon 04-22-09 04:07 AM

Sorry, but I don't think that is going to happen. There is a ton of initialization that happens at various times on login to hook into a variety of game systems. It is not something we even want to attempt.

kneeki 04-22-09 01:52 PM

Quote:

Originally Posted by carboniteaddon (Post 129923)
Sorry, but I don't think that is going to happen. There is a ton of initialization that happens at various times on login to hook into a variety of game systems. It is not something we even want to attempt.

Ok, thanks for the response! I figured I would at least give it a shot ;)

Spahut 04-22-09 03:22 PM

It is load on demand: I demand it is loaded then i start ;)


All times are GMT -6. The time now is 12:31 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI