|
1 | 1 | using System; |
2 | | -using System.Collections.Generic; |
3 | | -using System.Linq; |
4 | 2 | using System.Reflection; |
5 | | -using System.Text; |
6 | 3 | using UnityEngine; |
7 | 4 |
|
8 | 5 | namespace MandatoryRCS |
9 | 6 | { |
10 | 7 | // Should be allscenes, but there is a bug if called from the main menu |
11 | 8 | // temp fix : settings aren't available from the main menu |
12 | | - [KSPAddon(KSPAddon.Startup.AllGameScenes, false)] |
| 9 | + [KSPAddon(KSPAddon.Startup.AllGameScenes, false)] |
13 | 10 | class MandatoryRCSSettings : MonoBehaviour |
14 | 11 | { |
15 | 12 | // RW feature master switch |
@@ -40,24 +37,22 @@ class MandatoryRCSSettings : MonoBehaviour |
40 | 37 |
|
41 | 38 | private void Start() |
42 | 39 | { |
| 40 | + foreach (var a in AssemblyLoader.loadedAssemblies) |
| 41 | + { |
| 42 | + if (a.name == "PersistentRotation") |
43 | 43 | { |
44 | | - foreach (var a in AssemblyLoader.loadedAssemblies) |
45 | | - { |
46 | | - if (a.name == "PersistentRotation") |
47 | | - { |
48 | | - isPluginPersistentRotation = true; |
49 | | - } |
50 | | - |
51 | | - if (a.name == "SaturatableRW") |
52 | | - { |
53 | | - isPluginSaturatableRW = true; |
54 | | - } |
55 | | - } |
| 44 | + isPluginPersistentRotation = true; |
56 | 45 | } |
57 | 46 |
|
58 | | - GameEvents.onLevelWasLoaded.Add(onLevelWasLoaded); |
59 | | - GameEvents.onGameStatePostLoad.Add(onGameStatePostLoad); |
60 | | - GameEvents.OnGameSettingsApplied.Add(OnGameSettingsApplied); |
| 47 | + if (a.name == "SaturatableRW") |
| 48 | + { |
| 49 | + isPluginSaturatableRW = true; |
| 50 | + } |
| 51 | + } |
| 52 | + |
| 53 | + GameEvents.onLevelWasLoaded.Add(onLevelWasLoaded); |
| 54 | + GameEvents.onGameStatePostLoad.Add(onGameStatePostLoad); |
| 55 | + GameEvents.OnGameSettingsApplied.Add(OnGameSettingsApplied); |
61 | 56 | } |
62 | 57 |
|
63 | 58 | private void ApplySettings() |
@@ -176,16 +171,16 @@ public override string Title |
176 | 171 | toolTip = "Disabling will revert to the stock behaviour.")] |
177 | 172 | public bool reactionWheelsNerf = !MandatoryRCSSettings.isPluginSaturatableRW; |
178 | 173 |
|
179 | | - [GameParameters.CustomStringParameterUI("About ", autoPersistance = false, lines = 7)] |
180 | | - public string aboutRW0 = "reduce the reaction wheels torque output on pilot or SAS rotation requests. Full torque is still provided when the SAS is standing by in \"Stability Assist\" mode or when the craft orientation is near the current SAS selection."; |
| 174 | + [GameParameters.CustomStringParameterUI("About ", autoPersistance = false, lines = 6)] |
| 175 | + public string aboutRW0 = "Reaction wheels force is heavily reduced on pilot & SAS rotation requests. Full force is provided if the SAS in \"Stability Assist\" mode or if you have reached the active SAS marker."; |
181 | 176 |
|
182 | 177 | [GameParameters.CustomParameterUI("Reaction wheels SAS & pilot control", |
183 | 178 | toolTip = "Reaction wheels torque output on pilot/SAS rotation requests :\n\n\"None\" : Reaction wheels provide only stabilization, they can't be used\nto initiate a rotation (was the default in previous versions). \n\n\"Realistic\" : Reaction wheels torque output is scaled to a somewhat realistic value\naccording their ingame weight and size.\n\n\"Easy\" : 2 times the realistic torque.\n\n\"Easier\" : 10 times the realistic torque.")] |
184 | 179 | public wheelsTorqueRatio torqueRatio = wheelsTorqueRatio.Realistic; |
185 | 180 | public enum wheelsTorqueRatio { None, Realistic, Easy, Easier } |
186 | 181 |
|
187 | 182 | [GameParameters.CustomParameterUI("SAS & pilot control customization", |
188 | | - toolTip = "When enabled, not all reaction wheels can provide SAS & pilot control.\n\nDefault setting disable the control for all pods and cockpits and\nenable it for independant reaction wheels and probe cores. \n\n This can be overriden by explicitly defining the ModuleTorqueController\nin the part config (or with an MM patch) and adding the property\n isControllable=true/false.")] |
| 183 | + toolTip = "When enabled, reaction wheels integrated in pods and cockpits can't provide SAS & pilot control,\nonly independant reaction wheels parts and probe cores can. \n\nWhen disabled, all reaction wheels can provide SAS & pilot control.\n\nThis can be overriden by explicitly defining the ModuleTorqueController\nin the part config (or with an MM patch) and adding the property\nisControllable=true/false.")] |
189 | 184 | public bool customizedWheels = true; |
190 | 185 |
|
191 | 186 | [GameParameters.CustomParameterUI("Enable velocity saturation", |
@@ -279,7 +274,7 @@ public override string Title |
279 | 274 | [GameParameters.CustomStringParameterUI("About ", autoPersistance = false, lines = 9)] |
280 | 275 | public string aboutRSP = "This feature make the vessel rotation persistent through non-physics timewarps, when switching vessels and reloading. It also make the craft keep its orientation toward the SAS selection during timewarps. The SAS selection is remembered when switching vessels and reloading."; |
281 | 276 |
|
282 | | - [GameParameters.CustomFloatParameterUI("Stability threesold (deg/sec)", minValue = 0.25f, maxValue = 4.0f, displayFormat = "F1", |
| 277 | + [GameParameters.CustomFloatParameterUI("Stability thresold (deg/sec)", minValue = 0.25f, maxValue = 4.0f, displayFormat = "F1", |
283 | 278 | toolTip = "When the angular velocity (rotation speed) of the vessel is under this value, \nit is considered stable and will not rotate during timwarps or when unloaded.\nDefault value : 1.5 deg/sec")] |
284 | 279 | public float velocityThreesold = 1.5f; // 0,02617 rad/s |
285 | 280 |
|
|
0 commit comments