diff --git a/frames/selectButton.lua b/frames/selectButton.lua index e9e5567..857e006 100644 --- a/frames/selectButton.lua +++ b/frames/selectButton.lua @@ -22,10 +22,21 @@ function AprRC.SelectButton:Show() btnItem:SetFullWidth(true) btnItem:SetCallback("OnClick", function() AceGUI:Release(frame) - AprRC.questionDialog:CreateEditBoxPopupWithCallback("Item Button (ID)", function(text) - local currentStep = AprRC:GetLastStep() - currentStep.Button = tonumber(text, 10) - print("|cff00bfff Button |r Added") + AprRC.questionDialog:CreateEditBoxPopupWithCallback("QuestID for the button (ID)", function(questID) + C_Timer.After(0.2, function() + AprRC.questionDialog:CreateEditBoxPopupWithCallback("Objective index of the quest", function(index) + C_Timer.After(0.2, function() + AprRC.questionDialog:CreateEditBoxPopupWithCallback("Item Button (ID)", function(itemID) + local currentStep = AprRC:GetLastStep() + if not currentStep.Button then + currentStep.Button = {} + end + currentStep.Button[questID .. "-" .. index] = tonumber(itemID, 10) + print("|cff00bfff Button |r Added") + end) + end) + end) + end) end) end) buttonGroup:AddChild(btnItem) @@ -35,10 +46,21 @@ function AprRC.SelectButton:Show() btnSpell:SetFullWidth(true) btnSpell:SetCallback("OnClick", function() AceGUI:Release(frame) - AprRC.questionDialog:CreateEditBoxPopupWithCallback("Spell Button (ID)", function(text) - local currentStep = AprRC:GetLastStep() - currentStep.SpellButton = tonumber(text, 10) - print("|cff00bfff SpellButton |r Added") + AprRC.questionDialog:CreateEditBoxPopupWithCallback("QuestID for the button (ID)", function(questID) + C_Timer.After(0.2, function() + AprRC.questionDialog:CreateEditBoxPopupWithCallback("Objective index of the quest", function(index) + C_Timer.After(0.2, function() + AprRC.questionDialog:CreateEditBoxPopupWithCallback("Spell Button (ID)", function(spellID) + local currentStep = AprRC:GetLastStep() + if not currentStep.SpellButton then + currentStep.SpellButton = {} + end + currentStep.SpellButton[questID .. "-" .. index] = tonumber(spellID, 10) + print("|cff00bfff SpellButton |r Added") + end) + end) + end) + end) end) end) buttonGroup:AddChild(btnSpell)