From 9ed80ec83579a90d5c6369f134d0c8abdd2eecc5 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 24 Nov 2024 12:09:46 +0300 Subject: [PATCH] disable traceback lines with non-existing files --- res/layouts/console.xml.lua | 6 ++---- res/layouts/templates/stack_frame.xml | 2 +- src/assets/assetload_funcs.cpp | 10 +++++++++- src/logic/scripting/lua/libs/libfile.cpp | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/res/layouts/console.xml.lua b/res/layouts/console.xml.lua index 7d4c2771..11d7bd14 100644 --- a/res/layouts/console.xml.lua +++ b/res/layouts/console.xml.lua @@ -84,13 +84,11 @@ events.on("core:open_traceback", function(traceback_b64) framestr = framestr.."("..tostring(frame.name)..")" end local color = "#FFFFFF" - if frame.source:starts_with("core:") then - color = "#C0D0C5" - end tb_list:add(gui.template("stack_frame", { location=framestr, color=color, - callback=callback + callback=callback, + enabled=file.exists(frame.source) })) end tb_list.size = srcsize diff --git a/res/layouts/templates/stack_frame.xml b/res/layouts/templates/stack_frame.xml index c73890bb..16f2571c 100644 --- a/res/layouts/templates/stack_frame.xml +++ b/res/layouts/templates/stack_frame.xml @@ -1,3 +1,3 @@ -