From ad0f5ce802b0009974934f2add0f7e57d17a8f96 Mon Sep 17 00:00:00 2001 From: Misfiy <85962933+obvEve@users.noreply.github.com> Date: Wed, 7 Jan 2026 21:48:44 +0100 Subject: [PATCH 1/6] SSSS additions for sending values --- SecretAPI/Features/UserSettings/CustomSetting.cs | 7 +++++++ SecretAPI/Features/UserSettings/CustomSliderSetting.cs | 6 ++++++ SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/SecretAPI/Features/UserSettings/CustomSetting.cs b/SecretAPI/Features/UserSettings/CustomSetting.cs index 9f65019..793d3f7 100644 --- a/SecretAPI/Features/UserSettings/CustomSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomSetting.cs @@ -252,6 +252,13 @@ public static void SendSettingsToPlayer(Player player, int? version = null) ListPool.Shared.Return(ordered); } + /// + /// Checks whether a is equal to . + /// + /// The to check. + /// Whether is equal to Owner . + internal bool IsKnownOwnerHub(ReferenceHub? hub) => hub && KnownOwner?.ReferenceHub == hub; + /// /// Resyncs the setting to its owner. /// diff --git a/SecretAPI/Features/UserSettings/CustomSliderSetting.cs b/SecretAPI/Features/UserSettings/CustomSliderSetting.cs index 98b7e4e..4b33328 100644 --- a/SecretAPI/Features/UserSettings/CustomSliderSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomSliderSetting.cs @@ -83,5 +83,11 @@ public float MaximumValue /// Gets a value indicating whether to use integer. False will use float. /// public bool UseInteger => Base.Integer; + + /// + /// Sends an update to that this has been updated on Server. Only works if is true. + /// + /// The new value that this is set to. + public void SendServerUpdate(float value) => Base.SendValueUpdate(value, false, IsKnownOwnerHub); } } \ No newline at end of file diff --git a/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs b/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs index 4a48a2a..446a85a 100644 --- a/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs @@ -48,5 +48,11 @@ protected CustomTwoButtonSetting(int? id, string label, string optionA, string o /// Gets a value indicating whether the selected option is currently set to the default. /// public bool IsDefault => Base.DefaultIsB ? IsOptionB : IsOptionA; + + /// + /// Sends an update to that this has been updated on Server. Only works if is true. + /// + /// Whether the setting is set to B value now. + public void SendServerUpdate(bool isB) => Base.SendValueUpdate(isB, false, IsKnownOwnerHub); } } \ No newline at end of file From 8ec1ba7fbd9cb86e67d81f1c04bb206f8b2a7c13 Mon Sep 17 00:00:00 2001 From: Misfiy <85962933+obvEve@users.noreply.github.com> Date: Thu, 8 Jan 2026 12:19:30 +0100 Subject: [PATCH 2/6] SSSS additions!! --- .../Features/UserSettings/CustomSetting.cs | 10 +++ .../UserSettings/CustomSliderSetting.cs | 63 +++++++++++++++++-- .../UserSettings/CustomTwoButtonSetting.cs | 31 +++++++++ 3 files changed, 98 insertions(+), 6 deletions(-) diff --git a/SecretAPI/Features/UserSettings/CustomSetting.cs b/SecretAPI/Features/UserSettings/CustomSetting.cs index 793d3f7..fb23c9f 100644 --- a/SecretAPI/Features/UserSettings/CustomSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomSetting.cs @@ -75,6 +75,11 @@ public bool IsServerOnly set => Base.IsServerOnly = value; } + /// + /// Gets a value indicating whether the setting is the default and not tied to a . + /// + public bool IsDefaultSetting => KnownOwner == null; + /// /// Gets or sets the current label. /// @@ -252,6 +257,11 @@ public static void SendSettingsToPlayer(Player player, int? version = null) ListPool.Shared.Return(ordered); } + /// + /// Sends an update to that or has changed. + /// + public void SendSettingUpdate() => Base.SendUpdate(Label, DescriptionHint, false, IsKnownOwnerHub); + /// /// Checks whether a is equal to . /// diff --git a/SecretAPI/Features/UserSettings/CustomSliderSetting.cs b/SecretAPI/Features/UserSettings/CustomSliderSetting.cs index 4b33328..c995f53 100644 --- a/SecretAPI/Features/UserSettings/CustomSliderSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomSliderSetting.cs @@ -56,13 +56,43 @@ protected CustomSliderSetting( /// public int SelectedValueInt => Base.SyncIntValue; + /// + /// Gets or sets the value to string format. + /// + public string ValueToStringFormat + { + get => Base.ValueToStringFormat; + set + { + Base.ValueToStringFormat = value; + SendSliderUpdate(); + } + } + + /// + /// Gets or sets the final display display format. + /// + public string FinalDisplayFormat + { + get => Base.FinalDisplayFormat; + set + { + Base.FinalDisplayFormat = value; + SendSliderUpdate(); + } + } + /// /// Gets or sets the minimum value of the setting. /// public float MinimumValue { get => Base.MinValue; - set => Base.MinValue = value; + set + { + Base.MinValue = value; + SendSliderUpdate(); + } } /// @@ -71,23 +101,44 @@ public float MinimumValue public float MaximumValue { get => Base.MaxValue; - set => Base.MaxValue = value; + set + { + Base.MaxValue = value; + SendSliderUpdate(); + } } /// - /// Gets the default value of the setting. + /// Gets or sets the default value of the setting. /// - public float DefaultValue => Base.DefaultValue; + public float DefaultValue + { + get => Base.DefaultValue; + set => Base.DefaultValue = value; + } /// - /// Gets a value indicating whether to use integer. False will use float. + /// Gets or sets a value indicating whether to use integer. False will use float. /// - public bool UseInteger => Base.Integer; + public bool UseInteger + { + get => Base.Integer; + set + { + Base.Integer = value; + SendSliderUpdate(); + } + } /// /// Sends an update to that this has been updated on Server. Only works if is true. /// /// The new value that this is set to. public void SendServerUpdate(float value) => Base.SendValueUpdate(value, false, IsKnownOwnerHub); + + /// + /// Sends an update that any of the slider values have been updated. + /// + public void SendSliderUpdate() => Base.SendSliderUpdate(MinimumValue, MaximumValue, UseInteger, ValueToStringFormat, FinalDisplayFormat, false, IsKnownOwnerHub); } } \ No newline at end of file diff --git a/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs b/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs index 446a85a..7b7b2c9 100644 --- a/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs @@ -34,6 +34,32 @@ protected CustomTwoButtonSetting(int? id, string label, string optionA, string o /// public new SSTwoButtonsSetting Base { get; } + /// + /// Gets or sets the current text for the first option. + /// + public string OptionA + { + get => Base.OptionA; + set + { + Base.OptionA = value; + SendOptionsUpdate(); + } + } + + /// + /// Gets or sets the current text for the second option. + /// + public string OptionB + { + get => Base.OptionB; + set + { + Base.OptionB = value; + SendOptionsUpdate(); + } + } + /// /// Gets a value indicating whether the selected option is currently the first. /// @@ -54,5 +80,10 @@ protected CustomTwoButtonSetting(int? id, string label, string optionA, string o /// /// Whether the setting is set to B value now. public void SendServerUpdate(bool isB) => Base.SendValueUpdate(isB, false, IsKnownOwnerHub); + + /// + /// Sends an update to the that or has changed values. + /// + public void SendOptionsUpdate() => Base.SendTwoButtonUpdate(OptionA, OptionB, false, IsKnownOwnerHub); } } \ No newline at end of file From 33d426e7c09abcb3bfa8ecac4b3f41e6f50290f6 Mon Sep 17 00:00:00 2001 From: Misfiy <85962933+obvEve@users.noreply.github.com> Date: Thu, 8 Jan 2026 12:42:36 +0100 Subject: [PATCH 3/6] Do all settings properly --- .../UserSettings/CustomButtonSetting.cs | 29 +++++++++-- .../UserSettings/CustomDropdownSetting.cs | 17 ++++++- .../Features/UserSettings/CustomHeader.cs | 2 + .../UserSettings/CustomPlainTextSetting.cs | 48 ++++++++++++++++--- .../Features/UserSettings/CustomSetting.cs | 22 ++++++--- .../UserSettings/CustomSliderSetting.cs | 4 +- .../UserSettings/CustomTextAreaSetting.cs | 9 ++++ .../UserSettings/CustomTwoButtonSetting.cs | 2 +- 8 files changed, 112 insertions(+), 21 deletions(-) diff --git a/SecretAPI/Features/UserSettings/CustomButtonSetting.cs b/SecretAPI/Features/UserSettings/CustomButtonSetting.cs index 3076fb3..7ef676c 100644 --- a/SecretAPI/Features/UserSettings/CustomButtonSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomButtonSetting.cs @@ -40,13 +40,34 @@ protected CustomButtonSetting(int? id, string label, string buttonText, float? h public TimeSpan LastPress => Base.SyncLastPress.Elapsed; /// - /// Gets the text of the button. + /// Gets or sets the text of the button. /// - public string Text => Base.ButtonText; + public string Text + { + get => Base.ButtonText; + set + { + Base.ButtonText = value; + SendButtonUpdate(); + } + } + + /// + /// Gets or sets the amount of time to hold the button in seconds. + /// + public float RequiredHoldTime + { + get => Base.HoldTimeSeconds; + set + { + Base.HoldTimeSeconds = value; + SendButtonUpdate(); + } + } /// - /// Gets the amount of time to hold the button in seconds. + /// Sends an update to that or has updated. /// - public float HoldTime => Base.HoldTimeSeconds; + private void SendButtonUpdate() => Base.SendButtonUpdate(Text, RequiredHoldTime, false, IsKnownOwnerHub); } } \ No newline at end of file diff --git a/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs b/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs index 00626a1..f2ae73c 100644 --- a/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs @@ -58,12 +58,27 @@ protected CustomDropdownSetting( public string[] Options { get => Base.Options; - set => Base.Options = value; + set + { + Base.Options = value; + SendDropdownUpdate(); + } } /// /// Gets the selected option as string. /// public string SelectedOption => Options[ValidatedSelectedIndex]; + + /// + /// Sends an update to that this has been updated on Server. Only works if is true. + /// + /// The new ID selected. + public void SendServerUpdate(int selectionId) => Base.SendValueUpdate(selectionId, false, IsKnownOwnerHub); + + /// + /// Sends an update to that has been updated. + /// + private void SendDropdownUpdate() => Base.SendDropdownUpdate(Options, false, IsKnownOwnerHub); } } \ No newline at end of file diff --git a/SecretAPI/Features/UserSettings/CustomHeader.cs b/SecretAPI/Features/UserSettings/CustomHeader.cs index bc7c7b5..d638121 100644 --- a/SecretAPI/Features/UserSettings/CustomHeader.cs +++ b/SecretAPI/Features/UserSettings/CustomHeader.cs @@ -1,5 +1,6 @@ namespace SecretAPI.Features.UserSettings { + using System; using global::UserSettings.ServerSpecific; /// @@ -21,6 +22,7 @@ public CustomHeader(string label, bool reducedPadding = false, string? hint = nu /// /// Gets a for Gameplay purposes. /// + [Obsolete("3.0 will remove this - Please handle your setting header yourself!")] public static CustomHeader Gameplay { get; } = new("Gameplay", hint: "Features that affect gameplay"); /// diff --git a/SecretAPI/Features/UserSettings/CustomPlainTextSetting.cs b/SecretAPI/Features/UserSettings/CustomPlainTextSetting.cs index 963f93d..6b947b2 100644 --- a/SecretAPI/Features/UserSettings/CustomPlainTextSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomPlainTextSetting.cs @@ -1,5 +1,6 @@ namespace SecretAPI.Features.UserSettings { + using System; using global::UserSettings.ServerSpecific; using TMPro; @@ -47,18 +48,53 @@ protected CustomPlainTextSetting( public string InputText => Base.SyncInputText; /// - /// Gets the content type. + /// Gets or sets the content type. /// - public TMP_InputField.ContentType ContentType => Base.ContentType; + public TMP_InputField.ContentType ContentType + { + get => Base.ContentType; + set + { + Base.ContentType = value; + SendPlaintextUpdate(); + } + } + + /// + /// Gets or sets the placeholder. + /// + public string Placeholder + { + get => Base.Placeholder; + set + { + Base.Placeholder = value; + SendPlaintextUpdate(); + } + } + + /// + /// Gets or sets the character limit. + /// + public int CharacterLimit + { + get => Base.CharacterLimit; + set + { + Base.CharacterLimit = value; + SendPlaintextUpdate(); + } + } /// - /// Gets the placeholder. + /// Sends an update to that this has been updated on Server. Only works if is true. /// - public string Placeholder => Base.Placeholder; + /// The new text. + public void SendServerUpdate(string text) => Base.SendValueUpdate(text, false, IsKnownOwnerHub); /// - /// Gets the character limit. + /// Sends an update to the that or has changed values. /// - public int CharacterLimit => Base.CharacterLimit; + private void SendPlaintextUpdate() => Base.SendPlaintextUpdate(Placeholder, (ushort)Math.Clamp(CharacterLimit, ushort.MinValue, ushort.MaxValue), ContentType, false, IsKnownOwnerHub); } } \ No newline at end of file diff --git a/SecretAPI/Features/UserSettings/CustomSetting.cs b/SecretAPI/Features/UserSettings/CustomSetting.cs index fb23c9f..9c46abf 100644 --- a/SecretAPI/Features/UserSettings/CustomSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomSetting.cs @@ -86,7 +86,11 @@ public bool IsServerOnly public string Label { get => Base.Label; - set => Base.Label = value; + set + { + Base.Label = value; + SendSettingUpdate(); + } } /// @@ -95,7 +99,11 @@ public string Label public string DescriptionHint { get => Base.HintDescription; - set => Base.HintDescription = value; + set + { + Base.HintDescription = value; + SendSettingUpdate(); + } } /// @@ -257,11 +265,6 @@ public static void SendSettingsToPlayer(Player player, int? version = null) ListPool.Shared.Return(ordered); } - /// - /// Sends an update to that or has changed. - /// - public void SendSettingUpdate() => Base.SendUpdate(Label, DescriptionHint, false, IsKnownOwnerHub); - /// /// Checks whether a is equal to . /// @@ -343,5 +346,10 @@ private static CustomSetting EnsurePlayerSpecificSetting(Player player, CustomSe return currentSetting; } + + /// + /// Sends an update to that or has changed. + /// + private void SendSettingUpdate() => Base.SendUpdate(Label, DescriptionHint, false, IsKnownOwnerHub); } } diff --git a/SecretAPI/Features/UserSettings/CustomSliderSetting.cs b/SecretAPI/Features/UserSettings/CustomSliderSetting.cs index c995f53..17912a9 100644 --- a/SecretAPI/Features/UserSettings/CustomSliderSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomSliderSetting.cs @@ -70,7 +70,7 @@ public string ValueToStringFormat } /// - /// Gets or sets the final display display format. + /// Gets or sets the final display format. /// public string FinalDisplayFormat { @@ -139,6 +139,6 @@ public bool UseInteger /// /// Sends an update that any of the slider values have been updated. /// - public void SendSliderUpdate() => Base.SendSliderUpdate(MinimumValue, MaximumValue, UseInteger, ValueToStringFormat, FinalDisplayFormat, false, IsKnownOwnerHub); + private void SendSliderUpdate() => Base.SendSliderUpdate(MinimumValue, MaximumValue, UseInteger, ValueToStringFormat, FinalDisplayFormat, false, IsKnownOwnerHub); } } \ No newline at end of file diff --git a/SecretAPI/Features/UserSettings/CustomTextAreaSetting.cs b/SecretAPI/Features/UserSettings/CustomTextAreaSetting.cs index ea4b4d8..e70c67c 100644 --- a/SecretAPI/Features/UserSettings/CustomTextAreaSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomTextAreaSetting.cs @@ -39,6 +39,15 @@ protected CustomTextAreaSetting( /// public new SSTextArea Base { get; } + /// + /// Gets or sets the current content. This is equal to . + /// + public string Content + { + get => Label; + set => Label = value; + } + /// /// Gets the foldout mode. /// diff --git a/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs b/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs index 7b7b2c9..f9f4bdf 100644 --- a/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs @@ -84,6 +84,6 @@ public string OptionB /// /// Sends an update to the that or has changed values. /// - public void SendOptionsUpdate() => Base.SendTwoButtonUpdate(OptionA, OptionB, false, IsKnownOwnerHub); + private void SendOptionsUpdate() => Base.SendTwoButtonUpdate(OptionA, OptionB, false, IsKnownOwnerHub); } } \ No newline at end of file From 35ba658f6c9dd23226c8b1f539d2a02907b66f2d Mon Sep 17 00:00:00 2001 From: Misfiy <85962933+obvEve@users.noreply.github.com> Date: Tue, 17 Feb 2026 18:28:22 +0100 Subject: [PATCH 4/6] SSSS stuff --- .../Features/UserSettings/CustomDropdownSetting.cs | 8 ++++++-- .../Features/UserSettings/CustomKeybindSetting.cs | 6 ++++-- SecretAPI/Features/UserSettings/CustomSetting.cs | 12 ++++++------ .../Features/UserSettings/CustomSliderSetting.cs | 6 +++++- .../UserSettings/CustomTwoButtonSetting.cs | 14 ++++++++++++-- 5 files changed, 33 insertions(+), 13 deletions(-) diff --git a/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs b/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs index f2ae73c..e5d79ed 100644 --- a/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs @@ -27,14 +27,18 @@ protected CustomDropdownSetting(SSDropdownSetting setting) /// The default option (int index). /// The entry type. /// The hint to show. + /// The . + /// See . protected CustomDropdownSetting( int? id, string label, string[] options, int defaultOptionIndex = 0, SSDropdownSetting.DropdownEntryType entryType = SSDropdownSetting.DropdownEntryType.Regular, - string? hint = null) - : this(new SSDropdownSetting(id, label, options, defaultOptionIndex, entryType, hint)) + string? hint = null, + byte collectionId = byte.MaxValue, + bool isServerSetting = false) + : this(new SSDropdownSetting(id, label, options, defaultOptionIndex, entryType, hint, collectionId, isServerSetting)) { } diff --git a/SecretAPI/Features/UserSettings/CustomKeybindSetting.cs b/SecretAPI/Features/UserSettings/CustomKeybindSetting.cs index 1b8d094..32ae2aa 100644 --- a/SecretAPI/Features/UserSettings/CustomKeybindSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomKeybindSetting.cs @@ -27,14 +27,16 @@ protected CustomKeybindSetting(SSKeybindSetting setting) /// Whether to prevent interaction in a GUI. /// Whether to allow spectators to trigger. /// The hint to show. + /// The . protected CustomKeybindSetting( int? id, string label, KeyCode suggestedKey = KeyCode.None, bool preventInteractionOnGui = true, bool allowSpectatorTrigger = true, - string? hint = null) - : this(new SSKeybindSetting(id, label, suggestedKey, preventInteractionOnGui, allowSpectatorTrigger, hint)) + string? hint = null, + byte collectionId = byte.MaxValue) + : this(new SSKeybindSetting(id, label, suggestedKey, preventInteractionOnGui, allowSpectatorTrigger, hint, collectionId)) { } diff --git a/SecretAPI/Features/UserSettings/CustomSetting.cs b/SecretAPI/Features/UserSettings/CustomSetting.cs index 9c46abf..0db54cf 100644 --- a/SecretAPI/Features/UserSettings/CustomSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomSetting.cs @@ -21,7 +21,7 @@ public abstract class CustomSetting : ISetting static CustomSetting() { - SecretApi.Harmony?.PatchCategory(nameof(CustomSetting)); + SecretApi.Harmony?.PatchCategory(nameof(CustomSetting), SecretApi.Assembly); ServerSpecificSettingsSync.SendOnJoinFilter = null; ServerSpecificSettingsSync.DefinedSettings ??= []; // fix null ref @@ -66,10 +66,10 @@ protected CustomSetting(ServerSpecificSettingBase setting) public abstract CustomHeader Header { get; } /// - /// Gets or sets a value indicating whether the setting is server side only. + /// Gets or sets a value indicating whether the setting is server side. /// - /// The setting value cannot be updated from client side and can be used to indicate server features being toggled. - public bool IsServerOnly + /// This will result in client not saving the setting values and allows the server to change the setting . + public bool IsServerSetting { get => Base.IsServerOnly; set => Base.IsServerOnly = value; @@ -151,13 +151,13 @@ public bool IsShared /// Unregisters collection of settings. /// /// The settings to unregister. - public static void UnRegister(params CustomSetting[] settings) => CustomSettings.RemoveAll(s => settings.Contains(s)); + public static void UnRegister(params CustomSetting[] settings) => CustomSettings.RemoveAll(settings.Contains); /// /// Unregisters a collection of settings. /// /// The settings to unregister. - public static void UnRegister(IEnumerable settings) => CustomSettings.RemoveAll(s => settings.Contains(s)); + public static void UnRegister(IEnumerable settings) => CustomSettings.RemoveAll(settings.Contains); /// /// Tries to get player specific setting. diff --git a/SecretAPI/Features/UserSettings/CustomSliderSetting.cs b/SecretAPI/Features/UserSettings/CustomSliderSetting.cs index 17912a9..3b7f9cc 100644 --- a/SecretAPI/Features/UserSettings/CustomSliderSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomSliderSetting.cs @@ -29,6 +29,8 @@ protected CustomSliderSetting(SSSliderSetting setting) /// Value to string format. /// The final display format. /// The hint to display. + /// The . + /// See . protected CustomSliderSetting( int? id, string label, @@ -38,7 +40,9 @@ protected CustomSliderSetting( bool integer = false, string valueToStringFormat = "0.##", string finalDisplayFormat = "{0}", - string? hint = null) + string? hint = null, + byte collectionId = byte.MaxValue, + bool isServerSetting = false) : this(new SSSliderSetting(id, label, minValue, maxValue, defaultValue, integer, valueToStringFormat, finalDisplayFormat, hint)) { } diff --git a/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs b/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs index f9f4bdf..a0adb94 100644 --- a/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs @@ -26,8 +26,18 @@ protected CustomTwoButtonSetting(SSTwoButtonsSetting button) /// The second option. /// Whether the second option should be default. Default: false. /// The hint to show. - protected CustomTwoButtonSetting(int? id, string label, string optionA, string optionB, bool defaultIsB = false, string? hint = null) - : this(new SSTwoButtonsSetting(id, label, optionA, optionB, defaultIsB, hint)) + /// The . + /// See . + protected CustomTwoButtonSetting( + int? id, + string label, + string optionA, + string optionB, + bool defaultIsB = false, + string? hint = null, + byte collectionId = byte.MaxValue, + bool isServerSetting = false) + : this(new SSTwoButtonsSetting(id, label, optionA, optionB, defaultIsB, hint, collectionId, isServerSetting)) { } From 0ec313044e576b5966bbe0497052f348cc83b990 Mon Sep 17 00:00:00 2001 From: Misfiy <85962933+obvEve@users.noreply.github.com> Date: Wed, 18 Feb 2026 16:26:50 +0100 Subject: [PATCH 5/6] Fix: Harmony is not created early enough, causing patches to fail --- SecretAPI/SecretApi.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SecretAPI/SecretApi.cs b/SecretAPI/SecretApi.cs index 72634a7..7f58deb 100644 --- a/SecretAPI/SecretApi.cs +++ b/SecretAPI/SecretApi.cs @@ -38,7 +38,7 @@ public class SecretApi : Plugin /// /// Gets the harmony to use for the API. /// - internal static Harmony? Harmony { get; private set; } + internal static Harmony? Harmony { get; } = new("SecretAPI" + DateTime.Now); /// /// Gets the Assembly of the API. @@ -48,7 +48,6 @@ public class SecretApi : Plugin /// public override void Enable() { - Harmony = new Harmony("SecretAPI" + DateTime.Now); CallOnLoadAttribute.Load(Assembly); } From cf21b85a10decca9a8343030a937ca5ea8e92f7b Mon Sep 17 00:00:00 2001 From: Misfiy <85962933+obvEve@users.noreply.github.com> Date: Wed, 18 Feb 2026 16:40:22 +0100 Subject: [PATCH 6/6] Improve & Fix docs --- SecretAPI/Features/UserSettings/CustomDropdownSetting.cs | 8 +++++++- SecretAPI/Features/UserSettings/CustomPlainTextSetting.cs | 2 +- SecretAPI/Features/UserSettings/CustomSliderSetting.cs | 2 +- SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs b/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs index e5d79ed..02ac34b 100644 --- a/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomDropdownSetting.cs @@ -75,7 +75,13 @@ public string[] Options public string SelectedOption => Options[ValidatedSelectedIndex]; /// - /// Sends an update to that this has been updated on Server. Only works if is true. + /// Gets the . + /// + /// Refer to https://github.com/HubertMoszka/Server-Specific-Settings-System/blob/main/SSDropdownSetting.cs#L151 for proper documentation. + public SSDropdownSetting.DropdownEntryType EntryType => Base.EntryType; + + /// + /// Sends an update to that this has been updated on Server. Only works if is true. /// /// The new ID selected. public void SendServerUpdate(int selectionId) => Base.SendValueUpdate(selectionId, false, IsKnownOwnerHub); diff --git a/SecretAPI/Features/UserSettings/CustomPlainTextSetting.cs b/SecretAPI/Features/UserSettings/CustomPlainTextSetting.cs index 6b947b2..d8750b4 100644 --- a/SecretAPI/Features/UserSettings/CustomPlainTextSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomPlainTextSetting.cs @@ -87,7 +87,7 @@ public int CharacterLimit } /// - /// Sends an update to that this has been updated on Server. Only works if is true. + /// Sends an update to that this has been updated on Server. Only works if is true. /// /// The new text. public void SendServerUpdate(string text) => Base.SendValueUpdate(text, false, IsKnownOwnerHub); diff --git a/SecretAPI/Features/UserSettings/CustomSliderSetting.cs b/SecretAPI/Features/UserSettings/CustomSliderSetting.cs index 3b7f9cc..d3877b6 100644 --- a/SecretAPI/Features/UserSettings/CustomSliderSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomSliderSetting.cs @@ -135,7 +135,7 @@ public bool UseInteger } /// - /// Sends an update to that this has been updated on Server. Only works if is true. + /// Sends an update to that this has been updated on Server. Only works if is true. /// /// The new value that this is set to. public void SendServerUpdate(float value) => Base.SendValueUpdate(value, false, IsKnownOwnerHub); diff --git a/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs b/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs index a0adb94..f3db69d 100644 --- a/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs +++ b/SecretAPI/Features/UserSettings/CustomTwoButtonSetting.cs @@ -86,7 +86,7 @@ public string OptionB public bool IsDefault => Base.DefaultIsB ? IsOptionB : IsOptionA; /// - /// Sends an update to that this has been updated on Server. Only works if is true. + /// Sends an update to that this has been updated on Server. Only works if is true. /// /// Whether the setting is set to B value now. public void SendServerUpdate(bool isB) => Base.SendValueUpdate(isB, false, IsKnownOwnerHub);