Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions AdvancedTradeSkillWindow/AdvancedTradeSkillWindow.toc
Original file line number Diff line number Diff line change
Expand Up @@ -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 $
Expand All @@ -11,4 +11,4 @@
## X-Website: https://github.com/laytya/AdvancedTradeSkillWindow-vanilla

atsw.xml
atsw_customsorting.xml
atsw_customsorting.xml
9 changes: 8 additions & 1 deletion AdvancedTradeSkillWindow/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
- 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.
108 changes: 103 additions & 5 deletions AdvancedTradeSkillWindow/atsw.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -3053,4 +3151,4 @@ end

function ATSW_NOP()
-- do nothing!
end
end
Loading