Example #1
0
        string AirTightCheck(IMyBlockGroup ventBlocks, IMyTextSurface disp)
        {
            List <IMyAirVent> airVents = new List <IMyAirVent>();

            ventBlocks.GetBlocksOfType <IMyAirVent>(airVents);

            Color         fontColor = new Color(0, 150, 0);
            StringBuilder sb        = new StringBuilder();

            sb.AppendLine("Air Integrity Status");
            sb.AppendLine("--------------------");
            foreach (IMyAirVent av in airVents)
            {
                VentStatus ventStatus = av.Status;

                sb.AppendLine($"{av.CustomName}: {ventStatus.ToString()}");
                if (ventStatus == VentStatus.Depressurized || ventStatus == VentStatus.Depressurizing)
                {
                    disp.FontColor = Color.Red;
                }
                else
                {
                    disp.FontColor = fontColor;
                }
            }
            return(sb.ToString());
        }
Example #2
0
            public override string ToText(MonitorContent content)
            {
                switch (content.Subtype)
                {
                case "stat": return(EnumToText((int)VentStatus, VentStatus.ToString(), content));

                case "pressurized": return(BoolToText(Pressurized, "Pressurized", "", content));

                case "depressurized": return(BoolToText(Depressurized, "Depressurized", "", content));

                case "can": return(BoolToText(CanPressurize, "Can Pressurize", "", content));

                case "mode": return(BoolToText(Depressurize, "Depressurize", "Pressurize", content));

                case "enable": return(BoolToText(PressurizationEnabled, "Pressurization Enabled", "", content));

                default: return(base.ToText(content));
                }
            }