31
31
32
32
-- Path can be in any format recognized by the extractor at oozPath, ie,
33
33
-- a .ggpk file or a Steam Path of Exile directory
34
- local GGPKClass = newClass (" GGPKData" , function (self , path , datPath )
34
+ local GGPKClass = newClass (" GGPKData" , function (self , path , datPath , reExport )
35
35
if datPath then
36
36
self .oozPath = datPath :match (" \\ $" ) and datPath or (datPath .. " \\ " )
37
37
else
38
38
self .path = path
39
39
self .oozPath = io.popen (" cd" ):read (' *l' ):gsub (' \r ?' , ' ' ) .. " \\ ggpk\\ "
40
- self :CleanDir ()
41
- self :ExtractFiles ()
40
+ self :CleanDir (reExport )
41
+ self :ExtractFiles (reExport )
42
42
end
43
43
44
44
self .dat = { }
@@ -51,10 +51,12 @@ local GGPKClass = newClass("GGPKData", function(self, path, datPath)
51
51
end
52
52
end )
53
53
54
- function GGPKClass :CleanDir ()
55
- local cmd = ' del ' .. self .oozPath .. ' Data ' .. self .oozPath .. ' Metadata /Q /S'
56
- ConPrintf (cmd )
57
- os.execute (cmd )
54
+ function GGPKClass :CleanDir (reExport )
55
+ if reExport then
56
+ local cmd = ' del ' .. self .oozPath .. ' Data ' .. self .oozPath .. ' Metadata /Q /S'
57
+ ConPrintf (cmd )
58
+ os.execute (cmd )
59
+ end
58
60
end
59
61
60
62
function GGPKClass :ExtractFilesWithBun (fileListStr )
@@ -63,45 +65,47 @@ function GGPKClass:ExtractFilesWithBun(fileListStr)
63
65
os.execute (cmd )
64
66
end
65
67
66
- function GGPKClass :ExtractFiles ()
67
- local datList , txtList , itList = self :GetNeededFiles ()
68
- local sweetSpotCharacter = 6000
69
- local fileList = ' '
70
- for _ , fname in ipairs (datList ) do
71
- if USE_DAT64 then
72
- fileList = fileList .. ' "' .. fname .. ' c64" '
73
- else
74
- fileList = fileList .. ' "' .. fname .. ' " '
75
- end
68
+ function GGPKClass :ExtractFiles (reExport )
69
+ if reExport then
70
+ local datList , txtList , itList = self :GetNeededFiles ()
71
+ local sweetSpotCharacter = 6000
72
+ local fileList = ' '
73
+ for _ , fname in ipairs (datList ) do
74
+ if USE_DAT64 then
75
+ fileList = fileList .. ' "' .. fname .. ' c64" '
76
+ else
77
+ fileList = fileList .. ' "' .. fname .. ' " '
78
+ end
76
79
77
- if fileList :len () > sweetSpotCharacter then
78
- self :ExtractFilesWithBun (fileList )
79
- fileList = ' '
80
+ if fileList :len () > sweetSpotCharacter then
81
+ self :ExtractFilesWithBun (fileList )
82
+ fileList = ' '
83
+ end
80
84
end
81
- end
82
85
83
- for _ , fname in ipairs (txtList ) do
84
- fileList = fileList .. ' "' .. fname .. ' " '
86
+ for _ , fname in ipairs (txtList ) do
87
+ fileList = fileList .. ' "' .. fname .. ' " '
85
88
86
- if fileList :len () > sweetSpotCharacter then
87
- self :ExtractFilesWithBun (fileList )
88
- fileList = ' '
89
+ if fileList :len () > sweetSpotCharacter then
90
+ self :ExtractFilesWithBun (fileList )
91
+ fileList = ' '
92
+ end
89
93
end
90
- end
91
94
92
- for _ , fname in ipairs (itList ) do
93
- fileList = fileList .. ' "' .. fname .. ' " '
95
+ for _ , fname in ipairs (itList ) do
96
+ fileList = fileList .. ' "' .. fname .. ' " '
97
+
98
+ if fileList :len () > sweetSpotCharacter then
99
+ self :ExtractFilesWithBun (fileList )
100
+ fileList = ' '
101
+ end
102
+ end
94
103
95
- if fileList :len () > sweetSpotCharacter then
104
+ if ( fileList :len () > 0 ) then
96
105
self :ExtractFilesWithBun (fileList )
97
- fileList = ' '
98
106
end
99
107
end
100
108
101
- if (fileList :len () > 0 ) then
102
- self :ExtractFilesWithBun (fileList )
103
- end
104
-
105
109
-- Overwrite Enums
106
110
local errMsg = PLoadModule (" Scripts/enums.lua" )
107
111
if errMsg then
0 commit comments