Exemplo n.º 1
0
        protected override string GetParameterTitle()
        {
            string bodyName  = targetBody?.CleanDisplayName() ?? "a body";
            string fieldName = RadiationField.Name(field);

            string prefix = title;

            if (!string.IsNullOrEmpty(prefix))
            {
                prefix = prefix + ": ";
            }

            if (stay_in)
            {
                return(prefix + Localizer.Format("Stay in <<1>> of <<2>>", fieldName, bodyName));
            }
            if (stay_out)
            {
                return(prefix + Localizer.Format("Do not enter <<1>> of <<2>>", fieldName, bodyName));
            }

            if (crossed_count == 0)
            {
                if (crossings_min > 0)
                {
                    return(prefix + Localizer.Format("Cross <<1>> of <<2>> at least <<3>> times", fieldName, bodyName, crossings_min));
                }
                if (crossings_max > 0)
                {
                    return(prefix + Localizer.Format("Cross <<1>> of <<2>> no more than <<3>> times", fieldName, bodyName, crossings_max));
                }
            }
            else
            {
                if (crossings_min > 0)
                {
                    return(prefix + Localizer.Format("Cross <<1>> of <<2>> at least <<3>> times (<<4>>/<<3>>)", fieldName, bodyName, crossings_min, crossed_count));
                }
                if (crossings_max > 0)
                {
                    return(prefix + Localizer.Format("Cross <<1>> of <<2>> no more than <<3>> times (<<4>>/<<3>>)", fieldName, bodyName, crossings_max, crossed_count));
                }
            }

            return(prefix + Localizer.Format("Find <<1>> of <<2>>", fieldName, bodyName));
        }
        protected override string GetParameterTitle()
        {
            string bodyName  = targetBody?.CleanDisplayName() ?? "#KerCon_ABody";
            string fieldName = RadiationField.Name(field);

            string prefix = title;

            if (!string.IsNullOrEmpty(prefix))
            {
                prefix = prefix + ": ";
            }

            if (stay_in)
            {
                return(prefix + Localizer.Format("#KerCon_StayInXofY", fieldName, bodyName));                // Stay in <<1>> of <<2>>
            }
            if (stay_out)
            {
                return(prefix + Localizer.Format("#KerCon_StayOutOfXofY", fieldName, bodyName));                // Do not enter <<1>> of <<2>>
            }
            if (crossed_count == 0)
            {
                if (crossings_min > 0)
                {
                    return(prefix + Localizer.Format("#KerCon_CrossXofYatLeastZtimes", fieldName, bodyName, crossings_min));
                }
                if (crossings_max > 0)
                {
                    return(prefix + Localizer.Format("#KerCon_CrossXofYatMostZtimes", fieldName, bodyName, crossings_max));
                }
            }
            else
            {
                if (crossings_min > 0)
                {
                    return(prefix + Localizer.Format("#KerCon_CrossXofYatLeastZtimes_n", fieldName, bodyName, crossings_min, crossed_count));
                }
                if (crossings_max > 0)
                {
                    return(prefix + Localizer.Format("#KerCon_CrossXofYatMostZtimes_n", fieldName, bodyName, crossings_max, crossed_count));
                }
            }

            return(prefix + Localizer.Format("#KerCon_FindXofY", fieldName, bodyName));
        }
        protected override string GetParameterTitle()
        {
            string bodyName  = targetBody?.CleanDisplayName() ?? "#KerCon_ABody";            // a body
            string fieldName = RadiationField.Name(field);

            string prefix = title;

            if (!string.IsNullOrEmpty(prefix))
            {
                prefix = prefix + ":\n - ";
            }

            if (crossed_count == 0)
            {
                if (crossings_min > 0)
                {
                    return(prefix + Localizer.Format("#KerCon_CrossXofYatLeastZtimes", fieldName, bodyName, crossings_min));                    // Cross <<1>> of <<2>> at least <<3>> times
                }
                if (crossings_max > 0)
                {
                    return(prefix + Localizer.Format("#KerCon_CrossXofYatMostZtimes", fieldName, bodyName, crossings_max));                    // Cross <<1>> of <<2>> no more than <<3>> times
                }
            }
            else
            {
                if (crossings_min > 0)
                {
                    return(prefix + Localizer.Format("#KerCon_CrossXofYatLeastZtimes_n", fieldName, bodyName, crossings_min, crossed_count));                    // Cross <<1>> of <<2>> at least <<3>> times (<<4>>/<<3>>)
                }
                if (crossings_max > 0)
                {
                    return(prefix + Localizer.Format("#KerCon_CrossXofYatMostZtimes_n", fieldName, bodyName, crossings_max, crossed_count));                    // Cross <<1>> of <<2>> no more than <<3>> times (<<4>>/<<3>>)
                }
            }

            return(prefix + Localizer.Format("#KerCon_FindXofY", fieldName, bodyName));            // Find <<1>> of <<2>>
        }
        private static void ShowMessage(CelestialBody body, bool wasVisible, bool visible, RadiationFieldType field)
        {
            if (visible && !wasVisible)
            {
                StringBuilder sb      = new StringBuilder(256);
                string        message = Lib.BuildString("<b>", body.bodyName, ": <color=#8BED8B>", RadiationField.Name(field), "</color> researched</b>");
                sb.Append(message);
                sb.Append("\n\n");

                var bd = Instance.BodyData(body);

                API.Message(sb.ToString());

                MessageSystem.Message m = new MessageSystem.Message("Radiation Field Researched", sb.ToString(), MessageSystemButton.MessageButtonColor.GREEN, MessageSystemButton.ButtonIcons.ACHIEVE);
                MessageSystem.Instance.AddMessage(m);
            }
        }
        private static void ShowMessage(CelestialBody body, bool wasVisible, bool visible, RadiationFieldType field)
        {
            if (visible && !wasVisible)
            {
                StringBuilder sb      = new StringBuilder(256);
                string        message = Localizer.Format("#KerCon_FieldXofYresearched",          // <<1>>: <<2>> researched
                                                         Lib.Bold(body.bodyName), Lib.Color(RadiationField.Name(field), Lib.Kolor.Science));
                sb.Append(message);
                sb.Append("\n\n");
                sb.Append(Localizer.Format("#KerCon_FieldResearchedMessage"));

                var bd = Instance.BodyData(body);

                API.Message(sb.ToString());

                MessageSystem.Message m = new MessageSystem.Message("#KerCon_FieldResearched", sb.ToString(), MessageSystemButton.MessageButtonColor.GREEN, MessageSystemButton.ButtonIcons.ACHIEVE);
                MessageSystem.Instance.AddMessage(m);
            }
        }
 protected override string RequirementText()
 {
     return(targetBody.name + " has " + RadiationField.Name(field));
 }
Exemplo n.º 7
0
 protected override string RequirementText()
 {
     return(Localizer.Format("#KerCon_XhasY", targetBody.name, RadiationField.Name(field)));
 }