Exemplo n.º 1
0
 /// <summary>
 /// Constructs a new <see cref="GadgetConfigMultiStringComponent"/> that serves as one or more textboxes where you can enter one or more string values. The given <paramref name="valueSetter"/> will be called whenever the values are changed. Be aware that the given height value is only the height of one entry in the list. The actual height can vary depending on the number of set values.
 /// </summary>
 public GadgetConfigMultiStringComponent(BasicGadgetConfigMenu configMenu, string name, string[] value, Action <string[]> valueSetter, bool readOnly = false, string[] defaultValue = null, string[] vanillaValue = null, float height = 0.1f) : base(configMenu, name, height * value.Length)
 {
     Value        = value;
     DefaultValue = defaultValue;
     VanillaValue = vanillaValue;
     ReadOnly     = readOnly;
     ValueSetter  = valueSetter;
 }
 /// <summary>
 /// Constructs a new <see cref="GadgetConfigBoolComponent"/> that serves as a pair of toggles for representing a bool-based config value. The given <paramref name="valueSetter"/> will be called whenever the value is changed.
 /// </summary>
 public GadgetConfigBoolComponent(BasicGadgetConfigMenu configMenu, string name, bool value, Action <bool> valueSetter, bool readOnly = false, bool?defaultValue = null, bool?vanillaValue = null, float height = 0.1f) : base(configMenu, name, height)
 {
     Value        = value;
     DefaultValue = defaultValue;
     VanillaValue = vanillaValue;
     ReadOnly     = readOnly;
     ValueSetter  = valueSetter;
 }
 /// <summary>
 /// Constructs a new <see cref="GadgetConfigDropdownComponent"/> that serves as a dropdown for selecting from an array of choices. The given <paramref name="valueSetter"/> will be called whenever the dropdown's selection is changed.
 /// </summary>
 public GadgetConfigDropdownComponent(BasicGadgetConfigMenu configMenu, string name, string value, string[] values, Action <string> valueSetter, bool readOnly = false, string defaultValue = null, string vanillaValue = null, float height = 0.1f) : base(configMenu, name, height)
 {
     Value        = value;
     Values       = values;
     DefaultValue = defaultValue;
     VanillaValue = vanillaValue;
     ReadOnly     = readOnly;
     ValueSetter  = valueSetter;
 }
 /// <summary>
 /// Constructs a new <see cref="GadgetConfigKeybindComponent"/> that serves as a button where you can enter a keybind. The given <paramref name="valueSetter"/> will be called whenever the keybind is changed.
 /// </summary>
 public GadgetConfigKeybindComponent(BasicGadgetConfigMenu configMenu, string name, string value, Action <string> valueSetter, bool allowMultiBind = true, bool readOnly = false, string defaultValue = null, string vanillaValue = null, float height = 0.1f) : base(configMenu, name, height)
 {
     Value          = value;
     AllowMultiBind = allowMultiBind;
     DefaultValue   = defaultValue;
     VanillaValue   = vanillaValue;
     ReadOnly       = readOnly;
     ValueSetter    = valueSetter;
 }
 /// <summary>
 /// Constructs a new <see cref="GadgetConfigIntComponent"/> that serves as a input field for representing an int-based config value. The given <paramref name="valueSetter"/> will be called whenever the input field's contents are changed.
 /// </summary>
 public GadgetConfigIntComponent(BasicGadgetConfigMenu configMenu, string name, int value, Action <int> valueSetter, int minValue = 0, int maxValue = 0, bool readOnly = false, int?defaultValue = null, int?vanillaValue = null, float height = 0.1f) : base(configMenu, name, height)
 {
     Value        = value;
     MinValue     = minValue;
     MaxValue     = maxValue;
     DefaultValue = defaultValue;
     VanillaValue = vanillaValue;
     ReadOnly     = readOnly;
     ValueSetter  = valueSetter;
 }
 /// <summary>
 /// Constructs a new <see cref="GadgetConfigDoubleComponent"/> that serves as a input field for representing an double-based config value. The given <paramref name="valueSetter"/> will be called whenever the input field's contents are changed.
 /// </summary>
 public GadgetConfigDoubleComponent(BasicGadgetConfigMenu configMenu, string name, double value, Action <double> valueSetter, double minValue = 0, double maxValue = 0, int decimals = -1, bool readOnly = false, double?defaultValue = null, double?vanillaValue = null, float height = 0.1f) : base(configMenu, name, height)
 {
     Value        = value;
     MinValue     = minValue;
     MaxValue     = maxValue;
     Decimals     = decimals;
     DefaultValue = defaultValue;
     VanillaValue = vanillaValue;
     ReadOnly     = readOnly;
     ValueSetter  = valueSetter;
 }
 /// <summary>
 /// Constructs a new <see cref="GadgetConfigSeparatorComponent"/> that creates a separator in the config menu.
 /// </summary>
 public GadgetConfigSeparatorComponent(BasicGadgetConfigMenu configMenu, string name, float height = 0.05f) : base(configMenu, name, height)
 {
 }
 /// <summary>
 /// Constructs a new <see cref="GadgetConfigButtonComponent"/> that serves as a button that can execute arbitrary code when pressed. The given <paramref name="trigger"/> will be called whenever the button is pressed.
 /// </summary>
 public GadgetConfigButtonComponent(BasicGadgetConfigMenu configMenu, string name, string label, Action trigger, float height = 0.1f) : base(configMenu, name, height)
 {
     Label   = label;
     Trigger = trigger;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Constructs a new <see cref="GadgetConfigLabelComponent"/> that simply displays a piece of text.
 /// </summary>
 public GadgetConfigLabelComponent(BasicGadgetConfigMenu configMenu, string name, string text, float height = 0.05f, bool allowHeightResize = false) : base(configMenu, name, height)
 {
     Text = text;
     AllowHeightResize = allowHeightResize;
     InitialHeight     = height;
 }
 /// <summary>
 /// Constructs a new component with the given name and height.
 /// </summary>
 protected GadgetConfigComponent(BasicGadgetConfigMenu configMenu, string name, float height)
 {
     ConfigMenu = configMenu;
     Name       = name;
     Height     = height;
 }