From aaf6c4fa5836322bb9835c13a44db7d07b255366 Mon Sep 17 00:00:00 2001 From: Brad Morgan Date: Sun, 1 Dec 2024 12:18:42 -0700 Subject: [PATCH] Add "List Reagents" to recipe right-click menu --- SkilletNewsData.lua | 3 ++- UI/MainFrame.lua | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/SkilletNewsData.lua b/SkilletNewsData.lua index f2c3abf..99ecdf4 100644 --- a/SkilletNewsData.lua +++ b/SkilletNewsData.lua @@ -36,7 +36,8 @@ Skillet.NewsData = { }, { name = "Changes", data = { - { header = "Recipes", body = "Remove 'Link Recipe' from Classic Era" }, + { header = "Recipes", body = "Remove 'Link Recipe' from Classic Era right-click menu" }, + { header = "Recipes", body = "Add 'List Reagents' to Classic Era right-click menu" }, }, }, }, diff --git a/UI/MainFrame.lua b/UI/MainFrame.lua index 7d83187..85fe7e0 100644 --- a/UI/MainFrame.lua +++ b/UI/MainFrame.lua @@ -2275,6 +2275,17 @@ function Skillet:SkillButton_OnReceiveDrag(button) end end +function Skillet:SkillButton_ListReagents() + DA.DEBUG(0,"SkillButton_ListReagents()") + local skill = Skillet.menuButton.skill + if skill and skill.skillIndex then + Skillet:ReagentsLinkOnClick(menuButton, skill.skillIndex, false) + else + DA.DEBUG(0,"SkillButton_ListReagents: skill= "..DA.DUMP1(skill)) + return + end +end + function Skillet:SkillButton_LinkRecipe() DA.DEBUG(0,"SkillButton_LinkRecipe()") local skill = Skillet.menuButton.skill @@ -3153,7 +3164,9 @@ local function SkillMenuList(SkilletSkillMenu, rootDescription) end rootDescription:CreateTitle(title); end - if not isClassic then + if isClassic then + rootDescription:CreateButton(L["List Reagents"], function() Skillet:SkillButton_ListReagents() end); + else rootDescription:CreateButton(L["Link Recipe"], function() Skillet:SkillButton_LinkRecipe() end); end rootDescription:CreateButton(L["Wowhead URL"], function() Skillet:SkillButton_WowheadURL() end);