private void EmitOnValueChanged(object obj)
 {
     OnValueChanged?.Invoke(obj);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a slider with a descriptive text label above and an automatically updating value label immediately to the right.
        /// </summary>
        /// <param name="parent">Panel to add the control to</param>
        /// <param name="text">Descriptive label text</param>
        /// <param name="min">Slider minimum value</param>
        /// <param name="max">Slider maximum value</param>
        /// <param name="step">Slider minimum step</param>
        /// <param name="defaultValue">Slider initial value</param>
        /// <param name="eventCallback">Slider event handler</param>
        /// <param name="width">Slider width (excluding value label to right) (default 600)</param>
        /// <returns>New UI slider with attached labels</returns>
        public static UISlider AddSliderWithValue(UIComponent parent, string text, float min, float max, float step, float defaultValue, OnValueChanged eventCallback, float width = 600f)
        {
            // Add slider component.
            UIPanel sliderPanel = parent.AttachUIComponent(UITemplateManager.GetAsGameObject("OptionsSliderTemplate")) as UIPanel;

            sliderPanel.Find <UILabel>("Label").text = text;

            // Label.
            UILabel sliderLabel = sliderPanel.Find <UILabel>("Label");

            sliderLabel.autoHeight       = true;
            sliderLabel.width            = width;
            sliderLabel.anchor           = UIAnchorStyle.Left | UIAnchorStyle.Top;
            sliderLabel.relativePosition = Vector3.zero;
            sliderLabel.relativePosition = Vector3.zero;
            sliderLabel.text             = text;

            // Slider configuration.
            UISlider newSlider = sliderPanel.Find <UISlider>("Slider");

            newSlider.minValue = min;
            newSlider.maxValue = max;
            newSlider.stepSize = step;
            newSlider.value    = defaultValue;

            // Move default slider position to match resized label.
            sliderPanel.autoLayout     = false;
            newSlider.anchor           = UIAnchorStyle.Left | UIAnchorStyle.Top;
            newSlider.relativePosition = PositionUnder(sliderLabel);
            newSlider.width            = width;

            // Increase height of panel to accomodate it all plus some extra space for margin.
            sliderPanel.autoSize = false;
            sliderPanel.width    = width + 50f;
            sliderPanel.height   = newSlider.relativePosition.y + newSlider.height + 20f;

            // Value label.
            UILabel valueLabel = sliderPanel.AddUIComponent <UILabel>();

            valueLabel.name             = "ValueLabel";
            valueLabel.text             = newSlider.value.ToString();
            valueLabel.relativePosition = PositionRightOf(newSlider, 8f, 1f);

            // Event handler to update value label.
            newSlider.eventValueChanged += (component, value) =>
            {
                valueLabel.text = value.ToString();
                eventCallback(value);
            };

            return(newSlider);
        }
Exemplo n.º 3
0
 public void Add(float addend)
 {
     Value = Mathf.Min(Value + addend, MaxValue);
     OnValueChanged?.Invoke();
 }
Exemplo n.º 4
0
 private void Internal_onValueChanged(ref Vector4 p0)
 {
     OnValueChanged?.Invoke(p0);
 }
Exemplo n.º 5
0
 protected void ValueChanged() => OnValueChanged?.Invoke(Prefab);
Exemplo n.º 6
0
        public object AddSlider(string text, float min, float max, float step, float defaultValue, OnValueChanged eventCallback)
        {
            bool   flag = eventCallback != null && !string.IsNullOrEmpty(text);
            object result;

            if (flag)
            {
                UIPanel uIPanel = this.m_Root.AttachUIComponent(UITemplateManager.GetAsGameObject(UIHelperExtension.kSliderTemplate)) as UIPanel;
                uIPanel.Find <UILabel>("Label").text = text;
                UISlider uISlider = uIPanel.Find <UISlider>("Slider");
                uISlider.minValue           = min;
                uISlider.maxValue           = max;
                uISlider.stepSize           = step;
                uISlider.value              = defaultValue;
                uISlider.eventValueChanged += delegate(UIComponent c, float val)
                {
                    eventCallback(val);
                };
                result = uISlider;
            }
            else
            {
                DebugOutputPanel.AddMessage(PluginManager.MessageType.Warning, "Cannot create slider with no name or no event");
                result = null;
            }
            return(result);
        }
Exemplo n.º 7
0
 public void SetUpate()
 {
     OnValueChanged.Invoke(int.Parse(mToggleGroup.ActiveToggles().First().gameObject.name));
 }
 public static UISlider AddSlider(UIComponent parent, string text, float min, float max, float step, float defaultValue, OnValueChanged eventCallback, out UILabel label)
 {
     if (eventCallback != null)
     {
         var uIPanel = parent.AttachUIComponent(UITemplateManager.GetAsGameObject(kSliderTemplate)) as UIPanel;
         if (string.IsNullOrEmpty(text))
         {
             label = null;
             GameObject.Destroy(uIPanel.Find <UILabel>("Label"));
         }
         else
         {
             label      = uIPanel.Find <UILabel>("Label");
             label.text = text;
         }
         UISlider uISlider = uIPanel.Find <UISlider>("Slider");
         uISlider.minValue           = min;
         uISlider.maxValue           = max;
         uISlider.stepSize           = step;
         uISlider.value              = defaultValue;
         uISlider.eventValueChanged += delegate(UIComponent c, float val)
         {
             eventCallback(val);
         };
         return(uISlider);
     }
     DebugOutputPanel.AddMessage(PluginManager.MessageType.Warning, "Cannot create slider with no name or no event");
     label = null;
     return(null);
 }
Exemplo n.º 9
0
 void DataEntered(string inputFieldData)
 {
     OnValueChanged?.Invoke(inputDataType, inputFieldData);
 }
Exemplo n.º 10
0
 public void InvokeOnValueChanged()
 {
     OnValueChanged?.Invoke();
 }
        public static void AddSlider(string label, out UISlider slider, UIHelperExtension parentHelper, OnValueChanged onChange, float min, float max, float step, Func <float, string> valueLabelFunc)
        {
            UILabel labelValue = null;

            slider = (UISlider)parentHelper.AddSlider(label, min, max, step, min, (x) =>
            {
                onChange(x);
                labelValue.text = valueLabelFunc(x);
            });
            slider.GetComponentInParent <UIPanel>().autoLayoutDirection       = LayoutDirection.Horizontal;
            slider.GetComponentInParent <UIPanel>().autoFitChildrenVertically = true;
            KlyteMonoUtils.LimitWidthAndBox(slider.parent.GetComponentInChildren <UILabel>(), (parentHelper.Self.width / 2) - 10, true);
            labelValue = slider.GetComponentInParent <UIPanel>().AddUIComponent <UILabel>();
            labelValue.textAlignment = UIHorizontalAlignment.Center;
            labelValue.padding       = new RectOffset(4, 4, 0, 0);
            KlyteMonoUtils.LimitWidthAndBox(labelValue, (parentHelper.Self.width / 2) - slider.width, true);
            labelValue.text = valueLabelFunc(slider.value);
        }
Exemplo n.º 12
0
 private void OnInternalDeviceUpdated(object sender)
 {
     OnValueChanged?.Invoke(this);
 }
 /// <summary>
 /// Adds an extended slider to a UI helper.
 /// </summary>
 /// <param name="helper">The UI helper.</param>
 /// <param name="text">The text label.</param>
 /// <param name="min">The minimum value.</param>
 /// <param name="max">The maximum value.</param>
 /// <param name="step">The step size.</param>
 /// <param name="defaultValue">The default value.</param>
 /// <param name="allowFloats">If set to <c>true</c> allow non-integers.</param>
 /// <param name="eventCallback">The value changed event callback.</param>
 /// <returns>The extended slider.</returns>
 public static ExtendedSlider AddExtendedSlider(this UIHelperBase helper, string text, float min, float max, float step, float defaultValue, bool allowFloats, OnValueChanged eventCallback)
 {
     return new ExtendedSlider(helper, text, min, max, step, defaultValue, allowFloats, null, eventCallback);
 }
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        /// <param name="helper">The UI helper.</param>
        /// <param name="text">The text label.</param>
        /// <param name="min">The minimum value.</param>
        /// <param name="max">The maximum value.</param>
        /// <param name="step">The step size.</param>
        /// <param name="defaultValue">The default value.</param>
        /// <param name="allowFloats">If set to <c>true</c> allow non-integers.</param>
        /// <param name="textFormat">The text format.</param>
        /// <param name="eventCallback">The value changed event callback.</param>
        private void Initialize(UIHelperBase helper, string text, float min, float max, float step, float defaultValue, bool allowFloats, string textFormat, OnValueChanged eventCallback)
        {
            this.SetTextFormat(allowFloats, textFormat);

            this.slider = helper.AddSlider(
                text,
                min,
                max,
                step,
                defaultValue,
                value =>
                {
                    if (!this.isUpdating)
                    {
                        try
                        {
                            this.isUpdating = true;

                            this.textField.text = this.FormatText(value);

                            eventCallback(value);
                        }
                        finally
                        {
                            this.isUpdating = false;
                        }
                    }
                }) as UISlider;

            this.textField = helper.AddTextfield(
                text,
                this.FormatText(defaultValue),
                value =>
                {
                    if (submitOnFocusLost && !this.isUpdating)
                    {
                        try
                        {
                            this.isUpdating = true;

                            float number = this.ParseText(value, false);
                            if (number != this.slider.value)
                            {
                                this.slider.value = number;
                            }
                        }
                        finally
                        {
                            this.isUpdating = false;
                        }
                    }
                },
                value =>
                {
                    if (!this.isUpdating)
                    {
                        try
                        {
                            this.isUpdating = true;

                            float number = this.ParseText(value, false);
                            if (number != slider.value)
                            {
                                this.slider.value = number;
                                this.textField.text = this.FormatText(number);

                                eventCallback(number);
                            }
                        }
                        finally
                        {
                            this.isUpdating = false;
                        }
                    }
                }) as UITextField;

            this.textField.numericalOnly = true;
            this.textField.allowFloats = this.AllowFloats;
            this.textField.submitOnFocusLost = this.submitOnFocusLost;
            this.textField.eventVisibilityChanged += (component, value) =>
            {
                this.HideTextFieldLabel();
            };

            this.HideTextFieldLabel();
        }
Exemplo n.º 15
0
        private void Input_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (initing)
            {
                initing = false;
                return;
            }

            if (ctk != null)
            {
                ctk.Cancel();
            }

            ctk = new CancellationTokenSource();

            if (property != null)
            {
                switch (NumberType)
                {
                case NumberInputType.Float:
                    Task.Delay(250, ctk.Token)
                    .ContinueWith(t =>
                    {
                        if (t.IsCanceled)
                        {
                            return;
                        }

                        App.Current.Dispatcher.Invoke(() =>
                        {
                            ctk      = null;
                            float fv = 0;
                            float.TryParse(Input.Text, out fv);

                            property.SetValue(propertyOwner, fv);
                            OnValueChanged?.Invoke(this, fv);
                        });
                    });
                    break;

                case NumberInputType.Int:
                    Task.Delay(250, ctk.Token)
                    .ContinueWith(t =>
                    {
                        if (t.IsCanceled)
                        {
                            return;
                        }

                        App.Current.Dispatcher.Invoke(() =>
                        {
                            ctk    = null;
                            int iv = 0;
                            int.TryParse(Input.Text, out iv);

                            property.SetValue(propertyOwner, iv);
                            OnValueChanged?.Invoke(this, iv);
                        });
                    });
                    break;
                }
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExtendedSlider" /> class.
 /// </summary>
 /// <param name="helper">The UI helper.</param>
 /// <param name="text">The text label.</param>
 /// <param name="min">The minimum value.</param>
 /// <param name="max">The maximum value.</param>
 /// <param name="step">The step size.</param>
 /// <param name="defaultValue">The default value.</param>
 /// <param name="allowFloats">If set to <c>true</c> allow non-integers.</param>
 /// <param name="eventCallback">The value changed event callback.</param>
 public ExtendedSlider(UIHelperBase helper, string text, float min, float max, float step, float defaultValue, bool allowFloats, OnValueChanged eventCallback)
 {
     this.Initialize(helper, text, min, max, step, defaultValue, allowFloats, null, eventCallback);
 }
Exemplo n.º 17
0
 private void UpdateValueListeners()
 {
     OnValueChanged?.Invoke(this, slider.Value);
 }
Exemplo n.º 18
0
        /// <summary>
        /// Sets the option's value.
        /// </summary>
        /// <remarks>
        /// Does nothing when the value type differs or when the value matches the current value.
        /// </remarks>
        /// <param name="value">The new value</param>
        /// <param name="raiseEvents">Whether or not to raise events</param>
        protected virtual void SetValue(object value, bool raiseEvents)
        {
            if (value?.GetType() != Value?.GetType() || Value == value)
            {
                return;                                                         // Refuse value updates that don't match the option type.
            }
            if (raiseEvents && OnValueChanged != null && AmongUsClient.Instance?.AmHost == true && PlayerControl.LocalPlayer)
            {
                object lastValue = value;

                OptionOnValueChangedEventArgs args = OnValueChangedEventArgs(value, Value);
                foreach (EventHandler <OptionOnValueChangedEventArgs> handler in OnValueChanged.GetInvocationList())
                {
                    handler(this, args);

                    if (args.Value.GetType() != value.GetType())
                    {
                        args.Value  = lastValue;
                        args.Cancel = false;

                        EssentialsPlugin.Logger.LogWarning($"A handler for option \"{Name}\" attempted to change value type, ignored.");
                    }

                    lastValue = args.Value;

                    if (args.Cancel)
                    {
                        return;              // Handler cancelled value change.
                    }
                }

                value = args.Value;
            }

            if (OldValue != Value)
            {
                OldValue = Value;
            }

            Value = value;

            //if (SendRpc && GameSetting != null && AmongUsClient.Instance?.AmHost == true && PlayerControl.LocalPlayer) Rpc.Send(new (string, CustomOptionType, object)[] { this });
            if (SendRpc && GameSetting != null && AmongUsClient.Instance?.AmHost == true && PlayerControl.LocalPlayer)
            {
                Rpc.Instance.Send(this);
            }

            UpdateGameOption();

            if (raiseEvents)
            {
                ValueChanged?.SafeInvoke(this, ValueChangedEventArgs(value, Value), nameof(ValueChanged));
            }

            if (GameSetting == null)
            {
                return;
            }

            try
            {
                GameOptionsMenu optionsMenu = Object.FindObjectOfType <GameOptionsMenu>();

                if (optionsMenu == null)
                {
                    return;
                }

                for (int i = 0; i < optionsMenu.Children.Length; i++)
                {
                    OptionBehaviour optionBehaviour = optionsMenu.Children[i];
                    optionBehaviour.enabled = false;
                    optionBehaviour.enabled = true;
                }
            }
            catch
            {
            }
        }
Exemplo n.º 19
0
        public static object AddTimeSpanSecondsSlider(this UIHelperBase helperBase, string text, TimeSpan minimum, TimeSpan maximum, TimeSpan defaultValue, OnValueChanged valueChanged, string format = "s")
        {
            var sliderObject = helperBase.AddSlider(text, (float)minimum.TotalSeconds, (float)maximum.TotalSeconds, 1, (float)defaultValue.TotalSeconds, valueChanged) as UIComponent;

            if (sliderObject is UISlider slider)
            {
                slider.eventValueChanged += (component, eventParam) => UpdateTooltipForTimeSpan(component, (sliderValue) => TimeSpan.FromSeconds(sliderValue), format);
                slider.eventTooltipHover += (component, value) => UpdateTooltipForTimeSpan(component, (sliderValue) => TimeSpan.FromSeconds(sliderValue), format);
            }

            return(sliderObject);
        }
Exemplo n.º 20
0
 public void Click()
 {
     _value++;
     OnValueChanged?.Invoke(_value);
 }
Exemplo n.º 21
0
        public static object AddTimeSpanHoursSlider(this UIHelperBase helperBase, string text, TimeSpan minimum, TimeSpan maximum, TimeSpan defaultValue, OnValueChanged valueChanged, string format = "HH:mm")
        {
            var resolution   = (1f / 60f) * 5f;
            var sliderObject = helperBase.AddSlider(text, (float)minimum.TotalHours, (float)maximum.TotalHours, resolution, (float)defaultValue.TotalHours, valueChanged) as UIComponent;

            if (sliderObject is UISlider slider)
            {
                slider.eventValueChanged += (component, eventParam) => UpdateTooltipForTimeSpan(component, (sliderValue) => TimeSpan.FromHours(sliderValue), format);
                slider.eventTooltipHover += (component, value) => UpdateTooltipForTimeSpan(component, (sliderValue) => TimeSpan.FromHours(sliderValue), format);
            }

            return(sliderObject);
        }
Exemplo n.º 22
0
 protected virtual void ValueChanged(string text)
 {
     OnValueChanged?.Invoke(text);
 }
Exemplo n.º 23
0
        private void KeyFieldChanged(ChangeEvent <string> _event)
        {
            m_WorldStateDescription.Key = _event.newValue;

            OnValueChanged?.Invoke(this);
        }
 public void UpdateToServer()
 {
     refreshAction?.Invoke();
     OnValueChanged?.Invoke(value);
 }
Exemplo n.º 25
0
        private void ValueFieldChanged()
        {
            m_WorldStateDescription.Value = ConfiguratorTypeConverter.GetValueFromField(m_ValueField);

            OnValueChanged?.Invoke(this);
        }
Exemplo n.º 26
0
 protected void ValueChanged(object?newValue)
 {
     OnValueChanged?.Invoke(newValue);
 }
Exemplo n.º 27
0
        /// <summary>
        /// Sets the option's value, it's not recommended to call this directly, call derivatives instead.
        /// </summary>
        /// <remarks>
        /// Does nothing when the value type differs or when the value matches the current value.
        /// </remarks>
        /// <param name="value">The new value</param>
        /// <param name="raiseEvents">Whether or not to raise events</param>
        private protected void SetValue(object value, bool raiseEvents)
        {
            if (value?.GetType() != Value?.GetType() || Value == value)
            {
                return;                                                         // Refuse value updates that don't match the option type
            }
            if (raiseEvents && OnValueChanged != null && AmongUsClient.Instance && PlayerControl.LocalPlayer && AmongUsClient.Instance.AmHost)
            {
                object lastValue = value;

                OptionOnValueChangedEventArgs args = OnValueChangedEventArgs(value, Value);
                foreach (EventHandler <OptionOnValueChangedEventArgs> handler in OnValueChanged.GetInvocationList())
                {
                    handler(this, args);

                    if (args.Value.GetType() != value.GetType())
                    {
                        args.Value  = lastValue;
                        args.Cancel = false;

                        EssentialsPlugin.Logger.LogWarning($"A handler for option \"{Name}\" attempted to change value type, ignored.");
                    }

                    lastValue = args.Value;

                    if (args.Cancel)
                    {
                        return;              // Handler cancelled value change.
                    }
                }

                value = args.Value;
            }

            if (OldValue != Value)
            {
                OldValue = Value;
            }

            Value = value;

            if (GameSetting != null && AmongUsClient.Instance && PlayerControl.LocalPlayer && AmongUsClient.Instance.AmHost)
            {
                Rpc.Instance.Send(new Rpc.Data(this));
            }

            try
            {
                if (GameSetting is ToggleOption toggle)
                {
                    bool newValue = (bool)Value;

                    toggle.oldValue = newValue;
                    if (toggle.CheckMark != null)
                    {
                        toggle.CheckMark.enabled = newValue;
                    }
                }
                else if (GameSetting is NumberOption number)
                {
                    float newValue = (float)Value;

                    number.Value          = number.oldValue = newValue;
                    number.ValueText.Text = ToString();
                }
                else if (GameSetting is StringOption str)
                {
                    int newValue = (int)Value;

                    str.Value          = str.oldValue = newValue;
                    str.ValueText.Text = ToString();
                }
                else if (GameSetting is KeyValueOption kv)
                {
                    int newValue = (int)Value;

                    kv.Selected       = kv.oldValue = newValue;
                    kv.ValueText.Text = ToString();
                }
            }
            catch (Exception e)
            {
                EssentialsPlugin.Logger.LogWarning($"Failed to update game setting value for option \"{Name}\": {e}");
            }

            if (raiseEvents)
            {
                ValueChanged?.Invoke(this, ValueChangedEventArgs(value, Value));
            }

            /*{
             *  OptionValueChangedEventArgs args = ValueChangedEventArgs(value, Value);
             *  foreach (EventHandler<OptionValueChangedEventArgs> handler in ValueChanged.GetInvocationList()) handler(this, args);
             * }*/

            try
            {
                if (GameSetting != null)
                {
                    Object.FindObjectOfType <GameOptionsMenu>()?.Method_16();                     // RefreshChildren();
                }
            }
            catch
            {
            }
        }
        private void addSlider(UIScrollablePanel panel, Vector3 position, float width, OnValueChanged eventCallback, IDifficultyParameter param)
        {
            UISlider slider = panel.AddUIComponent <UISlider>();

            slider.size             = new Vector2(width, 8);
            slider.relativePosition = position;
            slider.minValue         = 0;
            slider.maxValue         = param.MaxIndex;
            slider.stepSize         = 1;
            slider.value            = param.SelectedIndex;
            slider.backgroundSprite = "TextFieldPanel"; // TextFieldPanel, GenericProgressBar

            UISprite thumb = slider.AddUIComponent <UISprite>();

            thumb.size         = new Vector2(16, 16);
            thumb.spriteName   = "InfoIconBaseFocused"; // SliderBudget, InfoIconBaseFocused
            slider.thumbObject = thumb;

            UILabel label = panel.AddUIComponent <UILabel>();

            label.textScale        = textScaleSmall;
            label.text             = param.GetValueStr((int)slider.value);
            label.relativePosition = new Vector3(position.x + width + 10, position.y);

            slider.eventValueChanged += delegate(UIComponent c, float val)
            {
                label.text = param.GetValueStr((int)val);
                eventCallback(val);
            };

            sliders.Add(slider, param);
        }
Exemplo n.º 29
0
 protected void ValueChanged()
 {
     OnValueChanged.Call();
 }
Exemplo n.º 30
0
 public void Increment()
 {
     ++value;
     OnValueChanged?.Invoke(value);
 }
Exemplo n.º 31
0
 public void RunEvent()
 {
     OnValueChanged?.Invoke(value, value);
     OnValueChangedSimple?.Invoke();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ExtendedSlider"/> class.
 /// </summary>
 /// <param name="helper">The UI helper.</param>
 /// <param name="text">The text label.</param>
 /// <param name="min">The minimum value.</param>
 /// <param name="max">The maximum value.</param>
 /// <param name="step">The step size.</param>
 /// <param name="defaultValue">The default value.</param>
 /// <param name="eventCallback">The value changed event callback.</param>
 public ExtendedSlider(UIHelperBase helper, string text, float min, float max, float step, float defaultValue, OnValueChanged eventCallback)
 {
     bool allowFloats = min != Math.Truncate(min) || max != Math.Truncate(max) || step != Math.Truncate(step) || defaultValue != Math.Truncate(defaultValue);
     this.Initialize(helper, text, min, max, step, defaultValue, allowFloats, null, eventCallback);
 }
Exemplo n.º 33
0
 public void ClearInput()
 {
     _text = "";
     OnValueChanged.InvokeSafe(_text);
 }
        private void addSlider(UIScrollablePanel panel, Vector3 position, float width, OnValueChanged eventCallback, IDifficultyParameter param)
        {
            UISlider slider = panel.AddUIComponent<UISlider>();
            slider.size = new Vector2(width, 8);
            slider.relativePosition = position;
            slider.minValue = 0;
            slider.maxValue = param.MaxIndex;
            slider.stepSize = 1;
            slider.value = param.SelectedIndex;
            slider.backgroundSprite = "TextFieldPanel"; // TextFieldPanel, GenericProgressBar

            UISprite thumb = slider.AddUIComponent<UISprite>();
            thumb.size = new Vector2(16, 16);
            thumb.spriteName = "InfoIconBaseFocused"; // SliderBudget, InfoIconBaseFocused
            slider.thumbObject = thumb;

            UILabel label = panel.AddUIComponent<UILabel>();
            label.textScale = textScaleSmall;
            label.text = param.GetValueStr((int)slider.value);
            label.relativePosition = new Vector3(position.x + width + 10, position.y);

            slider.eventValueChanged += delegate (UIComponent c, float val)
            {
                label.text = param.GetValueStr((int)val);
                eventCallback(val);
            };

            sliders.Add(slider, param);
        }
 public static UISlider AddSlider(UIComponent parent, string text, float min, float max, float step, float defaultValue, OnValueChanged eventCallback) => AddSlider(parent, text, min, max, step, defaultValue, eventCallback, out _);