From 0ad7cc6b3cd80ee93634a2f7059b6ddcc29298e5 Mon Sep 17 00:00:00 2001 From: sasha80 Date: Sat, 20 Sep 2025 13:23:05 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5.=20=D0=A1=D0=BD=D0=B8=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B8=D0=B7=D0=B2=D0=BE?= =?UTF-8?q?=D0=B4=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=B8=20=D0=BF=D1=80=D0=B8=20=D0=B1=D0=BE=D0=BB=D1=8C=D1=88?= =?UTF-8?q?=D0=BE=D0=BC=20=D0=BA=D0=BE=D0=BB=D0=B8=D1=87=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D0=B2=D0=B5=20=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B5=D0=B9=20?= =?UTF-8?q?=D0=B2=20=D0=B6=D1=83=D1=80=D0=BD=D0=B0=D0=BB=D0=B5.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addons/godot-logger/scripts/logger_output.gd | 7 ++++++- scenes/журнал/журнал.tscn | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/addons/godot-logger/scripts/logger_output.gd b/addons/godot-logger/scripts/logger_output.gd index 10d187a1..ee7e62dc 100644 --- a/addons/godot-logger/scripts/logger_output.gd +++ b/addons/godot-logger/scripts/logger_output.gd @@ -17,7 +17,7 @@ signal handled() Logger.ERROR: Color.RED, Logger.FATAL: Color.RED, } - +@export var max_lines_count: int = 512 var _logger : Logger @@ -75,3 +75,8 @@ func handle_message(message: Dictionary) -> void: append_text(format(message) + '\n') pop() handled.emit() + var pc: = get_paragraph_count() + if pc < max_lines_count: + return + for i in pc - max_lines_count: + remove_paragraph(i) diff --git a/scenes/журнал/журнал.tscn b/scenes/журнал/журнал.tscn index 61ae1eba..75df2f63 100644 --- a/scenes/журнал/журнал.tscn +++ b/scenes/журнал/журнал.tscn @@ -36,6 +36,7 @@ colors = { 8: Color(0.91, 0, 0, 1), 16: Color(0.868077, 0.247988, 0.62812, 1) } +max_lines_count = 256 [node name="btn_save" type="Button" parent="."] layout_mode = 0