TradeSkillFrame-add info below next rank text
Reaching out to the community for some help/guidance on how to add additional text just below the "Next Rank:" text within the TradeSkillUI frame. I've been dusting off an old addon I wrote from several years ago and the new changes have me stumped.
See here for an example of what I'm trying to accomplish: I have this bit of code below, which works fine. The Recipe_Select() function currently does what it's suppose to and returns the output to the chat window. Rather than outputting to the chat window, I'm trying to figure out how to go about adding a new text field directly below the "Next Rank:" text like in my screenshot. Code:
hooksecurefunc(TradeSkillFrame.RecipeList, "OnRecipeButtonClicked", function(self, ...) |
This code adds the selected recipe ID to that spot. This was tricky to figure out, but through some investigation of the Blizzard UI code, I managed it.
Code:
ExtraTradeSkillRecipeTextFrame = CreateFrame("Frame", nil, UIParent) |
Thanks, but I wasn't able to get your code to work. For me arg1 was never equal to "Blizzard_TradeSkillUI" (arg1 kept showing up as other addon names). Once I corrected for that I was able to get the code to run, but the text wasn't always formatted at the bottom within the frame. I believe that was driven by the recipe (some have more text than others).
Here's the code I ended up using: Code:
local details = TradeSkillFrame.DetailsFrame |
What? You weren't able to get the code to work? That makes no sense. As a standalone addon, which is how I was programming it, it works perfectly.
|
So I tried running it as a stand-alone addon and made sure it was the only addon I had enabled.
For me, arg1 = the addon name. This IF statement is never true for me: "if arg1 == "Blizzard_TradeSkillUI" then" If I take out that check, then it works like a champ. No drawing errors with the text. So the text drawing issues must have been on my end when I tried incorporating it into my code. I'll have to take another look. |
I published my code as an addon: https://wow.curseforge.com/projects/...recipeidshower
I see no reason why it shouldn't work for you. It works perfectly for me, as shown in the screenshot. |
Blizzard_TradeSkillUI is load on demand.
|
Yup, hence why I wait for it to exist using the ADDON_LOADED event. If I try to implement the hook before it's loaded, I get a missing reference error.
|
In your .toc file you need two lines because Blizzard_TradeSkillUI is load on demand:
Code:
## LoadOnDemand: 1 |
That sounds like an alternative (and superior) way to do it, but my original method did work. I'll update my addon to use that method though. Thanks!
Edit: Looks like "LoadsWith" is incorrect; using "LoadWith" instead. Edit 2: Yup, that worked. Thanks! Project updated. |
I downloaded it and it works perfect now. I can only assume my TOC file was jacked before. This updated version is much cleaner than what I had before. I've already updated my addon with the new version. Many thanks.
|
All times are GMT -6. The time now is 12:25 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI