diff --git a/res/layouts/console.xml b/res/layouts/console.xml index 84183f61..3e1b802d 100644 --- a/res/layouts/console.xml +++ b/res/layouts/console.xml @@ -11,6 +11,13 @@ gravity="bottom-left" > + + + - - - diff --git a/res/layouts/console.xml.lua b/res/layouts/console.xml.lua index 597dfcb7..79a82e3f 100644 --- a/res/layouts/console.xml.lua +++ b/res/layouts/console.xml.lua @@ -1,6 +1,12 @@ history = session.get_entry("commands_history") history_pointer = #history +events.on("core:warning", function (wtype, text) + document.problemsLog:add(gui.template("problem", { + type="warning", text=wtype..": "..text, id=tostring(math.random()) + })) +end) + function setup_variables() local pid = hud.get_player() local x,y,z = player.get_pos(pid) diff --git a/res/layouts/templates/problem.xml b/res/layouts/templates/problem.xml new file mode 100644 index 00000000..0dfb2794 --- /dev/null +++ b/res/layouts/templates/problem.xml @@ -0,0 +1,6 @@ + + + + + diff --git a/res/scripts/stdmin.lua b/res/scripts/stdmin.lua index ec3b1fec..530ec091 100644 --- a/res/scripts/stdmin.lua +++ b/res/scripts/stdmin.lua @@ -238,6 +238,7 @@ function on_deprecated_call(name, alternatives) return end __warnings_hidden[name] = true + events.emit("core:warning", "deprecated call", name) if alternatives then debug.warning("deprecated function called ("..name.."), use ".. alternatives.." instead\n"..debug.traceback())