public EnumInputWidget(P parent, string label, float labelWidth, GetValue getValue, SetValue setValue, ShouldDrawInput shouldDrawInput = null) : base(parent, label, getValue, setValue, shouldDrawInput) { this.labelWidth = labelWidth; args = new FloatOptionsArgs <E>() { getDisplayName = v => v.ToString(), items = Enum.GetValues(typeof(E)).Cast <E>(), onSelect = v => base.setValue(base.Parent, v) }; }
public DefInputWidget(P parent, string label, float labelWidth, GetValue getValue, SetValue setValue, bool includeNullOption, Predicate <D> exclude = null, ShouldDrawInput shouldDrawInput = null) : base(parent, label, getValue, setValue, shouldDrawInput) { this.labelWidth = labelWidth; args = new FloatOptionsArgs <D>() { getDisplayName = def => Util.GetLabel(def), items = Util.SortedDefList <D>(exclude), onSelect = def => base.setValue(base.Parent, def), includeNullOption = includeNullOption }; }