Skip to content

Commit

Permalink
more work
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurelius7309 committed Jul 21, 2024
1 parent ed48aeb commit 893a965
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
12 changes: 11 additions & 1 deletion core/StackTracePlus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,12 @@ Stack Traceback
elseif source == "SMODS" then
local modID = table.remove(props, 1)
local fileName = table.concat(props, " ")
dumper:add_f("(%d) main chunk of file '%s' at line %d (from mod with id %s)\r\n", level_to_show,
if modID == '_' then
dumper:add_f("(%d) main chunk of Steamodded file '%s' at line %d\r\n", level_to_show, fileName:sub(2, -2), info.currentline)
else
dumper:add_f("(%d) main chunk of file '%s' at line %d (from mod with id %s)\r\n", level_to_show,
fileName:sub(2, -2), info.currentline, modID)
end
else
dumper:add_f("(%d) main chunk of %s at line %d\r\n", level_to_show, info.source, info.currentline)
end
Expand Down Expand Up @@ -421,9 +425,15 @@ Stack Traceback
elseif source == "SMODS" then
local modID = table.remove(props, 1)
local fileName = table.concat(props, " ")
if modID == '_' then
dumper:add_f("(%d) Lua %s '%s' at Steamodded file '%s:%d' %s\r\n", level_to_show,
function_type, function_name, fileName:sub(2, -2), info.currentline,
was_guessed and " (best guess)" or "")
else
dumper:add_f("(%d) Lua %s '%s' at file '%s:%d' (from mod with id %s)%s\r\n", level_to_show,
function_type, function_name, fileName:sub(2, -2), info.currentline, modID,
was_guessed and " (best guess)" or "")
end
else
dumper:add_f("(%d) Lua %s '%s' at line %d of chunk '%s'\r\n", level_to_show, function_type,
function_name, info.currentline, source)
Expand Down
6 changes: 3 additions & 3 deletions core/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ local function find_self(directory, target_filename, target_line, depth)
local file_path = directory .. "/" .. filename
local file_type = NFS.getInfo(file_path).type
if file_type == 'directory' or file_type == 'symlink' then
local f = find_self(file_path, target_filename, line, depth)
local f = find_self(file_path, target_filename, target_line, depth+1)
if f then return f end
elseif filename == target_filename then
local first_line = NFS.read(file_path):match('^(.-)\n')
Expand All @@ -60,7 +60,7 @@ end

SMODS.path = find_self(SMODS.MODS_DIR, 'core.lua', '--- STEAMODDED CORE')

for _, v in ipairs {
for _, path in ipairs {
"core/ui.lua",
"core/utils.lua",
"core/overrides.lua",
Expand All @@ -69,5 +69,5 @@ for _, v in ipairs {
"core/compat_0_9_8.lua",
"loader/loader.lua",
} do

assert(load(NFS.read(SMODS.path..path), ('=[SMODS _ "%s"]'):format(path)))()
end
6 changes: 0 additions & 6 deletions lovely/core.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,4 @@ target = "main.lua"
position = "append"
sources = [
"core/core.lua",
"core/utils.lua",
"core/overrides.lua",
"core/game_object.lua",
"debug/debug.lua",
"core/compat_0_9_8.lua",
"loader/loader.lua",
]

0 comments on commit 893a965

Please sign in to comment.