From fd2e56848fb8571bbb4bce2065d2a507236febcc Mon Sep 17 00:00:00 2001 From: Wires77 Date: Wed, 15 Apr 2026 05:34:59 +0000 Subject: [PATCH 1/2] Apply changes from https://github.com/PathOfBuildingCommunity/PathOfBuilding/pull/9760 --- src/Classes/ImportTab.lua | 1 + src/Classes/ImportTab.lua.rej | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/Classes/ImportTab.lua.rej diff --git a/src/Classes/ImportTab.lua b/src/Classes/ImportTab.lua index b3cb06563..062043e4b 100644 --- a/src/Classes/ImportTab.lua +++ b/src/Classes/ImportTab.lua @@ -463,6 +463,7 @@ function ImportTabClass:DownloadCharacterList() end end table.sort(leagueList) + charSelectLeague = self.controls.charSelectLeague wipeTable(self.controls.charSelectLeague.list) for _, league in ipairs(leagueList) do t_insert(self.controls.charSelectLeague.list, { diff --git a/src/Classes/ImportTab.lua.rej b/src/Classes/ImportTab.lua.rej new file mode 100644 index 000000000..32356da08 --- /dev/null +++ b/src/Classes/ImportTab.lua.rej @@ -0,0 +1,42 @@ +diff a/src/Classes/ImportTab.lua b/src/Classes/ImportTab.lua (rejected hunks) +@@ -523,11 +523,11 @@ function ImportTabClass:DownloadCharacterList() + if self.lastLeague then + charSelectLeague:SelByValue(self.lastLeague, "league") + -- check that it worked +- if charSelectLeague:GetSelValue("league") ~= self.lastLeague then ++ if charSelectLeague:GetSelValueByKey("league") ~= self.lastLeague then + -- League maybe over, Character will be in standard + standardLeagueName = FindMatchingStandardLeague(self.lastLeague) + self.controls.charSelectLeague:SelByValue(standardLeagueName, "league") +- if charSelectLeague:GetSelValue("league") ~= standardLeagueName then ++ if charSelectLeague:GetSelValueByKey("league") ~= standardLeagueName then + -- give up and select the first entry. Ruthless mode may not have Standard equivalents + charSelectLeague.selIndex = 1 + else +@@ -645,7 +645,7 @@ function ImportTabClass:DownloadPassiveTree() + end + self.lastCharacterHash = common.sha1(charData.name) + if not self.lastLeague then +- self.lastLeague = charSelectLeague:GetSelValue("league") ++ self.lastLeague = charSelectLeague:GetSelValueByKey("league") + end + self:ImportPassiveTreeAndJewels(response.body, charData) + end, sessionID and { header = "Cookie: POESESSID=" .. sessionID }) +@@ -670,7 +670,7 @@ function ImportTabClass:DownloadItems() + end + self.lastCharacterHash = common.sha1(charData.name) + if not self.lastLeague then +- self.lastLeague = charSelectLeague:GetSelValue("league") ++ self.lastLeague = charSelectLeague:GetSelValueByKey("league") + end + self:ImportItemsAndSkills(response.body) + end, sessionID and { header = "Cookie: POESESSID=" .. sessionID }) +@@ -756,7 +756,7 @@ function ImportTabClass:ImportPassiveTreeAndJewels(json, charData) + self.build.spec:BuildClusterJewelGraphs() + self.build.spec:AddUndoState() + if not self.lastLeague then +- self.lastLeague = charSelectLeague:GetSelValue("league") ++ self.lastLeague = charSelectLeague:GetSelValueByKey("league") + end + self.build.characterLevel = charData.level + self.build.characterLevelAutoMode = false From f1742ca9f5f94df381648d346d5c120d50bc335e Mon Sep 17 00:00:00 2001 From: LocalIdentity Date: Sun, 26 Apr 2026 08:07:17 +1000 Subject: [PATCH 2/2] Fix conflicts --- src/Classes/ImportTab.lua | 55 +++++++++++++++++++++++++++++++---- src/Classes/ImportTab.lua.rej | 42 -------------------------- 2 files changed, 49 insertions(+), 48 deletions(-) delete mode 100644 src/Classes/ImportTab.lua.rej diff --git a/src/Classes/ImportTab.lua b/src/Classes/ImportTab.lua index 062043e4b..400506d11 100644 --- a/src/Classes/ImportTab.lua +++ b/src/Classes/ImportTab.lua @@ -75,8 +75,8 @@ local ImportTabClass = newClass("ImportTab", "ControlHost", "Control", function( self.controls.accountNameHeader.shown = function() return self.charImportMode == "GETACCOUNTNAME" end - self.controls.accountRealm = new("DropDownControl", {"TOPLEFT",self.controls.accountNameHeader,"BOTTOMLEFT"}, {0, 4, 60, 20}, realmList ) - self.controls.accountRealm:SelByValue( main.lastRealm or "PC", "id" ) + self.controls.accountRealm = new("DropDownControl", {"TOPLEFT",self.controls.accountNameHeader,"BOTTOMLEFT"}, {0, 4, 60, 20}, realmList) + self.controls.accountRealm:SelByValue(main.lastRealm or "PC", "id") self.controls.accountNameGo = new("ButtonControl", {"LEFT",self.controls.accountNameHeader,"RIGHT"}, {8, 0, 60, 20}, "Start", function() self:DownloadCharacterList() @@ -357,7 +357,9 @@ end function ImportTabClass:Load(xml, fileName) self.lastRealm = xml.attrib.lastRealm - self.controls.accountRealm:SelByValue( self.lastRealm or main.lastRealm or "PC", "id" ) + self.controls.accountRealm:SelByValue(self.lastRealm or main.lastRealm or "PC", "id") + self.lastLeague = xml.attrib.lastLeague + self.controls.charSelectLeague:SelByValue(self.lastLeague or "Standard", "id") self.lastAccountHash = xml.attrib.lastAccountHash self.importLink = xml.attrib.importLink self.controls.enablePartyExportBuffs.state = xml.attrib.exportParty == "true" @@ -375,6 +377,7 @@ end function ImportTabClass:Save(xml) xml.attrib = { lastRealm = self.lastRealm, + lastLeague = self.lastLeague, lastAccountHash = self.lastAccountHash, lastCharacterHash = self.lastCharacterHash, exportParty = tostring(self.controls.enablePartyExportBuffs.state), @@ -402,6 +405,23 @@ function ImportTabClass:Draw(viewPort, inputEvents) end function ImportTabClass:DownloadCharacterList() + function FindMatchingStandardLeague(league) + -- Find a Standard league name for a given league name + -- Reference https://api.pathofexile.com/league?realm=pc + if string.find(league, "Hardcore") then + return "Hardcore" + elseif string.find(league, "HC SSF") then + -- includes Ruthless "HC SSF R " + return "SSF Hardcore" + elseif string.find(league, "SSF") then + -- Any non HardCore SSF's - includes Ruthless "SSF R " + return "SSF Standard" + else + -- normal league and ruthless league (Sanctum, Ruthless Sanctum) + return "Standard" + end + end + self.charImportMode = "DOWNLOADCHARLIST" self.charImportStatus = "Retrieving character list..." local realm = realmList[self.controls.accountRealm.selIndex] @@ -463,7 +483,7 @@ function ImportTabClass:DownloadCharacterList() end end table.sort(leagueList) - charSelectLeague = self.controls.charSelectLeague + charSelectLeague = self.controls.charSelectLeague wipeTable(self.controls.charSelectLeague.list) for _, league in ipairs(leagueList) do t_insert(self.controls.charSelectLeague.list, { @@ -474,8 +494,25 @@ function ImportTabClass:DownloadCharacterList() t_insert(self.controls.charSelectLeague.list, { label = "All", }) - if self.controls.charSelectLeague.selIndex > #self.controls.charSelectLeague.list then - self.controls.charSelectLeague.selIndex = 1 + -- set the league combo to the last used if possible, used for previously imported characters + if self.lastLeague then + charSelectLeague:SelByValue(self.lastLeague, "league") + -- check that it worked + if charSelectLeague:GetSelValueByKey("league") ~= self.lastLeague then + -- League maybe over, Character will be in standard + local standardLeagueName = FindMatchingStandardLeague(self.lastLeague) + self.controls.charSelectLeague:SelByValue(standardLeagueName, "league") + if charSelectLeague:GetSelValueByKey("league") ~= standardLeagueName then + -- give up and select the first entry. Ruthless mode may not have Standard equivalents + charSelectLeague.selIndex = 1 + else + self.lastLeague = standardLeagueName + end + end + else + if self.controls.charSelectLeague.selIndex > #self.controls.charSelectLeague.list then + self.controls.charSelectLeague.selIndex = 1 + end end self.lastCharList = charList self:BuildCharacterList(self.controls.charSelectLeague:GetSelValueByKey("league")) @@ -554,6 +591,9 @@ function ImportTabClass:DownloadCharacter(callback) return end self.lastCharacterHash = common.sha1(charData.name) + if not self.lastLeague then + self.lastLeague = charSelectLeague:GetSelValueByKey("league") + end --local out = io.open("get-passive-skills.json", "w") --out:write(json) --out:close() @@ -714,6 +754,9 @@ function ImportTabClass:ImportPassiveTreeAndJewels(charData) self.build.spec:AddUndoState() self:ImportQuestRewardConfig(charPassiveData.quest_stats) + if not self.lastLeague then + self.lastLeague = charSelectLeague:GetSelValueByKey("league") + end self.build.characterLevel = charData.level self.build.characterLevelAutoMode = false self.build.configTab:UpdateLevel() diff --git a/src/Classes/ImportTab.lua.rej b/src/Classes/ImportTab.lua.rej deleted file mode 100644 index 32356da08..000000000 --- a/src/Classes/ImportTab.lua.rej +++ /dev/null @@ -1,42 +0,0 @@ -diff a/src/Classes/ImportTab.lua b/src/Classes/ImportTab.lua (rejected hunks) -@@ -523,11 +523,11 @@ function ImportTabClass:DownloadCharacterList() - if self.lastLeague then - charSelectLeague:SelByValue(self.lastLeague, "league") - -- check that it worked -- if charSelectLeague:GetSelValue("league") ~= self.lastLeague then -+ if charSelectLeague:GetSelValueByKey("league") ~= self.lastLeague then - -- League maybe over, Character will be in standard - standardLeagueName = FindMatchingStandardLeague(self.lastLeague) - self.controls.charSelectLeague:SelByValue(standardLeagueName, "league") -- if charSelectLeague:GetSelValue("league") ~= standardLeagueName then -+ if charSelectLeague:GetSelValueByKey("league") ~= standardLeagueName then - -- give up and select the first entry. Ruthless mode may not have Standard equivalents - charSelectLeague.selIndex = 1 - else -@@ -645,7 +645,7 @@ function ImportTabClass:DownloadPassiveTree() - end - self.lastCharacterHash = common.sha1(charData.name) - if not self.lastLeague then -- self.lastLeague = charSelectLeague:GetSelValue("league") -+ self.lastLeague = charSelectLeague:GetSelValueByKey("league") - end - self:ImportPassiveTreeAndJewels(response.body, charData) - end, sessionID and { header = "Cookie: POESESSID=" .. sessionID }) -@@ -670,7 +670,7 @@ function ImportTabClass:DownloadItems() - end - self.lastCharacterHash = common.sha1(charData.name) - if not self.lastLeague then -- self.lastLeague = charSelectLeague:GetSelValue("league") -+ self.lastLeague = charSelectLeague:GetSelValueByKey("league") - end - self:ImportItemsAndSkills(response.body) - end, sessionID and { header = "Cookie: POESESSID=" .. sessionID }) -@@ -756,7 +756,7 @@ function ImportTabClass:ImportPassiveTreeAndJewels(json, charData) - self.build.spec:BuildClusterJewelGraphs() - self.build.spec:AddUndoState() - if not self.lastLeague then -- self.lastLeague = charSelectLeague:GetSelValue("league") -+ self.lastLeague = charSelectLeague:GetSelValueByKey("league") - end - self.build.characterLevel = charData.level - self.build.characterLevelAutoMode = false