public void SetNodeTarget() { WBIDockingNodeHelper dockingModule = null; //Turn off all the glowing docking ports. foreach (Part part in this.vessel.parts) { //See if the part has a docking module dockingModule = part.FindModuleImplementing <WBIDockingNodeHelper>(); if (dockingModule == null) { continue; } //It does! Now turn off the glow animation if (dockingModule != this) { dockingModule.TurnAnimationOff(); } } //Turn our animation on TurnAnimationOn(); //And call the real SetAsTarget dockingNode.SetAsTarget(); }
private void DockingInitializeSuffixes() { AddSuffix("AQUIRERANGE", new Suffix <ScalarValue>(() => { throw new Safe.Exceptions.KOSObsoletionException("0.18.0", "AQUIRERANGE", "ACQUIRERANGE", string.Empty); })); AddSuffix("AQUIREFORCE", new Suffix <ScalarValue>(() => { throw new Safe.Exceptions.KOSObsoletionException("0.18.0", "AQUIREFORCE", "ACQUIREFORCE", string.Empty); })); AddSuffix("AQUIRETORQUE", new Suffix <ScalarValue>(() => { throw new Safe.Exceptions.KOSObsoletionException("0.18.0", "AQUIRETORQUE", "ACQUIRETORQUE", string.Empty); })); AddSuffix("ACQUIRERANGE", new Suffix <ScalarValue>(() => module.acquireRange)); AddSuffix("ACQUIREFORCE", new Suffix <ScalarValue>(() => module.acquireForce)); AddSuffix("ACQUIRETORQUE", new Suffix <ScalarValue>(() => module.acquireTorque)); AddSuffix("REENGAGEDISTANCE", new Suffix <ScalarValue>(() => module.minDistanceToReEngage)); AddSuffix("DOCKEDSHIPNAME", new Suffix <StringValue>(() => module.vesselInfo != null ? module.vesselInfo.name : string.Empty)); AddSuffix("STATE", new Suffix <StringValue>(() => module.state)); AddSuffix("TARGETABLE", new Suffix <BooleanValue>(() => true)); AddSuffix("UNDOCK", new NoArgsVoidSuffix(() => DoUndock())); AddSuffix("TARGET", new NoArgsVoidSuffix(() => module.SetAsTarget())); AddSuffix("PORTFACING", new NoArgsSuffix <Direction>(GetPortFacing, "The direction facing outward from the docking port. This " + "can differ from :FACING in the case of sideways-facing " + "docking ports like the inline docking port.")); AddSuffix("NODEPOSITION", new Suffix <Vector>(GetNodePosition, "The position of the docking node itself rather than the part's center of mass")); AddSuffix("NODETYPE", new Suffix <StringValue>(() => module.nodeType, "The type of the docking node")); AddSuffix("DOCKWATCHERS", new NoArgsSuffix <UniqueSetValue <UserDelegate> >(() => Shared.DispatchManager.CurrentDispatcher.GetPartCoupleNotifyees(module.part))); AddSuffix("UNDOCKWATCHERS", new NoArgsSuffix <UniqueSetValue <UserDelegate> >(() => Shared.DispatchManager.CurrentDispatcher.GetPartUndockNotifyees(module.part))); AddSuffix("PARTNER", new Suffix <Structure>(() => (Structure)GetPartner() ?? StringValue.None, "The docking port this docking port is attached to.")); AddSuffix("HASPARTNER", new Suffix <BooleanValue>(() => module.otherNode != null, "Whether or not this docking port is attached to another docking port.")); }
private void DockingInitializeSuffixes() { AddSuffix("AQUIRERANGE", new Suffix <float>(() => module.acquireRange)); AddSuffix("AQUIREFORCE", new Suffix <float>(() => module.acquireForce)); AddSuffix("AQUIRETORQUE", new Suffix <float>(() => module.acquireTorque)); AddSuffix("REENGAGEDISTANCE", new Suffix <float>(() => module.minDistanceToReEngage)); AddSuffix("DOCKEDSHIPNAME", new Suffix <string>(() => module.vesselInfo != null ? module.vesselInfo.name : string.Empty)); AddSuffix("STATE", new Suffix <string>(() => module.state)); AddSuffix("TARGETABLE", new Suffix <bool>(() => true)); AddSuffix("UNDOCK", new NoArgsSuffix(() => module.Undock())); AddSuffix("TARGET", new NoArgsSuffix(() => module.SetAsTarget())); AddSuffix("PORTFACING", new NoArgsSuffix <Direction>(GetPortFacing, "The direction facing outward from the docking port. This " + "can differ from :FACING in the case of sideways-facing " + "docking ports like the inline docking port.")); }
private void DockingInitializeSuffixes() { AddSuffix("AQUIRERANGE", new Suffix <ScalarValue>(() => { throw new Safe.Exceptions.KOSDeprecationException("0.18.0", "AQUIRERANGE", "ACQUIRERANGE", string.Empty); })); AddSuffix("AQUIREFORCE", new Suffix <ScalarValue>(() => { throw new Safe.Exceptions.KOSDeprecationException("0.18.0", "AQUIREFORCE", "ACQUIREFORCE", string.Empty); })); AddSuffix("AQUIRETORQUE", new Suffix <ScalarValue>(() => { throw new Safe.Exceptions.KOSDeprecationException("0.18.0", "AQUIRETORQUE", "ACQUIRETORQUE", string.Empty); })); AddSuffix("ACQUIRERANGE", new Suffix <ScalarValue>(() => module.acquireRange)); AddSuffix("ACQUIREFORCE", new Suffix <ScalarValue>(() => module.acquireForce)); AddSuffix("ACQUIRETORQUE", new Suffix <ScalarValue>(() => module.acquireTorque)); AddSuffix("REENGAGEDISTANCE", new Suffix <ScalarValue>(() => module.minDistanceToReEngage)); AddSuffix("DOCKEDSHIPNAME", new Suffix <StringValue>(() => module.vesselInfo != null ? module.vesselInfo.name : string.Empty)); AddSuffix("STATE", new Suffix <StringValue>(() => module.state)); AddSuffix("TARGETABLE", new Suffix <BooleanValue>(() => true)); AddSuffix("UNDOCK", new NoArgsVoidSuffix(() => DoUndock())); AddSuffix("TARGET", new NoArgsVoidSuffix(() => module.SetAsTarget())); AddSuffix("PORTFACING", new NoArgsSuffix <Direction>(GetPortFacing, "The direction facing outward from the docking port. This " + "can differ from :FACING in the case of sideways-facing " + "docking ports like the inline docking port.")); AddSuffix("NODEPOSITION", new Suffix <Vector>(GetNodePosition, "The position of the docking node itself rather than the part's center of mass")); AddSuffix("NODETYPE", new Suffix <StringValue>(() => module.nodeType, "The type of the docking node")); }
public void SetNodeTarget() { //Start watching for our docking event. watchForDocking = true; //GUI update Events["UnsetNodeTarget"].guiActiveUnfocused = true; Events["SetNodeTarget"].guiActiveUnfocused = false; //Turn off all the glowing docking ports. List <WBIDockingNodeHelper> dockingHelpers = this.part.vessel.FindPartModulesImplementing <WBIDockingNodeHelper>(); foreach (WBIDockingNodeHelper dockingHelper in dockingHelpers) { dockingHelper.TurnAnimationOff(); } //Turn our animation on TurnAnimationOn(); //And call the real SetAsTarget dockingNode.SetAsTarget(); }