public NavPath Copy()
        {
            var node = new ConfigNode(NODE_NAME);
            var path = new NavPath();

            Save(node);
            path.Load(node);
            return(path);
        }
Esempio n. 2
0
 public override void Load(ConfigNode node)
 {
     DB.Clear();
     base.Load(node);
     foreach (var n in node.GetNodes(NavPath.NODE_NAME))
     {
         var path = new NavPath();
         path.Load(n);
         DB[path.Name] = path;
     }
 }
Esempio n. 3
0
        protected override void DrawThis()
        {
            var title = Name;

            if (Path.Count > 0)
            {
                title += " (waypoints stored)";
            }
            GUILayout.BeginHorizontal();
            if (Edit)
            {
                Edit &= !GUILayout.Button(title, Styles.active_button, GUILayout.ExpandWidth(false));
                if (EditedCFG != null && GUILayout.Button("Copy waypoints from Vessel",
                                                          Styles.active_button, GUILayout.ExpandWidth(false)))
                {
                    Path = EditedCFG.Path.Copy();
                }
            }
            else
            {
                Edit |= GUILayout.Button(title, Styles.normal_button) && EditedCFG != null;
            }
            GUILayout.EndHorizontal();
        }
Esempio n. 4
0
 public void SavePath(NavPath path)
 {
     DB[path.Name] = path.Copy();
 }