From 56285e544e4996265b254e7c4c9effc448bb324b Mon Sep 17 00:00:00 2001 From: Ruan Lucas <79365912+RuanLucasGD@users.noreply.github.com> Date: Mon, 24 Jul 2023 08:54:53 -0400 Subject: [PATCH] disable set all linear / smooth when select many splines --- .../Editor/CustomEditors/Dedicated/SplineEditor.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/Editor/CustomEditors/Dedicated/SplineEditor.cs b/Source/Editor/CustomEditors/Dedicated/SplineEditor.cs index 4e0234974..8d2644378 100644 --- a/Source/Editor/CustomEditors/Dedicated/SplineEditor.cs +++ b/Source/Editor/CustomEditors/Dedicated/SplineEditor.cs @@ -356,8 +356,8 @@ namespace FlaxEditor.CustomEditors.Dedicated _alignedTangentButton.Button.Enabled = CanSetTangentAligned(); _smoothInTangentButton.Button.Enabled = CanSetTangentSmoothIn(); _smoothOutTangentButton.Button.Enabled = CanSetTangentSmoothOut(); - _setLinearAllTangentsButton.Button.Enabled = CanEditTangent(); - _setSmoothAllTangentsButton.Button.Enabled = CanEditTangent(); + _setLinearAllTangentsButton.Button.Enabled = CanSetAllTangentsLinear(); + _setSmoothAllTangentsButton.Button.Enabled = CanSetAllTangentsSmooth(); if (!CanEditTangent()) { @@ -422,6 +422,16 @@ namespace FlaxEditor.CustomEditors.Dedicated return _lastPointSelected.Index < _selectedSpline.SplinePointsCount - 1 && _lastPointSelected.Index != 0; } + private bool CanSetAllTangentsSmooth() + { + return _selectedSpline != null; + } + + private bool CanSetAllTangentsLinear() + { + return _selectedSpline != null; + } + private void SetModeLinear() { if (_currentTangentMode is LinearTangentMode) return;