Thread Tools Display Modes
04-20-09, 04:01 PM   #1
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
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.
 
04-22-09, 04:07 AM   #2
carboniteaddon
A Pyroguard Emberseer
 
carboniteaddon's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2008
Posts: 2,245
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.
__________________
faatal
 
04-22-09, 01:52 PM   #3
kneeki
A Flamescale Wyrmkin
 
kneeki's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2006
Posts: 134
Originally Posted by carboniteaddon View Post
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
 
04-22-09, 03:22 PM   #4
Spahut
A Cobalt Mageweaver
Join Date: Jan 2006
Posts: 231
It is load on demand: I demand it is loaded then i start
 
 

WoWInterface » Featured Projects » Carbonite » Carbonite Archive » Carbonite Load on Demand


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off