I wonder why this was changed in Legion though, previously you could just shift-click anything into the search bar but now you need to have it focused first
https://www.townlong-yak.com/framexm....lua/diff#3816
Code:
@@ -3820,15 +3814,13 @@ function ChatEdit_InsertLink(text)
end
return true;
end
- if ( TradeSkillFrame and TradeSkillFrame:IsShown() ) then
+ if ( TradeSkillFrame and TradeSkillFrame.SearchBox:HasFocus() ) then
local item;
if ( strfind(text, "item:", 1, true) ) then
item = GetItemInfo(text);
This is what I'm using in
FixTradeSkillSearch if anyone is interested
Lua Code:
hooksecurefunc("ChatEdit_InsertLink", function(text) -- shift-clicked
-- change from SearchBox:HasFocus to :IsShown again
if text and TradeSkillFrame and TradeSkillFrame:IsShown() then
local spellId = strmatch(text, "enchant:(%d+)")
local spell = GetSpellInfo(spellId)
local item = GetItemInfo(strmatch(text, "item:(%d+)") or 0)
local search = spell or item
if not search then return end
TradeSkillFrame.SearchBox:SetText(search)
-- jump to the recipe
if spell then -- can only select recipes on the learned tab
if PanelTemplates_GetSelectedTab(TradeSkillFrame.RecipeList) == 1 then
TradeSkillFrame:SelectRecipe(tonumber(spellId))
end
elseif item then
C_Timer.After(.1, function() -- wait a bit or we cant select the recipe yet
for _, v in pairs(TradeSkillFrame.RecipeList.dataList) do
if v.name == item then
TradeSkillFrame:SelectRecipe(v.recipeID)
return
end
end
end)
end
end
end)
-- increase search box width (up from 112)
TradeSkillFrame.SearchBox:SetWidth(200)
-- make it only split stacks with shift-rightclick if the TradeSkillFrame is open
-- shift-leftclick should be reserved for the search box
hooksecurefunc("ContainerFrameItemButton_OnModifiedClick", function(self, button)
if TradeSkillFrame and TradeSkillFrame:IsShown() then
if button == "LeftButton" then
StackSplitFrame:Hide()
end
end
end)
But the "jumping" to tradeskill part doesn't seem to work anymore in 7.1 when clicking reagents while shift is pressed, maybe have to hook something else now