diff --git a/AdvancedTradeSkillWindow/AdvancedTradeSkillWindow.toc b/AdvancedTradeSkillWindow/AdvancedTradeSkillWindow.toc index 77708cf..440423b 100644 --- a/AdvancedTradeSkillWindow/AdvancedTradeSkillWindow.toc +++ b/AdvancedTradeSkillWindow/AdvancedTradeSkillWindow.toc @@ -2,7 +2,7 @@ ## Title: AdvancedTradeSkillWindow ## Notes: An improved window for your tradeskills for Vanilla ## RequiredDeps: -## Version: v0.5.8 +## Version: v0.5.9 ## SavedVariables: atsw_orderby, atsw_bankitemlist, atsw_merchantlist, atsw_itemlist, atsw_considerbank, atsw_consideralts, atsw_considermerchants, atsw_autobuy, atsw_multicount, atsw_recipetooltip, atsw_customsorting, atsw_customheaders, atsw_displayshoppinglist, atsw_disabled, atsw_savedqueue, atsw_savednecessaryitems ## X-ReleaseDate: $Date: 2024-11-18 $ @@ -11,4 +11,4 @@ ## X-Website: https://github.com/laytya/AdvancedTradeSkillWindow-vanilla atsw.xml -atsw_customsorting.xml \ No newline at end of file +atsw_customsorting.xml diff --git a/AdvancedTradeSkillWindow/README.txt b/AdvancedTradeSkillWindow/README.txt index d0824e8..fa04a80 100644 --- a/AdvancedTradeSkillWindow/README.txt +++ b/AdvancedTradeSkillWindow/README.txt @@ -289,4 +289,11 @@ v0.5.6 - Added "enchant" links support (aux not understand it yet) v0.5.6a -- Fix errors after RightClick on reagents \ No newline at end of file +- Fix errors after RightClick on reagents + +v0.5.7 +- No update information provided by author. + +v0.5.8 +- Added ability to move queued crafts up and down the queue list +- Combined searching recipes and reagents into the default search. diff --git a/AdvancedTradeSkillWindow/atsw.lua b/AdvancedTradeSkillWindow/atsw.lua index 45d512e..1bfc857 100644 --- a/AdvancedTradeSkillWindow/atsw.lua +++ b/AdvancedTradeSkillWindow/atsw.lua @@ -1,4 +1,4 @@ --- Advanced Trade Skill Window v0.5.6a for Vanilla +-- Advanced Trade Skill Window v0.5.8 for Vanilla 1.12 -- copyright 2006 by Rene Schneider (Slarti on EU-Blackhand), 2017 by laytya -- main script file @@ -356,7 +356,7 @@ function ATSWFrame_OnEvent() ATSWFilterButton:SetHeight(20) ATSWFilterButton:SetWidth(70) end - if (IsAddOnLoaded('Blizzard_TradeSkillUI') and getglobal('TradeSkillListScrollFrame')) then + if (IsAddOnLoaded('Blizzard_TradeSkillUI')) then getglobal('TradeSkillListScrollFrame').offset = 0 end elseif(event=="CRAFT_CLOSE") then @@ -828,6 +828,22 @@ function ATSWSkillButton_OnClick(button) if(button=="LeftButton") then ATSWFrame_SetSelection(this:GetID(),true); ATSWFrame_Update(); + + -- Alt+Click to add 1x to queue + if(IsAltKeyDown()) then + local skillName, skillType, numAvailable; + local listpos=ATSW_GetSkillListingPos(this:GetID()); + if(atsw_skilllisting[listpos]) then + skillName = atsw_skilllisting[listpos].name; + skillType = atsw_skilllisting[listpos].type; + end + + -- Only add to queue if it's not a header and has a valid skill name + if(skillName and skillType ~= "header") then + ATSW_AddJob(skillName, 1); + ATSWFrame_UpdateQueue(); + end + end end end @@ -1282,16 +1298,34 @@ function ATSWFrame_UpdateQueue() local queueName=getglobal("ATSWQueueItem"..i.."NameText"); local queueItem=getglobal("ATSWQueueItem"..i); local queueButton=getglobal("ATSWQueueItem"..i.."DeleteButton"); + local downButton=getglobal("ATSWQueueItem"..i.."DownButton"); + local upButton=getglobal("ATSWQueueItem"..i.."UpButton") if(atsw_queue[jobindex]) then queueCount:SetText(atsw_queue[jobindex].count.."x"); queueName:SetText(atsw_queue[jobindex].name); queueItem.jobindex=jobindex; queueButton.jobindex=jobindex; + downButton.jobindex=jobindex; + upButton.jobindex=jobindex; queueItem:Show(); queueButton:Show(); + downButton:Show(); + upButton:Show(); + if(jobindex >= jobs) then + downButton:Disable(); else + downButton:Enable(); + end + if(jobindex <= 1) then + upButton:Disable(); + else + upButton:Enable(); + end + else queueButton:Hide(); queueItem:Hide(); + downButton:Hide(); + upButton:Hide(); end end @@ -1359,6 +1393,34 @@ function ATSW_DeleteJob(jobindex) end end +function ATSW_MoveJobUp(jobindex) + if(jobindex > 1) then + local temp = atsw_queue[jobindex-1]; + atsw_queue[jobindex-1] = atsw_queue[jobindex]; + atsw_queue[jobindex] = temp; + if(atsw_preventupdate==false) then + ATSW_ResetPossibleItemCounts(); + ATSWInv_UpdateQueuedItemList(); + ATSWFrame_UpdateQueue(); + ATSWFrame_Update(); + end + end +end + +function ATSW_MoveJobDown(jobindex) + if(jobindex < table.getn(atsw_queue)) then + local temp = atsw_queue[jobindex+1]; + atsw_queue[jobindex+1] = atsw_queue[jobindex]; + atsw_queue[jobindex] = temp; + if(atsw_preventupdate==false) then + ATSW_ResetPossibleItemCounts(); + ATSWInv_UpdateQueuedItemList(); + ATSWFrame_UpdateQueue(); + ATSWFrame_Update(); + end + end +end + function ATSW_AddJobLL(skillname, num) for i=1,table.getn(atsw_queue),1 do if(atsw_queue[i].name==skillname) then @@ -2162,10 +2224,43 @@ function ATSW_Filter(skillname) end for i=1,table.getn(parameters),1 do if(parameters[i].name=="name") then + -- Search both recipe name and reagents by default ||| START OF CODE + local nameMatch = string.find(string.lower(skillname),".-"..string.lower(parameters[i].value)..".-"); + local reagentMatch = false; + + -- Check reagents if name doesn't match + if(nameMatch == nil) then + local index=ATSW_GetTradeSkillListPosByName(skillname); + if(index~=-1) then + for j=1,table.getn(atsw_tradeskilllist[index].reagents),1 do + if(string.find(string.lower(atsw_tradeskilllist[index].reagents[j].name),".-"..string.lower(parameters[i].value)..".-")~=nil) then + reagentMatch=true; + break; + end + end + end + end + + -- Return false only if neither name nor reagents match + if(nameMatch == nil and reagentMatch == false) then + return false; + end + -- Search both recipe name and reagents by default ||| END OF CODE + + --[[ ||| ORIGINAL CODE THAT DOES NOT COMBINE FILTERS + if(string.find(string.lower(skillname),".-"..string.lower(parameters[i].value)..".-")==nil) then + return false; + end + ]] + end + -- Added :craft filter to replace original search behavior where only craft recipe names were searched + if(parameters[i].name=="craft" or parameters[i].name=="c") then + -- Search only recipe names (original behavior) if(string.find(string.lower(skillname),".-"..string.lower(parameters[i].value)..".-")==nil) then return false; end end + -- if(parameters[i].name=="reagent" or parameters[i].name=="r") then local index=ATSW_GetTradeSkillListPosByName(skillname); if(index~=-1) then @@ -2365,6 +2460,7 @@ function ATSW_BuildFilterDropDown() [7] = { ":maxlevel 60", "Max Level", ":maxlevel [level]", "Filters the list to only include recipes for items with no more than the given level requirement." }, [8] = { ":maxrarity blue", "Max Rarity", ":maxrarity [grey|white|green|blue|purple]", "Filters the list to only include recipes for items with no more than the given rarity." }, [9] = { ":reagent ", "Reagents", ":reagent [reagent name]", "Filters the list to only include items that need the specified reagent." }, + [10] = {":craft", "Crating Recipe", ":craft: [recipe name]", "Filters the list to only include recipes with the specific name"}, } for filter, values in ipairs(filters) do @@ -2404,7 +2500,7 @@ function ATSW_DisplayTradeskillTooltip() skillType = atsw_skilllisting[listpos].type; else skillName=nil; - akillType=nil; + skillType=nil; end if(skillName and skillType ~= "header") then @@ -2435,6 +2531,8 @@ function ATSW_DisplayTradeskillTooltip() end end ATSWTradeskillTooltip:AddLine(ATSW_TOOLTIP_LEGEND); + ATSWTradeskillTooltip:AddLine(" "); + ATSWTradeskillTooltip:AddLine("Alt+Click to add craft to queue (x1)"); ATSWTradeskillTooltip:Show(); end @@ -2706,7 +2804,7 @@ function ATSWShoppingListFrameOnUpdate() if aux_frame and aux_frame:IsVisible() then ATSWShoppingListFrame:ClearAllPoints(); - ATSWShoppingListFrame:SetPoint("TOPRIGHT","aux_frame","BOTTOMRIGHT",0,0); + ATSWShoppingListFrame:SetPoint("TOPRIGHT","aux_frame","BOTTOMRIGHT", 28,-10); else ATSWShoppingListFrame:SetPoint("TOPLEFT","AuctionFrame","TOPLEFT",353,-436); end @@ -3053,4 +3151,4 @@ end function ATSW_NOP() -- do nothing! -end \ No newline at end of file +end diff --git a/AdvancedTradeSkillWindow/atsw.xml b/AdvancedTradeSkillWindow/atsw.xml index 4ed46f3..0eb0ab7 100644 --- a/AdvancedTradeSkillWindow/atsw.xml +++ b/AdvancedTradeSkillWindow/atsw.xml @@ -1641,8 +1641,66 @@ ATSW_DeleteJob(this.jobindex); + + GameTooltip:SetOwner(this, "ANCHOR_RIGHT"); + GameTooltip:SetText("Remove craft from the queue"); + GameTooltip:Show(); + + + GameTooltip:Hide(); + + + @@ -1668,9 +1726,68 @@ ATSW_DeleteJob(this.jobindex); + + GameTooltip:SetOwner(this, "ANCHOR_RIGHT"); + GameTooltip:SetText("Remove craft from the queue"); + GameTooltip:Show(); + + + GameTooltip:Hide(); + + + + + + @@ -1695,8 +1812,66 @@ ATSW_DeleteJob(this.jobindex); + + GameTooltip:SetOwner(this, "ANCHOR_RIGHT"); + GameTooltip:SetText("Remove craft from the queue"); + GameTooltip:Show(); + + + GameTooltip:Hide(); + + + @@ -1722,8 +1897,66 @@ ATSW_DeleteJob(this.jobindex); + + GameTooltip:SetOwner(this, "ANCHOR_RIGHT"); + GameTooltip:SetText("Remove craft from the queue"); + GameTooltip:Show(); + + + GameTooltip:Hide(); + + + @@ -4132,4 +4365,4 @@