Skip to content

Commit ab8d7ad

Browse files
committed
Update data export class definitions
1 parent c0a223e commit ab8d7ad

8 files changed

Lines changed: 32 additions & 16 deletions

File tree

src/Export/Classes/Dat64File.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ local dataTypes = {
8585
}
8686

8787
---@class Dat64File
88-
local Dat64FileClass = newClass("Dat64File", function(self, name, raw)
88+
local Dat64FileClass = newClass("Dat64File")
89+
90+
function Dat64FileClass:Dat64File(name, raw)
8991
self.name = name:lower()
9092
self.raw = raw
9193

@@ -125,7 +127,7 @@ local Dat64FileClass = newClass("Dat64File", function(self, name, raw)
125127
--ConPrintf("Loaded '%s': %d Rows at %d Bytes", self.name, self.rowCount, self.rowSize)
126128

127129
self:OnSpecChanged()
128-
end)
130+
end
129131

130132
function Dat64FileClass:OnSpecChanged()
131133
wipeTable(self.cols)

src/Export/Classes/DatFile.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ local dataTypes = {
7777
}
7878

7979
---@class DatFile
80-
local DatFileClass = newClass("DatFile", function(self, name, raw)
80+
local DatFileClass = newClass("DatFile")
81+
82+
function DatFileClass:DatFile(name, raw)
8183
self.name = name
8284
self.raw = raw
8385

@@ -117,7 +119,7 @@ local DatFileClass = newClass("DatFile", function(self, name, raw)
117119
--ConPrintf("Loaded '%s': %d Rows at %d Bytes", self.name, self.rowCount, self.rowSize)
118120

119121
self:OnSpecChanged()
120-
end)
122+
end
121123

122124
function DatFileClass:OnSpecChanged()
123125
wipeTable(self.cols)

src/Export/Classes/DatListControl.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
-- Dat list control.
55
--
66
---@class DatListControl: ListControl
7-
local DatListClass = newClass("DatListControl", "ListControl", function(self, anchor, rect)
7+
local DatListClass = newClass("DatListControl", "ListControl")
8+
9+
function DatListClass:DatListControl(anchor, rect)
810
self.originalList = main.datFileList
911
self.searchBuf = ""
1012
self.filteredList = self.originalList
1113
self:ListControl(anchor, rect, 14, "VERTICAL", false, self.filteredList)
12-
end)
14+
end
1315

1416
function DatListClass:BuildFilteredList()
1517
local search = self.searchBuf:lower()

src/Export/Classes/GGPKData.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ end
3232
-- Path can be in any format recognized by the extractor at oozPath, ie,
3333
-- a .ggpk file or a Steam Path of Exile directory
3434
---@class GGPKData
35-
local GGPKClass = newClass("GGPKData", function(self, path, datPath, reExport)
35+
local GGPKClass = newClass("GGPKData")
36+
37+
function GGPKClass:GGPKData(path, datPath, reExport)
3638
if datPath then
3739
self.oozPath = datPath:match("\\$") and datPath or (datPath .. "\\")
3840
else
@@ -47,7 +49,7 @@ local GGPKClass = newClass("GGPKData", function(self, path, datPath, reExport)
4749
self.ot = { }
4850

4951
self:AddDat64Files()
50-
end)
52+
end
5153

5254
function GGPKClass:CleanDir(reExport)
5355
if reExport then

src/Export/Classes/GGPKSourceListControl.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
-- GGPK source list control.
55
--
66
---@class GGPKSourceListControl: ListControl
7-
local GGPKSourceListClass = newClass("GGPKSourceListControl", "ListControl", function(self, anchor, rect)
7+
local GGPKSourceListClass = newClass("GGPKSourceListControl", "ListControl")
8+
9+
function GGPKSourceListClass:GGPKSourceListControl(anchor, rect)
810
self:ListControl(anchor, rect, 16, false, false, main.datSources)
911
self.colList = {
1012
{ width = self.width * 0.25, label = "Name", sortable = true },
@@ -21,7 +23,7 @@ local GGPKSourceListClass = newClass("GGPKSourceListControl", "ListControl", fun
2123
self.controls.delete.enabled = function()
2224
return self.selValue ~= nil and #self.list > 1
2325
end
24-
end)
26+
end
2527

2628
function GGPKSourceListClass:EditDATSource(datSource, newSource)
2729
local controls = { }

src/Export/Classes/RowListControl.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ local ipairs = ipairs
77
local t_insert = table.insert
88

99
---@class RowListControl: ListControl
10-
local RowListClass = newClass("RowListControl", "ListControl", function(self, anchor, rect)
10+
local RowListClass = newClass("RowListControl", "ListControl")
11+
12+
function RowListClass:RowListControl(anchor, rect)
1113
self:ListControl(anchor, rect, 14, "HORIZONTAL", false, { })
1214
self.colLabels = true
1315
self._autoSizeToggleState = {} -- internal toggle memory, not saved to spec
14-
end)
16+
end
1517

1618
function RowListClass:BuildRows(filter)
1719
wipeTable(self.list)

src/Export/Classes/ScriptListControl.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
-- Script list control.
55
--
66
---@class ScriptListControl: ListControl
7-
local ScriptListClass = newClass("ScriptListControl", "ListControl", function(self, anchor, rect)
7+
local ScriptListClass = newClass("ScriptListControl", "ListControl")
8+
9+
function ScriptListClass:ScriptListControl(anchor, rect)
810
self:ListControl(anchor, rect, 16, "VERTICAL", false, main.scriptList)
9-
end)
11+
end
1012

1113
function ScriptListClass:GetRowValue(column, index, script)
1214
if column == 1 then

src/Export/Classes/SpecColListControl.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
local t_remove = table.remove
77

88
---@class SpecColListControl: ListControl
9-
local SpecColListClass = newClass("SpecColListControl", "ListControl", function(self, anchor, rect)
9+
local SpecColListClass = newClass("SpecColListControl", "ListControl")
10+
11+
function SpecColListClass:SpecColListControl(anchor, rect)
1012
self:ListControl(anchor, rect, 14, "VERTICAL", true)
11-
end)
13+
end
1214

1315
function SpecColListClass:GetRowValue(column, index, specCol)
1416
if column == 1 then

0 commit comments

Comments
 (0)