Thread Tools Display Modes
12-25-14, 03:14 PM   #1
AnrDaemon
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 156
Little help fixing too flashy garrison frames

I'm trying to make a permanent fix to abusive garrison interface.
I've found a way to disable flash for order queue frame, …
lua Code:
  1. frame = GarrisonCapacitiveDisplayFrame.FinishedGlow
  2. frame:SetScript("OnShow", frame.Hide)
  3. frame:Hide()
…but it only works, if I've seen that frame at least once in current game session.
How can I go about it firing automatically at the right moment?

Last edited by AnrDaemon : 12-25-14 at 03:30 PM.
  Reply With Quote
12-25-14, 04:38 PM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
Garrison UI is probably a LoD Blizzard addon.

You should register ADDON_LOADED and watch for arg1 being "Blizzard_GarrisonUI", then do whatever to the frame.
  Reply With Quote
12-25-14, 04:56 PM   #3
AnrDaemon
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 156
That's an idea. Thankfully I've the necessary infrastructure already in place.
  Reply With Quote
12-25-14, 08:23 PM   #4
AnrDaemon
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 156
On a second thought, I could use a little hint or two.
Right now, I have everything in a single file. Which, quite unsurprisingly, grow "a little" unwieldy.
I plan to separate stuff into more manageable chunks. However, the order of execution is important.

Right now, the code is laid like this:

Main addon frame (listener) is created right away, along with events table.
Then some additional stuff happens, that is not relevant to anything at this point.
Then events table is populated by callback functions, one per event. Like,
Code:
function events:PLAYER_ENTERING_WORLD(...) … end
…and all the things are written inside.
Then the callbacks are registered as listeners. Like the usual
lua Code:
  1. for eventName, eventFunc in pairs(events) do
  2.   -- Register all events for which handlers have been defined
  3.   frame:RegisterEvent(eventName)
  4. end

The problem as I see it is I can no longer registed events right away in the main block. I need to postpone them. May be I should hook some event that is fired very early first, and do the registration there? Which event, if that is a good idea?

P.S.
I plan to use
Code:
local addonName, addon = ...
and pass the data structures inside the "local-global" "addon" table, so that is not an issue.
  Reply With Quote
12-25-14, 10:44 PM   #5
semlar
A Pyroguard Emberseer
 
semlar's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2007
Posts: 1,060
Just add "##Dependencies: Blizzard_GarrisonUI" to the toc file, unless your addon needs to do something before the garrison addon loads.
  Reply With Quote
12-25-14, 11:14 PM   #6
AnrDaemon
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 156
That would cause Garrison UI to load unconditionally, wouldn't it?
I'd like to avoid it, if I can help it. My loading times already quite long.
Besides, I can use some coding practice.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Little help fixing too flashy garrison frames


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