void menuWindow(int windowID) { GUILayout.BeginVertical(); if (GUILayout.Button("buy a new ship", HighLogic.Skin.button)) { craftBrowser = LoadCraftDialog.Create(EditorFacility.VAB, HighLogic.CurrentGame.Title.Split(new string[] { " (" }, StringSplitOptions.None)[0], OnSelected, OnCancelled, false); MenuWindow = false; } if (GUILayout.Button("Sell a ship", HighLogic.Skin.button)) { MenuWindow = false; sellWindow = true; } if (GUILayout.Button("Design a new ship", HighLogic.Skin.button)) { MenuWindow = false; sellWindow = false; aboutWindow = false; GamePersistence.SaveGame("persistent", HighLogic.SaveFolder, SaveMode.BACKUP); EditorDriver.StartEditor(EditorFacility.VAB); } if (GUILayout.Button("close", HighLogic.Skin.button)) { MenuWindow = false; MainMenu.menuWindow = true; } GUILayout.EndVertical(); }
void OnSelected(string fullPath, LoadCraftDialog.LoadType Type) { Vector3 gpsPos = vessel.GetWorldPos3D(); SpawnVesselFromCraftFile(fullPath); craftBrowser = null; }
void OnCancelled() { craftBrowser = null; }