diff --git a/AGExt/Editor.cs b/AGExt/Editor.cs index 8284ed4..0b30a97 100644 --- a/AGExt/Editor.cs +++ b/AGExt/Editor.cs @@ -16,6 +16,7 @@ namespace ActionGroupsExtended [KSPAddon(KSPAddon.Startup.EditorAny, false)] public class AGXEditor : PartModule { + bool defaultShowingNonNumeric = false; //are we in non-numeric (abort/brakes/gear/list) mode? List defaultActionsListThisType; //list of default actions showing in group win when non-numeric List defaultActionsListAll; //list of all default actions on vessel, only used in non-numeric mode when going to other mode @@ -31,6 +32,7 @@ public class AGXEditor : PartModule private List SelectedWithSym; //selected parts from last frame for Default actions monitoring private List SelectedWithSymActions; //monitor baseaction.actiongroups of selected parts + private KSPActionGroup actionGroupLastFrame; //used when monitoring KSP default editor for actions, remember selected group last frame. public static bool NeedToLoadActions = true; public static bool LoadFinished = false; //Selected Parts Window Variables @@ -121,6 +123,7 @@ public class AGXEditor : PartModule Texture2D PartPlus = new Texture2D(21, 21); bool showAllPartsList = false; //show list of all parts in group window? List showAllPartsListTitles; //list of all parts with actions to show in group window + KSPActionGroup KSPDefaultLastActionGroup = KSPActionGroup.Custom01; //static Part partLastHighlight = null; ////static Color partHighlighLastColor; //static Part.HighlightType partHighlightLastType; @@ -288,6 +291,7 @@ public void Start() EditorLogic.fetch.launchBtn.AddValueChangedDelegate(OnSaveButtonClick); EditorLogic.fetch.exitBtn.AddValueChangedDelegate(OnSaveButtonClick); EditorLogic.fetch.newBtn.AddValueChangedDelegate(OnSaveButtonClick); + //GameEvents.onGameSceneLoadRequested.Add(LeavingEditor); errLine = "18"; IsGroupToggle = new Dictionary(); @@ -369,6 +373,7 @@ public void Start() EditorLoadFromNode(); errLine = "21"; //print("Loading now"); + //EditorActionGroups.Instance.groupActionsList.AddValueChangedDelegate(OnGroupActionsListChange); LoadFinished = true; } catch(Exception e) @@ -377,6 +382,13 @@ public void Start() } } + //public void OnGroupActionsListChange(IUIObject obj) + //{ + // print("List change " + obj.GetType()); + // UIScrollList lst = (UIScrollList)obj; + // print(lst. + //} + public void PartAttaching(GameEvents.HostTargetAction host_target) { // print("Part attached! " + host_target.host.ConstructID + " " + host_target.target.ConstructID); @@ -2118,10 +2130,12 @@ public void GroupsWindow(int WindowID) { if (p.partInfo.title == partNameToSelect) { - AGEditorSelectedParts.Add(new AGXPart(p)); + + AGEditorSelectedParts.Add(new AGXPart(p)); + } } - AGEditorSelectedParts.RemoveAll(p2 => p2.AGPart.name != AGEditorSelectedParts.First().AGPart.name); //error trap just incase two parts have the same title, they can't have the same name + //AGEditorSelectedParts.RemoveAll(p2 => p2.AGPart.name != AGEditorSelectedParts.First().AGPart.name); //error trap just incase two parts have the same title, they can't have the same name PartActionsList.Clear(); //populate actions list from selected parts PartActionsList.AddRange(AGEditorSelectedParts.First().AGPart.Actions); foreach (PartModule pm in AGEditorSelectedParts.First().AGPart.Modules) @@ -2632,7 +2646,7 @@ public void Update() } - if (EditorLogic.fetch.editorScreen == EditorLogic.EditorScreen.Actions) + if (EditorLogic.fetch.editorScreen == EditorLogic.EditorScreen.Actions && !AGXShow) { MonitorDefaultActions(); } @@ -2650,11 +2664,39 @@ public void Update() //PrintPartPos(); //PrintPartActs(); //PrintSelectedPart(); + //print(CurrentVesselActions.Count); } public void PrintSelectedPart() { - //print("Selpart " + EditorLogic.fetch.UndoRedo()); + if (DateTime.Now.Second.ToString().Substring(DateTime.Now.Second.ToString().Length - 1, 1) == "0") + { + print("All true"); + foreach (Part p in EditorLogic.SortedShipList) + { + foreach (PartModule pm in p.Modules) + { + foreach (BaseAction ba in pm.Actions) + { + ba.active = true; + } + } + } + } + if (DateTime.Now.Second.ToString().Substring(DateTime.Now.Second.ToString().Length - 1, 1) == "5") + { + print("All false"); + foreach (Part p in EditorLogic.SortedShipList) + { + foreach (PartModule pm in p.Modules) + { + foreach (BaseAction ba in pm.Actions) + { + ba.active = false; + } + } + } + } } public void PrintPartActs() @@ -2704,13 +2746,36 @@ public void PrintPartPos() public void MonitorDefaultActions() { //print("2a"); + KSPActionGroup KSPDefaultActionGroupThisFrame = KSPActionGroup.Custom01; + try //find which action group is selected in default ksp editor this pass + { + string grpText = "None"; + for (int i = 0; i < EditorActionGroups.Instance.actionGroupList.Count; i++) + { + IUIListObject lObj = EditorActionGroups.Instance.actionGroupList.GetItem(i); + UIListItem LstItem = (UIListItem)lObj; + if (LstItem.controlState == UIButton.CONTROL_STATE.ACTIVE) + { + grpText = LstItem.Text; + } + } + + KSPDefaultActionGroupThisFrame = (KSPActionGroup)Enum.Parse(typeof(KSPActionGroup), grpText); + //print("Selected group " + KSPDefaultLastActionGroup); + + } + catch + { + print("Monitor default list fail"); + } + if (EditorActionGroups.Instance.GetSelectedParts() != null) //is a part selected? { if (EditorActionGroups.Instance.GetSelectedParts().Count > 0) //list can exist with no parts in it if you selected then unselect one { - - if(SelectedWithSym.Count == 0 || SelectedWithSym.First() != EditorActionGroups.Instance.GetSelectedParts().First()) //check if there is a previously selected part, if so check if its changed + + if (SelectedWithSym.Count == 0 || SelectedWithSym.First() != EditorActionGroups.Instance.GetSelectedParts().First() || KSPDefaultActionGroupThisFrame != KSPDefaultLastActionGroup) //check if there is a previously selected part, if so check if its changed { //print("2b"); //parts are different @@ -2735,12 +2800,56 @@ public void MonitorDefaultActions() } } } + int groupToAdd = 1; + switch (KSPDefaultActionGroupThisFrame) + { + case KSPActionGroup.Custom01: + groupToAdd = 1; + break; + case KSPActionGroup.Custom02: + groupToAdd = 2; + break; + case KSPActionGroup.Custom03: + groupToAdd = 3; + break; + case KSPActionGroup.Custom04: + groupToAdd = 4; + break; + case KSPActionGroup.Custom05: + groupToAdd = 5; + break; + case KSPActionGroup.Custom06: + groupToAdd = 6; + break; + case KSPActionGroup.Custom07: + groupToAdd = 7; + break; + case KSPActionGroup.Custom08: + groupToAdd = 8; + break; + case KSPActionGroup.Custom09: + groupToAdd = 9; + break; + case KSPActionGroup.Custom10: + groupToAdd = 10; + break; + } + + foreach(AGXAction agact2 in CurrentVesselActions.Where(ag => ag.group == groupToAdd)) + { + SelectedWithSymActions.Add(new AGXDefaultCheck() { ba = agact2.ba, agrp = agact2.ba.actionGroup }); + } + KSPDefaultLastActionGroup = KSPDefaultActionGroupThisFrame; + //foreach (AGXDefaultCheck dC in SelectedWithSymActions) + //{ + // print("Acts " + dC.ba.name); + //} // print("2e"); } else //selected part is the same a previously selected part { - // print("2f"); + //print("2f"); List PartsThisFrame = new List(); //get list of parts this update frame PartsThisFrame.AddRange(EditorActionGroups.Instance.GetSelectedParts()); PartsThisFrame.AddRange(EditorActionGroups.Instance.GetSelectedParts().First().symmetryCounterparts); @@ -2761,9 +2870,53 @@ public void MonitorDefaultActions() } } } + + int groupToAdd = 1; + switch (KSPDefaultActionGroupThisFrame) + { + case KSPActionGroup.Custom01: + groupToAdd = 1; + break; + case KSPActionGroup.Custom02: + groupToAdd = 2; + break; + case KSPActionGroup.Custom03: + groupToAdd = 3; + break; + case KSPActionGroup.Custom04: + groupToAdd = 4; + break; + case KSPActionGroup.Custom05: + groupToAdd = 5; + break; + case KSPActionGroup.Custom06: + groupToAdd = 6; + break; + case KSPActionGroup.Custom07: + groupToAdd = 7; + break; + case KSPActionGroup.Custom08: + groupToAdd = 8; + break; + case KSPActionGroup.Custom09: + groupToAdd = 9; + break; + case KSPActionGroup.Custom10: + groupToAdd = 10; + break; + } + + foreach (AGXAction agact2 in CurrentVesselActions.Where(ag => ag.group == groupToAdd)) + { + ThisFrameActions.Add(agact2.ba); + } + + + + //print("2i"); - foreach (BaseAction ba2 in ThisFrameActions) //check each action's actiongroup enum against last update frames actiongroup enum + foreach (BaseAction ba2 in ThisFrameActions) //check each action's actiongroup enum against last update frames actiongroup enum, this adds/removes a group to default KSP when added/removed in agx { //print("2j"); AGXDefaultCheck ActionLastFrame = new AGXDefaultCheck(); @@ -2812,7 +2965,7 @@ public void MonitorDefaultActions() } else if (KSPActionGroup.Custom10 == (ActionLastFrame.agrp ^ ba2.actionGroup)) { - NewGroup = 10; + NewGroup = 10; } // print("2k"); @@ -2820,6 +2973,16 @@ public void MonitorDefaultActions() if (NewGroup != 0) //if one of the other actiongroups (gear, lights) has changed, ignore it. newgroup will be the actiongroup if I want to process it. { + // print("Newgroup called on " + NewGroup); + if (Mouse.screenPos.x >= 130 && Mouse.screenPos.x <= 280) + { + //print("remove actions"); + //AGXAction ToRemove = new AGXAction() { prt = ba2.listParent.part, ba = ba2, group = NewGroup, activated = false }; + CurrentVesselActions.RemoveAll(ag3 => ag3.ba == ba2 && ag3.group == NewGroup); + } + else + { + //print("add actions"); AGXAction ToAdd = new AGXAction() { prt = ba2.listParent.part, ba = ba2, group = NewGroup, activated = false }; List Checking = new List(); Checking.AddRange(CurrentVesselActions); @@ -2832,16 +2995,17 @@ public void MonitorDefaultActions() CurrentVesselActions.Add(ToAdd); //SaveCurrentVesselActions(); } + } } ActionLastFrame.agrp = KSPActionGroup.None; ActionLastFrame.agrp = ActionLastFrame.agrp | ba2.actionGroup; - // print("2l"); + //print("2l"); } } SelectedWithSymActions.Clear(); //reset actions list as one of the enums changed. - // print("2k"); + //print("2k"); foreach (Part prt in SelectedWithSym) { @@ -2857,10 +3021,19 @@ public void MonitorDefaultActions() } } } + + foreach (AGXAction agact2 in CurrentVesselActions.Where(ag => ag.group == groupToAdd)) + { + SelectedWithSymActions.Add(new AGXDefaultCheck() { ba = agact2.ba, agrp = agact2.ba.actionGroup }); + } + + + } } } - // print("2l"); + //print("2l " + Mouse.screenPos); + } public static void EditorLoadFromFile() diff --git a/AGExt/Flight.cs b/AGExt/Flight.cs index fda0747..881af96 100644 --- a/AGExt/Flight.cs +++ b/AGExt/Flight.cs @@ -2738,7 +2738,7 @@ public void GroupsWindow(int WindowID) AGEditorSelectedParts.Add(new AGXPart(p)); } } - AGEditorSelectedParts.RemoveAll(p2 => p2.AGPart.name != AGEditorSelectedParts.First().AGPart.name); //error trap just incase two parts have the same title, they can't have the same name + //AGEditorSelectedParts.RemoveAll(p2 => p2.AGPart.name != AGEditorSelectedParts.First().AGPart.name); //error trap just incase two parts have the same title, they can't have the same name PartActionsList.Clear(); //populate actions list from selected parts PartActionsList.AddRange(AGEditorSelectedParts.First().AGPart.Actions); foreach (PartModule pm in AGEditorSelectedParts.First().AGPart.Modules) @@ -3106,7 +3106,7 @@ public void LoadGroupNames(string namesToLoad, bool doReset) //LoadNames = (string)pm.Fields.GetValue("AGXNames"); //print("AGX Load Name: "+ p.partName+ " " + LoadNames); - + // print("Loadnames " + LoadNames); if (LoadNames.Length > 0) //also update PartVesselCheck method { while (LoadNames[0] == '\u2023') @@ -3130,9 +3130,10 @@ public void LoadGroupNames(string namesToLoad, bool doReset) LoadNames = LoadNames.Substring(LoadNames.IndexOf('\u2023')); } - - if (AGXguiNames[groupNum].Length == 0) + //print(groupName + " || " + AGXguiNames[groupNum] + " " + groupNum); + if (AGXguiNames[groupNum].Length < 1) { + //print("Add name in"); AGXguiNames[groupNum] = groupName; } @@ -3227,7 +3228,7 @@ public void AddSelectedPart(Part p) public void DockingEvent() { //print("call dockingevent"); - CurrentVesselActions.Clear(); + CurrentVesselActions.Clear(); bool ShowAmbiguousMessage = true; ConfigNode newVsl = new ConfigNode(); //get new vessel root for vessel info @@ -3276,7 +3277,7 @@ public void DockingEvent() //print("Nodes end!"); foreach (ConfigNode vslNode in NodesToAdd) //cycle through all nodes to add, { - LoadGroupNames(newVsl.GetValue("groupNames"), false); + LoadGroupNames(vslNode.GetValue("groupNames"), false); foreach (ConfigNode prtNode in vslNode.nodes) //cycle through each part { @@ -3370,6 +3371,7 @@ public void Update() errLine = "8"; if (AGXRoot != FlightGlobals.ActiveVessel.rootPart) //root part change, refresh stuff { + print("AGX Root change"); bool isDocking = false; bool isUndocking = false; try @@ -3377,23 +3379,23 @@ public void Update() if (FlightGlobals.ActiveVessel.parts.Contains(AGXRoot)) { isDocking = true; - print("Is a dock " + AGXRoot.ConstructID + " " + FlightGlobals.ActiveVessel.rootPart.ConstructID); + print("AGX: Is a dock ");// + AGXRoot.ConstructID + " " + FlightGlobals.ActiveVessel.rootPart.ConstructID); } else if (oldShipParts.Contains(FlightGlobals.ActiveVessel.rootPart)) { isUndocking = true; - print("is an undock"); + print("AGX: is an undock"); //only clear actions if not a docking event } else { - print("vessel switch"); + print("AGX: vessel switch"); //CurrentVesselActions.Clear(); } } catch { - print("something was null in docking check"); + print("AGX: something was null in docking check"); } errLine = "8a"; //print("Root part changed, AGX reloading"); @@ -3579,22 +3581,23 @@ public void Update() //} else if (AGXEditorNode.HasNode(AGextScenario.EditorHashShipName(FlightGlobals.ActiveVessel.vesselName, checkIsVab))) { - print("AGX VAB1"); + print("AGX VAB1 ");// + FlightGlobals.ActiveVessel.vesselName + " " + FlightGlobals.ActiveVessel.rootPart.ConstructID); vslNode = AGXEditorNode.GetNode(AGextScenario.EditorHashShipName(FlightGlobals.ActiveVessel.vesselName, checkIsVab)); - vslNode.name = FlightGlobals.ActiveVessel.id.ToString(); + vslNode.name = FlightGlobals.ActiveVessel.rootPart.flightID.ToString(); AGXFlightNode.AddNode(vslNode); + // print("node check " + vslNode.ToString()); } else if (AGXEditorNode.HasNode(AGextScenario.EditorHashShipName(FlightGlobals.ActiveVessel.vesselName, !checkIsVab))) { print("AGX vab2"); vslNode = AGXEditorNode.GetNode(AGextScenario.EditorHashShipName(FlightGlobals.ActiveVessel.vesselName, !checkIsVab)); - vslNode.name = FlightGlobals.ActiveVessel.id.ToString(); + vslNode.name = FlightGlobals.ActiveVessel.rootPart.flightID.ToString(); AGXFlightNode.AddNode(vslNode); } else { print("AGX notfound"); - vslNode = new ConfigNode(FlightGlobals.ActiveVessel.id.ToString()); + vslNode = new ConfigNode(FlightGlobals.ActiveVessel.rootPart.flightID.ToString()); vslNode.AddValue("name", FlightGlobals.ActiveVessel.vesselName); vslNode.AddValue("currentKeyset", "1"); vslNode.AddValue("groupNames", ""); @@ -3644,6 +3647,7 @@ public void Update() { ShowAmbiguousMessage2 = false; } + //print("gamepart " + gamePart.ConstructID + " " + partDist); foreach (ConfigNode actNode in prtNode.nodes) { //print("node " + actNode + " " + gamePart.ConstructID); @@ -3736,6 +3740,7 @@ public void Update() loadFinished = true; //print("sit " + FlightGlobals.ActiveVessel.situation.ToString()); errLine = "23"; + FlightSaveToFile(AGXFlightNode);//add save current vessel here } } errLine = "24"; @@ -3898,7 +3903,7 @@ public void PrintPartActs() { partActs.AddRange(pm.Actions); } - print(p.ConstructID); + //print(p.ConstructID); foreach (BaseAction ba in partActs) { print(ba.listParent.module.moduleName + " " + ba.name + " " + ba.guiName); @@ -3915,17 +3920,18 @@ public void PrintPartActs() public void PrintPartPos() { + print("begin update pos " + CurrentVesselActions.Count); try { foreach (Part p in FlightGlobals.ActiveVessel.Parts) { - print(p.ConstructID + " " + p.orgPos + " " + p.vessel.rootPart.transform.InverseTransformPoint(p.transform.position) + " " + p.orgRot); + print(p.ConstructID); } } catch { - print("Print fail!"); + print("Print fail on pos!"); } } @@ -4025,7 +4031,7 @@ public void partDead(Part p) RefreshCurrentActions(); } - public void DockingEvent(GameEvents.HostTargetAction htAct) //docking event happend, merge two vessel actions + public void DockingEventggg(GameEvents.HostTargetAction htAct) //docking event happend, merge two vessel actions //never called, ggg voids it { //print("undock " + htAct.host.vessel.rootPart.ConstructID + " " + htAct.target.vessel.rootPart.ConstructID); @@ -4039,14 +4045,14 @@ public void DockingEvent(GameEvents.HostTargetAction htAct) //dockin //print(vsl1.id + " " + vsl2.id); if (vsl1 != vsl2) //check to make sure this is not the same vessel docking to itself somehow, both vsl1 and vsl2 would be FG.AC then. { - print("Docking event!"); + print("Old Docking event!"); overrideRootChange = true; if (vsl1 == FlightGlobals.ActiveVessel || vsl2 == FlightGlobals.ActiveVessel) //check to make sure at least one vessel is FG.AC Not sure how a docking event could happen when neither vessel is active but make sure { - if (AGXFlightNode.HasNode(vsl1.id.ToString())) + if (AGXFlightNode.HasNode(vsl1.rootPart.flightID.ToString())) { // print("vsl1 found"); - ConfigNode vsl1Node = AGXFlightNode.GetNode(vsl1.id.ToString()); + ConfigNode vsl1Node = AGXFlightNode.GetNode(vsl1.rootPart.flightID.ToString()); foreach (ConfigNode prtNode in vsl1Node.nodes) { @@ -4100,10 +4106,10 @@ public void DockingEvent(GameEvents.HostTargetAction htAct) //dockin } } - if (AGXFlightNode.HasNode(vsl2.id.ToString())) + if (AGXFlightNode.HasNode(vsl2.rootPart.flightID.ToString())) { //print("vsl2 found"); - ConfigNode vsl2Node = AGXFlightNode.GetNode(vsl2.id.ToString()); + ConfigNode vsl2Node = AGXFlightNode.GetNode(vsl2.rootPart.flightID.ToString()); foreach (ConfigNode prtNode in vsl2Node.nodes) { @@ -4187,9 +4193,9 @@ public void PartCheckTemp() } else if (prtCheck.prt.vessel != prtCheck.pVsl) { - if (prtCheck.prt.vessel == FlightGlobals.ActiveVessel && AGXFlightNode.HasNode(prtCheck.prt.vessel.id.ToString())) //if the part changing is part of the active vessel, ensure the save node is up to date + if (prtCheck.prt.vessel == FlightGlobals.ActiveVessel && AGXFlightNode.HasNode(prtCheck.prt.vessel.rootPart.flightID.ToString())) //if the part changing is part of the active vessel, ensure the save node is up to date { - ConfigNode vslUpdate = AGXFlightNode.GetNode(prtCheck.prt.vessel.id.ToString()); + ConfigNode vslUpdate = AGXFlightNode.GetNode(prtCheck.prt.vessel.rootPart.flightID.ToString()); if (vslUpdate.HasValue("name")) { vslUpdate.RemoveValue("name"); @@ -4215,13 +4221,13 @@ public void PartCheckTemp() vslUpdate.RemoveValue("groupVisibilityNames"); } vslUpdate.AddValue("groupVisibilityNames", SaveGroupVisibilityNames("")); - AGXFlightNode.RemoveNode(prtCheck.prt.vessel.id.ToString()); + AGXFlightNode.RemoveNode(prtCheck.prt.vessel.rootPart.flightID.ToString()); AGXFlightNode.AddNode(vslUpdate); } - if (prtCheck.pVsl == FlightGlobals.ActiveVessel && AGXFlightNode.HasNode(prtCheck.pVsl.id.ToString())) //if the part changing is part of the active vessel, ensure the save node is up to date + if (prtCheck.pVsl == FlightGlobals.ActiveVessel && AGXFlightNode.HasNode(prtCheck.pVsl.rootPart.flightID.ToString())) //if the part changing is part of the active vessel, ensure the save node is up to date { - ConfigNode vslUpdate = AGXFlightNode.GetNode(prtCheck.pVsl.id.ToString()); + ConfigNode vslUpdate = AGXFlightNode.GetNode(prtCheck.pVsl.rootPart.flightID.ToString()); if (vslUpdate.HasValue("name")) { vslUpdate.RemoveValue("name"); @@ -4247,15 +4253,15 @@ public void PartCheckTemp() vslUpdate.RemoveValue("groupVisibilityNames"); } vslUpdate.AddValue("groupVisibilityNames", SaveGroupVisibilityNames("")); - AGXFlightNode.RemoveNode(prtCheck.pVsl.id.ToString()); + AGXFlightNode.RemoveNode(prtCheck.pVsl.rootPart.flightID.ToString()); AGXFlightNode.AddNode(vslUpdate); } - - if(AGXFlightNode.HasNode(prtCheck.prt.vessel.id.ToString()) && AGXFlightNode.HasNode(prtCheck.pVsl.id.ToString())) + + if (AGXFlightNode.HasNode(prtCheck.prt.vessel.rootPart.flightID.ToString()) && AGXFlightNode.HasNode(prtCheck.pVsl.rootPart.flightID.ToString())) { //both ships exist in node, combine groupnames - ConfigNode mainVsl = AGXFlightNode.GetNode(prtCheck.prt.vessel.id.ToString()); - ConfigNode secVsl = AGXFlightNode.GetNode(prtCheck.pVsl.id.ToString()); + ConfigNode mainVsl = AGXFlightNode.GetNode(prtCheck.prt.vessel.rootPart.flightID.ToString()); + ConfigNode secVsl = AGXFlightNode.GetNode(prtCheck.pVsl.rootPart.flightID.ToString()); string LoadNames1 = mainVsl.GetValue("groupNames"); string LoadNames2 = secVsl.GetValue("groupNames"); Dictionary Names1 = new Dictionary(); @@ -4343,9 +4349,9 @@ public void PartCheckTemp() prtCheck.pVsl = prtCheck.prt.vessel; } - else if (AGXFlightNode.HasNode(prtCheck.pVsl.id.ToString())) + else if (AGXFlightNode.HasNode(prtCheck.pVsl.rootPart.flightID.ToString())) { - ConfigNode newVsl = new ConfigNode(prtCheck.prt.vessel.id.ToString()); + ConfigNode newVsl = new ConfigNode(prtCheck.prt.vessel.rootPart.flightID.ToString()); //if(RootParts.HasNode(prtCheck.prt.vessel.rootPart.flightID.ToString())) //{ // ConfigNode existRoot = RootParts.GetNode(prtCheck.prt.vessel.rootPart.flightID.ToString()); @@ -4357,7 +4363,7 @@ public void PartCheckTemp() //else //{ - ConfigNode oldVsl = AGXFlightNode.GetNode(prtCheck.pVsl.id.ToString()); + ConfigNode oldVsl = AGXFlightNode.GetNode(prtCheck.pVsl.rootPart.flightID.ToString()); newVsl.AddValue("currentKeyset",oldVsl.GetValue("currentKeyset")); newVsl.AddValue("groupNames", oldVsl.GetValue("groupNames")); diff --git a/AGExt/Instantly.cs b/AGExt/Instantly.cs index f86e423..7516a9a 100644 --- a/AGExt/Instantly.cs +++ b/AGExt/Instantly.cs @@ -15,7 +15,7 @@ public class AGXMainMenu :PartModule public void Start() { - print("AGExt Ver. 1.21a loaded"); + print("AGExt Ver. 1.22 loaded"); //below no longer needed with InputLockManager //AGXguiKeys = new Dictionary(); //AGExtNode = ConfigNode.Load(KSPUtil.ApplicationRootPath + "GameData/Diazo/AGExt/AGExt.cfg"); diff --git a/AGExt/Scenario.cs b/AGExt/Scenario.cs index 4d55ebe..d89f864 100644 --- a/AGExt/Scenario.cs +++ b/AGExt/Scenario.cs @@ -577,6 +577,7 @@ public static AGXAction LoadAGXActionVer2(ConfigNode actNode, Part actPart, bool //print("load action2 " + ActionToLoad.ba.name + " " + ActionToLoad.group); //print("agx check " + actsToCompare.Count + " " + ActionToLoad.group + ActionToLoad.ba.name); //print("actual act " + ActionToLoad + " " + ActionToLoad.ba.name); + print("BA load " + ActionToLoad.ba.name + " " + ActionToLoad.ba.listParent.part.ConstructID + " " + ActionToLoad.prt.ConstructID); return ActionToLoad; } @@ -680,6 +681,7 @@ public static ConfigNode SaveAGXActionVer2(AGXAction agxAct) actionNode.AddValue("custom1","NA"); //u2021 is sciencemodule errLine = "24"; } + return actionNode; }