Class TwoButtonsSetting
- Namespace
- Exiled.API.Features.Core.UserSettings
- Assembly
- Exiled.API.dll
Represents a two-button setting.
public class TwoButtonsSetting : SettingBase, IWrapper<ServerSpecificSettingBase>, IWrapper<SSTwoButtonsSetting>- Inheritance
- 
      
      
      
      TwoButtonsSetting
- Inherited Members
- Extension Methods
Constructors
TwoButtonsSetting(int, string, string, string, bool, string, HeaderSetting, Action<Player, SettingBase>)
Initializes a new instance of the TwoButtonsSetting class.
[Obsolete("Will be removed in Exiled 10 in favour of ctor with more params.")]
public TwoButtonsSetting(int id, string label, string firstOption, string secondOption, bool defaultIsSecond, string hintDescription, HeaderSetting header, Action<Player, SettingBase> onChanged)Parameters
- idint
- labelstring
- firstOptionstring
- secondOptionstring
- defaultIsSecondbool
- hintDescriptionstring
- headerHeaderSetting
- onChangedAction<Player, SettingBase>
TwoButtonsSetting(int, string, string, string, bool, string, byte, bool, HeaderSetting, Action<Player, SettingBase>)
Initializes a new instance of the TwoButtonsSetting class.
public TwoButtonsSetting(int id, string label, string firstOption, string secondOption, bool defaultIsSecond = false, string hintDescription = "", byte collectionId = 255, bool isServerOnly = false, HeaderSetting header = null, Action<Player, SettingBase> onChanged = null)Parameters
- idint
- labelstring
- firstOptionstring
- secondOptionstring
- defaultIsSecondbool
- hintDescriptionstring
- collectionIdbyte
- isServerOnlybool
- headerHeaderSetting
- onChangedAction<Player, SettingBase>
Properties
Base
Gets the base UserSettings.ServerSpecific.SSTwoButtonsSetting that this class is wrapping.
public SSTwoButtonsSetting Base { get; }Property Value
- SSTwoButtonsSetting
FirstOption
Gets or sets a label for the first option.
public string FirstOption { get; set; }Property Value
IsFirst
Gets or sets a value indicating whether the first option is chosen.
public bool IsFirst { get; set; }Property Value
IsSecond
Gets or sets a value indicating whether the second option is chosen.
public bool IsSecond { get; set; }Property Value
IsSecondDefault
Gets or sets a value indicating whether the second option is default.
public bool IsSecondDefault { get; set; }Property Value
SecondOption
Gets or sets a label for the second option.
public string SecondOption { get; set; }Property Value
Methods
ToString()
Returns a representation of this ButtonSetting.
public override string ToString()Returns
- string
- A string in human-readable format. 
UpdateSetting(string, string, bool, Predicate<Player>)
Sends updated values to clients.
public void UpdateSetting(string firstOption, string secondOption, bool overrideValue = true, Predicate<Player> filter = null)Parameters
- firstOptionstring
- secondOptionstring
- overrideValuebool
- If false, sends fake values. 
- filterPredicate<Player>
- Who to send the update to. 
UpdateValue(bool, bool, Predicate<Player>)
If setting is server only, sends updated values to clients.
public void UpdateValue(bool isSecond, bool overrideValue = true, Predicate<Player> filter = null)