From 91b0545a5cbc7f01c7ed949e561a96171ba6cf31 Mon Sep 17 00:00:00 2001 From: R-T-B <21GunSoftware@comcast.net> Date: Sun, 23 Jul 2023 01:48:16 -0700 Subject: [PATCH] Release-175: Fix some doc typos in the autogenerated configs. --- README.md | 10 +++----- .../Kopernicus/Plugins/Kopernicus.version | 2 +- .../Constants/CompatibilityChecker.cs | 2 +- src/Kopernicus/Constants/Version.cs | 4 +-- src/Kopernicus/Injector.cs | 25 ++++++++++++------- src/Kopernicus/Properties/AssemblyInfo.cs | 2 +- .../RuntimeUtility/RuntimeUtility.cs | 8 +++--- src/Kopernicus/UI/ToolbarButton.cs | 4 +-- 8 files changed, 30 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index ecd1c4b0..9bce282e 100755 --- a/README.md +++ b/README.md @@ -1,19 +1,15 @@ Kopernicus ============================== -June 22nd, 2023 +June 23rd, 2023 * Created by: BryceSchroeder and Nathaniel R. Lewis (Teknoman117) * Actively maintained by: Prestja and R-T-B. * Formerly maintained by: Thomas P., NathanKell and KillAshley * Additional Content by: Democat3457, Gravitasi, aftokino, KCreator, Padishar, Kragrathea, OvenProofMars, zengei, MrHappyFace, Sigma88, Majiir (CompatibilityChecker), blackrack/LGHassen (shaders/GPL'd scatterer code) * Much thanks to Sarbian for ModuleManager and ModularFlightIntegrator -New in this latest version release-174: +New in this latest version release-175: -1.) New parameters added related to scaling Kerbal scale bodies automatically to real world densities (such as the stock system). Please see the config file or GUI for a description of each parameter. They are designed to be used alongside a rescale mod like Sigma Dimensions. If you don't want to play with a real world density system (most don't) you can just ignore this. - -2.) Reorganize the GUI to be more sensibly arranged (boolean/checkbox options up top, always). - -3.) In short, most the things added in this release are for pack authors to easily make "real world scale" systems, and the end users don't need to touch them, really. +1.) New parameter documentation in autogenerated Kopernicus_Config.cfg and GUI updated correcting some incorrect info. Known Bugs: diff --git a/build/KSP19PLUS/GameData/Kopernicus/Plugins/Kopernicus.version b/build/KSP19PLUS/GameData/Kopernicus/Plugins/Kopernicus.version index 2c73182b..5b2dfb8e 100644 --- a/build/KSP19PLUS/GameData/Kopernicus/Plugins/Kopernicus.version +++ b/build/KSP19PLUS/GameData/Kopernicus/Plugins/Kopernicus.version @@ -8,7 +8,7 @@ "MAJOR": 1, "MINOR": 12, "PATCH": 1, - "BUILD": 174 + "BUILD": 175 }, "KSP_VERSION_MIN": { diff --git a/src/Kopernicus/Constants/CompatibilityChecker.cs b/src/Kopernicus/Constants/CompatibilityChecker.cs index a6094f8a..808c9d11 100755 --- a/src/Kopernicus/Constants/CompatibilityChecker.cs +++ b/src/Kopernicus/Constants/CompatibilityChecker.cs @@ -56,7 +56,7 @@ public class CompatibilityChecker : MonoBehaviour #endif internal const Int32 VERSION_MINOR_LOWER_LIMIT = 8; internal const Int32 REVISION = 1; - internal const Int32 KOPERNICUS = 174; + internal const Int32 KOPERNICUS = 175; public static Boolean IsCompatible() { diff --git a/src/Kopernicus/Constants/Version.cs b/src/Kopernicus/Constants/Version.cs index b720e2fa..0d43845b 100755 --- a/src/Kopernicus/Constants/Version.cs +++ b/src/Kopernicus/Constants/Version.cs @@ -39,9 +39,9 @@ public static String VersionNumber get { #if (!KSP_VERSION_1_8) - return "Release-174"; + return "Release-175"; #else - return "LEGACY18_Release-174"; + return "LEGACY18_Release-175"; #endif } } diff --git a/src/Kopernicus/Injector.cs b/src/Kopernicus/Injector.cs index 91a6c641..55b2a5f1 100755 --- a/src/Kopernicus/Injector.cs +++ b/src/Kopernicus/Injector.cs @@ -304,16 +304,23 @@ public void PostSpawnFixups() } } } - if ((!body.name.Equals("Sun") && Utility.IsStockBody(body)) && (RuntimeUtility.RuntimeUtility.KopernicusConfig.UseRealWorldDensity)) + if ((!body.name.Equals("Sun") && (RuntimeUtility.RuntimeUtility.KopernicusConfig.UseRealWorldDensity))) { - float realWorldSize = RuntimeUtility.RuntimeUtility.KopernicusConfig.RealWorldSizeFactor; - float rescaleFactor = RuntimeUtility.RuntimeUtility.KopernicusConfig.RescaleFactor; - float gpm = rescaleFactor / realWorldSize; - float massFactor = 1 / ((realWorldSize - rescaleFactor) + 1); - body.Mass *= massFactor; - body.gravParameter *= gpm; - body.GeeASL *= gpm; - body.scienceValues.spaceAltitudeThreshold *= gpm; + if ((!Utility.IsStockBody(body)) && (RuntimeUtility.RuntimeUtility.KopernicusConfig.LimitRWDensityToStockBodies)) + { + //Do Nothing + } + else + { + float realWorldSize = RuntimeUtility.RuntimeUtility.KopernicusConfig.RealWorldSizeFactor; + float rescaleFactor = RuntimeUtility.RuntimeUtility.KopernicusConfig.RescaleFactor; + float gpm = rescaleFactor / realWorldSize; + float massFactor = 1 / ((realWorldSize - rescaleFactor) + 1); + body.Mass *= massFactor; + body.gravParameter *= gpm; + body.GeeASL *= gpm; + body.scienceValues.spaceAltitudeThreshold *= gpm; + } } // Event Events.OnPostBodyFixing.Fire(body); diff --git a/src/Kopernicus/Properties/AssemblyInfo.cs b/src/Kopernicus/Properties/AssemblyInfo.cs index 7d7a2d52..497aee44 100755 --- a/src/Kopernicus/Properties/AssemblyInfo.cs +++ b/src/Kopernicus/Properties/AssemblyInfo.cs @@ -13,7 +13,7 @@ [assembly: KSPAssemblyDependency("Kopernicus.Parser", 1, 0)] [assembly: KSPAssemblyDependency("ModularFlightIntegrator", 1, 0)] [assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.12.174.0")] +[assembly: AssemblyFileVersion("1.12.175.0")] [assembly: LogAggregator("GameData/ModuleManager.ConfigCache")] [assembly: LogAggregator("Logs/Kopernicus/")] [assembly: LogAggregator("KSP.log")] diff --git a/src/Kopernicus/RuntimeUtility/RuntimeUtility.cs b/src/Kopernicus/RuntimeUtility/RuntimeUtility.cs index 3404a801..a134db47 100644 --- a/src/Kopernicus/RuntimeUtility/RuntimeUtility.cs +++ b/src/Kopernicus/RuntimeUtility/RuntimeUtility.cs @@ -1182,8 +1182,8 @@ private void WriteConfigIfNoneExists() configFile.WriteLine(" ScatterLatLongDecimalPrecision = 5 //Integer. Default 5. Higher values allow for smoother scatter/biome precision, at the cost of performance. Leave untouched if unsure."); configFile.WriteLine(" UseOnDemandLoader = False //Boolean. Default False. Turning this on can save ram and thus improve perforamnce situationally but will break some mods requiring long distance viewing and also increase stutter."); configFile.WriteLine(" UseRealWorldDensity = False //Boolean. Default False. Turning this on will calculate realistic body gravity and densities for all or Kerbolar/stock bodies based on size of said body. Don't turn this on unless you understand what it does."); - configFile.WriteLine(" RecomputeSOIAndHillSpheres = False //Boolean. Default False. Turning this on will recompute hill spheres and SOIs using standard math for bodies that have been modified for density in anyway by UseRealWorldDensity. Affected by LimitRWDensityToStockBodies bool. Leave alone if you don't understand."); - configFile.WriteLine(" LimitRWDensityToStockBodies = True //Boolean. Default True. Turning this on will limit density/HS/SOI corrections to stock/Kerbolar bodies only. Don't mess with this unless you understand what it does."); + configFile.WriteLine(" RecomputeSOIAndHillSpheres = False //Boolean. Default False. Turning this on will recompute hill spheres and SOIs using standard math for bodies that have been modified for density in anyway by UseRealWorldDensity. Global effect/Not affected by LimitRWDensityToStockBodies. Leave alone if you don't understand."); + configFile.WriteLine(" LimitRWDensityToStockBodies = True //Boolean. Default True. Turning this on will limit density corrections to stock/Kerbolar bodies only. Don't mess with this unless you understand what it does."); configFile.WriteLine(" RescaleFactor = 1.0 //Float. Default 1.0. Set this to the rescale factor of your system if using UseRealWorldDensity, otherwise ignore."); configFile.WriteLine(" RealWorldSizeFactor = 10.625 //Float. Default 10.625. This is the size the density multiplier considers a 'normal' real world system. Don't change unless you know what you are doing."); configFile.WriteLine(" SelectedPQSQuality = " + PQSCache.PresetList.preset); @@ -1234,8 +1234,8 @@ private void UpdateConfig() configFile.WriteLine(" ScatterLatLongDecimalPrecision = " + KopernicusConfig.ScatterLatLongDecimalPrecision.ToString() + " //Integer. Default 5. Higher values allow for smoother scatter/biome precision, at the cost of performance. Leave untouched if unsure."); configFile.WriteLine(" UseOnDemandLoader = " + KopernicusConfig.UseOnDemandLoader.ToString() + " //Boolean. Default False. Turning this on can save ram and thus improve perforamnce situationally but will break some mods requiring long distance viewing and also increase stutter."); configFile.WriteLine(" UseRealWorldDensity = " + KopernicusConfig.UseRealWorldDensity.ToString() + " //Boolean. Default False. Turning this on will calculate realistic body gravity and densities for all or Kerbolar/stock bodies based on size of said body. Don't turn this on unless you understand what it does."); - configFile.WriteLine(" RecomputeSOIAndHillSpheres = " + KopernicusConfig.RecomputeSOIAndHillSpheres.ToString() + " //Boolean. Default False. Turning this on will recompute hill spheres and SOIs using standard math for bodies that have been modified for density in anyway by UseRealWorldDensity. Affected by LimitRWDensityToStockBodies bool. Leave alone if you don't understand."); - configFile.WriteLine(" LimitRWDensityToStockBodies = " + KopernicusConfig.LimitRWDensityToStockBodies.ToString() + " //Boolean. Default True. Turning this on will limit density/HS/SOI corrections to stock/Kerbolar bodies only. Don't mess with this unless you understand what it does."); + configFile.WriteLine(" RecomputeSOIAndHillSpheres = " + KopernicusConfig.RecomputeSOIAndHillSpheres.ToString() + " //Boolean. Default False. Turning this on will recompute hill spheres and SOIs using standard math for bodies that have been modified for density in anyway by UseRealWorldDensity. Global effect/Not affected by LimitRWDensityToStockBodies. Leave alone if you don't understand."); + configFile.WriteLine(" LimitRWDensityToStockBodies = " + KopernicusConfig.LimitRWDensityToStockBodies.ToString() + " //Boolean. Default True. Turning this on will limit density corrections to stock/Kerbolar bodies only. Don't mess with this unless you understand what it does."); configFile.WriteLine(" RescaleFactor = " + KopernicusConfig.RescaleFactor.ToString() + " //Float. Default 1.0. Set this to the rescale factor of your system if using UseRealWorldDensity, otherwise ignore."); configFile.WriteLine(" RealWorldSizeFactor = " + KopernicusConfig.RealWorldSizeFactor.ToString() + " //Float. Default 10.625. This is the size the density multiplier considers a 'normal' real world system. Don't change unless you know what you are doing."); configFile.WriteLine(" SelectedPQSQuality = " + PQSCache.PresetList.preset); diff --git a/src/Kopernicus/UI/ToolbarButton.cs b/src/Kopernicus/UI/ToolbarButton.cs index 4dfa218a..45020cf9 100644 --- a/src/Kopernicus/UI/ToolbarButton.cs +++ b/src/Kopernicus/UI/ToolbarButton.cs @@ -115,8 +115,8 @@ public void DrawKopernicusWindow(int windowId) RuntimeUtility.RuntimeUtility.KopernicusConfig.ResetFloatingOriginOnKSCReturn = GUILayout.Toggle(RuntimeUtility.RuntimeUtility.KopernicusConfig.ResetFloatingOriginOnKSCReturn, "ResetFloatingOriginOnKSCReturn: Check this for interstaller (LY+) range planet packs to prevent corruption on return to KSC.", toggleStyle); RuntimeUtility.RuntimeUtility.KopernicusConfig.UseOnDemandLoader = GUILayout.Toggle(RuntimeUtility.RuntimeUtility.KopernicusConfig.UseOnDemandLoader, "UseOnDemandLoader: Turning this on can save ram and thus improve perforamnce situationally but will break some mods requiring long distance viewing and also increase stutter.", toggleStyle); RuntimeUtility.RuntimeUtility.KopernicusConfig.UseRealWorldDensity = GUILayout.Toggle(RuntimeUtility.RuntimeUtility.KopernicusConfig.UseRealWorldDensity, "UseRealWorldDensity: Turning this on will calculate realistic body gravity and densities for all or Kerbolar/stock bodies based on size of said body. Don't turn this on unless you understand what it does.", toggleStyle); - RuntimeUtility.RuntimeUtility.KopernicusConfig.RecomputeSOIAndHillSpheres = GUILayout.Toggle(RuntimeUtility.RuntimeUtility.KopernicusConfig.RecomputeSOIAndHillSpheres, "RecomputeSOIAndHillSpheres: Turning this on will recompute hill spheres and SOIs using standard math for bodies that have been modified for density in anyway by UseRealWorldDensity. Affected by LimitRWDensityToStockBodies bool. Leave alone if you don't understand.", toggleStyle); - RuntimeUtility.RuntimeUtility.KopernicusConfig.LimitRWDensityToStockBodies = GUILayout.Toggle(RuntimeUtility.RuntimeUtility.KopernicusConfig.LimitRWDensityToStockBodies, "LimitRWDensityToStockBodies: Turning this on will limit density/HS/SOI corrections to stock/Kerbolar bodies only. Don't mess with this unless you understand what it does.", toggleStyle); + RuntimeUtility.RuntimeUtility.KopernicusConfig.RecomputeSOIAndHillSpheres = GUILayout.Toggle(RuntimeUtility.RuntimeUtility.KopernicusConfig.RecomputeSOIAndHillSpheres, "RecomputeSOIAndHillSpheres: Turning this on will recompute hill spheres and SOIs using standard math for bodies that have been modified for density in anyway by UseRealWorldDensity. Global effect/Not affected by LimitRWDensityToStockBodies. Leave alone if you don't understand.", toggleStyle); + RuntimeUtility.RuntimeUtility.KopernicusConfig.LimitRWDensityToStockBodies = GUILayout.Toggle(RuntimeUtility.RuntimeUtility.KopernicusConfig.LimitRWDensityToStockBodies, "LimitRWDensityToStockBodies: Turning this on will limit density corrections to stock/Kerbolar bodies only. Don't mess with this unless you understand what it does.", toggleStyle); GUILayout.Label("ScatterLatLongDecimalPrecision: Higher values allow for smoother scatter/biome precision, at the cost of performance. Leave untouched if unsure.", labelStyle); try {