示例#1
0
        public void ShowSynopsis()
        {
            //Set info text
            infoView.ModuleInfo = this.GetInfo();

            //Show view
            infoView.SetVisible(true);
        }
示例#2
0
        public void GetModuleInfo()
        {
            if (outputList.Count == 0)
            {
                prepareOutputs();
            }

            infoView.WindowTitle = "Prospector";
            infoView.ModuleInfo  = base.GetInfo();
            infoView.SetVisible(true);
        }
示例#3
0
        public void showAssemblyRequirements()
        {
            StringBuilder requirementsList = new StringBuilder();
            string        templateName     = "";

            //If we have a template then be sure to list its requirements.
            //Template name
            if (CurrentTemplate.HasValue("title"))
            {
                templateName = CurrentTemplate.GetValue("title");
            }
            else
            {
                templateName = CurrentTemplate.GetValue("name");
            }
            if (templateName.ToLower() != "empty")
            {
                requirementsList.AppendLine("Configuration: " + templateName);
            }

            //Resource Requirements.
            buildInputList(templateName);
            string[] keys = inputList.Keys.ToArray();
            for (int index = 0; index < keys.Length; index++)
            {
                requirementsList.Append(keys[index]);
                requirementsList.Append(": ");
                requirementsList.AppendLine(string.Format("{0:f2}", inputList[keys[index]]));
            }

            if (keys.Length == 0)
            {
                requirementsList.AppendLine("No resource requirements");
            }

            InfoView infoView = new InfoView();

            infoView.ModuleInfo = requirementsList.ToString();
            infoView.SetVisible(true);
        }
示例#4
0
        public void ShowResourceOutputs()
        {
            StringBuilder outputInfo = new StringBuilder();

            //Make sure we're up to date.
            this.OnUpdate();

            if (Utils.IsBiomeUnlocked(this.part.vessel) == false)
            {
                outputInfo.Append("<color=white><b>Unlock the biome to get the list of outputs.</b></color>");
            }

            else
            {
                if (IsSituationValid())
                {
                    int           count = resourceRatios.Count;
                    ResourceRatio output;
                    for (int index = 0; index < count; index++)
                    {
                        output = resourceRatios[index];
                        outputInfo.Append("<color=white>");
                        outputInfo.Append(formatResource(output.ResourceName, output.Ratio));
                        outputInfo.AppendLine("</color>");
                    }
                }

                else
                {
                    outputInfo.AppendLine("<color=white><b>Requires one of:</b></color>");

                    foreach (HarvestTypes harvestType in this.harvestTypeList)
                    {
                        switch (harvestType)
                        {
                        case HarvestTypes.Atmospheric:
                            outputInfo.AppendLine("<color=white>Flying</color>");
                            break;

                        case HarvestTypes.Oceanic:
                            outputInfo.AppendLine("<color=white>In water</color>");
                            break;

                        case HarvestTypes.Exospheric:
                            outputInfo.AppendLine("<color=white>In Space</color>");
                            break;

                        default:
                            outputInfo.AppendLine("<color=white>On the ground</color>");
                            break;
                        }
                    }
                }
            }

            //Setup info view
            infoView             = new InfoView();
            infoView.WindowTitle = this.part.partInfo.title;
            infoView.ModuleInfo  = outputInfo.ToString();
            infoView.SetVisible(true);
        }
 public void GetModuleInfo()
 {
     infoView.SetVisible(true);
 }