public void UpdateFairingNodes() { ROLLog.log($"UpdateFairingNodes()"); foreach (ROLNodeFairingData data in fairingParts) { ROLLog.log($"fairingName: {fairingName}"); // Update the Nose Interstage Node if (fairingName == "Top Fairing") { Vector3 pos = new Vector3(0, data.topY, 0); ROLLog.log($"data.topY: {data.topY}"); ROLSelectableNodes.updateNodePosition(part, noseFairingNode, pos); if (part.FindAttachNode(noseFairingNode) is AttachNode noseInterstage) { ROLAttachNodeUtils.updateAttachNodePosition(part, noseInterstage, pos, Vector3.up, true, 2); } } // Update the Mount Interstage Node if (fairingName == "Bottom Fairing") { Vector3 pos = new Vector3(0, data.bottomY, 0); ROLSelectableNodes.updateNodePosition(part, data.mountNode, pos); if (part.FindAttachNode(mountFairingNode) is AttachNode mountInterstage) { ROLAttachNodeUtils.updateAttachNodePosition(part, mountInterstage, pos, Vector3.down, true, 2); } } } }
public void UpdateImpulseValues() { ROLLog.log("UpdateImpulseValues() called"); float nf = (float)Math.Min(100f * Math.Pow(modularPart.currentDiameter, diamExponent), maxImpulse); nf = (float)Math.Round(nf, 0); currentEjectionForce = decouple.ejectionForce = nf; }
public void SetCurrentDiameter(float f) { float oldDiameter = module.currentDiameter; module.currentDiameter = f; BaseField fld = module.Fields[nameof(module.currentDiameter)]; fld.uiControlEditor.onFieldChanged.Invoke(fld, oldDiameter); MonoUtilities.RefreshContextWindows(module.part); ROLLog.log("ModuleROTank - Diameter set to: " + f); }
public static void load() { ROLLog.log("Loading Model Layouts"); layouts.Clear(); ConfigNode[] layoutNodes = GameDatabase.Instance.GetConfigNodes("ROL_MODEL_LAYOUT"); int len = layoutNodes.Length; for (int i = 0; i < len; i++) { ModelLayoutData mld = new ModelLayoutData(layoutNodes[i]); layouts.Add(mld.name, mld); } loaded = true; ROLLog.log("Finished loading Model Layouts"); }
public void SetCurrentDiameter(float f) { module.currentDiameter = f; module.updateModulePositions(); module.updateDimensions(); module.updateAttachNodes(true); module.updateAvailableVariants(); if (module.scaleMass) { module.updateMass(); } if (module.scaleCost) { module.updateCost(); } UpdatePartActionWindow(); ROLLog.log("ModuleROTank - Diameter set to: " + f); }
private static void loadDefs() { if (defsLoaded) { return; } defsLoaded = true; ConfigNode[] modelDatas = GameDatabase.Instance.GetConfigNodes("ROL_MODEL"); ROLModelDefinition data; foreach (ConfigNode node in modelDatas) { data = new ROLModelDefinition(node); ROLLog.log("Loading model definition data for name: " + data.name + " with model URL: " + data.modelName); if (baseModelData.ContainsKey(data.name)) { ROLLog.error("Model defs already contains def for name: " + data.name + ". Please check your configs as this is an error. The duplicate entry was found in the config node of:\n" + node); continue; } baseModelData.Add(data.name, data); } }