Class DropdownSetting
- Namespace
- Exiled.API.Features.Core.UserSettings
- Assembly
- Exiled.API.dll
Represents a dropdown setting.
public class DropdownSetting : SettingBase, IWrapper<ServerSpecificSettingBase>, IWrapper<SSDropdownSetting>- Inheritance
- 
      
      
      
      DropdownSetting
- Inherited Members
- Extension Methods
Constructors
DropdownSetting(int, string, IEnumerable<string>, int, DropdownEntryType, string, HeaderSetting, Action<Player, SettingBase>)
Initializes a new instance of the DropdownSetting class.
[Obsolete("Will be removed in Exiled 10 in favour of ctor with more params")]
public DropdownSetting(int id, string label, IEnumerable<string> options, int defaultOptionIndex, SSDropdownSetting.DropdownEntryType dropdownEntryType, string hintDescription, HeaderSetting header, Action<Player, SettingBase> onChanged)Parameters
- idint
- labelstring
- optionsIEnumerable<string>
- defaultOptionIndexint
- dropdownEntryTypeSSDropdownSetting.DropdownEntryType
- hintDescriptionstring
- headerHeaderSetting
- onChangedAction<Player, SettingBase>
DropdownSetting(int, string, IEnumerable<string>, int, DropdownEntryType, string, byte, bool, HeaderSetting, Action<Player, SettingBase>)
Initializes a new instance of the DropdownSetting class.
public DropdownSetting(int id, string label, IEnumerable<string> options, int defaultOptionIndex = 0, SSDropdownSetting.DropdownEntryType dropdownEntryType = DropdownEntryType.Regular, string hintDescription = null, byte collectionId = 255, bool isServerOnly = false, HeaderSetting header = null, Action<Player, SettingBase> onChanged = null)Parameters
- idint
- labelstring
- optionsIEnumerable<string>
- defaultOptionIndexint
- dropdownEntryTypeSSDropdownSetting.DropdownEntryType
- hintDescriptionstring
- collectionIdbyte
- isServerOnlybool
- headerHeaderSetting
- onChangedAction<Player, SettingBase>
Properties
Base
Gets the base UserSettings.ServerSpecific.SSDropdownSetting that this class is wrapping.
public SSDropdownSetting Base { get; }Property Value
- SSDropdownSetting
DefaultOption
Gets or sets a default option.
public string DefaultOption { get; set; }Property Value
DefaultOptionIndex
Gets or sets an index of default option.
public int DefaultOptionIndex { get; set; }Property Value
DropdownType
Gets or sets a type of dropdown.
public SSDropdownSetting.DropdownEntryType DropdownType { get; set; }Property Value
- SSDropdownSetting.DropdownEntryType
Options
Gets or sets a collection of all options in dropdown.
public IEnumerable<string> Options { get; set; }Property Value
SelectedIndex
Gets or sets an index of selected option.
public int SelectedIndex { get; set; }Property Value
SelectedOption
Gets or sets a selected option.
public string SelectedOption { get; set; }Property Value
Methods
ToString()
Gets a string representation of this DropdownSetting.
public override string ToString()Returns
- string
- A string in human-readable format. 
UpdateSetting(string[], bool, Predicate<Player>)
Sends updated values to clients.
public void UpdateSetting(string[] options, bool overrideValue = true, Predicate<Player> filter = null)Parameters
- optionsstring[]
- overrideValuebool
- If false, sends fake values. 
- filterPredicate<Player>
- Who to send the update to. 
UpdateValue(int, bool, Predicate<Player>)
If setting is server only, sends updated values to clients.
public void UpdateValue(int selectedIndex, bool overrideValue = true, Predicate<Player> filter = null)