Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1140cc1
Initial Commit
QuickStick123 Dec 16, 2022
73420d1
Fix accidently placed code do some checks of non-zeroness and update …
QuickStick123 Dec 16, 2022
52ed648
Remove uneccary speical mods
QuickStick123 Dec 16, 2022
68c9738
Simplify
QuickStick123 Dec 16, 2022
707e2d8
uncomment debugger and use old var naming
QuickStick123 Dec 16, 2022
b0ec67c
cleanup filters and readd fallback as item weight
QuickStick123 Dec 16, 2022
5223c46
Update item bases sadly you can't support numbers in old format so ha…
QuickStick123 Dec 17, 2022
0a84602
Use item base type
QuickStick123 Dec 17, 2022
9bfd083
Partially working flasks
QuickStick123 Dec 17, 2022
00315b2
Fix import button not being immediately updated after search
QuickStick123 Dec 17, 2022
401b296
Ignore enchants and fix full dps not applying
QuickStick123 Dec 21, 2022
344f33b
Widen box and add button to toggle if enchants are included
QuickStick123 Dec 21, 2022
77eb3c5
Slightly more readable tbh
QuickStick123 Dec 21, 2022
f0e5333
Add a tooltip to hopefully alleviate confusion
QuickStick123 Dec 21, 2022
ee788b6
Probably better as plural
QuickStick123 Dec 21, 2022
59acccf
Add support for projectiles pierce an additional target
QuickStick123 Dec 23, 2022
02875b1
Properly fix two hands
QuickStick123 Dec 25, 2022
5a4d5dd
Fix mistake with thrusting swords
QuickStick123 Dec 25, 2022
6cbda03
Add missing attack dagger tag
QuickStick123 Dec 25, 2022
b0e06b0
Remove left overs
QuickStick123 Dec 25, 2022
5205fdd
Update queryMods.lua as well cause that is a thing
QuickStick123 Dec 25, 2022
ebffe08
Merge branch 'dev' into local-mod-support-and-default-sort-mods
QuickStick123 Dec 26, 2022
4d3b359
Probably slightly more efficient as avoids string manipulation.
QuickStick123 Dec 27, 2022
1652da3
Merge branch 'dev' into local-mod-support-and-default-sort-mods
QuickStick123 Dec 30, 2022
b9a7bdf
Reapply tab fix
QuickStick123 Dec 30, 2022
78c6e82
Merge branch 'dev' into local-mod-support-and-default-sort-mods
QuickStick123 Jan 2, 2023
0dcd92c
Update query mods incase something has changed
QuickStick123 Jan 2, 2023
9641009
Fix sorting not getting update by enchant button
QuickStick123 Jan 2, 2023
37ffaaf
Add missed fix here and or 0
QuickStick123 Jan 2, 2023
27007eb
Merge branch 'dev' into local-mod-support-and-default-sort-mods
QuickStick123 Jan 24, 2023
9a8b479
Merge branch 'dev' into local-mod-support-and-default-sort-mods
QuickStick123 Feb 18, 2023
511936d
Merge branch 'dev' into local-mod-support-and-default-sort-mods
QuickStick123 Feb 18, 2023
3869113
Remove sorting fix as not needed anymore
QuickStick123 Feb 18, 2023
b7fc84a
Update query mods
QuickStick123 Feb 18, 2023
c0745a6
Merge branch 'dev' into local-mod-support-and-default-sort-mods
QuickStick123 Mar 1, 2023
fad43c0
Move around boxes to make more sense
QuickStick123 Mar 1, 2023
6c12787
Update query mods
QuickStick123 Mar 1, 2023
69193c0
Fix messing up jewel mods
QuickStick123 Mar 1, 2023
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
6 changes: 3 additions & 3 deletions src/Classes/CheckBoxControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local CheckBoxClass = newClass("CheckBoxControl", "Control", "TooltipHost", func
self.Control(anchor, x, y, size, size)
self.TooltipHost(tooltipText)
self.label = label
self.labelWidth = DrawStringWidth(size - 4, "VAR", label or "") + 5
self.changeFunc = changeFunc
self.state = initialState
end)
Expand All @@ -22,9 +23,8 @@ function CheckBoxClass:IsMouseOver()
-- move x left by label width, increase width by label width
local label = self:GetProperty("label")
if label then
local labelWidth = DrawStringWidth(height - 4, "VAR", label) + 5
x = x - labelWidth
width = width + labelWidth
x = x - self.labelWidth
width = width + self.labelWidth
end
return cursorX >= x and cursorY >= y and cursorX < x + width and cursorY < y + height
end
Expand Down
21 changes: 4 additions & 17 deletions src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -459,16 +459,7 @@ function ItemClass:ParseRaw(raw)
self.enchantments = data.enchantments[self.base.type]
end
self.corruptible = self.base.type ~= "Flask"
self.influenceTags = { }
for _, influenceTag in ipairs(influenceInfo) do
self.influenceTags[influenceTag.key] = { }
for tag, _ in pairs(self.base.tags) do
if tag ~= "default" then
t_insert(self.influenceTags[influenceTag.key], tag..'_'..influenceTag.key)
end
end
end
self.canBeInfluenced = self.influenceTags
self.canBeInfluenced = self.base.influenceTags ~= nil
self.clusterJewel = data.clusterJewels and data.clusterJewels.jewels[self.baseName]
self.requirements.str = self.base.req.str or 0
self.requirements.dex = self.base.req.dex or 0
Expand Down Expand Up @@ -677,14 +668,10 @@ function ItemClass:GetModSpawnWeight(mod, extraTags)
local weight = 0
if self.base then
local function HasInfluenceTag(key)
if self.influenceTags then
if self.base.influenceTags then
for _, curInfluenceInfo in ipairs(influenceInfo) do
if self[curInfluenceInfo.key] then
for _, tag in ipairs(self.influenceTags[curInfluenceInfo.key]) do
if tag == key then
return true
end
end
if self[curInfluenceInfo.key] and self.base.influenceTags[curInfluenceInfo.key] == key then
return true
end
end
end
Expand Down
74 changes: 44 additions & 30 deletions src/Classes/TradeQuery.lua
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,26 @@ You can click this button to enter your POESESSID.
- You can only generate weighted searches for public leagues. (Generated searches can be modified
on trade site to work on other leagues and realms)]]

-- Fetches Box
self.maxFetchPerSearchDefault = 2
self.controls.fetchCountEdit = new("EditControl", {"TOPRIGHT", nil, "TOPRIGHT"}, -12, 19, 154, row_height, "", "Fetch Pages", "%D", 3, function(buf)
self.maxFetchPages = m_min(m_max(tonumber(buf) or self.maxFetchPerSearchDefault, 1), 10)
self.tradeQueryRequests.maxFetchPerSearch = 10 * self.maxFetchPages
self.controls.fetchCountEdit.focusValue = self.maxFetchPages
end)
self.controls.fetchCountEdit.focusValue = self.maxFetchPerSearchDefault
self.tradeQueryRequests.maxFetchPerSearch = 10 * self.maxFetchPerSearchDefault
self.controls.fetchCountEdit:SetText(tostring(self.maxFetchPages or self.maxFetchPerSearchDefault))
function self.controls.fetchCountEdit:OnFocusLost()
self:SetText(tostring(self.focusValue))
end
self.controls.fetchCountEdit.tooltipFunc = function(tooltip)
tooltip:Clear()
tooltip:AddLine(16, "Specify maximum number of item pages to retrieve per search from PoE Trade.")
tooltip:AddLine(16, "Each page fetches up to 10 items.")
tooltip:AddLine(16, "Acceptable Range is: 1 to 10")
end

-- Stat sort popup button
self.statSortSelectionList = { }
t_insert(self.statSortSelectionList, {
Expand All @@ -294,7 +314,7 @@ on trade site to work on other leagues and realms)]]
stat = "TotalEHP",
weightMult = 0.5,
})
self.controls.StatWeightMultipliersButton = new("ButtonControl", {"TOPRIGHT", nil, "TOPRIGHT"}, -12, 19, 150, 18, "^7Adjust search weights:", function()
self.controls.StatWeightMultipliersButton = new("ButtonControl", {"TOPRIGHT", self.controls.fetchCountEdit, "BOTTOMRIGHT"}, 0, 4, 154, row_height, "^7Adjust search weights:", function()
self:SetStatWeights()
end)
self.controls.StatWeightMultipliersButton.tooltipFunc = function(tooltip)
Expand All @@ -307,18 +327,18 @@ on trade site to work on other leagues and realms)]]
end
self.sortModes = {
StatValue = "(Highest) Stat Value",
StatValuePRICE = "Stat Value / Price",
PRICE = "(Lowest) Price",
WEIGHT = "(Highest) Weighted Sum",
StatValuePrice = "Stat Value / Price",
Price = "(Lowest) Price",
Weight = "(Highest) Weighted Sum",
}
-- Item sort dropdown
self.itemSortSelectionList = {
self.sortModes.StatValue,
self.sortModes.StatValuePRICE,
self.sortModes.PRICE,
self.sortModes.WEIGHT,
self.sortModes.StatValuePrice,
self.sortModes.Price,
self.sortModes.Weight,
}
self.controls.itemSortSelection = new("DropDownControl", {"TOPRIGHT",self.controls.StatWeightMultipliersButton,"BOTTOMRIGHT"}, 0, 4, 154, 18, self.itemSortSelectionList, function(index, value)
self.controls.itemSortSelection = new("DropDownControl", {"TOPRIGHT",self.controls.StatWeightMultipliersButton,"TOPLEFT"}, -8, 0, 160, row_height, self.itemSortSelectionList, function(index, value)
self.pbItemSortSelectionIndex = index
for index, _ in pairs(self.resultTbl) do
self:UpdateControlsWithItems(slotTables[index], index)
Expand All @@ -332,26 +352,16 @@ Highest Stat Value / Price - Sorts from highest to lowest Stat Value per currenc
Lowest Price - Sorts from lowest to highest price of retrieved items
Highest Weight - Displays the order retrieved from trade]]
self.controls.itemSortSelection:SetSel(self.pbItemSortSelectionIndex)
self.controls.itemSortSelectionLabel = new("LabelControl", {"TOPRIGHT", self.controls.itemSortSelection, "TOPLEFT"}, -4, 0, 100, 16, "^7Sort Items By:")

self.maxFetchPerSearchDefault = 2
self.controls.fetchCountEdit = new("EditControl", {"TOPRIGHT", self.controls.itemSortSelectionLabel, "TOPLEFT"}, -8, 0, 150, row_height, "", "Fetch Pages", "%D", 3, function(buf)
self.maxFetchPages = m_min(m_max(tonumber(buf) or self.maxFetchPerSearchDefault, 1), 10)
self.tradeQueryRequests.maxFetchPerSearch = 10 * self.maxFetchPages
self.controls.fetchCountEdit.focusValue = self.maxFetchPages
self.controls.itemSortSelectionLabel = new("LabelControl", {"TOPRIGHT", self.controls.itemSortSelection, "TOPLEFT"}, -4, 0, 60, 16 , "^7Sort By:")

-- Use Enchant in DPS sorting
self.controls.enchantInSort = new("CheckBoxControl", {"TOPRIGHT",self.controls.fetchCountEdit,"TOPLEFT"}, -8, 0, row_height, "Include Enchants:", function(state)
self.enchantInSort = state
for index, _ in pairs(self.resultTbl) do
self:UpdateControlsWithItems({name = baseSlots[index]}, index)
end
end)
self.controls.fetchCountEdit.focusValue = self.maxFetchPerSearchDefault
self.tradeQueryRequests.maxFetchPerSearch = 10 * self.maxFetchPerSearchDefault
self.controls.fetchCountEdit:SetText(tostring(self.maxFetchPages or self.maxFetchPerSearchDefault))
function self.controls.fetchCountEdit:OnFocusLost()
self:SetText(tostring(self.focusValue))
end
self.controls.fetchCountEdit.tooltipFunc = function(tooltip)
tooltip:Clear()
tooltip:AddLine(16, "Specify maximum number of item pages to retrieve per search from PoE Trade.")
tooltip:AddLine(16, "Each page fetches up to 10 items.")
tooltip:AddLine(16, "Acceptable Range is: 1 to 10")
end
self.controls.enchantInSort.tooltipText = "This includes enchants in sorting that occurs after trade results have been retrieved"

-- Realm selection
self.controls.realmLabel = new("LabelControl", {"TOPLEFT", self.controls.setSelect, "TOPRIGHT"}, 18, 0, 20, 16, "^7Realm:")
Expand Down Expand Up @@ -629,6 +639,10 @@ function TradeQueryClass:SortFetchResults(slotTbl, trade_index, mode)
local baseItemOutput = calcFunc({ })
for index, tbl in pairs(self.resultTbl[trade_index]) do
local item = new("Item", tbl.item_string)
if not self.enchantInSort then -- Calc item DPS without anoint or enchant as these can generally be added after.
item.enchantModLines = { }
item:BuildAndParseRaw()
end
local output = calcFunc({ repSlotName = slotName, repItem = item }, {})
out[index] = self.tradeQueryGenerator.WeightedRatioOutputs(baseItemOutput, output, self.statSortSelectionList)
end
Expand All @@ -650,7 +664,7 @@ function TradeQueryClass:SortFetchResults(slotTbl, trade_index, mode)
return out
end
local newTbl = {}
if mode == self.sortModes.WEIGHT then
if mode == self.sortModes.Weight then
for index, _ in pairs(self.resultTbl[trade_index]) do
t_insert(newTbl, { outputAttr = index, index = index })
end
Expand All @@ -661,7 +675,7 @@ function TradeQueryClass:SortFetchResults(slotTbl, trade_index, mode)
t_insert(newTbl, { outputAttr = statValue, index = index })
end
table.sort(newTbl, function(a,b) return a.outputAttr > b.outputAttr end)
elseif mode == self.sortModes.StatValuePRICE then
elseif mode == self.sortModes.StatValuePrice then
local StatValueTable = getStatValueTable()
local priceTable = getPriceTable()
if priceTable == nil then
Expand All @@ -671,7 +685,7 @@ function TradeQueryClass:SortFetchResults(slotTbl, trade_index, mode)
t_insert(newTbl, { outputAttr = statValue / priceTable[index], index = index })
end
table.sort(newTbl, function(a,b) return a.outputAttr > b.outputAttr end)
elseif mode == self.sortModes.PRICE then
elseif mode == self.sortModes.Price then
local priceTable = getPriceTable()
if priceTable == nil then
return nil, "MissingConversionRates"
Expand Down
Loading