Hi there...
The short answer to your question is:
You need to put this in your .toc file:
Code:
## LoadOnDemand: 1
## LoadWith: Blizzard_TradeSkillUI
The TradeSkillFrame is not virtual:
Code:
<Frame name="TradeSkillFrame" toplevel="true" movable="true" parent="UIParent" enableMouse="true" hidden="true">
If you want your add-on to be for Alchemy only, I think you need to handle that in your script file, cause TradeSkillFrame is used for all trade skills.
FYI: Enchanting is not a Trade Skill in respect to the API, it's a Craft, and hence if you want your add-on to work for Enchanting too, you need to put it in the CraftFrame and load your add-on with Blizzard_CraftUI too.
And here's the longer answer, showing how I found out:
In one add-on I have this:
Code:
<Button
name="Bank2BBButtonExport"
inherits="UIPanelButtonTemplate"
text="Export..."
parent="BankFrame"
hidden="false"
>
<Size>
<AbsDimension x="102" y="21"/>
</Size>
<Anchors>
<Anchor point="TOPRIGHT" relativeTo="BankCloseButton" relativePoint="BOTTOM">
<Offset>
<AbsDimension x="-22" y="-4"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnClick>
Bank2BB:OnExportClick();
</OnClick>
</Scripts>
</Button>
and it works - no problems.
I copy pasted that code into another add-on and roughly replaced "Bank" with "TradeSkill"
Code:
<Button name="TradeSkill2BB_Button" parent="TradeSkillFrame" inherits="UIPanelButtonTemplate" text="Test" hidden="false">
<Size>
<AbsDimension x="120" y="21" />
</Size>
<Anchors>
<Anchor relativePoint="TOPRIGHT" relativeTo="TradeSkillFrameCloseButton" point="BOTTOM">
<Offset>
<AbsDimension x="-22" y="-4" />
</Offset>
</Anchor>
</Anchors>
</Button>
Alas... I did not see any button in the trade skill frame.
So of course, I started wondering, what's the difference between BankFrame and TradeSkillFrame.
Most noteworthy difference that appeared to me is that BankFrame is defined in FrameXML, while TradeSkillFrame has been moved to an add-on, Blizzard Trade Skill UI.
I didn't see any noteworthy difference in the XML files. So I went for the .toc files
And there's something there.
The FrameXML.toc file basically just sais:
Code:
# Do not delete the following line!
## Interface: 20000
of course followed by a lot of filenames.
While the Blizzard_TradeSkillUI.toc contains a little more:
Code:
## Interface: 20000
## Title: Blizzard Trade Skill UI
## Secure: 1
## LoadOnDemand: 1
Aha... first of it's Secure. I remembered having read abot some Secure templates in the change notes, so I started digging around for those, but it didn't seem to me to be the solution to this particular problem.
The other thing is the LoadOnDemand. My add-on wasn't LoadOnDemand.
I started browsing this forum to see if any others have had similar problems, and along the way I found the
Modifying an Existing Frame thread.
In this regard the important info in there is:
Originally Posted by EricStratton
I got some help from Iriel on the official WoW UI boards. I needed to make my mod load on demand and also have it load with the Auction UI.
|
I added these two lines to my own .toc:
Code:
## LoadOnDemand: 1
## LoadWith: Blizzard Trade Skill UI
That didn't solve the problem though. The "Blizzard Trade Skill UI" I retrieved from the title in Blizzard_TradeSkillUI.toc. It then hit me that maybe I didn't need the title of the add-on but the auctual directory name of it. And bingo!
Code:
## LoadOnDemand: 1
## LoadWith: Blizzard_TradeSkillUI
Now my button appears. It's placed somewhat weird, but that's an entirely different issue, that I think will be easy to solve
.
/PerT