Skip to content

Commit 489502a

Browse files
committed
Merge branch 'dev' into spectre-updates
2 parents 28a1e75 + fcc144f commit 489502a

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/Export/Classes/GGPKData.lua

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,22 @@ end
126126

127127
function GGPKClass:AddDat64Files()
128128
local datFiles = self:GetNeededFiles()
129+
local missingCount = 0
129130
table.sort(datFiles, function(a, b) return a:lower() < b:lower() end)
130131
for _, fname in ipairs(datFiles) do
131132
local record = { }
132133
record.name = fname:match("([^/\\]+)$") .. "c64"
133134
local rawFile = io.open(self.oozPath .. fname:gsub("/", "\\") .. "c64", 'rb')
134-
record.data = rawFile:read("*all")
135-
rawFile:close()
136-
t_insert(self.dat, record)
135+
if rawFile then
136+
record.data = rawFile:read("*all")
137+
rawFile:close()
138+
t_insert(self.dat, record)
139+
else
140+
missingCount = missingCount + 1
141+
end
142+
end
143+
if missingCount > 0 then
144+
t_insert(main.scriptOutput, { "^7"..string.format("Skipped %d missing cached GGPK data files. Press Ctrl+F5 to refresh GGPK data.", missingCount), height = 14 })
137145
end
138146
end
139147

src/Export/Main.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ local remainingScripts = { }
6767
function main:Init()
6868
self.inputEvents = { }
6969
self.popups = { }
70+
self.scriptOutput = { }
7071

7172
self.datSpecs = LoadModule("spec")
7273

@@ -98,7 +99,6 @@ function main:Init()
9899
break
99100
end
100101
end
101-
self.scriptOutput = { }
102102

103103
function print(text)
104104
for line in text:gmatch("[^\r\n]+") do

0 commit comments

Comments
 (0)