Skip to content

Commit

Permalink
Remove accidentally leftover null exception tracking logs
Browse files Browse the repository at this point in the history
  • Loading branch information
MrPurple6411 committed Dec 21, 2022
1 parent 16ae6f4 commit 68deae3
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions SMLHelper/Options/SliderModOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,33 +146,24 @@ public class ModSliderOption : ModOption

internal override void AddToPanel(uGUI_TabbedControlsPanel panel, int tabIndex)
{
Console.WriteLine("0");
UnityAction<float> callback = new UnityAction<float>((value) => parentOptions.OnSliderChange(Id, sliderValue?.ConvertToDisplayValue(value) ?? value));
Console.WriteLine("1");

panel.AddSliderOption(tabIndex, Label, Value, MinValue, MaxValue, DefaultValue, Step, callback, SliderLabelMode.Default, "0.0");
Console.WriteLine("2");

// AddSliderOption for some reason doesn't return created GameObject, so we need this little hack
Transform options = panel.tabs[tabIndex].container.transform;
Console.WriteLine("3");
OptionGameObject = options.GetChild(options.childCount - 1).gameObject; // last added game object
Console.WriteLine("4");

// if we using custom value format, we need to replace vanilla uGUI_SliderWithLabel with our component
if (ValueFormat != null)
OptionGameObject.transform.Find("Slider").gameObject.AddComponent<SliderValue>().ValueFormat = ValueFormat;
Console.WriteLine("5");

// fixing tooltip for slider
OptionGameObject.transform.Find("Slider/Caption").GetComponent<TextMeshProUGUI>().raycastTarget = true;
Console.WriteLine("6");

base.AddToPanel(panel, tabIndex);
Console.WriteLine("7");

sliderValue = OptionGameObject.GetComponentInChildren<SliderValue>(); // we can also add custom SliderValue in OnGameObjectCreated event
Console.WriteLine("8");
}

/// <summary>
Expand Down

0 comments on commit 68deae3

Please sign in to comment.