Skip to content

Commit 1cdc1a8

Browse files
authored
Merge branch 'PathOfBuildingCommunity:dev' into show-flavour-text-on-uniques
2 parents 5f29bba + 9b201c2 commit 1cdc1a8

38 files changed

+23256
-21588
lines changed

src/Classes/FolderListControl.lua

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,38 @@ local t_insert = table.insert
99
local FolderListClass = newClass("FolderListControl", "ListControl", function(self, anchor, rect, subPath, onChange)
1010
self.ListControl(anchor, rect, 16, "VERTICAL", false, { })
1111
self.subPath = subPath or ""
12-
self.controls.path = new("PathControl", {"BOTTOM",self,"TOP"}, {0, -2, self.width, 24}, main.buildPath, self.subPath, function(subPath)
13-
self.subPath = subPath
12+
self.onChangeCallback = onChange
13+
14+
self.controls.path = new("PathControl", {"BOTTOM",self,"TOP"}, {0, -2, self.width, 24}, main.buildPath, self.subPath, function(newSubPath)
15+
self.subPath = newSubPath
1416
self:BuildList()
1517
self.selIndex = nil
1618
self.selValue = nil
17-
if onChange then
18-
onChange(subPath)
19+
if self.onChangeCallback then
20+
self.onChangeCallback(newSubPath)
1921
end
2022
end)
2123
self:BuildList()
2224
end)
2325

26+
function FolderListClass:SortList()
27+
if not self.list then return end
28+
local sortMode = main.buildSortMode or "NAME"
29+
30+
table.sort(self.list, function(a, b)
31+
if sortMode == "EDITED" then
32+
local modA = a.modified or 0
33+
local modB = b.modified or 0
34+
if modA ~= modB then
35+
return modA > modB
36+
end
37+
return naturalSortCompare(a.name, b.name)
38+
else
39+
return naturalSortCompare(a.name, b.name)
40+
end
41+
end)
42+
end
43+
2444
function FolderListClass:BuildList()
2545
wipeTable(self.list)
2646
local handle = NewFileSearch(main.buildPath..self.subPath.."*", true)
@@ -29,11 +49,17 @@ function FolderListClass:BuildList()
2949
t_insert(self.list, {
3050
name = fileName,
3151
fullFileName = main.buildPath..self.subPath..fileName,
52+
modified = handle:GetFileModifiedTime()
3253
})
3354
if not handle:NextFile() then
3455
break
3556
end
3657
end
58+
if handle and handle.Close then handle:Close() end
59+
60+
self:SortList()
61+
if self.UpdateScrollbar then self:UpdateScrollbar() end
62+
if self.Redraw then self:Redraw() end
3763
end
3864

3965
function FolderListClass:OpenFolder(folderName)
@@ -61,7 +87,7 @@ function FolderListClass:OnSelDelete(index, folder)
6187
main:OpenMessagePopup("Error", "Couldn't delete '"..folder.fullFileName.."': "..msg)
6288
return
6389
end
64-
self:BuildList()
90+
self:BuildList()
6591
self.selIndex = nil
6692
self.selValue = nil
6793
end

src/Classes/ListControl.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,12 @@ function ListClass:OnKeyDown(key, doubleClick)
346346
newSelect = index
347347
end
348348
else
349+
local scrollOffsetH = self.controls.scrollBarH.offset
349350
for colIndex, column in ipairs(self.colList) do
350351
local relX = cursorX - (x + 2)
351352
local relY = cursorY - (y + 2)
352-
local mOver = relX >= column._offset and relX <= column._offset + column._width and relY >= 0 and relY <= 18
353+
local adjustedRelX = relX + scrollOffsetH
354+
local mOver = adjustedRelX >= column._offset and adjustedRelX <= column._offset + column._width and relY >= 0 and relY <= 18
353355
if self:GetColumnProperty(column, "sortable") and mOver and self.ReSort then
354356
self:ReSort(colIndex)
355357
end

src/Data/Bases/flail.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ itemBases["Twin Flail"] = {
4444
socketLimit = 2,
4545
tags = { maraketh_basetype = true, onehand = true, flail = true, weapon = true, one_hand_weapon = true, default = true, },
4646
implicit = "Forks Critical Hits",
47-
implicitModTypes = { { }, },
47+
implicitModTypes = { { "critical" }, },
4848
weapon = { PhysicalMin = 8, PhysicalMax = 18, CritChanceBase = 10, AttackRateBase = 1.4, Range = 11, },
4949
req = { level = 20, str = 37, int = 16, },
5050
}

src/Data/Bases/staff.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ itemBases["Dark Staff"] = {
106106
implicitModTypes = { },
107107
req = { },
108108
}
109+
itemBases["Permafrost Staff"] = {
110+
type = "Staff",
111+
quality = 20,
112+
tags = { default = true, twohand = true, staff = true, },
113+
implicit = "Grants Skill: Level (1-20) Heart of Ice",
114+
implicitModTypes = { },
115+
req = { },
116+
}
109117

110118
itemBases["Wrapped Quarterstaff"] = {
111119
type = "Staff",

0 commit comments

Comments
 (0)