public static ModelGUISelection[] createFromModelData(ModelData[] data, float diameter) { int len = data.Length; ModelGUISelection[] selections = new ModelGUISelection[len]; for (int i = 0; i < len; i++) { selections[i] = new ModelGUISelection(data[i], diameter); } return selections; }
public static ModelGUISelection[] createFromModelData(ModelData[] data, float diameter) { int len = data.Length; ModelGUISelection[] selections = new ModelGUISelection[len]; for (int i = 0; i < len; i++) { selections[i] = new ModelGUISelection(data[i], diameter); } return(selections); }
/// <summary> /// Should be called by the PartModule to open the GUI. /// </summary> /// <param name="models"></param> public static void openGUI(ModelData[] models, float diameter, Action <String, bool> modelSelectedCB) { if (guiOpen) { throw new NotSupportedException("Cannot open a GUI when it is already open!"); } EditorLogic editor = EditorLogic.fetch; if (editor != null) { editor.Lock(true, true, true, "SSTUModelSelectLock"); } adapters = ModelGUISelection.createFromModelData(models, diameter); modelSelectedCallback = modelSelectedCB; guiOpen = true; shouldClose = false; UIPartActionController.Instance.Deactivate(); }
/// <summary> /// Internal call from GUI interaction when the 'select adapter' button is pressed for a specific adapter. /// Should issue a callback to the opening PartModule with info regarding what adapter was selected, /// and then close the GUI? /// </summary> /// <param name="adapterName"></param> private static void adapterSelected(ModelGUISelection selection) { modelSelectedCallback.Invoke(selection.modelName, true); }