public void ResetBuffers()
        {
            IEnumerable <QualityCategory> categories = Enum.GetValues(typeof(QualityCategory)).Cast <QualityCategory>().ToList();

            this.MinQualityRange = new FloatOptionsArgs <QualityCategory>()
            {
                items             = categories,
                getDisplayName    = (category) => category.GetLabel(),
                includeNullOption = false,
                onSelect          = (category) => this.QualityRange.min = category
            };
            this.MaxQualityRange = new FloatOptionsArgs <QualityCategory>()
            {
                items             = categories,
                getDisplayName    = (category) => category.GetLabel(),
                includeNullOption = false,
                onSelect          = (category) => this.QualityRange.max = category
            };
        }
        public SimpleCurveWidget(string name, SimpleCurve curve) : base(true, true)
        {
            this.name  = name;
            this.curve = curve;

            this.pointsArgs = new FloatOptionsArgs <MinMaxFloatStats>()
            {
                items          = this.points,
                getDisplayName = v => v.Min + ", " + v.Max,
                onSelect       = v =>
                {
                    this.points.RemoveAll(p => object.Equals(p, v));
                    this.pointsInputs.RemoveAll(p => object.Equals(p.Parent, v));
                    this.RecreateCurve();
                },
            };

            this.ResetBuffers();
        }
        public static void DrawFloatingOptions <T>(FloatOptionsArgs <T> args)
        {
            if (args.skipListCustomOnly && args.onCustomOption != null)
            {
                Log.Warning("Invoke onCustomOptions");
                args.onCustomOption?.Invoke();
                return;
            }

            if (args == null || args.items == null || args.items.Count() == 0)
            {
                return;
            }

            List <FloatMenuOption> options = new List <FloatMenuOption>();

            if (args.includeNullOption)
            {
                options.Add(new FloatMenuOption(
                                "None", delegate { args.onSelect(default); },
 public static void DrawInput <T>(float x, ref float y, float width, string label, float labelWidth, string buttonText, FloatOptionsArgs <T> floatingOptionArgs, bool isBolded = false)
 {
     DrawLabel(x, y, labelWidth, label, isBolded);
     x = x + labelWidth + 10;
     if (Widgets.ButtonText(new Rect(x, y, width - x - 10, 30), buttonText))
     {
         DrawFloatingOptions(floatingOptionArgs);
     }
     y += 40;
 }