From 6ba9ed618b6adb9f6d05d1abfaebb0c3b18e844d Mon Sep 17 00:00:00 2001 From: Wires77 Date: Fri, 18 Apr 2025 23:05:26 -0500 Subject: [PATCH] Restore ability to save any previously loaded specs before switching --- src/Export/Main.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Export/Main.lua b/src/Export/Main.lua index 4179ec69..b21d03c6 100644 --- a/src/Export/Main.lua +++ b/src/Export/Main.lua @@ -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