From b96f195afbd8524a2274b3f10229ac83f0a454a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sun, 23 Jun 2024 18:58:40 +0200 Subject: [PATCH] Clear log on play option --- GlitchyEditor/src/EditorLayer.bf | 3 +++ GlitchyEditor/src/EditorSettings.bf | 3 +++ 2 files changed, 6 insertions(+) diff --git a/GlitchyEditor/src/EditorLayer.bf b/GlitchyEditor/src/EditorLayer.bf index f3a0ee2..01d6518 100644 --- a/GlitchyEditor/src/EditorLayer.bf +++ b/GlitchyEditor/src/EditorLayer.bf @@ -818,6 +818,9 @@ namespace GlitchyEditor private void OnScenePlay() { Log.EngineLogger.AssertDebug(_scriptSerializer.SerializedObjectCount == 0, "Somehow some entities are serialized."); + + if (Application.Instance.Settings.EditorSettings.ClearLogOnPlay) + Editor.Instance.LogWindow.ClearLog(); _scriptSerializer.SerializeScriptInstances(); diff --git a/GlitchyEditor/src/EditorSettings.bf b/GlitchyEditor/src/EditorSettings.bf index 77741be..e76ec0f 100644 --- a/GlitchyEditor/src/EditorSettings.bf +++ b/GlitchyEditor/src/EditorSettings.bf @@ -194,6 +194,9 @@ class EditorSettings [Setting("Editor", "Switch to Editor on pause", "If checked the editor will automatically switch to the \"Editor\" window when the game is being paused."), BonInclude] public bool SwitchToEditorOnPause = false; + [Setting("Editor", "Clear log on play", "If checked the message log will be cleared when the play-mode is entered."), BonInclude] + public bool ClearLogOnPlay = true; + [BonInclude] private List _recentProjects ~ DeleteContainerAndItems!(_);