void render_reliability(reliability_data reliability, crew_data crew) { render_title("RELIABILITY"); render_content("malfunctions", Lib.ValueOrNone(reliability.failure_year, "/y"), "per-component average case estimate"); render_content("redundancy", reliability.redundancy); render_content("quality", Malfunction.QualityToString(reliability.quality), "manufacturing quality"); render_content("engineer", crew.engineer ? "yes" : "no"); render_space(); }
GUIContent indicator_reliability(Vessel v) { GUIContent state = new GUIContent(); uint max_malfunctions = Malfunction.MaxMalfunction(v); if (max_malfunctions == 0) { state.image = icon_malfunction_nominal; state.tooltip = "No malfunctions"; } else if (max_malfunctions == 1) { state.image = icon_malfunction_warning; state.tooltip = "Minor malfunctions"; } else { state.image = icon_malfunction_danger; state.tooltip = "Major malfunctions"; } double avg_quality = Malfunction.AverageQuality(v); if (avg_quality > 0.0) state.tooltip += "\n<i>Quality: " + Malfunction.QualityToString(avg_quality) + "</i>"; return state; }