Lua Code:
function Open_Frame_With_Link_Test1(id)
if not PippoPlutoPaperino then
local f = CreateFrame("Frame", "PippoPlutoPaperino", UIParent);
PippoPlutoPaperino = f
f:SetSize(100, 55);
f:SetPoint("LEFT", 100, 0);
f:SetHyperlinksEnabled(true);
f.Text = f:CreateFontString(nil, "OVERLAY", "GameFontNormal");
f.Text:SetPoint("TOP")
f.Button = CreateFrame("Button", "PippoPlutoPaperino", f, "UIPanelButtonTemplate");
f.Button:SetSize(80, 25)
f.Button:SetText("Open")
f.Button:SetPoint("BOTTOM")
f.Button:SetScript("OnClick", function(self)
ProfessionsUtil.OpenProfessionFrameToRecipe(self:GetParent().ID)
end)
f:SetScript("OnHyperlinkEnter", function(self, link, text, region, left, bottom, width, height)
GameTooltip:SetOwner(self, "ANCHOR_CURSOR_RIGHT")
GameTooltip:SetHyperlink(link)
GameTooltip:Show()
end)
f:SetScript("OnHyperlinkLeave", function(self)
GameTooltip:Hide()
end)
f:SetScript("OnHyperlinkClick", function(self, link, text, region, left, bottom, width, height) -- if not using a seperate button
ProfessionsUtil.OpenProfessionFrameToRecipe(PippoPlutoPaperino.ID)
end)
print("passed --------");
end
local spell = Spell:CreateFromSpellID(id);
spell:ContinueOnSpellLoad(function()
local f = PippoPlutoPaperino
local info = C_TradeSkillUI.GetRecipeInfo(id)
f.Text:SetText(info.hyperlink);
f.ID = info.recipeID
end)
end
Login and:
Code:
-- 376530 Wildercloth Bolt or use a recipe ID you have
/run Open_Frame_With_Link_Test1(376530)