Esempio n. 1
0
        private void Update()
        {
            if (run)
            {
                EntryCostDatabaseAccessor.Init();
                EntryCostDatabaseAccessor.GetFields();
//                EntryCostDatabaseAccessor.ScanDatabase();
                foreach (AvailablePart ap in EntryCostDatabaseAccessor.nameToPart.Values)
                {
                    if (ap.partPrefab.FindModuleImplementing <ModuleShowInfo>() is ModuleShowInfo msi)
                    {
                        foreach (AvailablePart.ModuleInfo x in ap.moduleInfos)
                        {
                            if (x.moduleName.Equals(ModuleShowInfo.sModuleName))
                            {
                                x.info = msi.GetInfo();
                            }
                        }
                    }
                }

                run = false;
                GameObject.Destroy(this);
            }
        }
Esempio n. 2
0
        public override string GetInfo()
        {
            EntryCostDatabaseAccessor.Init();
            EntryCostDatabaseAccessor.GetFields();

            string data = null, APInfo = null;
            if (EntryCostDatabaseAccessor.GetHolder(part.name) is RealFuels.PartEntryCostHolder h)
                data = $"Total cost: {EntryCostDatabaseAccessor.GetCost(h)}\n{EntryCostDatabaseAccessor.DisplayHolder(h, false)}";
            if (part.partInfo is AvailablePart ap)
                APInfo = $"Tech Required: {ap.TechRequired}";
            string res = $"Part name: {part.name}\n{APInfo}\n{data}";
            return res;
        }
Esempio n. 3
0
        public override string GetInfo()
        {
            EntryCostDatabaseAccessor.Init();
            EntryCostDatabaseAccessor.GetFields();

            string data = null, apInfo = null;

            if (EntryCostDatabaseAccessor.GetHolder(part.name) is RealFuels.PartEntryCostHolder h)
            {
                data = $"Total cost: {EntryCostDatabaseAccessor.GetCost(h)}\n{EntryCostDatabaseAccessor.DisplayHolder(h, false)}";
            }
            if (part.partInfo is AvailablePart ap)
            {
                apInfo = $"Tech Required: {ap.TechRequired}";
                if (part.CrewCapacity > 0)
                {
                    apInfo = $"Training course: {TrainingDatabase.SynonymReplace(part.name)}\n{apInfo}";
                }
            }
            string res = $"Part name: {part.name}\n{apInfo}\n{data}";

            return(res);
        }