diff --git a/Source/Editor/Options/InterfaceOptions.cs b/Source/Editor/Options/InterfaceOptions.cs
index 4cd76adc6..a9d5d18ca 100644
--- a/Source/Editor/Options/InterfaceOptions.cs
+++ b/Source/Editor/Options/InterfaceOptions.cs
@@ -379,6 +379,22 @@ namespace FlaxEditor.Options
}
}
+ ///
+ /// Gets or sets the output log text color for warnings
+ ///
+ [DefaultValue(typeof(Color), "1,1,0,1")]
+ [EditorDisplay("Output Log", "Warning Color"), EditorOrder(446), Tooltip("The output log text color for warnings.")]
+ public Color OutputLogWarningTextColor { get; set; } = Color.Yellow;
+
+
+ ///
+ /// Gets or sets the output log text color for errors
+ ///
+ [DefaultValue(typeof(Color), "1,0,0,1")]
+ [EditorDisplay("Output Log", "Error Color"), EditorOrder(445), Tooltip("The output log text color for errors.")]
+ public Color OutputLogErrorTextColor { get; set; } = Color.Red;
+
+
///
/// Gets or sets a value indicating whether auto-focus output log window on code compilation error.
///
diff --git a/Source/Editor/Windows/DebugLogWindow.cs b/Source/Editor/Windows/DebugLogWindow.cs
index 88c19dc32..7d326a0c3 100644
--- a/Source/Editor/Windows/DebugLogWindow.cs
+++ b/Source/Editor/Windows/DebugLogWindow.cs
@@ -131,20 +131,21 @@ namespace FlaxEditor.Windows
else if (index % 2 == 0)
Render2D.FillRectangle(clientRect, style.Background * 0.9f);
+ var color = Group == LogGroup.Error ? _window.ErrorColor : (Group == LogGroup.Warning ? _window.WarningColor : _window.InfoColor);
+
// Icon
- var iconColor = Group == LogGroup.Error ? Color.Red : (Group == LogGroup.Warning ? Color.Yellow : style.Foreground);
- Render2D.DrawSprite(Icon, new Rectangle(5, 0, 32, 32), iconColor);
+ Render2D.DrawSprite(Icon, new Rectangle(5, 0, 32, 32), color);
// Title
var textRect = new Rectangle(38, 2, clientRect.Width - 40, clientRect.Height - 10);
Render2D.PushClip(ref clientRect);
if (LogCount == 1)
{
- Render2D.DrawText(style.FontMedium, Desc.Title, textRect, style.Foreground);
+ Render2D.DrawText(style.FontMedium, Desc.Title, textRect, color);
}
else if (LogCount > 1)
{
- Render2D.DrawText(style.FontMedium, $"{Desc.Title} ({LogCount})", textRect, style.Foreground);
+ Render2D.DrawText(style.FontMedium, $"{Desc.Title} ({LogCount})", textRect, color);
}
Render2D.PopClip();
}
@@ -306,8 +307,12 @@ namespace FlaxEditor.Windows
private LogType _iconType = LogType.Info;
internal SpriteHandle IconInfo;
+ internal Color InfoColor;
internal SpriteHandle IconWarning;
+ internal Color WarningColor;
internal SpriteHandle IconError;
+ internal Color ErrorColor;
+
///
/// Initializes a new instance of the class.
@@ -398,14 +403,28 @@ namespace FlaxEditor.Windows
IconWarning = Editor.Icons.Warning64;
IconError = Editor.Icons.Error64;
+ //Cache entries color
+ var interfaceOptions = Editor.Options.Options.Interface;
+ InfoColor = interfaceOptions.OutputLogTextColor;
+ WarningColor = interfaceOptions.OutputLogWarningTextColor;
+ ErrorColor = interfaceOptions.OutputLogErrorTextColor;
+
// Bind events
Editor.Options.OptionsChanged += OnEditorOptionsChanged;
+ OnEditorOptionsChanged(Editor.Options.Options);
+
Debug.Logger.LogHandler.SendLog += LogHandlerOnSendLog;
Debug.Logger.LogHandler.SendExceptionLog += LogHandlerOnSendExceptionLog;
}
private void OnEditorOptionsChanged(EditorOptions options)
{
+ if (_timestampsFormats == options.Interface.DebugLogTimestampsFormat &&
+ InfoColor == options.Interface.OutputLogTextColor &&
+ WarningColor == options.Interface.OutputLogWarningTextColor &&
+ ErrorColor == options.Interface.OutputLogErrorTextColor)
+ return;
+
_timestampsFormats = options.Interface.DebugLogTimestampsFormat;
_clearOnPlayButton.Checked = options.Interface.DebugLogClearOnPlay;
_collapseLogsButton.Checked = options.Interface.DebugLogCollapse;
@@ -413,6 +432,10 @@ namespace FlaxEditor.Windows
_groupButtons[0].Checked = options.Interface.DebugLogShowErrorMessages;
_groupButtons[1].Checked = options.Interface.DebugLogShowWarningMessages;
_groupButtons[2].Checked = options.Interface.DebugLogShowInfoMessages;
+
+ InfoColor = options.Interface.OutputLogTextColor;
+ WarningColor = options.Interface.OutputLogWarningTextColor;
+ ErrorColor = options.Interface.OutputLogErrorTextColor;
}
///
diff --git a/Source/Editor/Windows/OutputLogWindow.cs b/Source/Editor/Windows/OutputLogWindow.cs
index 1ce17218e..e3168521f 100644
--- a/Source/Editor/Windows/OutputLogWindow.cs
+++ b/Source/Editor/Windows/OutputLogWindow.cs
@@ -286,7 +286,9 @@ namespace FlaxEditor.Windows
_output.DefaultStyle.Font == options.Interface.OutputLogTextFont &&
_output.DefaultStyle.Color == options.Interface.OutputLogTextColor &&
_output.DefaultStyle.ShadowColor == options.Interface.OutputLogTextShadowColor &&
- _output.DefaultStyle.ShadowOffset == options.Interface.OutputLogTextShadowOffset)
+ _output.DefaultStyle.ShadowOffset == options.Interface.OutputLogTextShadowOffset &&
+ _output.WarningStyle.Color == options.Interface.OutputLogWarningTextColor &&
+ _output.ErrorStyle.Color == options.Interface.OutputLogErrorTextColor)
return;
_output.DefaultStyle = new TextBlockStyle
@@ -297,10 +299,11 @@ namespace FlaxEditor.Windows
ShadowOffset = options.Interface.OutputLogTextShadowOffset,
BackgroundSelectedBrush = new SolidColorBrush(Style.Current.BackgroundSelected),
};
+
_output.WarningStyle = _output.DefaultStyle;
- _output.WarningStyle.Color = Color.Yellow;
+ _output.WarningStyle.Color = options.Interface.OutputLogWarningTextColor;
_output.ErrorStyle = _output.DefaultStyle;
- _output.ErrorStyle.Color = Color.Red;
+ _output.ErrorStyle.Color = options.Interface.OutputLogErrorTextColor;
_timestampsFormats = options.Interface.OutputLogTimestampsFormat;
_showLogType = options.Interface.OutputLogShowLogType;