WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Tradeskill recipe question (https://www.wowinterface.com/forums/showthread.php?t=58463)

dragonflyy 12-15-20 03:33 AM

Tradeskill recipe question
 
I am wanting to add a shift-click to recipes in the default TradeSkillFrame. The function that I have found is

Code:

function TradeSkillRecipeListMixin:OnRecipeButtonClicked(recipeButton, recipeInfo, mouseButton)
        if mouseButton == "LeftButton" then
                self:SetSelectedRecipeID(recipeInfo.recipeID);
        elseif mouseButton == "RightButton" then
                if recipeInfo.learned and not C_TradeSkillUI.IsTradeSkillGuild() and not C_TradeSkillUI.IsNPCCrafting() and not C_TradeSkillUI.IsTradeSkillLinked() then
                        self.contextMenuRecipeID = recipeInfo.recipeID;
                        ToggleDropDownMenu(1, nil, self.RecipeOptionsMenu, recipeButton, 0, 0);
                        PlaySound(SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON);
                end
        end
end

How would I hook this function so I could add a Shift-LeftButton to it? Or is this not possible?

(Found that code snippet in the Blizzard_TradeSkillRecipeList.lua file.)

SDPhantom 12-16-20 05:54 PM

The DefaultUI already does this.

Code:

if self.isHeader then
        self:GetParent():GetParent():OnHeaderButtonClicked(self, self.tradeSkillInfo, button);
else
        if IsModifiedClick() then
                HandleModifiedItemClick(C_TradeSkillUI.GetRecipeLink(self.tradeSkillInfo.recipeID));
        else
                self:GetParent():GetParent():OnRecipeButtonClicked(self, self.tradeSkillInfo, button);
        end
end

Blizzard_TradeSkillRecipeButton.xml:169

This is what calls the function you noted.


All times are GMT -6. The time now is 02:33 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI