Skip to content

Commit

Permalink
Implem of lootitem step option
Browse files Browse the repository at this point in the history
  • Loading branch information
Neogeekmo committed Aug 28, 2024
1 parent a534779 commit de96f96
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 13 deletions.
15 changes: 14 additions & 1 deletion Commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ function AprRC.command:SlashCmd(input)
print("|cffeda55f/aprrc grind |r- " .. "Grind")
print("|cffeda55f/aprrc help, h |r- " .. L_APR["HELP_COMMAND"])
print("|cffeda55f/aprrc instance |r- " .. "InstanceQuest")
print("|cffeda55f/aprrc lootitem, lt |r- " .. "LootItem")
print("|cffeda55f/aprrc noachievement |r- " .. "DontHaveAchievement")
print("|cffeda55f/aprrc noarrow |r- " .. "NoArrow")
print("|cffeda55f/aprrc notskipvid, nsv |r- " .. "Dontskipvid")
Expand Down Expand Up @@ -117,6 +118,18 @@ function AprRC.command:SlashCmd(input)
currentStep.InstanceQuest = true
print("|cff00bfffInstanceQuest|r Added")
return
elseif inputText == "lootitem" or inputText == "lt" then
AprRC.autocomplete:ShowItemAutoComplete(questID, objectiveID, function(_, itemID, frame)
local step = {}
step.LootItem = tonumber(itemID, 10)

AprRC:SetStepCoord(step)
AprRC:NewStep(step)

print("|cff00bfff LootItem |r Added")
AceGUI:Release(frame)
end)
return
elseif inputText == "notskipvid" or inputText == "nsv" then
local currentStep = AprRC:GetLastStep()
currentStep.Dontskipvid = 1
Expand Down Expand Up @@ -156,7 +169,7 @@ function AprRC.command:SlashCmd(input)
})
return
elseif inputText == "spelltrigger" then
AprRC.autocomplete:ShowSpellAutoComplete(questID, objectiveID, function(_, spellID, frame)
AprRC.autocomplete:ShowButtonSpellAutoComplete(questID, objectiveID, function(_, spellID, frame)
local currentStep = AprRC:GetLastStep()

currentStep.SpellTrigger = tonumber(spellID, 10)
Expand Down
Binary file added assets/icons/LootItem.blp
Binary file not shown.
1 change: 1 addition & 0 deletions frames/CommandsBarSetting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ local allCommands = {
{ command = "achievement", label = "HasAchievement", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\HasAchievement" },
{ command = "instance", label = "InstanceQuest", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\InstanceQuest" },
{ command = "addjob", label = "LearnProfession", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\LearnProfession" },
{ command = "lootitem", label = "LootItem", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\LootItem" },
{ command = "noarrow", label = "NoArrow", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\NoArrow" },
{ command = "pickupdb", label = "PickUpDB", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\PickUpDB" },
{ command = "qpartdb", label = "QpartDB", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\QpartDB" },
Expand Down
12 changes: 2 additions & 10 deletions frames/autocomplete.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ function AprRC.autocomplete:ShowLocaleAutoComplete()
)
end

function AprRC.autocomplete:ShowItemAutoComplete(questID, objectiveID)
function AprRC.autocomplete:ShowItemAutoComplete(questID, objectiveID, onConfirm)
local itemList = {}
for bag = 0, 4 do
for slot = 1, C_Container.GetContainerNumSlots(bag) do
Expand All @@ -155,15 +155,7 @@ function AprRC.autocomplete:ShowItemAutoComplete(questID, objectiveID)
self:ShowAutoComplete(
"Select Item",
itemList,
function(_, itemID, frame)
local currentStep = AprRC:GetLastStep()
if not currentStep.Button then
currentStep.Button = {}
end
currentStep.Button[questID .. "-" .. objectiveID] = tonumber(itemID, 10)
print("|cff00bfff Button |r Added")
AceGUI:Release(frame)
end,
onConfirm,
function(match)
local itemName, _, _, _, _, _, _, _, _, itemIcon = C_Item.GetItemInfo(match.key)
return "|T" .. itemIcon .. ":35:35|t " .. itemName
Expand Down
10 changes: 9 additions & 1 deletion frames/selectButton.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ function AprRC.SelectButton:ShowQuestSelector(type)
local callback
if type == "Item" then
callback = function(questID, objectiveID)
AprRC.autocomplete:ShowItemAutoComplete(questID, objectiveID)
AprRC.autocomplete:ShowItemAutoComplete(questID, objectiveID, function(_, itemID, frame)
local currentStep = AprRC:GetLastStep()
if not currentStep.Button then
currentStep.Button = {}
end
currentStep.Button[questID .. "-" .. objectiveID] = tonumber(itemID, 10)
print("|cff00bfff Button |r Added")
AceGUI:Release(frame)
end)
end
elseif type == "Spell" then
callback = function(questID, objectiveID)
Expand Down
2 changes: 1 addition & 1 deletion helper/Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ end
function AprRC:CustomSortKeys(tbl)
local priorityList = {
"Waypoint", "PickUp", "PickUpDB", "Qpart", "QpartPart", "QpartDB", "Done", "DoneDB",
"LeaveQuests", "Treasure", "Scenario", "LearnProfession", "Grind", "DropQuest", "DroppableQuest",
"LeaveQuests", "Treasure", "Scenario", "LearnProfession", "Grind", "DropQuest", "DroppableQuest", "LootItem",
"ChromiePick", "SetHS", "GetFP", "UseHS", "UseDalaHS", "UseGarrisonHS", "UseFlightPath",
"Name", "NodeID", "WarMode", "Coord", "Fillers", "BuyMerchant", "Button", "SpellButton", "ExtraLineText",
"GossipOptionID", "GossipOptionIDs", "Range", "NoArrow", "ZoneStepTrigger",
Expand Down

0 comments on commit de96f96

Please sign in to comment.