View Single Post
11-17-16, 01:24 PM   #9
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Not sure if RequiredDeps is the right tag to use when the target is a LoD addon. You should use LoadWith instead.

Code:
## LoadOnDemand: 1
## LoadWith: Blizzard_Collections


Also, the specific way CollectionsJournal_UpdateSelectedTab() is written, you don't need to replace it. You can secure hook it and add your own code to show your own tab.

Here's an example:
Lua Code:
  1. local TabName="MyNewTab";
  2.  
  3. local TabID=CollectionsJournal.numTabs+1;
  4. local Tab=CreateFrame("Button","$parentTab"..TabID,CollectionsJournal,"CollectionsJournalTab",TabID);
  5. PanelTemplates_SetNumTabs(CollectionsJournal,TabID);
  6. Tab:SetPoint("LEFT","$parentTab"..(TabID-1),"RIGHT",-16,0);
  7. Tab:SetText(TabName);
  8.  
  9. local Panel=CreateFrame("Frame",nil,CollectionsJournal);
  10. Panel:SetAllPoints(CollectionsJournal);
  11.  
  12. hooksecurefunc("CollectionsJournal_UpdateSelectedTab",function(self)
  13.     local selected=PanelTemplates_GetSelectedTab(self);
  14.     if selected==TabID then CollectionsJournalTitleText:SetText(TabName); end
  15.     Panel:SetShown(selected==TabID);
  16. end);

Panel is the frame you'll want to build your UI on and it also plays nice with any other addon that wants to create their own tab on the CollectionsJournal.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)

Last edited by SDPhantom : 11-17-16 at 01:45 PM.
  Reply With Quote