Cleanup code #2213

This commit is contained in:
Wojtek Figat
2024-03-19 20:13:41 +01:00
parent bfbabbc395
commit 9e54827cb3
20 changed files with 150 additions and 84 deletions

View File

@@ -14,6 +14,8 @@ namespace FlaxEditor.GUI.Input
[HideInEditor]
public class DoubleValueBox : ValueBox<double>
{
private Utils.ValueCategory _category = Utils.ValueCategory.None;
/// <inheritdoc />
public override double Value
{
@@ -131,9 +133,19 @@ namespace FlaxEditor.GUI.Input
}
/// <summary>
/// Get or set the category of the value. This can either be none for just a number, a distance or an angle.
/// Gets or sets the category of the value. This can be none for just a number or a more specific one like a distance.
/// </summary>
public Utils.ValueCategory Category = Utils.ValueCategory.None;
public Utils.ValueCategory Category
{
get => _category;
set
{
if (_category == value)
return;
_category = value;
UpdateText();
}
}
/// <inheritdoc />
protected sealed override void UpdateText()

View File

@@ -14,6 +14,8 @@ namespace FlaxEditor.GUI.Input
[HideInEditor]
public class FloatValueBox : ValueBox<float>
{
private Utils.ValueCategory _category = Utils.ValueCategory.None;
/// <inheritdoc />
public override float Value
{
@@ -137,14 +139,19 @@ namespace FlaxEditor.GUI.Input
Value = Value;
}
private Utils.ValueCategory _category = Utils.ValueCategory.None;
/// <summary>
/// Get or set the category of the value. This can be none for just a number or a more specific one like a distance.
/// Gets or sets the category of the value. This can be none for just a number or a more specific one like a distance.
/// </summary>
public Utils.ValueCategory Category {
public Utils.ValueCategory Category
{
get => _category;
set { _category = value; UpdateText(); }
set
{
if (_category == value)
return;
_category = value;
UpdateText();
}
}
/// <inheritdoc />