public static void ShowLaunchAlert(string launchSite) { KCTDebug.Log("Showing Launch Alert"); if (KCT_GUI.PrimarilyDisabled) { EditorLogic.fetch.launchVessel(); } else { KCT_Utilities.AddVesselToBuildList(launchSite); KCT_Utilities.RecalculateEditorBuildTime(EditorLogic.fetch.ship); } }
public static void DelayedStart() { // KCTDebug.Log(ScenarioUpgradeableFacilities.protoUpgradeables.Keys); // KCTDebug.Log(ScenarioUpgradeableFacilities.protoUpgradeables.Values.ElementAt(0).facilityRefs[0].name); /* if (!updateChecked) * { * if (KCT_GameStates.settings.CheckForUpdates && !KCT_GameStates.firstStart) //Check for updates * KCT_UpdateChecker.CheckForUpdate(false, KCT_GameStates.settings.VersionSpecific); * updateChecked = true; * }*/ if (!KCT_PresetManager.Instance.ActivePreset.generalSettings.Enabled) { return; } List <GameScenes> validScenes = new List <GameScenes> { GameScenes.SPACECENTER }; if (validScenes.Contains(HighLogic.LoadedScene)) { //Check for simulation save and load it. string backupFile = KSPUtil.ApplicationRootPath + "saves/" + HighLogic.SaveFolder + "/KCT_simulation_backup.sfs"; if (System.IO.File.Exists(backupFile)) { KCT_GameStates.LoadingSimulationSave = true; /* if (!KCT_GameStates.LoadingSimulationSave) * KCT_Utilities.LoadSimulationSave(); * else * System.IO.File.Delete(backupFile);*/ } } if (HighLogic.LoadedSceneIsFlight && KCT_GameStates.flightSimulated) { KCTDebug.Log("Simulation started"); KCT_GUI.hideAll(); KCT_GUI.showSimulationWindow = !KCT_GameStates.settings.NoSimGUI; KCT_GUI.showTimeRemaining = true; if (!KCT_GameStates.simulationInitialized) { Planetarium.SetUniversalTime(KCT_GameStates.simulationUT); KCT_GameStates.simulationInitialized = true; } } if (!HighLogic.LoadedSceneIsFlight && KCT_GameStates.FundsToChargeAtSimEnd != 0) { KCT_Utilities.SpendFunds(KCT_GameStates.FundsToChargeAtSimEnd, TransactionReasons.None); KCT_GameStates.FundsToChargeAtSimEnd = 0; } if (!HighLogic.LoadedSceneIsFlight && KCT_GameStates.FundsGivenForVessel != 0) { KCT_Utilities.SpendFunds(KCT_GameStates.FundsGivenForVessel, TransactionReasons.VesselRollout); KCT_GameStates.FundsGivenForVessel = 0; } if (HighLogic.LoadedSceneIsFlight && !KCT_GameStates.flightSimulated) { List <VesselType> invalidTypes = new List <VesselType> { VesselType.Debris, VesselType.SpaceObject, VesselType.Unknown }; if (!invalidTypes.Contains(FlightGlobals.ActiveVessel.vesselType) && !KCT_GameStates.BodiesVisited.Contains(FlightGlobals.ActiveVessel.mainBody.bodyName)) { KCT_GameStates.BodiesVisited.Add(FlightGlobals.ActiveVessel.mainBody.bodyName); var message = new ScreenMessage("[KCT] New simulation body unlocked: " + FlightGlobals.ActiveVessel.mainBody.bodyName, 4.0f, ScreenMessageStyle.UPPER_LEFT); ScreenMessages.PostScreenMessage(message, true); KCTDebug.Log("Unlocked sim body: " + FlightGlobals.ActiveVessel.mainBody.bodyName); } } if (KCT_GUI.PrimarilyDisabled) { return; } //The following should only be executed when fully enabled for the save //check that all parts are valid in all ships. If not, warn the user and disable that vessel (once that code is written) if (!KCT_GameStates.vesselErrorAlerted) { List <KCT_BuildListVessel> erroredVessels = new List <KCT_BuildListVessel>(); foreach (KCT_KSC KSC in KCT_GameStates.KSCs) //this is faster one subsequent scene changes { foreach (KCT_BuildListVessel blv in KSC.VABList) { if (!blv.allPartsValid) { //error! KCTDebug.Log(blv.shipName + " contains invalid parts!"); erroredVessels.Add(blv); } } foreach (KCT_BuildListVessel blv in KSC.VABWarehouse) { if (!blv.allPartsValid) { //error! KCTDebug.Log(blv.shipName + " contains invalid parts!"); erroredVessels.Add(blv); } } foreach (KCT_BuildListVessel blv in KSC.SPHList) { if (!blv.allPartsValid) { //error! KCTDebug.Log(blv.shipName + " contains invalid parts!"); erroredVessels.Add(blv); } } foreach (KCT_BuildListVessel blv in KSC.SPHWarehouse) { if (!blv.allPartsValid) { //error! KCTDebug.Log(blv.shipName + " contains invalid parts!"); erroredVessels.Add(blv); } } } if (erroredVessels.Count > 0) { PopUpVesselError(erroredVessels); } KCT_GameStates.vesselErrorAlerted = true; } foreach (KCT_KSC KSC in KCT_GameStates.KSCs) { KSC.RecalculateBuildRates(); KSC.RecalculateUpgradedBuildRates(); } if (!HighLogic.LoadedSceneIsFlight && KCT_GameStates.buildSimulatedVessel) { KCT_GameStates.buildSimulatedVessel = false; KCT_BuildListVessel toBuild = KCT_GameStates.launchedVessel.NewCopy(false); toBuild.buildPoints = KCT_Utilities.GetBuildTime(toBuild.ExtractedPartNodes, true, KCT_GUI.useInventory); KCT_Utilities.AddVesselToBuildList(toBuild, KCT_GUI.useInventory); } if (HighLogic.LoadedSceneIsFlight && !KCT_GameStates.flightSimulated) { KCT_GUI.hideAll(); if (FlightGlobals.ActiveVessel.situation == Vessel.Situations.PRELAUNCH && KCT_GameStates.launchedVessel != null) { bool removed = KCT_GameStates.launchedVessel.RemoveFromBuildList(); if (removed) //Only do these when the vessel is first removed from the list { //Add the cost of the ship to the funds so it can be removed again by KSP //KCT_Utilities.AddFunds(KCT_Utilities.GetTotalVesselCost(FlightGlobals.ActiveVessel.protoVessel), TransactionReasons.VesselRollout); KCT_Utilities.AddFunds(KCT_GameStates.launchedVessel.cost, TransactionReasons.VesselRollout); FlightGlobals.ActiveVessel.vesselName = KCT_GameStates.launchedVessel.shipName; } KCT_Recon_Rollout rollout = KCT_GameStates.ActiveKSC.Recon_Rollout.FirstOrDefault(r => r.associatedID == KCT_GameStates.launchedVessel.id.ToString()); if (rollout != null) { KCT_GameStates.ActiveKSC.Recon_Rollout.Remove(rollout); } } } if (HighLogic.LoadedSceneIsEditor) { if (KCT_GameStates.EditorShipEditingMode) { KCTDebug.Log("Editing " + KCT_GameStates.editedVessel.shipName); EditorLogic.fetch.shipNameField.Text = KCT_GameStates.editedVessel.shipName; } if (!KCT_GUI.PrimarilyDisabled) { if (KCT_GameStates.settings.OverrideLaunchButton) { KCTDebug.Log("Taking control of launch button"); EditorLogic.fetch.launchBtn.methodToInvoke = "ShowLaunchAlert"; EditorLogic.fetch.launchBtn.scriptWithMethodToInvoke = KerbalConstructionTime.instance; } else { InputLockManager.SetControlLock(ControlTypes.EDITOR_LAUNCH, "KCTLaunchLock"); } KCT_Utilities.RecalculateEditorBuildTime(EditorLogic.fetch.ship); } } if (HighLogic.LoadedScene == GameScenes.SPACECENTER) { if (!KCT_GUI.PrimarilyDisabled) { if (ToolbarManager.ToolbarAvailable && KCT_GameStates.settings.PreferBlizzyToolbar) { if (KCT_GameStates.showWindows[0]) { KCT_GUI.ClickOn(); } else { if (KCT_Events.instance != null && KCT_Events.instance.KCTButtonStock != null) { //KCT_Events.instance.KCTButtonStock.SetTrue(true); //KCT_GUI.clicked = true; if (KCT_GameStates.showWindows[0]) { KCT_GUI.ClickOn(); } } /* else * { * KCT_GUI.showEditorGUI = KCT_GameStates.showWindows[0]; * }*/ } } KCT_GUI.ResetBLWindow(); } else { KCT_GUI.showBuildList = false; KCT_GameStates.showWindows[0] = false; } if (KCT_GameStates.firstStart) { KCTDebug.Log("Showing first start."); KCT_GUI.showFirstRun = true; //initialize the proper launchpad KCT_GameStates.ActiveKSC.ActiveLPInstance.level = KCT_Utilities.BuildingUpgradeLevel(SpaceCenterFacility.LaunchPad); } KCT_GameStates.firstStart = false; if (KCT_GameStates.LaunchFromTS) { KCT_GameStates.launchedVessel.Launch(); } KCT_GameStates.ActiveKSC.SwitchLaunchPad(KCT_GameStates.ActiveKSC.ActiveLaunchPadID); foreach (KCT_KSC ksc in KCT_GameStates.KSCs) { //foreach (KCT_Recon_Rollout rr in ksc.Recon_Rollout) for (int i = 0; i < ksc.Recon_Rollout.Count; i++) { KCT_Recon_Rollout rr = ksc.Recon_Rollout[i]; if (rr.RRType != KCT_Recon_Rollout.RolloutReconType.Reconditioning && KCT_Utilities.FindBLVesselByID(new Guid(rr.associatedID)) == null) { KCTDebug.Log("Invalid Recon_Rollout at " + ksc.KSCName + ". ID " + rr.associatedID + " not found."); ksc.Recon_Rollout.Remove(rr); i--; } } } } }
private static void DrawBuildPlansWindow(int id) { int butW = 20; GUILayout.BeginVertical(); if (HighLogic.LoadedSceneIsEditor) { if (EditorLogic.fetch.ship != null && EditorLogic.fetch.ship.Parts != null && EditorLogic.fetch.ship.Parts.Count > 0) { if (EditorLogic.fetch.ship.shipName == "Untitled Space Craft" || EditorLogic.fetch.ship.shipName == "") { if (GUILayout.Button("Cannot Add a Plan Without a Valid Name", GUILayout.Height(2 * 22))) { if (EditorLogic.fetch.ship.shipName == "Untitled Space Craft") { var message = new ScreenMessage("[KCT] Vessel must have a name other than 'Untitled Space Craft'.", 4.0f, ScreenMessageStyle.UPPER_CENTER); ScreenMessages.PostScreenMessage(message); } else { var message = new ScreenMessage("[KCT] Vessel must have a name", 4.0f, ScreenMessageStyle.UPPER_CENTER); ScreenMessages.PostScreenMessage(message); } } } else { GUILayout.BeginHorizontal(); if (GUILayout.Button("Add To Building Plans", GUILayout.Height(2 * 22))) { AddVesselToPlansList(); } GUILayout.EndHorizontal(); //if (!KCT_GameStates.settings.OverrideLaunchButton) { GUILayout.BeginHorizontal(); if (GUILayout.Button("Build", GUILayout.Height(2 * 22))) { KCT_Utilities.AddVesselToBuildList(); //SwitchCurrentPartCategory(); KCT_Utilities.RecalculateEditorBuildTime(EditorLogic.fetch.ship); } GUILayout.EndHorizontal(); } } } else { GUILayout.Button("No vessel available", GUILayout.Height(2 * 22)); } } GUILayout.Space(10); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); GUILayout.Label("Available Building Plans"); GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); bool VABSelectedNew = GUILayout.Toggle(VABSelected, "VAB", GUI.skin.button); bool SPHSelectedNew = GUILayout.Toggle(SPHSelected, "SPH", GUI.skin.button); if (VABSelectedNew != VABSelected) { SelectList("VAB"); } else if (SPHSelectedNew != SPHSelected) { SelectList("SPH"); } GUILayout.EndHorizontal(); { switch (listWindow) { case 0: plansList = KCT_GameStates.ActiveKSC.VABPlans; break; case 1: plansList = KCT_GameStates.ActiveKSC.SPHPlans; break; } if (listWindow >= 0 && plansList != null) { GUILayout.BeginHorizontal(); // GUILayout.Space((butW + 4) * 3); GUILayout.Label("Name:"); GUILayout.EndHorizontal(); buildPlanScrollPos = GUILayout.BeginScrollView(buildPlanScrollPos, GUILayout.Height(250)); if (plansList.Count == 0) { GUILayout.Label("No vessels in plans."); } for (int i = 0; i < plansList.Count; i++) { KCT_BuildListVessel b = plansList.Values[i]; if (!b.allPartsValid) { continue; } GUILayout.BeginHorizontal(); { if (GUILayout.Button("X", redButton, GUILayout.Width(butW))) { planToDelete = i; InputLockManager.SetControlLock(ControlTypes.EDITOR_SOFT_LOCK, "KCTPopupLock"); IDSelected = b.id; DialogGUIBase[] options = new DialogGUIBase[2]; options[0] = new DialogGUIButton("Yes", RemoveVesselFromPlans); options[1] = new DialogGUIButton("No", DummyVoid); MultiOptionDialog diag = new MultiOptionDialog("scrapVesselPopup", "Are you sure you want to remove this vessel from the plans?", "Delete plan", null, options: options); PopupDialog.SpawnPopupDialog(new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), diag, false, HighLogic.UISkin); } if (GUILayout.Button(b.shipName)) { KCT_Utilities.AddVesselToBuildList(b.NewCopy(true)); } } GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); } GUILayout.FlexibleSpace(); if (GUILayout.Button("Close")) { showBuildPlansWindow = false; } } GUILayout.EndVertical(); GUI.DragWindow(); }
private static void DrawBLPlusWindow(int windowID) { //bLPlusPosition.xMax = buildListWindowPosition.xMin; //bLPlusPosition.width = 100; bLPlusPosition.yMin = buildListWindowPosition.yMin; bLPlusPosition.height = 225; //bLPlusPosition.height = bLPlusPosition.yMax - bLPlusPosition.yMin; KCT_BuildListVessel b = KCT_Utilities.FindBLVesselByID(IDSelected); GUILayout.BeginVertical(); if (GUILayout.Button("Scrap")) { InputLockManager.SetControlLock(ControlTypes.KSC_ALL, "KCTPopupLock"); DialogOption[] options = new DialogOption[2]; options[0] = new DialogOption("Yes", ScrapVessel); options[1] = new DialogOption("No", DummyVoid); MultiOptionDialog diag = new MultiOptionDialog("Are you sure you want to scrap this vessel?", windowTitle: "Scrap Vessel", options: options); PopupDialog.SpawnPopupDialog(diag, false, windowSkin); showBLPlus = false; ResetBLWindow(); } if (GUILayout.Button("Edit")) { showBLPlus = false; editorWindowPosition.height = 1; string tempFile = KSPUtil.ApplicationRootPath + "saves/" + HighLogic.SaveFolder + "/Ships/temp.craft"; b.shipNode.Save(tempFile); GamePersistence.SaveGame("persistent", HighLogic.SaveFolder, SaveMode.OVERWRITE); KCT_GameStates.editedVessel = b; KCT_GameStates.EditorShipEditingMode = true; KCT_GameStates.delayStart = true; InputLockManager.SetControlLock(ControlTypes.EDITOR_EXIT, "KCTEditExit"); InputLockManager.SetControlLock(ControlTypes.EDITOR_LOAD, "KCTEditLoad"); InputLockManager.SetControlLock(ControlTypes.EDITOR_NEW, "KCTEditNew"); InputLockManager.SetControlLock(ControlTypes.EDITOR_LAUNCH, "KCTEditLaunch"); KCT_GameStates.EditedVesselParts.Clear(); foreach (ConfigNode node in b.ExtractedPartNodes) { string name = KCT_Utilities.PartNameFromNode(node) + KCT_Utilities.GetTweakScaleSize(node); if (!KCT_GameStates.EditedVesselParts.ContainsKey(name)) { KCT_GameStates.EditedVesselParts.Add(name, 1); } else { ++KCT_GameStates.EditedVesselParts[name]; } } //EditorDriver.StartAndLoadVessel(tempFile); EditorDriver.StartAndLoadVessel(tempFile, b.type == KCT_BuildListVessel.ListType.VAB ? EditorFacility.VAB : EditorFacility.SPH); } if (GUILayout.Button("Rename")) { centralWindowPosition.width = 360; centralWindowPosition.x = (Screen.width - 360) / 2; centralWindowPosition.height = 1; showBuildList = false; showBLPlus = false; showRename = true; newName = b.shipName; //newDesc = b.getShip().shipDescription; } if (GUILayout.Button("Duplicate")) { KCT_Utilities.AddVesselToBuildList(b.NewCopy(true), b.InventoryParts.Count > 0); } if (KCT_GameStates.ActiveKSC.Recon_Rollout.Find(rr => rr.RRType == KCT_Recon_Rollout.RolloutReconType.Rollout && rr.associatedID == b.id.ToString()) != null && GUILayout.Button("Rollback")) { KCT_GameStates.ActiveKSC.Recon_Rollout.Find(rr => rr.RRType == KCT_Recon_Rollout.RolloutReconType.Rollout && rr.associatedID == b.id.ToString()).SwapRolloutType(); } if (!b.isFinished && GUILayout.Button("Warp To")) { KCT_GameStates.targetedItem = b; KCT_GameStates.canWarp = true; KCT_Utilities.RampUpWarp(b); KCT_GameStates.warpInitiated = true; showBLPlus = false; } if (!b.isFinished && GUILayout.Button("Move to Top")) { if (b.type == KCT_BuildListVessel.ListType.VAB) { b.RemoveFromBuildList(); KCT_GameStates.ActiveKSC.VABList.Insert(0, b); } else if (b.type == KCT_BuildListVessel.ListType.SPH) { b.RemoveFromBuildList(); KCT_GameStates.ActiveKSC.SPHList.Insert(0, b); } } if (!b.isFinished && GUILayout.Button("Rush Build 10%\n√" + Math.Round(0.2 * b.GetTotalCost()))) { double cost = b.GetTotalCost(); cost *= 0.2; double remainingBP = b.buildPoints - b.progress; if (Funding.Instance.Funds >= cost) { b.AddProgress(remainingBP * 0.1); KCT_Utilities.SpendFunds(cost, TransactionReasons.None); } } if (GUILayout.Button("Close")) { showBLPlus = false; } GUILayout.EndVertical(); float width = bLPlusPosition.width; bLPlusPosition.x = buildListWindowPosition.x - width; bLPlusPosition.width = width; }
public static void DelayedStart() { // KCTDebug.Log(ScenarioUpgradeableFacilities.protoUpgradeables.Keys); // KCTDebug.Log(ScenarioUpgradeableFacilities.protoUpgradeables.Values.ElementAt(0).facilityRefs[0].name); if (!updateChecked) { if (KCT_GameStates.settings.CheckForUpdates && !KCT_GameStates.firstStart) //Check for updates { KCT_UpdateChecker.CheckForUpdate(false, KCT_GameStates.settings.VersionSpecific); } updateChecked = true; } if (!KCT_GameStates.settings.enabledForSave) { return; } List <GameScenes> validScenes = new List <GameScenes> { GameScenes.SPACECENTER }; if (validScenes.Contains(HighLogic.LoadedScene)) { //Check for simulation save and load it. string backupFile = KSPUtil.ApplicationRootPath + "saves/" + HighLogic.SaveFolder + "/KCT_simulation_backup.sfs"; if (System.IO.File.Exists(backupFile)) { KCT_GameStates.LoadingSimulationSave = true; /* if (!KCT_GameStates.LoadingSimulationSave) * KCT_Utilities.LoadSimulationSave(); * else * System.IO.File.Delete(backupFile);*/ } } if (HighLogic.LoadedSceneIsFlight && KCT_GameStates.flightSimulated) { KCTDebug.Log("Simulation started"); KCT_GUI.hideAll(); KCT_GUI.showSimulationWindow = !KCT_GameStates.settings.NoSimGUI; KCT_GUI.showTimeRemaining = true; Planetarium.SetUniversalTime(KCT_GameStates.simulationUT); } if (!HighLogic.LoadedSceneIsFlight && KCT_GameStates.FundsToChargeAtSimEnd != 0) { KCT_Utilities.SpendFunds(KCT_GameStates.FundsToChargeAtSimEnd, TransactionReasons.None); KCT_GameStates.FundsToChargeAtSimEnd = 0; } if (!HighLogic.LoadedSceneIsFlight && KCT_GameStates.FundsGivenForVessel != 0) { KCT_Utilities.SpendFunds(KCT_GameStates.FundsGivenForVessel, TransactionReasons.VesselRollout); KCT_GameStates.FundsGivenForVessel = 0; } if (HighLogic.LoadedSceneIsFlight && !KCT_GameStates.flightSimulated) { List <VesselType> invalidTypes = new List <VesselType> { VesselType.Debris, VesselType.SpaceObject, VesselType.Unknown }; if (!invalidTypes.Contains(FlightGlobals.ActiveVessel.vesselType) && !KCT_GameStates.BodiesVisited.Contains(FlightGlobals.ActiveVessel.mainBody.bodyName)) { KCT_GameStates.BodiesVisited.Add(FlightGlobals.ActiveVessel.mainBody.bodyName); var message = new ScreenMessage("[KCT] New simulation body unlocked: " + FlightGlobals.ActiveVessel.mainBody.bodyName, 4.0f, ScreenMessageStyle.UPPER_LEFT); ScreenMessages.PostScreenMessage(message, true); KCTDebug.Log("Unlocked sim body: " + FlightGlobals.ActiveVessel.mainBody.bodyName); } } if (KCT_GUI.PrimarilyDisabled) { return; } //The following should only be executed when fully enabled for the save foreach (KCT_KSC KSC in KCT_GameStates.KSCs) { KSC.RecalculateBuildRates(); KSC.RecalculateUpgradedBuildRates(); } if (!HighLogic.LoadedSceneIsFlight && KCT_GameStates.buildSimulatedVessel) { KCT_GameStates.buildSimulatedVessel = false; KCT_BuildListVessel toBuild = KCT_GameStates.launchedVessel.NewCopy(false); toBuild.buildPoints = KCT_Utilities.GetBuildTime(toBuild.ExtractedPartNodes, true, KCT_GUI.useInventory); KCT_Utilities.AddVesselToBuildList(toBuild, KCT_GUI.useInventory); } if (HighLogic.LoadedSceneIsFlight && !KCT_GameStates.flightSimulated) { KCT_GUI.hideAll(); if (FlightGlobals.ActiveVessel.situation == Vessel.Situations.PRELAUNCH && KCT_GameStates.launchedVessel != null) { bool removed = KCT_GameStates.launchedVessel.RemoveFromBuildList(); if (removed) //Only do these when the vessel is first removed from the list { //Add the cost of the ship to the funds so it can be removed again by KSP //KCT_Utilities.AddFunds(KCT_Utilities.GetTotalVesselCost(FlightGlobals.ActiveVessel.protoVessel), TransactionReasons.VesselRollout); KCT_Utilities.AddFunds(KCT_GameStates.launchedVessel.cost, TransactionReasons.VesselRollout); FlightGlobals.ActiveVessel.vesselName = KCT_GameStates.launchedVessel.shipName; } KCT_Recon_Rollout rollout = KCT_GameStates.ActiveKSC.Recon_Rollout.FirstOrDefault(r => r.associatedID == KCT_GameStates.launchedVessel.id.ToString()); if (rollout != null) { KCT_GameStates.ActiveKSC.Recon_Rollout.Remove(rollout); } } } if (HighLogic.LoadedSceneIsEditor) { if (KCT_GameStates.EditorShipEditingMode) { KCTDebug.Log("Editing " + KCT_GameStates.editedVessel.shipName); EditorLogic.fetch.shipNameField.Text = KCT_GameStates.editedVessel.shipName; } if (!KCT_GUI.PrimarilyDisabled) { if (KCT_GameStates.settings.OverrideLaunchButton) { KCTDebug.Log("Taking control of launch button"); EditorLogic.fetch.launchBtn.methodToInvoke = "ShowLaunchAlert"; EditorLogic.fetch.launchBtn.scriptWithMethodToInvoke = KerbalConstructionTime.instance; } else { InputLockManager.SetControlLock(ControlTypes.EDITOR_LAUNCH, "KCTLaunchLock"); } KCT_Utilities.RecalculateEditorBuildTime(EditorLogic.fetch.ship); } } if (HighLogic.LoadedScene == GameScenes.SPACECENTER) { if (KCT_Utilities.CurrentGameHasScience() && KCT_GameStates.TotalUpgradePoints == 0) { ConfigNode CN = new ConfigNode(); ResearchAndDevelopment.Instance.snapshot.Save(CN); ConfigNode[] techNodes = CN.GetNodes("Tech"); KCTDebug.Log("technodes length: " + techNodes.Length); KCT_GameStates.TotalUpgradePoints = techNodes.Length + 14; } if (!KCT_GUI.PrimarilyDisabled) { KCT_GUI.showBuildList = KCT_GameStates.showWindows[0]; KCT_GUI.ResetBLWindow(); } else { KCT_GUI.showBuildList = false; KCT_GameStates.showWindows[0] = false; } if (KCT_GameStates.firstStart) { KCTDebug.Log("Showing first start."); KCT_GUI.showFirstRun = true; } KCT_GameStates.firstStart = false; if (KCT_GameStates.LaunchFromTS) { KCT_GameStates.launchedVessel.Launch(); } } }