Пример #1
0
        private string DisplayTech(string techid)
        {
            if (String.IsNullOrEmpty(techid))
            {
                return(string.Empty);
            }

            var translatedTech = Localizer.Format(PluginHelper.GetTechTitleById(techid));

            if (PluginHelper.UpgradeAvailable(techid))
            {
                return("<size=10><color=green>Ѵ</color> " + translatedTech + "</size>");
            }
            else
            {
                return("<size=10><color=red>X</color> " + translatedTech + "</size>");
            }
        }
Пример #2
0
        public override string GetInfo()
        {
            DetermineTechLevel();

            var sb = new StringBuilder();

            if (!string.IsNullOrEmpty(upgradeTechReq1))
            {
                sb.AppendLine("<color=#7fdfffff>" + Localizer.Format("#LOC_KSPIE_Generic_upgradeTechnologies") + ":</color><size=10>");
                if (!string.IsNullOrEmpty(upgradeTechReq1))
                {
                    sb.AppendLine("- " + Localizer.Format(PluginHelper.GetTechTitleById(upgradeTechReq1)));
                }
                if (!string.IsNullOrEmpty(upgradeTechReq2))
                {
                    sb.AppendLine("- " + Localizer.Format(PluginHelper.GetTechTitleById(upgradeTechReq2)));
                }
                if (!string.IsNullOrEmpty(upgradeTechReq3))
                {
                    sb.AppendLine("- " + Localizer.Format(PluginHelper.GetTechTitleById(upgradeTechReq3)));
                }
                if (!string.IsNullOrEmpty(upgradeTechReq4))
                {
                    sb.AppendLine("- " + Localizer.Format(PluginHelper.GetTechTitleById(upgradeTechReq4)));
                }
                if (!string.IsNullOrEmpty(upgradeTechReq5))
                {
                    sb.AppendLine("- " + Localizer.Format(PluginHelper.GetTechTitleById(upgradeTechReq5)));
                }
                if (!string.IsNullOrEmpty(upgradeTechReq6))
                {
                    sb.AppendLine("- " + Localizer.Format(PluginHelper.GetTechTitleById(upgradeTechReq6)));
                }
                if (!string.IsNullOrEmpty(upgradeTechReq7))
                {
                    sb.AppendLine("- " + Localizer.Format(PluginHelper.GetTechTitleById(upgradeTechReq7)));
                }
                if (!string.IsNullOrEmpty(upgradeTechReq8))
                {
                    sb.AppendLine("- " + Localizer.Format(PluginHelper.GetTechTitleById(upgradeTechReq8)));
                }
                sb.Append("</size>");
                sb.AppendLine();
            }

            sb.AppendLine("<color=#7fdfffff>" + Localizer.Format("#LOC_KSPIE_Generic_EnginePerformance") + ":</color><size=10>");
            sb.AppendLine(FormatStatistics(powerRequirementMk1, maxThrustMk1, thrustIspMk1));
            if (!string.IsNullOrEmpty(upgradeTechReq1))
            {
                sb.AppendLine(FormatStatistics(powerRequirementMk2, maxThrustMk2, thrustIspMk2));
            }
            if (!string.IsNullOrEmpty(upgradeTechReq2))
            {
                sb.AppendLine(FormatStatistics(powerRequirementMk3, maxThrustMk3, thrustIspMk3));
            }
            if (!string.IsNullOrEmpty(upgradeTechReq3))
            {
                sb.AppendLine(FormatStatistics(powerRequirementMk4, maxThrustMk4, thrustIspMk4));
            }
            if (!string.IsNullOrEmpty(upgradeTechReq4))
            {
                sb.AppendLine(FormatStatistics(powerRequirementMk5, maxThrustMk5, thrustIspMk5));
            }
            if (!string.IsNullOrEmpty(upgradeTechReq5))
            {
                sb.AppendLine(FormatStatistics(powerRequirementMk6, maxThrustMk6, thrustIspMk6));
            }
            if (!string.IsNullOrEmpty(upgradeTechReq6))
            {
                sb.AppendLine(FormatStatistics(powerRequirementMk7, maxThrustMk7, thrustIspMk7));
            }
            if (!string.IsNullOrEmpty(upgradeTechReq7))
            {
                sb.AppendLine(FormatStatistics(powerRequirementMk8, maxThrustMk8, thrustIspMk8));
            }
            if (!string.IsNullOrEmpty(upgradeTechReq8))
            {
                sb.AppendLine(FormatStatistics(powerRequirementMk9, maxThrustMk9, thrustIspMk9));
            }
            sb.Append("</size>");

            return(sb.ToString());
        }