Table of Contents

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
Implements
IWrapper<ServerSpecificSettingBase>
IWrapper<SSTwoButtonsSetting>
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

id int
label string
firstOption string
secondOption string
defaultIsSecond bool
hintDescription string
header HeaderSetting
onChanged Action<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

id int
label string
firstOption string
secondOption string
defaultIsSecond bool
hintDescription string
collectionId byte
isServerOnly bool
header HeaderSetting
onChanged Action<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

string

IsFirst

Gets or sets a value indicating whether the first option is chosen.

public bool IsFirst { get; set; }

Property Value

bool

IsSecond

Gets or sets a value indicating whether the second option is chosen.

public bool IsSecond { get; set; }

Property Value

bool

IsSecondDefault

Gets or sets a value indicating whether the second option is default.

public bool IsSecondDefault { get; set; }

Property Value

bool

SecondOption

Gets or sets a label for the second option.

public string SecondOption { get; set; }

Property Value

string

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

firstOption string
secondOption string
overrideValue bool

If false, sends fake values.

filter Predicate<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)

Parameters

isSecond bool
overrideValue bool

If false, sends fake values.

filter Predicate<Player>

Who to send the update to.