Skip to content

Commit

Permalink
Merge pull request #304 from amazingalek/raicuparta/fix-slidr-min-max
Browse files Browse the repository at this point in the history
Fix slider value calculation
  • Loading branch information
amazingalek authored Aug 4, 2020
2 parents ab4d43a + 5e27fab commit 46bf2ee
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion OWML.Launcher/OWML.Manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Alek",
"name": "OWML",
"uniqueName": "Alek.OWML",
"version": "0.7.0",
"version": "0.7.1",
"description": "The mod loader and mod framework for Outer Wilds",
"minGameVersion": "1.0.7.0",
"maxGameVersion": "1.0.7.481"
Expand Down
4 changes: 2 additions & 2 deletions OWML.ModHelper.Menus/ModSliderInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ private void UpdateValueText()

private float ToRealNumber(float fakeNumber)
{
return fakeNumber * (Max - Min) / 10;
return 0.1f * (fakeNumber * (Max - Min)) + Min;
}

private float ToFakeNumber(float realNumber)
{
return realNumber * 10 / (Max - Min);
return 10 * (realNumber - Min) / (Max - Min);
}
}
}
2 changes: 1 addition & 1 deletion OWML.SampleMods/OWML.EnableDebugMode/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "EnableDebugMode",
"uniqueName": "Alek.EnableDebugMode",
"version": "0.2",
"owmlVersion": "0.7.0",
"owmlVersion": "0.7.1",
"description": "Enables the debug mode in Outer Wilds",
"requireVR": false
}
12 changes: 12 additions & 0 deletions OWML.SampleMods/OWML.LoadCustomAssets/default-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
"min": 0,
"max": 20
},
"negativeMin": {
"type": "slider",
"value": -2,
"min": -10,
"max": 20
},
"negativeMax": {
"type": "slider",
"value": -2,
"min": -50,
"max": -20
},
"decimals": {
"type": "slider",
"value": 10.54545,
Expand Down
2 changes: 1 addition & 1 deletion OWML.SampleMods/OWML.LoadCustomAssets/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"name": "LoadCustomAssets",
"uniqueName": "Alek.LoadCustomAssets",
"version": "0.6",
"owmlVersion": "0.7.0",
"owmlVersion": "0.7.1",
"description": "A mod for testing loading of custom assets",
"requireVR": false
}

0 comments on commit 46bf2ee

Please sign in to comment.