@@ -334,11 +334,13 @@ end
334
334
335
335
function main :LoadDatSource (value )
336
336
self .leagueLabel = nil
337
+ local reExportState = self .reExportGGPKData
338
+ self .reExportGGPKData = true
339
+ self .datSource = value
337
340
local out = io.open (self .datSource .spec .. (self .datSource .spec :match (" %.lua$" ) and " " or " .lua" ), " w" )
338
341
out :write (' return ' )
339
342
writeLuaTable (out , self .datSpecs , 1 )
340
343
out :close ()
341
- self .datSource = value
342
344
self .datSpecs = LoadModule (self .datSource .spec )
343
345
self :InitGGPK ()
344
346
if USE_DAT64 then
@@ -349,6 +351,7 @@ function main:LoadDatSource(value)
349
351
if self .datFileByName [" leaguenames" ] then
350
352
self .leagueLabel = self .datFileByName [" leaguenames" ]:ReadValueText ({ type = " String" }, self .datFileByName [" leaguenames" ].rows [2 ] + 8 )
351
353
end
354
+ self .reExportGGPKData = reExportState
352
355
end
353
356
354
357
function main :OpenPathPopup ()
@@ -520,7 +523,7 @@ function main:LoadSettings()
520
523
end
521
524
for _ , node in ipairs (setXML [1 ]) do
522
525
if type (node ) == " table" then
523
- if node .elem == " DatSource" then
526
+ if node .elem == " DatSource" and ( node . attrib . ggpkPath or node . attrib . path ) and node . attrib . datFilePath then
524
527
self .datSource = self .datSource or { }
525
528
self .datSource .ggpkPath = node .attrib .ggpkPath or node .attrib .path
526
529
self .datSource .datFilePath = node .attrib .datFilePath
@@ -530,18 +533,19 @@ function main:LoadSettings()
530
533
if node .elem == " DatSources" then
531
534
self .datSources = self .datSources or { }
532
535
for _ , child in ipairs (node ) do
533
- t_insert (self .datSources , { ggpkPath = child .attrib .ggpkPath , datFilePath = child .attrib .datFilePath , label = child .attrib .label , spec = child .attrib .spec })
536
+ if (child .attrib .ggpkPath or child .attrib .path ) and child .attrib .datFilePath then
537
+ t_insert (self .datSources , { ggpkPath = child .attrib .ggpkPath , datFilePath = child .attrib .datFilePath , label = child .attrib .label , spec = child .attrib .spec })
538
+ end
534
539
end
535
540
end
536
541
end
537
542
end
538
- if type (self .datSources ) ~= " table" then
539
- self .datSources = { }
540
- end
541
- if not next (self .datSources ) then
543
+ if self .datSources and not next (self .datSources ) and self .datSource then
542
544
t_insert (self .datSources , self .datSource )
543
545
end
544
- self .datSource = self .datSource or self .datSources [1 ]
546
+ if not self .datSoruce and self .datSources then
547
+ self .datSource = self .datSources [1 ]
548
+ end
545
549
end
546
550
547
551
function main :SaveSettings ()
0 commit comments