diff --git a/Distribution/Restock/GameData/ReStock/Assets/Engine/restock-engine-mainsail-2.mu b/Distribution/Restock/GameData/ReStock/Assets/Engine/restock-engine-mainsail-2.mu index b8b2fac0..a7c12baf 100644 Binary files a/Distribution/Restock/GameData/ReStock/Assets/Engine/restock-engine-mainsail-2.mu and b/Distribution/Restock/GameData/ReStock/Assets/Engine/restock-engine-mainsail-2.mu differ diff --git a/Distribution/Restock/GameData/ReStock/Assets/Engine/restock-engine-skipper-2.mu b/Distribution/Restock/GameData/ReStock/Assets/Engine/restock-engine-skipper-2.mu index 766b7174..e13f74c7 100644 Binary files a/Distribution/Restock/GameData/ReStock/Assets/Engine/restock-engine-skipper-2.mu and b/Distribution/Restock/GameData/ReStock/Assets/Engine/restock-engine-skipper-2.mu differ diff --git a/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-1.mu b/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-1.mu index b8f5644e..3926df52 100644 Binary files a/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-1.mu and b/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-1.mu differ diff --git a/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-2.mu b/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-2.mu index 141fa843..a21a8b7f 100644 Binary files a/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-2.mu and b/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-2.mu differ diff --git a/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-3.mu b/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-3.mu index 6ceec8aa..4ed05723 100644 Binary files a/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-3.mu and b/Distribution/Restock/GameData/ReStock/Assets/FuelTank/restock-fueltank-5-3.mu differ diff --git a/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiator-deploying-small-1.mu b/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiator-deploying-small-1.mu index 0d7eb88c..3523e030 100644 Binary files a/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiator-deploying-small-1.mu and b/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiator-deploying-small-1.mu differ diff --git a/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiators-deployable-1-e.tga b/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiators-deployable-1-e.tga new file mode 100644 index 00000000..2242e7a5 Binary files /dev/null and b/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiators-deployable-1-e.tga differ diff --git a/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiators-deployable-1-n.tga b/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiators-deployable-1-n.tga new file mode 100644 index 00000000..a6985efa Binary files /dev/null and b/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiators-deployable-1-n.tga differ diff --git a/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiators-deployable-1.tga b/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiators-deployable-1.tga new file mode 100644 index 00000000..5b57a61f Binary files /dev/null and b/Distribution/Restock/GameData/ReStock/Assets/Thermal/restock-radiators-deployable-1.tga differ diff --git a/Distribution/Restock/GameData/ReStock/Patches/Thermal/restock-radiators.cfg b/Distribution/Restock/GameData/ReStock/Patches/Thermal/restock-radiators.cfg index 384f4a4a..8c50670f 100644 --- a/Distribution/Restock/GameData/ReStock/Patches/Thermal/restock-radiators.cfg +++ b/Distribution/Restock/GameData/ReStock/Patches/Thermal/restock-radiators.cfg @@ -233,6 +233,11 @@ @raycastTransformName = Panel_006 } MODULE + { + name = ModuleRestockDeployableMeshHider + transformName = TinyRadDeform + } + MODULE { name = ModuleRestockHeatEffects enableHeatEmissive = true @@ -280,6 +285,11 @@ @raycastTransformName = B_MedRad_Raycast } MODULE + { + name = ModuleRestockDeployableMeshHider + transformName = RadMed_DeformablePipes + } + MODULE { name = ModuleRestockHeatEffects enableHeatEmissive = true @@ -327,6 +337,13 @@ @raycastTransformName = B_LargeRad_Raycast } MODULE + { + name = ModuleRestockDeployableMeshHider + transformName = RadLrg_Deform01 + transformName = RadLrg_Deform02 + transformName = RadLrg_Deform03 + } + MODULE { name = ModuleRestockHeatEffects enableHeatEmissive = true diff --git a/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll b/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll index f92c4c0a..f3915298 100644 Binary files a/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll and b/Distribution/Restock/GameData/ReStock/Plugins/Restock.dll differ diff --git a/Distribution/Restock/changelog.txt b/Distribution/Restock/changelog.txt index 66236345..25e5cead 100644 --- a/Distribution/Restock/changelog.txt +++ b/Distribution/Restock/changelog.txt @@ -50,7 +50,7 @@ v1.1.0 - Fixed the Pollux SRB using FX from RestockPlus - flames would not show if RS+ was not installed - Fixed the centering of the Rovemate probe core - Fixed some smoothing groups on the white variant of the Rockomax X-32 Fuel Tank - + - Fixed an issue where radiators would freak out when destroyed. v1.0.3 ----- diff --git a/Distribution/RestockPlus/GameData/ReStockPlus/Parts/Engine/1875/restock-engine-caravel.cfg b/Distribution/RestockPlus/GameData/ReStockPlus/Parts/Engine/1875/restock-engine-caravel.cfg index b54f8592..86ae6682 100644 --- a/Distribution/RestockPlus/GameData/ReStockPlus/Parts/Engine/1875/restock-engine-caravel.cfg +++ b/Distribution/RestockPlus/GameData/ReStockPlus/Parts/Engine/1875/restock-engine-caravel.cfg @@ -99,7 +99,7 @@ PART manufacturer = #LOC_RestockPlus_agency_paperclips description = #LOC_RestockPlus_restock-engine-caravel_description attachRules = 1,1,1,0,0 - mass = 1.6 + mass = 2.0 dragModelType = default maximum_drag = 0.2 minimum_drag = 0.3 @@ -137,8 +137,8 @@ PART } atmosphereCurve { - key = 0 340 - key = 1 285 + key = 0 320 + key = 1 265 key = 9 0.001 } } diff --git a/Distribution/RestockPlus/changelog.txt b/Distribution/RestockPlus/changelog.txt index a459a162..0080381a 100644 --- a/Distribution/RestockPlus/changelog.txt +++ b/Distribution/RestockPlus/changelog.txt @@ -39,7 +39,7 @@ v1.1.0 - Adjusted configs for Caravel, Schnauzer to account for a bug Squad fixed in 1.9 - Fixed SkinnedMeshRenderer scaling for Caravel, Schnauzer (#800) - Fixed an issue with the thrust transforms on the Cherenkov nuclear engine (#804) - + - Reduced Caravel vacuum Isp to 265/320s from 285/340s, increased mass to 2.0t from 1.6t v1.0.3 ----- - Updated ModuleManager distribution to 4.1.3 diff --git a/Source/Restock/ModuleRestockDeployableMeshHider.cs b/Source/Restock/ModuleRestockDeployableMeshHider.cs new file mode 100644 index 00000000..ba3fabba --- /dev/null +++ b/Source/Restock/ModuleRestockDeployableMeshHider.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace Restock +{ + public class ModuleRestockDeployableMeshHider: PartModule + { + private ModuleDeployablePart deployable; + public List disableableGameObjects; + private ModuleDeployablePart.DeployState savedState; + + + [SerializeField] + private string serializedNode; + + public override void OnLoad(ConfigNode node) + { + base.OnLoad(node); + + if (serializedNode == null) + serializedNode = node.ToString(); + } + + + public override void OnStart(StartState state) + { + base.OnStart(state); + if (HighLogic.LoadedSceneIsFlight) + { + + if (string.IsNullOrEmpty(serializedNode)) + { + this.LogError("Serialized node is null or empty!"); + return; + } + + ConfigNode node = ConfigNode.Parse(serializedNode).nodes[0]; + LoadTransforms(node); + + + deployable = this.GetComponent(); + if (deployable == null) + { + Debug.LogError("No ModuleDeployablePart found on part"); + return; + } + + savedState = deployable.deployState; + SetVisibility(savedState != ModuleDeployablePart.DeployState.BROKEN); + } + } + public void LoadTransforms(ConfigNode node) + { + + disableableGameObjects = new List(); + + foreach (string transformName in node.GetValues("transformName")) + { + + Transform[] transforms = part.FindModelTransforms(transformName); + if (transforms.Length == 0) + { + this.LogError($"No transforms named '{transformName}' found in model"); + continue; + } + + foreach (Transform xform in transforms) + { + disableableGameObjects.Add(xform.gameObject); + } + } + } + + private void SetVisibility(bool visible) + { + for (int i = 0; i < disableableGameObjects.Count; i++) + { + disableableGameObjects[i].SetActive(visible); + } + } + public void Update() + { + if (HighLogic.LoadedSceneIsFlight && deployable && disableableGameObjects.Count > 0) + { + + if (deployable.deployState != savedState) + { + SetVisibility(deployable.deployState != ModuleDeployablePart.DeployState.BROKEN); + savedState = deployable.deployState; + } + } + } + void OnDestroy() + { + + if (HighLogic.LoadedSceneIsFlight && disableableGameObjects.Count > 0) + SetVisibility(false); + } + } +}