You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9439b70
Browse filesBrowse the repository at this point in the historyBrowse files
local ca=...local da=ca("core.logger")local _b=ca("flimg")
1515
1515
local ab={basePath=nil,spriteCache={},imageCache={},uiCache={},emitterCache={}}ab.flimg=_b
1516
-
local function bb(_c)
1517
-
if not _c or _c:sub(1,1)=="/"then return _c end
1518
-
if ab.basePath then return fs.combine(ab.basePath,_c)end
1519
-
if shell then local ac=shell.getRunningProgram()if ac then return
1520
-
fs.combine(fs.getDir(ac),_c)end end;return _c end;function ab.setBasePath(_c)ab.basePath=_c end;local function cb(_c)local ac={}for i=1,#_c do
1516
+
local function bb(_c)if not _c then return _c,"no path"end;if _c:sub(1,1)=="/"then return _c,
1517
+
"absolute path"end;if ab.basePath then
1518
+
return fs.combine(ab.basePath,_c),
1519
+
"basePath '"..tostring(ab.basePath).."'"end
1520
+
if
1521
+
shell and shell.getRunningProgram then local ac=shell.getRunningProgram()
1522
+
if ac and ac~=""then return
1523
+
fs.combine(fs.getDir(ac),_c),"directory of "..ac end end;return _c,"unchanged (no basePath, and no shell to resolve against)"end;function ab.setBasePath(_c)ab.basePath=_c end;local function cb(_c)local ac={}for i=1,#_c do
1521
1524
ac[i]=_c:sub(i,i)end;return ac end
1522
1525
local function db(_c)
1523
-
local ac=bb(_c)
1524
-
if not fs.exists(ac)then return false,"File not found: "..ac end;local bc=fs.open(ac,"r")if not bc then
1525
-
return false,"Could not open file: "..ac end;local cc=bc.readAll()bc.close()
1526
-
local dc,_d=pcall(textutils.unserialize,cc)
1527
-
if not dc or _d==nil then return false,"Failed to unserialize: "..ac end;return true,_d,ac end
1526
+
local ac,bc=bb(_c)
1527
+
if not fs.exists(ac)then return false,
1528
+
("File not found: %s (resolved from '%s' via %s)"):format(ac,tostring(_c),bc)end;local cc=fs.open(ac,"r")if not cc then
1529
+
return false,"Could not open file: "..ac end;local dc=cc.readAll()cc.close()
1530
+
local _d,ad=pcall(textutils.unserialize,dc)
1531
+
if not _d or ad==nil then return false,"Failed to unserialize: "..ac end;return true,ad,ac end
1528
1532
function ab._processSprite(_c)if not _c then return end
1529
1533
for i=1,(_c.frameCount or#_c)do local ac=_c[i]if ac then
1530
1534
for layer=1,3 do if ac[layer]then
@@ -1563,14 +1567,15 @@ da.error("Loader: Validation error in "..
0 commit comments