Add proper deserialization of old values pre-renaming

#767
This commit is contained in:
Wojtek Figat
2022-10-12 20:38:59 +02:00
parent e970b6fd04
commit 607afeee50
2 changed files with 30 additions and 1 deletions

View File

@@ -119,6 +119,21 @@ public:
API_FIELD(Attributes="EditorOrder(10000), EditorDisplay(\"Post Process Settings\", EditorDisplayAttribute.InlineStyle)")
PostProcessSettings PostProcessSettings;
private:
/// <summary>
/// Renamed UeeHDRProbes into UseHDRProbes
/// [Deprecated on 12.10.2022, expires on 12.10.2024]
/// </summary>
API_PROPERTY(Attributes="Serialize, Obsolete, NoUndo") bool GetUeeHDRProbes() const
{
return UseHDRProbes;
}
API_PROPERTY(Attributes="Serialize, Obsolete, NoUndo") void SetUeeHDRProbes(bool value)
{
UseHDRProbes = value;
}
public:
/// <summary>
/// Gets the instance of the settings asset (default value if missing). Object returned by this method is always loaded with valid data to use.

View File

@@ -1,5 +1,8 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
namespace FlaxEditor.Content.Settings
{
/// <summary>
@@ -11,13 +14,24 @@ namespace FlaxEditor.Content.Settings
partial class GraphicsSettings
{
/// <summary>
/// Renamed UeeHDRProbes into UseHDRProbes
/// [Deprecated on 12.10.2022, expires on 12.10.2024]
/// </summary>
[Serialize, Obsolete, NoUndo]
private bool UeeHDRProbes
{
get => UseHDRProbes;
set => UseHDRProbes = value;
}
/// <summary>
/// Initializes a new instance of the <see cref="GraphicsSettings"/>.
/// </summary>
public GraphicsSettings()
{
// Initialize PostFx settings with default options (C# structs don't support it)
PostProcessSettings = FlaxEngine.PostProcessSettings.Default;
PostProcessSettings = PostProcessSettings.Default;
}
}
}