WoW BlueTracker Home | RSS | News | Contact
Recent | Search | Archive | CS Posts
Poster: Graguk at 10/4/2005 10:52:51 PM PDT
Subject: (slouken) Addons that depend on Blizzard UIs
   I was wondering if we could get clarification on how setting Blizzard UI elements as a dependancy works..

Basically, Gaddor was proposing some changes which fix GoodInspect so it worked in 1.8, however I wanted to understand what we are actually doing here:

http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=231557&p=1&tmp=1#post231557


Basically 2 options - define the Blizzard UI addon for the inspect panel as a dependency, or execute the _LoadUI() function when the addon (GoodInspect) loads..


If we set it as a dependancy (without converting the entire addon to Load-On-Demand - we are't the author), will the addon be forever looping in it's pre-initialised state (thus using CPU anyway), until the addon it depends on is loaded, or will it never even be called for loading until the first one is loaded? Does the in-game addon loader see the ## Dependancy flag in the .toc file and thus "bind" the Dependant addon to the Dependee addon and load them both together (in the right order) at the appropriate time?


If we use the second method of using the appropriate _LoadUI() function, are we not negating the benefit of having Load-On-Demand addons as part of the default UI? Is there an "_UnloadUI()" function too that will potentially be called later that will/could stop the dependant addon from working again? If there isn't an _UnloadUI addon, doesn't that mean that Load-On-Demand only saves you CPU/memory until you actually use that UI once per session? ie once I go to the Auction House, or open the Keybindings frame, they stay in memory until I exit the game?

Just trying to get a clearer picture on how we can modify abandoned addons to work with the new Blizzard UI elements (also concerned with the LocalBindings addon).
http://wowrankings.com/viewb.htm?name=Graguk&s_id=71
  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=234528&p=#post234528
 
Poster: slouken at 10/4/2005 11:53:50 PM PDT
Subject: Re: (slouken) Addons that depend on Blizzard UIs
   You are correct on both counts.

1. If you list a blizzard addon as a dependency, and you are not a demand loaded addon, then you force the Blizzard addon to load before yours, negating the benefit of the Blizzard addon being demand loaded.

2. If you call the function to load it explicitly in the OnLoad, you are forcing it to load while your frame is loading, again, negating the benefit.

What you really want to do is hook the function that loads the Blizzard UI.

e.g.

--
-- GoodInspect increases inspect range and allows inspection of opposing faction members.
-- also adds guild info to inspect window a la your character sheet.
-- version 1.0.2 by usea - 2005
--
BINDING_NAME_GOODINSPECT = "Inspect Target";
BINDING_HEADER_GOODINSPECT = "Good Inspect";

local old_InspectFrame_LoadUI = InspectFrame_LoadUI;
function InspectFrame_LoadUI()
old_InspectFrame_LoadUI();
InspectFrame:SetScript("OnUpdate", GoodInspect_InspectFrame_OnUpdate);
end

function GoodInspect_OnLoad()
...


I haven't actually looked at GoodInspect and I'm working from memory, but you get the idea...

Edit: Silversteed beat me to the punch. :)
Edit Again: I forgot the _LoadUI function is called every time the game wants to access the UI, so you definitely want to cache whether you've loaded the UI, like Silversteed pointed out.

[ post edited by slouken ]

  http://forums.worldofwarcraft.com/thread.aspx?fn=wow-interface-customization&t=234528&p=#post234554

View all recent official Blue Posts

WoW Blue Tracker: Archiving World of Warcraft Blue Posts
since March 2005
Home | RSS | News | Contact
Recent | Search | Archive | CS Posts
 

Why Ads?