Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion EXILED/Exiled.API/Features/Core/UserSettings/ButtonSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,28 @@ public class ButtonSetting : SettingBase, IWrapper<SSButton>
/// <param name="hintDescription"><inheritdoc cref="SettingBase.HintDescription"/></param>
/// <param name="header"><inheritdoc cref="SettingBase.Header"/></param>
/// <param name="onChanged"><inheritdoc cref="SettingBase.OnChanged"/></param>
public ButtonSetting(int id, string label, string buttonText, float holdTime = 0.0f, string hintDescription = null, HeaderSetting header = null, Action<Player, SettingBase> onChanged = null)
[Obsolete("Use the constructor without the Header instead.")]
public ButtonSetting(int id, string label, string buttonText, float holdTime, string hintDescription, HeaderSetting header, Action<Player, SettingBase> onChanged)
: base(new SSButton(id, label, buttonText, holdTime, hintDescription), header, onChanged)
{
Base = (SSButton)base.Base;
}

/// <summary>
/// Initializes a new instance of the <see cref="ButtonSetting"/> class.
/// </summary>
/// <param name="id"><inheritdoc cref="SettingBase.Id"/></param>
/// <param name="label"><inheritdoc cref="SettingBase.Label"/></param>
/// <param name="buttonText"><inheritdoc cref="Text"/></param>
/// <param name="holdTime"><inheritdoc cref="HoldTime"/></param>
/// <param name="hintDescription"><inheritdoc cref="SettingBase.HintDescription"/></param>
/// <param name="onChanged"><inheritdoc cref="SettingBase.OnChanged"/></param>
public ButtonSetting(int id, string label, string buttonText, float holdTime = 0.0f, string hintDescription = null, Action<Player, SettingBase> onChanged = null)
: base(new SSButton(id, label, buttonText, holdTime, hintDescription), onChanged)
{
Base = (SSButton)base.Base;
}

/// <summary>
/// Initializes a new instance of the <see cref="ButtonSetting"/> class.
/// </summary>
Expand Down
28 changes: 26 additions & 2 deletions EXILED/Exiled.API/Features/Core/UserSettings/DropdownSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,40 @@ public class DropdownSetting : SettingBase, IWrapper<SSDropdownSetting>
/// <param name="hintDescription"><inheritdoc cref="SettingBase.HintDescription"/></param>
/// <param name="header"><inheritdoc cref="SettingBase.Header"/></param>
/// <param name="onChanged"><inheritdoc cref="SettingBase.OnChanged"/></param>
[Obsolete("Use the constructor without the Header instead.")]
public DropdownSetting(
int id,
string label,
IEnumerable<string> options,
int defaultOptionIndex,
SSDropdownSetting.DropdownEntryType dropdownEntryType,
string hintDescription,
HeaderSetting header,
Action<Player, SettingBase> onChanged)
: base(new SSDropdownSetting(id, label, options.ToArray(), defaultOptionIndex, dropdownEntryType, hintDescription), header, onChanged)
{
Base = (SSDropdownSetting)base.Base;
}

/// <summary>
/// Initializes a new instance of the <see cref="DropdownSetting"/> class.
/// </summary>
/// <param name="id"><inheritdoc cref="SettingBase.Id"/></param>
/// <param name="label"><inheritdoc cref="SettingBase.Label"/></param>
/// <param name="options"><inheritdoc cref="Options"/></param>
/// <param name="defaultOptionIndex"><inheritdoc cref="DefaultOptionIndex"/></param>
/// <param name="dropdownEntryType"><inheritdoc cref="DropdownType"/></param>
/// <param name="hintDescription"><inheritdoc cref="SettingBase.HintDescription"/></param>
/// <param name="onChanged"><inheritdoc cref="SettingBase.OnChanged"/></param>
public DropdownSetting(
int id,
string label,
IEnumerable<string> options,
int defaultOptionIndex = 0,
SSDropdownSetting.DropdownEntryType dropdownEntryType = SSDropdownSetting.DropdownEntryType.Regular,
string hintDescription = null,
HeaderSetting header = null,
Action<Player, SettingBase> onChanged = null)
: base(new SSDropdownSetting(id, label, options.ToArray(), defaultOptionIndex, dropdownEntryType, hintDescription), header, onChanged)
: base(new SSDropdownSetting(id, label, options.ToArray(), defaultOptionIndex, dropdownEntryType, hintDescription), onChanged)
{
Base = (SSDropdownSetting)base.Base;
}
Expand Down
18 changes: 17 additions & 1 deletion EXILED/Exiled.API/Features/Core/UserSettings/KeybindSetting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,28 @@ public class KeybindSetting : SettingBase, IWrapper<SSKeybindSetting>
/// <param name="hintDescription"><inheritdoc cref="SettingBase.HintDescription"/></param>
/// <param name="header"><inheritdoc cref="SettingBase.Header"/></param>
/// <param name="onChanged"><inheritdoc cref="SettingBase.OnChanged"/></param>
public KeybindSetting(int id, string label, KeyCode suggested, bool preventInteractionOnGUI = false, string hintDescription = "", HeaderSetting header = null, Action<Player, SettingBase> onChanged = null)
[Obsolete("Use the constructor without the Header instead.")]
public KeybindSetting(int id, string label, KeyCode suggested, bool preventInteractionOnGUI, string hintDescription, HeaderSetting header, Action<Player, SettingBase> onChanged)
: base(new SSKeybindSetting(id, label, suggested, preventInteractionOnGUI, hintDescription), header, onChanged)
{
Base = (SSKeybindSetting)base.Base;
}

/// <summary>
/// Initializes a new instance of the <see cref="KeybindSetting"/> class.
/// </summary>
/// <param name="id"><inheritdoc cref="SettingBase.Id"/></param>
/// <param name="label"><inheritdoc cref="SettingBase.Label"/></param>
/// <param name="suggested"><inheritdoc cref="KeyCode"/></param>
/// <param name="preventInteractionOnGUI"><inheritdoc cref="PreventInteractionOnGUI"/></param>
/// <param name="hintDescription"><inheritdoc cref="SettingBase.HintDescription"/></param>
/// <param name="onChanged"><inheritdoc cref="SettingBase.OnChanged"/></param>
public KeybindSetting(int id, string label, KeyCode suggested, bool preventInteractionOnGUI = false, string hintDescription = "", Action<Player, SettingBase> onChanged = null)
: base(new SSKeybindSetting(id, label, suggested, preventInteractionOnGUI, hintDescription), onChanged)
{
Base = (SSKeybindSetting)base.Base;
}

/// <summary>
/// Initializes a new instance of the <see cref="KeybindSetting"/> class.
/// </summary>
Expand Down
Loading