コード例 #1
0
 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;
 }
コード例 #2
0
        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);
        }
コード例 #3
0
        /// <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();
        }
コード例 #4
0
 /// <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);
 }
コード例 #5
0
 /// <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);
 }