Exemple #1
0
  // draw vessel config
  void render_config(Vessel v)
  {
    // do nothing if db isn' ready
    if (!DB.Ready()) return;

    // get vessel data
    vessel_data vd = DB.VesselData(v.id);

    // draw the config
    GUILayout.BeginHorizontal(row_style);
    GUILayout.Label(new GUIContent(" EC MESSAGES", icon_toggle[vd.cfg_ec]), config_style);
    if (Lib.IsClicked()) vd.cfg_ec = (vd.cfg_ec == 0 ? 1u : 0);
    GUILayout.EndHorizontal();
    GUILayout.BeginHorizontal(row_style);
    GUILayout.Label(new GUIContent(" SUPPLY MESSAGES", icon_toggle[vd.cfg_supply]), config_style);
    if (Lib.IsClicked()) vd.cfg_supply = (vd.cfg_supply == 0 ? 1u : 0);
    GUILayout.EndHorizontal();
    GUILayout.BeginHorizontal(row_style);
    GUILayout.Label(new GUIContent(" MALFUNCTIONS MESSAGES", icon_toggle[vd.cfg_malfunction]), config_style);
    if (Lib.IsClicked()) vd.cfg_malfunction = (vd.cfg_malfunction == 0 ? 1u : 0);
    GUILayout.EndHorizontal();
    GUILayout.BeginHorizontal(row_style);
    GUILayout.Label(new GUIContent(" SIGNAL MESSAGES", icon_toggle[vd.cfg_signal]), config_style);
    if (Lib.IsClicked()) vd.cfg_signal = (vd.cfg_signal == 0 ? 1u : 0);
    GUILayout.EndHorizontal();
    if (!filtered())
    {
      GUILayout.BeginHorizontal(row_style);
      GUILayout.Label(new GUIContent(" GROUP: ", icon_group), config_style, new[]{GUILayout.Width(48.0f)});
      vd.group = Lib.TextFieldPlaceholder("Kerbalism_group", vd.group, "NONE", group_style).ToUpper();
      GUILayout.EndHorizontal();
    }
    GUILayout.BeginHorizontal(row_style);
    GUILayout.Label(new GUIContent(" NOTES", icon_notes), config_style);
    if (Lib.IsClicked()) Notepad.Toggle(v);
    GUILayout.EndHorizontal();
  }
Exemple #2
0
  // draw vessel config
  void render_config(Vessel v)
  {
    // do nothing if db isn' ready
    if (!DB.Ready()) return;

    // get vessel data
    vessel_data vd = DB.VesselData(v.id);

    // draw the config
    if (Kerbalism.ec_rule != null)
    {
      GUILayout.BeginHorizontal(row_style);
      GUILayout.Label(new GUIContent(" EC MESSAGES", icon_toggle[vd.cfg_ec]), config_style);
      if (Lib.IsClicked()) vd.cfg_ec = (vd.cfg_ec == 0 ? 1u : 0);
      GUILayout.EndHorizontal();
    }
    if (Kerbalism.supply_rules.Count > 0)
    {
      GUILayout.BeginHorizontal(row_style);
      GUILayout.Label(new GUIContent(" SUPPLY MESSAGES", icon_toggle[vd.cfg_supply]), config_style);
      if (Lib.IsClicked()) vd.cfg_supply = (vd.cfg_supply == 0 ? 1u : 0);
      GUILayout.EndHorizontal();
    }
    if (Kerbalism.features.signal)
    {
      GUILayout.BeginHorizontal(row_style);
      GUILayout.Label(new GUIContent(" SIGNAL MESSAGES", icon_toggle[vd.cfg_signal]), config_style);
      if (Lib.IsClicked()) vd.cfg_signal = (vd.cfg_signal == 0 ? 1u : 0);
      GUILayout.EndHorizontal();
    }
    if (Settings.StormDuration > double.Epsilon)
    {
      GUILayout.BeginHorizontal(row_style);
      GUILayout.Label(new GUIContent(" STORM MESSAGES", icon_toggle[vd.cfg_storm]), config_style);
      if (Lib.IsClicked()) vd.cfg_storm = (vd.cfg_storm == 0 ? 1u : 0);
      GUILayout.EndHorizontal();
    }
    if (Kerbalism.features.malfunction)
    {
      GUILayout.BeginHorizontal(row_style);
      GUILayout.Label(new GUIContent(" RELIABILITY MESSAGES", icon_toggle[vd.cfg_malfunction]), config_style);
      if (Lib.IsClicked()) vd.cfg_malfunction = (vd.cfg_malfunction == 0 ? 1u : 0);
      GUILayout.EndHorizontal();
      GUILayout.BeginHorizontal(row_style);
      GUILayout.Label(new GUIContent(" HIGHLIGHT MALFUNCTIONS", icon_toggle[vd.cfg_highlights]), config_style);
      if (Lib.IsClicked()) vd.cfg_highlights = (vd.cfg_highlights == 0 ? 1u : 0);
      GUILayout.EndHorizontal();
    }
    if (Kerbalism.features.signal)
    {
      GUILayout.BeginHorizontal(row_style);
      GUILayout.Label(new GUIContent(" SHOW LINK", icon_toggle[vd.cfg_showlink]), config_style);
      if (Lib.IsClicked()) vd.cfg_showlink = (vd.cfg_showlink == 0 ? 1u : 0);
      GUILayout.EndHorizontal();
    }
    if (!filtered())
    {
      GUILayout.BeginHorizontal(row_style);
      GUILayout.Label(new GUIContent(" GROUP: ", icon_group), config_style, new[]{GUILayout.Width(48.0f)});
      vd.group = Lib.TextFieldPlaceholder("Kerbalism_group", vd.group, "NONE", group_style).ToUpper();
      GUILayout.EndHorizontal();
    }
    GUILayout.BeginHorizontal(row_style);
    GUILayout.Label(new GUIContent(" NOTES", icon_notes), config_style);
    if (Lib.IsClicked()) Notepad.Toggle(v);
    GUILayout.EndHorizontal();
    GUILayout.BeginHorizontal(row_style);
    GUILayout.Label(new GUIContent(" DETAILS", icon_info), config_style);
    if (Lib.IsClicked()) Info.Toggle(v);
    GUILayout.EndHorizontal();
  }