Restore ability to save any previously loaded specs before switching

This commit is contained in:
Wires77
2025-04-18 23:05:26 -05:00
parent c86bb986c2
commit 6ba9ed618b

View File

@@ -336,11 +336,13 @@ function main:LoadDatSource(value)
self.leagueLabel = nil
local reExportState = self.reExportGGPKData
self.reExportGGPKData = true
if self.datSource then
local out = io.open(self.datSource.spec..(self.datSource.spec:match("%.lua$") and "" or ".lua"), "w")
out:write('return ')
writeLuaTable(out, self.datSpecs, 1)
out:close()
end
self.datSource = value
local out = io.open(self.datSource.spec..(self.datSource.spec:match("%.lua$") and "" or ".lua"), "w")
out:write('return ')
writeLuaTable(out, self.datSpecs, 1)
out:close()
self.datSpecs = LoadModule(self.datSource.spec)
self:InitGGPK()
if USE_DAT64 then