public NavPath Copy() { var node = new ConfigNode(NODE_NAME); var path = new NavPath(); Save(node); path.Load(node); return(path); }
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; } }
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(); }
public void SavePath(NavPath path) { DB[path.Name] = path.Copy(); }