From b29b4387892eb24a4eb3d1e9f202d63322be4b0a Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 1 Nov 2024 17:20:59 +0300 Subject: [PATCH] fix --- res/layouts/console.xml.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/res/layouts/console.xml.lua b/res/layouts/console.xml.lua index 79a82e3f..791e1fb2 100644 --- a/res/layouts/console.xml.lua +++ b/res/layouts/console.xml.lua @@ -1,10 +1,12 @@ history = session.get_entry("commands_history") history_pointer = #history +local warning_id = 0 events.on("core:warning", function (wtype, text) document.problemsLog:add(gui.template("problem", { - type="warning", text=wtype..": "..text, id=tostring(math.random()) + type="warning", text=wtype..": "..text, id=tostring(warning_id) })) + warning_id = warning_id + 1 end) function setup_variables()