From 3e6350541ba8f93d95e3833e42470f127a5e3cab Mon Sep 17 00:00:00 2001 From: originalnicodr Date: Mon, 26 Feb 2024 21:30:52 -0300 Subject: [PATCH] Inverted favorite buttons on the Animator and fixed the default freecam move speed input to display the correct initial speed. --- src/Cinematic/Cells/AnimatorCell.cs | 10 +++++----- src/UI/Panels/FreeCamPanel.cs | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Cinematic/Cells/AnimatorCell.cs b/src/Cinematic/Cells/AnimatorCell.cs index c89ced1..6eebca2 100644 --- a/src/Cinematic/Cells/AnimatorCell.cs +++ b/src/Cinematic/Cells/AnimatorCell.cs @@ -107,7 +107,7 @@ namespace UnityExplorer.UI.Panels return; animatorDropdown.value = animatorDropdown.value == 0 ? animatorDropdown.options.Count - 1 : animatorDropdown.value - 1; - favAnimation.ButtonText.text = animatorPlayer.IsAnimationFaved(animatorPlayer.overridingAnimation) ? "☆" : "★"; + favAnimation.ButtonText.text = animatorPlayer.IsAnimationFaved(animatorPlayer.overridingAnimation) ? "★" : "☆"; }; GameObject overridingAnimationObj = UIFactory.CreateDropdown(UIRoot, $"Animations_Dropdown", out animatorDropdown, null, 14, (idx) => { @@ -115,7 +115,7 @@ namespace UnityExplorer.UI.Panels return; animatorPlayer.overridingAnimation = idx < animatorDropdown.options.Count ? animatorPlayer.animations.Find(a => a.name == animatorDropdown.options[idx].text) : animatorPlayer.overridingAnimation; - favAnimation.ButtonText.text = animatorPlayer.IsAnimationFaved(animatorPlayer.overridingAnimation) ? "☆" : "★"; + favAnimation.ButtonText.text = animatorPlayer.IsAnimationFaved(animatorPlayer.overridingAnimation) ? "★": "☆"; } ); @@ -128,10 +128,10 @@ namespace UnityExplorer.UI.Panels return; animatorDropdown.value = animatorDropdown.value == animatorDropdown.options.Count - 1 ? 0 : animatorDropdown.value + 1; - favAnimation.ButtonText.text = animatorPlayer.IsAnimationFaved(animatorPlayer.overridingAnimation) ? "☆" : "★"; + favAnimation.ButtonText.text = animatorPlayer.IsAnimationFaved(animatorPlayer.overridingAnimation) ? "★" : "☆"; }; - favAnimation = UIFactory.CreateButton(UIRoot, "FavAnimation", "★", new Color(0.05f, 0.05f, 0.05f)); + favAnimation = UIFactory.CreateButton(UIRoot, "FavAnimation", "☆", new Color(0.05f, 0.05f, 0.05f)); UIFactory.SetLayoutElement(favAnimation.Component.gameObject, minHeight: 25, minWidth: 25); favAnimation.OnClick += () => { if (animatorPlayer.animator.wrappedObject == null || animatorDropdown == null) @@ -145,7 +145,7 @@ namespace UnityExplorer.UI.Panels animatorPlayer.UnfavAnimation(animatorPlayer.overridingAnimation); } - favAnimation.ButtonText.text = !isAnimationFaved ? "☆" : "★"; + favAnimation.ButtonText.text = !isAnimationFaved ? "★" : "☆"; //UpdateDropdownOptions(); }; diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 0a27e23..57b43e3 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -286,7 +286,7 @@ namespace UnityExplorer.UI.Panels AddSpacer(5); GameObject nearCameraClipGroup = AddInputField("NearClipPlane", "Near clip plane:", "0", out nearClipPlaneInput, NearClipInput_OnEndEdit); - moveSpeedInput.Text = nearClipPlaneValue.ToString(); + nearClipPlaneInput.Text = nearClipPlaneValue.ToString(); GameObject nearClipObj = UIFactory.CreateSlider(nearCameraClipGroup, "Camera near plane clip", out nearClipPlaneSlider); UIFactory.SetLayoutElement(nearClipObj, minHeight: 25, minWidth: 250, flexibleWidth: 0); @@ -306,7 +306,7 @@ namespace UnityExplorer.UI.Panels AddSpacer(5); GameObject farCameraClipGroup = AddInputField("FearClipPlane", "Far clip plane:", "0", out farClipPlaneInput, FarClipInput_OnEndEdit); - moveSpeedInput.Text = farClipPlaneValue.ToString(); + farClipPlaneInput.Text = farClipPlaneValue.ToString(); GameObject farClipObj = UIFactory.CreateSlider(farCameraClipGroup, "Camera far plane clip", out farClipPlaneSlider); UIFactory.SetLayoutElement(farClipObj, minHeight: 25, minWidth: 250, flexibleWidth: 0);