public static bool AGX2VslActivateGroupName(uint flightID, string grpName, bool forceDir) { try { print("AGX Call: activate group by name for " + grpName + " for " + flightID + " in dir " + forceDir); if (HighLogic.LoadedSceneIsFlight) //only workes in flight { if (FlightGlobals.ActiveVessel.rootPart.flightID == flightID) { return(AGXActivateGroupName(grpName, forceDir)); } else { AGXOtherVessel otherVsl = new AGXOtherVessel(flightID); otherVsl.ActivateActionStringActivation(grpName, true, forceDir); return(true); } } else { return(false); } } catch { return(false); } }
public static bool AGX2VslToggleGroupName(uint flightID, string grpName, bool forceDir) { try { Log.trace("Call: toggle group by name for {0} for {1} in dir {2}", grpName, flightID, forceDir); if (HighLogic.LoadedSceneIsFlight) //only workes in flight { if (FlightGlobals.ActiveVessel.rootPart.flightID == flightID) { return(AGXToggleGroupName(grpName)); } else { AGXOtherVessel otherVsl = new AGXOtherVessel(flightID); otherVsl.ActivateActionStringActivation(grpName, false, false); return(true); } } else { return(false); } } catch { return(false); } }