Skip to content

Commit

Permalink
PoB 2 Changes
Browse files Browse the repository at this point in the history
Fix duplicated code causing item bases to be parsed twice and once with old code leaking talismans into general code.

Fix negative modifers

Handle sign after the fact and try fixing a mod that wasn't being parsed correctly.

Fix failed parse for a line affecting others.

Properly Fixed

Several fixes including talismans handling change, fix incorrect invert implementation and invert negaed mods before item creation, fix multi line implicits and move passives back to correct spot.

Fix chance to block flat again.

Change up and fix a couple of the local mods.
  • Loading branch information
QuickStick123 committed Dec 27, 2024
1 parent 5dc8ca4 commit 5ca4b7d
Show file tree
Hide file tree
Showing 4 changed files with 998 additions and 7,160 deletions.
49 changes: 20 additions & 29 deletions src/Classes/TradeQuery.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ local TradeQueryClass = newClass("TradeQuery", function(self, itemsTab)
-- table holding all realm/league pairs. (allLeagues[realm] = [league.id,...])
self.allLeagues = {}
-- realm id-text table to pair realm name with API parameter
self.realmIds = {}

self.realmIds = {
["PC"] = "pc",
["Xbox"] = "xbox",
["Sony"] = "sony",
}
self.tradeQueryRequests = new("TradeQueryRequests")
main.onFrameFuncs["TradeQueryRequests"] = function()
self.tradeQueryRequests:ProcessQueue()
Expand Down Expand Up @@ -511,7 +514,7 @@ Highest Weight - Displays the order retrieved from trade]]
self.controls.updateCurrencyConversion = new("ButtonControl", {"BOTTOMLEFT", nil, "BOTTOMLEFT"}, {pane_margins_horizontal, -pane_margins_vertical, 240, row_height}, "Get Currency Conversion Rates", function()
self:PullPoENinjaCurrencyConversion(self.pbLeague)
end)
self.controls.pbNotice = new("LabelControl", {"BOTTOMRIGHT", nil, "BOTTOMRIGHT"}, {-row_height - pane_margins_vertical - row_vertical_padding, -pane_margins_vertical, 300, row_height}, "")
self.controls.pbNotice = new("LabelControl", {"BOTTOMRIGHT", nil, "BOTTOMRIGHT"}, {-row_height - pane_margins_vertical - row_vertical_padding, -pane_margins_vertical - row_height - row_vertical_padding, 300, row_height}, "")

-- used in PopupDialog:Draw()
local function scrollBarFunc()
Expand Down Expand Up @@ -1102,38 +1105,26 @@ function TradeQueryClass:UpdateRealms()
self.controls.realm:SetSel(self.pbRealmIndex)
end

if main.POESESSID and main.POESESSID ~= "" then
-- Fetch from trade page using POESESSID, includes private leagues
ConPrintf("Fetching realms and leagues using POESESSID")
self.tradeQueryRequests:FetchRealmsAndLeaguesHTML(function(data, errMsg)
-- use trade leagues api to get trade leagues including private leagues if valid.
for _, realmId in pairs (self.realmIds) do
self.tradeQueryRequests:FetchLeagues(realmId, function(leagues, errMsg)
if errMsg then
self:SetNotice(self.controls.pbNotice, "Error while fetching league list: "..errMsg)
return
self:SetNotice(self.controls.pbNotice, "Using Fallback Error while fetching league list: "..errMsg)
end
local leagues = data.leagues
self.allLeagues = {}
for _, value in ipairs(leagues) do
if not self.allLeagues[value.realm] then self.allLeagues[value.realm] = {} end
t_insert(self.allLeagues[value.realm], value.id)
end
self.realmIds = {}
for _, value in pairs(data.realms) do
-- filter out only Path of Exile one realms, as poe2 is not supported yet
if value.text:match("PoE 1 ") then
self.realmIds[value.text:gsub("PoE 1 ", "")] = value.id
end
for _, league in ipairs(leagues) do
if not self.allLeagues[realmId] then self.allLeagues[realmId] = {} end
t_insert(self.allLeagues[realmId], league)
end
setRealmDropList()

end)
else
-- Fallback to static list
ConPrintf("Using static realms list")
self.realmIds = {
["PC"] = "pc",
["PS4"] = "sony",
["Xbox"] = "xbox",
}
setRealmDropList()
end

-- perform a generic search to make sure POESESSID if valid.
self.tradeQueryRequests:PerformSearch("pc", "Standard", [[{"query":{"status":{"option":"online"},"stats":[{"type":"and","filters":[]}]},"sort":{"price":"asc"}}]], function(response, errMsg)
if errMsg then
self:SetNotice(self.controls.pbNotice, "Error: " .. tostring(errMsg))
end
end)
end
Loading

0 comments on commit 5ca4b7d

Please sign in to comment.