Example #1
0
        private void SYReady()
        {
            if (HighLogic.LoadedSceneIsEditor && KCTGameStates.EditorShipEditingMode && KCTGameStates.EditedVessel != null)
            {
                KCTDebug.Log("Removing SY tracking of this vessel.");
                string id = ScrapYardWrapper.GetPartID(KCTGameStates.EditedVessel.ExtractedPartNodes[0]);
                ScrapYardWrapper.SetProcessedStatus(id, false);

                KCTDebug.Log("Adding parts back to inventory for editing...");
                foreach (ConfigNode partNode in KCTGameStates.EditedVessel.ExtractedPartNodes)
                {
                    if (ScrapYardWrapper.PartIsFromInventory(partNode))
                    {
                        ScrapYardWrapper.AddPartToInventory(partNode, false);
                    }
                }
            }
        }
Example #2
0
        private void SYReady()
        {
            const string logBlockName = nameof(KCTEvents) + "." + nameof(SYReady);

            using (EntryExitLogger.EntryExitLog(logBlockName, EntryExitLoggerOptions.All))
            {
                if (HighLogic.LoadedSceneIsEditor && GameStates.EditorShipEditingMode && GameStates.editedVessel != null)
                {
                    Log.Info("Removing SY tracking of this vessel.");
                    string id = ScrapYardWrapper.GetPartID(GameStates.editedVessel.ExtractedPartNodes[0]);
                    ScrapYardWrapper.SetProcessedStatus(id, false);

                    Log.Info("Adding parts back to inventory for editing...");
                    foreach (ConfigNode partNode in GameStates.editedVessel.ExtractedPartNodes)
                    {
                        if (ScrapYardWrapper.PartIsFromInventory(partNode))
                        {
                            ScrapYardWrapper.AddPartToInventory(partNode, false);
                        }
                    }
                }
            }
        }