Skip to content

Commit

Permalink
Merge pull request #192 from SubnauticaModding/revert-default-step
Browse files Browse the repository at this point in the history
SMLHelper 2.9.0.1 HOTFIX: Revert default slider step
  • Loading branch information
toebeann committed Sep 17, 2020
2 parents 527b745 + 042fd64 commit b613e8a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Example mod/mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"Id": "SMLHelperExampleMod",
"DisplayName": "Example Mod For SMLHelper",
"Author": "The SMLHelper Dev Team",
"Version": "2.9",
"Version": "2.9.0.1",
"Enable": true,
"AssemblyName": "Example mod.dll",
"VersionDependencies": {
"SMLHelper": "2.9"
"SMLHelper": "2.9.0.1"
}
}
12 changes: 6 additions & 6 deletions SMLHelper/Options/SliderModOption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ internal void OnSliderChange(string id, float value)
/// <param name="value">The starting value.</param>
protected void AddSliderOption(string id, string label, float minValue, float maxValue, float value)
{
AddSliderOption(id, label, minValue, maxValue, value, null, null, 0.05f);
AddSliderOption(id, label, minValue, maxValue, value, null, null, 0);
}

/// <summary>
Expand All @@ -89,7 +89,7 @@ protected void AddSliderOption(string id, string label, float minValue, float ma
/// (more on this <see href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings">here</see>)</param>
protected void AddSliderOption(string id, string label, float minValue, float maxValue, float value, float? defaultValue, string valueFormat = null)
{
AddSliderOption(id, label, minValue, maxValue, value, defaultValue, valueFormat, 0.05f);
AddSliderOption(id, label, minValue, maxValue, value, defaultValue, valueFormat, 0);
}

/// <summary>
Expand All @@ -104,7 +104,7 @@ protected void AddSliderOption(string id, string label, float minValue, float ma
/// <param name="valueFormat"> format for value, e.g. "{0:F2}" or "{0:F0} %"
/// (more on this <see href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings">here</see>)</param>
/// <param name="step">Step for the slider, ie. round to nearest X</param>
protected void AddSliderOption(string id, string label, float minValue, float maxValue, float value, float? defaultValue, string valueFormat = null, float step = 0.05f)
protected void AddSliderOption(string id, string label, float minValue, float maxValue, float value, float? defaultValue, string valueFormat = null, float step = 0)
{
AddOption(new ModSliderOption(id, label, minValue, maxValue, value, defaultValue, valueFormat, step));
}
Expand Down Expand Up @@ -138,9 +138,9 @@ public class ModSliderOption : ModOption

/// <summary>
/// The step value of the <see cref="ModSliderOption"/>.
/// Defaults to 0.05f same as default code.
/// Defaults to 0f for compatibility with older mods.
/// </summary>
public float Step { get; } = 0.05f;
public float Step { get; } = 0;

/// <summary> Format for value field (<see cref="ModOptions.AddSliderOption(string, string, float, float, float, float?, string)"/>) </summary>
public string ValueFormat { get; }
Expand Down Expand Up @@ -209,7 +209,7 @@ internal override void AddToPanel(uGUI_TabbedControlsPanel panel, int tabIndex)
/// <param name="defaultValue">The default value for the slider. If this is null then 'value' used as default.</param>
/// <param name="valueFormat">Format for value field (<see cref="ModOptions.AddSliderOption(string, string, float, float, float, float?, string, float)"/>) </param>
/// <param name="step">Step for the slider ie. round to nearest X</param>
internal ModSliderOption(string id, string label, float minValue, float maxValue, float value, float? defaultValue = null, string valueFormat = null, float step = 0.05f) : base(label, id)
internal ModSliderOption(string id, string label, float minValue, float maxValue, float value, float? defaultValue = null, string valueFormat = null, float step = 0) : base(label, id)
{
MinValue = minValue;
MaxValue = maxValue;
Expand Down
4 changes: 2 additions & 2 deletions SMLHelper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.9.0.0")]
[assembly: AssemblyFileVersion("2.9.0.0")]
[assembly: AssemblyVersion("2.9.0.1")]
[assembly: AssemblyFileVersion("2.9.0.1")]
[assembly: InternalsVisibleTo("SMLHelper.Tests")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
2 changes: 1 addition & 1 deletion SMLHelper/mod_BelowZero.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Id": "SMLHelper",
"DisplayName": "SMLHelper",
"Author": "The SMLHelper Dev Team",
"Version": "2.9",
"Version": "2.9.0.1",
"Enable": true,
"Game": "BelowZero",
"AssemblyName": "SMLHelper.dll"
Expand Down
2 changes: 1 addition & 1 deletion SMLHelper/mod_Subnautica.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Id": "SMLHelper",
"DisplayName": "SMLHelper",
"Author": "The SMLHelper Dev Team",
"Version": "2.9",
"Version": "2.9.0.1",
"Enable": true,
"Game": "Subnautica",
"AssemblyName": "SMLHelper.dll"
Expand Down

0 comments on commit b613e8a

Please sign in to comment.