Quantcast
Tradeskill recipe question - WoWInterface
Thread Tools Display Modes
12-15-20, 03:33 AM   #1
dragonflyy
A Fallenroot Satyr
 
dragonflyy's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 21
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.)
  Reply With Quote
12-16-20, 05:54 PM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,018
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.
__________________
ESOUI AddOns | 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)
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Tradeskill recipe question

Thread Tools
Display Modes

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