Thread Tools Display Modes
10-18-10, 09:36 AM   #1
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Completely confused

Just tried to do a fix for CFM, but has caused an error and I have no idea why:

lua Code:
  1. function CFM:ADDON_LOADED(_,addon)
  2.     if addon ~= "CFM" then return end
  3.    
  4.     -- Load Blizzard UIs
  5.     LoadAddOn("Blizzard_AchievementUI")
  6.     AchievementAlertFrame_GetAlertFrame() -- load to avoid achievement alert frame errors
  7. --rest of code
  8. end

Produces error when opening achievement frame:
Code:
Error occured in: Global
Count: 1
Message: ...ns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua line 569:
   attempt to index local 'button' (a nil value)
Debug:
   [C]: ?
   ...ns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:569: AchievementFrameCategories_SelectButton()
   ...ns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:717: AchievementCategoryButton_OnClick()
   ...ns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:119:
      ...ns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:114
   [C]: Show()
   ..\FrameXML\UIParent.lua:1467: SetUIPanel()
   ..\FrameXML\UIParent.lua:1288: ShowUIPanel()
   ..\FrameXML\UIParent.lua:1198:
      ..\FrameXML\UIParent.lua:1194
   [C]: SetAttribute()
   ..\FrameXML\UIParent.lua:1873:
      ..\FrameXML\UIParent.lua:1861
   [C]: ShowUIPanel()
   ...ns\Blizzard_AchievementUI\Blizzard_AchievementUI.lua:79: AchievementFrame_ToggleAchievementFrame()
   ..\FrameXML\UIParent.lua:373: ToggleAchievementFrame()
   [string "TOGGLEACHIEVEMENT"]:1:
      [string "TOGGLEACHIEVEMENT"]:1
And here I thought I was just simply forcing the creation of the achievement alert frames.
  Reply With Quote
10-18-10, 10:30 AM   #2
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
The time CFM gets loaded is too early to force load the Blizzard addon?

Try loading it at a later event.
  Reply With Quote
10-18-10, 10:41 AM   #3
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Originally Posted by Dridzt View Post
The time CFM gets loaded is too early to force load the Blizzard addon?

Try loading it at a later event.
I was just coming to post that this was the issue and to ignore my post. Thanks nonetheless.
  Reply With Quote
10-18-10, 11:48 AM   #4
Xinhuan
A Chromatic Dragonspawn
 
Xinhuan's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 174
You can always make your addon's TOC

## LoadOnDemand: 1
## LoadWith: Blizzard_AchievementUI

Problem solved, your addon always loads after it.
__________________
Author of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, GatherMate2, Routes and Cartographer_Routes
  Reply With Quote
10-18-10, 09:07 PM   #5
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Originally Posted by Xinhuan View Post
You can always make your addon's TOC

## LoadOnDemand: 1
## LoadWith: Blizzard_AchievementUI

Problem solved, your addon always loads after it.
Except that the Blizzard_AchievementUI doesn't load until you either open the frame or trip the event. I need the addon functional before this point. Good suggestion, just not useful in this case.
  Reply With Quote
10-18-10, 09:29 PM   #6
Xinhuan
A Chromatic Dragonspawn
 
Xinhuan's Avatar
AddOn Author - Click to view addons
Join Date: Feb 2007
Posts: 174
Originally Posted by ChaosInc View Post
Except that the Blizzard_AchievementUI doesn't load until you either open the frame or trip the event. I need the addon functional before this point. Good suggestion, just not useful in this case.
Then ## RequiredDeps: Blizzard_AchievementUI.
__________________
Author of Postal, Omen3, GemHelper, BankItems, WoWEquip, GatherMate, GatherMate2, Routes and Cartographer_Routes
  Reply With Quote
10-18-10, 09:47 PM   #7
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Personally, I would only want the Achievement UI loaded if it's needed...
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Completely confused


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