private void updateMainModelFromEditor(String newModel, bool updateSymmetry)
{
SRBModelData mod = Array.Find(mainModules, m => m.name == newModel);
if (mod != null && mod != currentMainModule)
{
currentMainModule.destroyCurrentModel();
currentMainModule = mod;
currentMainModule.setupModel(part.transform.FindRecursive(baseTransformName), ModelOrientation.CENTRAL);
}
currentMainName = currentMainModule.name;
if (!currentMainModule.isValidTextureSet(currentMainTexture))
{
currentMainTexture = currentMainModule.getDefaultTextureSet();
}
currentMainModule.enableTextureSet(currentMainTexture);
currentMainModule.updateTextureUIControl(this, "currentMainTexture", currentMainTexture);
updateModelScaleAndPosition();
updateEffectsScale();
updateContainerVolume();
updatePartMass();
updatePartCost();
updateAttachnodes(true);
updateEditorValues();
updateThrustOutput();
updateGui();
if (updateSymmetry)
{
foreach (Part p in part.symmetryCounterparts)
{
p.GetComponent<SSTUModularBooster>().updateMainModelFromEditor(newModel, false);
}
}
SSTUStockInterop.fireEditorUpdate();
SSTUModInterop.onPartGeometryUpdate(part, true);
}