Skip to content

Commit 1a58cba

Browse files
authored
Merge branch 'dev' into trader-tool-port
2 parents 628ab84 + b9aa7fb commit 1a58cba

18 files changed

Lines changed: 155 additions & 64 deletions

CONTRIBUTING.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,14 @@ Files in `/Data` `/Export` and `/TreeData` can be massive and cause the EmmyLua
179179
```json
180180
{
181181
"$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json",
182+
"runtime": {
183+
"version": "LuaJIT"
184+
},
182185
"workspace": {
183186
"ignoreGlobs": [
184-
"src/Data/**.lua",
185-
"src/TreeData/**.lua",
186-
"src/Modules/ModParser.lua"
187+
"**/src/Data/**/*.lua",
188+
"**/src/TreeData/**/*.lua",
189+
"**/src/Modules/ModParser.lua"
187190
]
188191
}
189192
}

src/Classes/GemSelectControl.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,6 @@ function GemSelectClass:PopulateGemList()
105105
end
106106
end
107107

108-
function GemSelectClass:GetQualityType(gemId)
109-
return gemId and gemId:gsub(":.+","") or "Default"
110-
end
111-
112108
function GemSelectClass:FilterSupport(gemId, gemData)
113109
local showSupportTypes = self.skillsTab.showSupportGemTypes
114110
return (not gemData.grantedEffect.support
@@ -354,7 +350,7 @@ function GemSelectClass:UpdateGem(setText, addUndo)
354350
if setText then
355351
self:SetText(self.gemName)
356352
end
357-
self.gemChangeFunc(self.gemId and self.gemId:gsub("%w+:", ""), self:GetQualityType(self.gemId), addUndo and self.gemName ~= self.initialBuf)
353+
self.gemChangeFunc(self.gemId and self.gemId:gsub("%w+:", ""), addUndo and self.gemName ~= self.initialBuf)
358354
end
359355

360356
function GemSelectClass:ScrollSelIntoView()

src/Classes/ImportTab.lua

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ local ImportTabClass = newClass("ImportTab", "ControlHost", "Control", function(
7878
self.controls.accountNameHeader.shown = function()
7979
return self.charImportMode == "GETACCOUNTNAME"
8080
end
81-
self.controls.accountRealm = new("DropDownControl", {"TOPLEFT",self.controls.accountNameHeader,"BOTTOMLEFT"}, {0, 4, 60, 20}, realmList )
82-
self.controls.accountRealm:SelByValue( main.lastRealm or "PC", "id" )
81+
self.controls.accountRealm = new("DropDownControl", {"TOPLEFT",self.controls.accountNameHeader,"BOTTOMLEFT"}, {0, 4, 60, 20}, realmList)
82+
self.controls.accountRealm:SelByValue(main.lastRealm or "PC", "id")
8383

8484
self.controls.accountNameGo = new("ButtonControl", {"LEFT",self.controls.accountNameHeader,"RIGHT"}, {8, 0, 60, 20}, "Start", function()
8585
self:DownloadCharacterList()
@@ -364,7 +364,9 @@ end
364364

365365
function ImportTabClass:Load(xml, fileName)
366366
self.lastRealm = xml.attrib.lastRealm
367-
self.controls.accountRealm:SelByValue( self.lastRealm or main.lastRealm or "PC", "id" )
367+
self.controls.accountRealm:SelByValue(self.lastRealm or main.lastRealm or "PC", "id")
368+
self.lastLeague = xml.attrib.lastLeague
369+
self.controls.charSelectLeague:SelByValue(self.lastLeague or "Standard", "id")
368370
self.lastAccountHash = xml.attrib.lastAccountHash
369371
self.importLink = xml.attrib.importLink
370372
self.controls.enablePartyExportBuffs.state = xml.attrib.exportParty == "true"
@@ -382,6 +384,7 @@ end
382384
function ImportTabClass:Save(xml)
383385
xml.attrib = {
384386
lastRealm = self.lastRealm,
387+
lastLeague = self.lastLeague,
385388
lastAccountHash = self.lastAccountHash,
386389
lastCharacterHash = self.lastCharacterHash,
387390
exportParty = tostring(self.controls.enablePartyExportBuffs.state),
@@ -409,6 +412,23 @@ function ImportTabClass:Draw(viewPort, inputEvents)
409412
end
410413

411414
function ImportTabClass:DownloadCharacterList()
415+
function FindMatchingStandardLeague(league)
416+
-- Find a Standard league name for a given league name
417+
-- Reference https://api.pathofexile.com/league?realm=pc
418+
if string.find(league, "Hardcore") then
419+
return "Hardcore"
420+
elseif string.find(league, "HC SSF") then
421+
-- includes Ruthless "HC SSF R "
422+
return "SSF Hardcore"
423+
elseif string.find(league, "SSF") then
424+
-- Any non HardCore SSF's - includes Ruthless "SSF R "
425+
return "SSF Standard"
426+
else
427+
-- normal league and ruthless league (Sanctum, Ruthless Sanctum)
428+
return "Standard"
429+
end
430+
end
431+
412432
self.charImportMode = "DOWNLOADCHARLIST"
413433
self.charImportStatus = "Retrieving character list..."
414434
local realm = realmList[self.controls.accountRealm.selIndex]
@@ -470,6 +490,7 @@ function ImportTabClass:DownloadCharacterList()
470490
end
471491
end
472492
table.sort(leagueList)
493+
charSelectLeague = self.controls.charSelectLeague
473494
wipeTable(self.controls.charSelectLeague.list)
474495
for _, league in ipairs(leagueList) do
475496
t_insert(self.controls.charSelectLeague.list, {
@@ -480,8 +501,25 @@ function ImportTabClass:DownloadCharacterList()
480501
t_insert(self.controls.charSelectLeague.list, {
481502
label = "All",
482503
})
483-
if self.controls.charSelectLeague.selIndex > #self.controls.charSelectLeague.list then
484-
self.controls.charSelectLeague.selIndex = 1
504+
-- set the league combo to the last used if possible, used for previously imported characters
505+
if self.lastLeague then
506+
charSelectLeague:SelByValue(self.lastLeague, "league")
507+
-- check that it worked
508+
if charSelectLeague:GetSelValueByKey("league") ~= self.lastLeague then
509+
-- League maybe over, Character will be in standard
510+
local standardLeagueName = FindMatchingStandardLeague(self.lastLeague)
511+
self.controls.charSelectLeague:SelByValue(standardLeagueName, "league")
512+
if charSelectLeague:GetSelValueByKey("league") ~= standardLeagueName then
513+
-- give up and select the first entry. Ruthless mode may not have Standard equivalents
514+
charSelectLeague.selIndex = 1
515+
else
516+
self.lastLeague = standardLeagueName
517+
end
518+
end
519+
else
520+
if self.controls.charSelectLeague.selIndex > #self.controls.charSelectLeague.list then
521+
self.controls.charSelectLeague.selIndex = 1
522+
end
485523
end
486524
self.lastCharList = charList
487525
self:BuildCharacterList(self.controls.charSelectLeague:GetSelValueByKey("league"))
@@ -560,6 +598,9 @@ function ImportTabClass:DownloadCharacter(callback)
560598
return
561599
end
562600
self.lastCharacterHash = common.sha1(charData.name)
601+
if not self.lastLeague then
602+
self.lastLeague = charSelectLeague:GetSelValueByKey("league")
603+
end
563604
--local out = io.open("get-passive-skills.json", "w")
564605
--out:write(json)
565606
--out:close()
@@ -720,6 +761,9 @@ function ImportTabClass:ImportPassiveTreeAndJewels(charData)
720761

721762
self.build.spec:AddUndoState()
722763
self:ImportQuestRewardConfig(charPassiveData.quest_stats)
764+
if not self.lastLeague then
765+
self.lastLeague = charSelectLeague:GetSelValueByKey("league")
766+
end
723767
self.build.characterLevel = charData.level
724768
self.build.characterLevelAutoMode = false
725769
self.build.configTab:UpdateLevel()

src/Classes/SkillsTab.lua

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,6 @@ local sortGemTypeList = {
7070
{ label = "Effective Hit Pool", type = "TotalEHP" },
7171
}
7272

73-
local alternateGemQualityList ={
74-
{ label = "Default", type = "Default" },
75-
{ label = "Anomalous", type = "Alternate1" },
76-
{ label = "Divergent", type = "Alternate2" },
77-
{ label = "Phantasmal", type = "Alternate3" },
78-
}
79-
8073
local SkillsTabClass = newClass("SkillsTab", "UndoHandler", "ControlHost", "Control", function(self, build)
8174
self.UndoHandler()
8275
self.ControlHost()

src/Classes/Tooltip.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ function TooltipClass:AddSeparator(size)
9898

9999
if self.tooltipHeader then
100100
local rarity = tostring(self.tooltipHeader):upper()
101+
-- spell-checker: disable
101102
local separatorConfigs = {
102103
RELIC = "Assets/itemsseparatorfoil.png",
103104
UNIQUE = "Assets/itemsseparatorunique.png",
@@ -106,6 +107,7 @@ function TooltipClass:AddSeparator(size)
106107
NORMAL = "Assets/itemsseparatorwhite.png",
107108
GEM = "Assets/itemsseparatorgem.png",
108109
}
110+
-- spell-checker: enable
109111
local separatorPath = separatorConfigs[rarity] or separatorConfigs.NORMAL
110112

111113
if not self.separatorImage or self.separatorImagePath ~= separatorPath then
@@ -288,6 +290,7 @@ function TooltipClass:Draw(x, y, w, h, viewPort)
288290
ttW = titleW + 50
289291
end
290292
end
293+
-- spell-checker: disable
291294
local headerInfluence = {
292295
Fractured = "Assets/fractureditemsymbol.png",
293296
Desecrated = "Assets/veileditemsymbol.png",
@@ -309,6 +312,7 @@ function TooltipClass:Draw(x, y, w, h, viewPort)
309312
ORACLE_NOTABLE = {left="Assets/oraclenotablepassiveheaderleft.png", middle="Assets/oraclenotablepassiveheadermiddle.png", right="Assets/oraclenotablepassiveheaderright.png", height=38, sideWidth=38, middleWidth=32, textYOffset=4},
310313
ORACLE_KEYSTONE = {left="Assets/oraclekeystonepassiveheaderleft.png", middle="Assets/oraclekeystonepassiveheadermiddle.png", right="Assets/oraclekeystonepassiveheaderright.png", height=38, sideWidth=32, middleWidth=32, textYOffset=4},
311314
}
315+
-- spell-checker: enable
312316
local config
313317
if self.tooltipHeader and main.showFlavourText and self.lines[1] and self.lines[1].text then
314318
local rarity = tostring(self.tooltipHeader):upper()

0 commit comments

Comments
 (0)