move log colors to visual settings

This commit is contained in:
xxSeys1
2025-03-26 23:38:54 +01:00
parent faa3f62813
commit 1e9f9c8e82
4 changed files with 30 additions and 32 deletions

View File

@@ -346,13 +346,6 @@ namespace FlaxEditor.Options
} }
} }
/// <summary>
/// Gets or sets the output log text color.
/// </summary>
[DefaultValue(typeof(Color), "1,1,1,1")]
[EditorDisplay("Output Log", "Text Color"), EditorOrder(430), Tooltip("The output log text color.")]
public Color OutputLogTextColor { get; set; } = Color.White;
/// <summary> /// <summary>
/// Gets or sets the output log text shadow color. /// Gets or sets the output log text shadow color.
/// </summary> /// </summary>
@@ -379,22 +372,6 @@ namespace FlaxEditor.Options
} }
} }
/// <summary>
/// Gets or sets the output log text color for warnings
/// </summary>
[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;
/// <summary>
/// Gets or sets the output log text color for errors
/// </summary>
[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;
/// <summary> /// <summary>
/// Gets or sets a value indicating whether auto-focus output log window on code compilation error. /// Gets or sets a value indicating whether auto-focus output log window on code compilation error.
/// </summary> /// </summary>

View File

@@ -94,5 +94,26 @@ namespace FlaxEditor.Options
[DefaultValue(true)] [DefaultValue(true)]
[EditorDisplay("Preview"), EditorOrder(1000)] [EditorDisplay("Preview"), EditorOrder(1000)]
public bool EnableParticlesPreview { get; set; } = true; public bool EnableParticlesPreview { get; set; } = true;
/// <summary>
/// Gets or sets the output log text color.
/// </summary>
[DefaultValue(typeof(Color), "1,1,1,1")]
[EditorDisplay("Log", "Info Color"), EditorOrder(1500), Tooltip("The color used for info messages in the Debug and Output Log.")]
public Color LogInfoColor { get; set; } = Color.White;
/// <summary>
/// Gets or sets the output log text color for warnings
/// </summary>
[DefaultValue(typeof(Color), "1,1,0,1")]
[EditorDisplay("Log", "Warning Color"), EditorOrder(1501), Tooltip("The color used for warnings in the Debug and Output Log.")]
public Color LogWarningColor { get; set; } = Color.Yellow;
/// <summary>
/// Gets or sets the output log text color for errors
/// </summary>
[DefaultValue(typeof(Color), "1,0,0,1")]
[EditorDisplay("Log", "Error Color"), EditorOrder(1502), Tooltip("The color used for errors in the Debug and Output Log.")]
public Color LogErrorColor { get; set; } = Color.Red;
} }
} }

View File

@@ -419,9 +419,9 @@ namespace FlaxEditor.Windows
_groupButtons[0].Checked = options.Interface.DebugLogShowErrorMessages; _groupButtons[0].Checked = options.Interface.DebugLogShowErrorMessages;
_groupButtons[1].Checked = options.Interface.DebugLogShowWarningMessages; _groupButtons[1].Checked = options.Interface.DebugLogShowWarningMessages;
_groupButtons[2].Checked = options.Interface.DebugLogShowInfoMessages; _groupButtons[2].Checked = options.Interface.DebugLogShowInfoMessages;
_colorInfo = options.Interface.OutputLogTextColor; _colorInfo = options.Visual.LogInfoColor;
_colorWarning = options.Interface.OutputLogWarningTextColor; _colorWarning = options.Visual.LogWarningColor;
_colorError = options.Interface.OutputLogErrorTextColor; _colorError = options.Visual.LogErrorColor;
} }
/// <summary> /// <summary>

View File

@@ -284,26 +284,26 @@ namespace FlaxEditor.Windows
if (options.Interface.OutputLogTimestampsFormat == _timestampsFormats && if (options.Interface.OutputLogTimestampsFormat == _timestampsFormats &&
options.Interface.OutputLogShowLogType == _showLogType && options.Interface.OutputLogShowLogType == _showLogType &&
_output.DefaultStyle.Font == options.Interface.OutputLogTextFont && _output.DefaultStyle.Font == options.Interface.OutputLogTextFont &&
_output.DefaultStyle.Color == options.Interface.OutputLogTextColor && _output.DefaultStyle.Color == options.Visual.LogInfoColor &&
_output.DefaultStyle.ShadowColor == options.Interface.OutputLogTextShadowColor && _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.WarningStyle.Color == options.Visual.LogWarningColor &&
_output.ErrorStyle.Color == options.Interface.OutputLogErrorTextColor) _output.ErrorStyle.Color == options.Visual.LogErrorColor)
return; return;
_output.DefaultStyle = new TextBlockStyle _output.DefaultStyle = new TextBlockStyle
{ {
Font = options.Interface.OutputLogTextFont, Font = options.Interface.OutputLogTextFont,
Color = options.Interface.OutputLogTextColor, Color = options.Visual.LogInfoColor,
ShadowColor = options.Interface.OutputLogTextShadowColor, ShadowColor = options.Interface.OutputLogTextShadowColor,
ShadowOffset = options.Interface.OutputLogTextShadowOffset, ShadowOffset = options.Interface.OutputLogTextShadowOffset,
BackgroundSelectedBrush = new SolidColorBrush(Style.Current.BackgroundSelected), BackgroundSelectedBrush = new SolidColorBrush(Style.Current.BackgroundSelected),
}; };
_output.WarningStyle = _output.DefaultStyle; _output.WarningStyle = _output.DefaultStyle;
_output.WarningStyle.Color = options.Interface.OutputLogWarningTextColor; _output.WarningStyle.Color = options.Visual.LogWarningColor;
_output.ErrorStyle = _output.DefaultStyle; _output.ErrorStyle = _output.DefaultStyle;
_output.ErrorStyle.Color = options.Interface.OutputLogErrorTextColor; _output.ErrorStyle.Color = options.Visual.LogErrorColor;
_timestampsFormats = options.Interface.OutputLogTimestampsFormat; _timestampsFormats = options.Interface.OutputLogTimestampsFormat;
_showLogType = options.Interface.OutputLogShowLogType; _showLogType = options.Interface.OutputLogShowLogType;