Ejemplo n.º 1
0
        public void pickupEVAFuelLine()
        {
            if (!checkEVAVessel)
            {
                ScreenMessages.PostScreenMessage("Current Vessel is not an EVA Kerbal...", 6f, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!checkProfession)
            {
                ScreenMessages.PostScreenMessage("The Kerbal must be an " + useProfession + " to activate the transfer line.", 6f, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!checkLevel)
            {
                ScreenMessages.PostScreenMessage("The Kerbal must be above level " + minLevel + " to activate the transfer line.", 6f, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!setEVAPosition())
            {
                return;
            }

            Events["pickupEVAFuelLine"].active = false;
            Events["dropEVAFuelLine"].active   = true;

            EVAAttachState           = CompoundPart.AttachState.Attaching;
            compoundPart.attachState = CompoundPart.AttachState.Detached;

            this.startCap.gameObject.SetActive(true);
        }
 public CompoundPartGeoUpdater(CompoundPart part, GeometryPartModule geoModule)
 {
     this.part       = part;
     this.geoModule  = geoModule;
     lastAttachState = part.attachState;
     lastTarget      = part.target;
 }
Ejemplo n.º 3
0
        public override void OnLoad(ConfigNode node)
        {
            base.OnLoad(node);

            if (!HighLogic.LoadedSceneIsFlight)
            {
                return;
            }

            if (!node.HasValue("TargetPartID"))
            {
                severStrut();
                loaded = true;
                return;
            }

            try
            {
                targetID = uint.Parse(node.GetValue("TargetPartID"));
            }
            catch (Exception e)
            {
                print("[EVA Refuel] Exception in assigning target part ID:\n" + e);
            }

            EVAAttachState = CompoundPart.AttachState.Attached;

            StartCoroutine(loadConnections());
        }
Ejemplo n.º 4
0
        public void pickupEVAStrut()
        {
            if (!checkEVAVessel)
            {
                ScreenMessages.PostScreenMessage("Current Vessel is not an EVA Kerbal...", 6f, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!checkProfession)
            {
                ScreenMessages.PostScreenMessage("The Kerbal must have the " + useSkill + " to attach the EVA strut.", 6f, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!checkLevel)
            {
                ScreenMessages.PostScreenMessage("The Kerbal must be above level " + minLevel + " to attach the EVA strut.", 6f, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!setEVAPosition())
            {
                return;
            }

            Events["pickupEVAStrut"].active = false;
            Events["dropEVAStrut"].active   = true;

            EVAAttachState           = CompoundPart.AttachState.Attaching;
            compoundPart.attachState = CompoundPart.AttachState.Detached;
            waitTimer = 0;
        }
Ejemplo n.º 5
0
        private void severFuelLine()
        {
            Events["dropEVAFuelLine"].active              = false;
            Events["pickupEVAFuelLine"].active            = true;
            Events["cutEVAFuelLine"].active               = false;
            Events["openEVAFuelTransfer"].active          = false;
            Events["closeEVAFuelTransfer"].active         = false;
            Events["cutEVAFuelLine"].unfocusedRange       = 4;
            Events["openEVAFuelTransfer"].unfocusedRange  = 5;
            Events["closeEVAFuelTransfer"].unfocusedRange = 5;

            if (evaWindow != null)
            {
                evaWindow.severConnection();
            }

            OnTargetLost();

            targetVessel = null;

            compoundPart.target = null;

            compoundPart.direction      = Vector3.zero;
            compoundPart.targetPosition = Vector3.zero;
            compoundPart.targetRotation = Quaternion.identity;

            compoundPart.attachState = CompoundPart.AttachState.Detached;
            EVAAttachState           = CompoundPart.AttachState.Detached;
        }
Ejemplo n.º 6
0
        private void attachFuelLine()
        {
            targetVessel   = compoundPart.target.vessel;
            targetVesselID = targetVessel.id;
            targetID       = compoundPart.target.craftID;

            if (evaWindow == null)
            {
                evaWindow = gameObject.AddComponent <EVATransfer_Window>();
                evaWindow.setup(transferLF, transferLOX, transferMono, transferXen, transferEC, transferOre, transferAll, this);
            }

            evaWindow.activateVessels(vessel, targetVessel);

            Events["dropEVAFuelLine"].active      = false;
            Events["pickupEVAFuelLine"].active    = false;
            Events["cutEVAFuelLine"].active       = true;
            Events["openEVAFuelTransfer"].active  = true;
            Events["closeEVAFuelTransfer"].active = false;

            OnTargetSet(compoundPart.target);

            connectionDistance = (endCap.transform.position - startCap.transform.position).magnitude;

            Events["cutEVAFuelLine"].unfocusedRange       = connectionDistance + 10;
            Events["openEVAFuelTransfer"].unfocusedRange  = connectionDistance + 10;
            Events["closeEVAFuelTransfer"].unfocusedRange = connectionDistance + 10;

            compoundPart.attachState = CompoundPart.AttachState.Detached;
            EVAAttachState           = CompoundPart.AttachState.Attached;
        }
 public CompoundPartGeoUpdater(CompoundPart part, GeometryPartModule geoModule)
 {
     this.part = part;
     this.geoModule = geoModule;
     lastAttachState = part.attachState;
     lastTarget = part.target;
 }
 public void FlightGeometryUpdate()
 {
     if (lastAttachState != part.attachState || lastTarget != part.target || !part.vessel.parts.Contains(part.target))
     {
         geoModule.RebuildAllMeshData();
         lastAttachState = part.attachState;
         lastTarget = part.target;
     }
 }
 public void EditorGeometryUpdate()
 {
     if (lastAttachState != part.attachState || lastTarget != part.target || !EditorLogic.SortedShipList.Contains(part.target))
     {
         geoModule.RebuildAllMeshData();
         lastAttachState = part.attachState;
         lastTarget      = part.target;
     }
 }
 public void EditorGeometryUpdate()
 {
     if (lastAttachState != part.attachState || lastTarget != part.target || !EditorLogic.SortedShipList.Contains(part.target))
     {
         geoModule.RebuildAllMeshData();
         lastAttachState = part.attachState;
         lastTarget = part.target;
     }
 }
 public void FlightGeometryUpdate()
 {
     if (lastAttachState != part.attachState || lastTarget != part.target || !part.vessel.parts.Contains(part.target))
     {
         geoModule.RebuildAllMeshData();
         lastAttachState = part.attachState;
         lastTarget      = part.target;
     }
 }
Ejemplo n.º 12
0
 public void EditorGeometryUpdate()
 {
     if (lastAttachState == part.attachState &&
         lastTarget == part.target &&
         EditorLogic.SortedShipList.Contains(part.target))
     {
         return;
     }
     geoModule.RebuildAllMeshData();
     lastAttachState = part.attachState;
     lastTarget      = part.target;
 }
Ejemplo n.º 13
0
 public void FlightGeometryUpdate()
 {
     if (lastAttachState == part.attachState &&
         lastTarget == part.target &&
         part.vessel.parts.Contains(part.target))
     {
         return;
     }
     geoModule.RebuildAllMeshData();
     lastAttachState = part.attachState;
     lastTarget      = part.target;
 }
Ejemplo n.º 14
0
        public void dropEVAStrut()
        {
            Events["dropEVAStrut"].active        = false;
            Events["pickupEVAStrut"].active      = true;
            Events["cutEVAStrut"].active         = false;
            Events["cutEVAStrut"].unfocusedRange = 4;

            EVAAttachState           = CompoundPart.AttachState.Detached;
            compoundPart.attachState = CompoundPart.AttachState.Detached;

            OnTargetLost();
        }
Ejemplo n.º 15
0
        public void dropEVAFuelLine()
        {
            Events["dropEVAFuelLine"].active              = false;
            Events["pickupEVAFuelLine"].active            = true;
            Events["cutEVAFuelLine"].active               = false;
            Events["openEVAFuelTransfer"].active          = false;
            Events["closeEVAFuelTransfer"].active         = false;
            Events["cutEVAFuelLine"].unfocusedRange       = 4;
            Events["openEVAFuelTransfer"].unfocusedRange  = 5;
            Events["closeEVAFuelTransfer"].unfocusedRange = 5;

            EVAAttachState           = CompoundPart.AttachState.Detached;
            compoundPart.attachState = CompoundPart.AttachState.Detached;

            OnTargetLost();
        }
Ejemplo n.º 16
0
        private void attachStrut()
        {
            targetID = compoundPart.target.flightID;

            Events["dropEVAStrut"].active   = false;
            Events["pickupEVAStrut"].active = false;
            Events["cutEVAStrut"].active    = true;

            OnTargetSet(compoundPart.target);

            connectionDistance = (targetAnchor.position - compoundTransform.position).magnitude;

            Events["cutEVAStrut"].unfocusedRange = connectionDistance + 10;

            compoundPart.attachState = CompoundPart.AttachState.Detached;
            EVAAttachState           = CompoundPart.AttachState.Attached;
        }
Ejemplo n.º 17
0
        private void severStrut()
        {
            Events["dropEVAStrut"].active        = false;
            Events["pickupEVAStrut"].active      = true;
            Events["cutEVAStrut"].active         = false;
            Events["cutEVAStrut"].unfocusedRange = 4;

            OnTargetLost();

            compoundPart.target = null;

            compoundPart.direction      = Vector3.zero;
            compoundPart.targetPosition = Vector3.zero;
            compoundPart.targetRotation = Quaternion.identity;

            compoundPart.attachState = CompoundPart.AttachState.Detached;
            EVAAttachState           = CompoundPart.AttachState.Detached;
        }
Ejemplo n.º 18
0
        public override void OnLoad(ConfigNode node)
        {
            base.OnLoad(node);

            if (!HighLogic.LoadedSceneIsFlight)
            {
                return;
            }

            if (!node.HasValue("TargetVesselID") || !node.HasValue("TargetPartID"))
            {
                loaded = true;
                severFuelLine();
                return;
            }

            try
            {
                targetVesselID = new Guid(node.GetValue("TargetVesselID"));
            }
            catch (Exception e)
            {
                print("[EVA Refuel] Exception in assigning vessel ID:\n" + e);
            }

            try
            {
                targetID = uint.Parse(node.GetValue("TargetPartID"));
            }
            catch (Exception e)
            {
                print("[EVA Refuel] Exception in assigning target part ID:\n" + e);
            }

            EVAAttachState = CompoundPart.AttachState.Attached;

            loaded = false;
        }
Ejemplo n.º 19
0
        public override void OnLoad(ConfigNode node)
        {
            base.OnLoad(node);

            if (!HighLogic.LoadedSceneIsFlight)
                return;

            if (!node.HasValue("TargetVesselID") || !node.HasValue("TargetPartID"))
            {
                loaded = true;
                severFuelLine();
                return;
            }

            try
            {
                targetVesselID = new Guid(node.GetValue("TargetVesselID"));
            }
            catch (Exception e)
            {
                print("[EVA Refuel] Exception in assigning vessel ID:\n" + e);
            }

            try
            {
                targetID = uint.Parse(node.GetValue("TargetPartID"));
            }
            catch (Exception e)
            {
                print("[EVA Refuel] Exception in assigning target part ID:\n" + e);
            }

            EVAAttachState = CompoundPart.AttachState.Attached;

            loaded = false;
        }
Ejemplo n.º 20
0
        public void dropEVAFuelLine()
        {
            Events["dropEVAFuelLine"].active = false;
            Events["pickupEVAFuelLine"].active = true;
            Events["cutEVAFuelLine"].active = false;
            Events["openEVAFuelTransfer"].active = false;
            Events["closeEVAFuelTransfer"].active = false;
            Events["cutEVAFuelLine"].unfocusedRange = 4;
            Events["openEVAFuelTransfer"].unfocusedRange = 5;
            Events["closeEVAFuelTransfer"].unfocusedRange = 5;

            EVAAttachState = CompoundPart.AttachState.Detached;
            compoundPart.attachState = CompoundPart.AttachState.Detached;

            OnTargetLost();
        }
Ejemplo n.º 21
0
        private void attachFuelLine()
        {
            targetVessel = compoundPart.target.vessel;
            targetVesselID = targetVessel.id;
            targetID = compoundPart.target.craftID;

            if (evaWindow == null)
            {
                evaWindow = gameObject.AddComponent<EVATransfer_Window>();
                evaWindow.setup(transferLF, transferLOX, transferMono, transferXen, transferEC, transferOre, transferAll, this);
            }

            evaWindow.activateVessels(sourceVessel, targetVessel);

            Events["dropEVAFuelLine"].active = false;
            Events["pickupEVAFuelLine"].active = false;
            Events["cutEVAFuelLine"].active = true;
            Events["openEVAFuelTransfer"].active = true;
            Events["closeEVAFuelTransfer"].active = false;

            OnTargetSet(compoundPart.target);

            connectionDistance = (endCap.transform.position - startCap.transform.position).magnitude;

            Events["cutEVAFuelLine"].unfocusedRange = connectionDistance + 10;
            Events["openEVAFuelTransfer"].unfocusedRange = connectionDistance + 10;
            Events["closeEVAFuelTransfer"].unfocusedRange = connectionDistance + 10;

            compoundPart.attachState = CompoundPart.AttachState.Detached;
            EVAAttachState = CompoundPart.AttachState.Attached;
        }
Ejemplo n.º 22
0
        public void pickupEVAFuelLine()
        {
            if (!checkEVAVessel)
            {
                ScreenMessages.PostScreenMessage("Current Vessel is not an EVA Kerbal...", 6f, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!checkProfession)
            {
                ScreenMessages.PostScreenMessage("The Kerbal must be an " + useProfession + " to activate the transfer line.", 6f, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!checkLevel)
            {
                ScreenMessages.PostScreenMessage("The Kerbal must be above level " + minLevel + "to activate the transfer line.", 6f, ScreenMessageStyle.UPPER_CENTER);
                return;
            }

            if (!setEVAPosition())
                return;

            Events["pickupEVAFuelLine"].active = false;
            Events["dropEVAFuelLine"].active = true;

            EVAAttachState = CompoundPart.AttachState.Attaching;
            compoundPart.attachState = CompoundPart.AttachState.Detached;

            this.startCap.gameObject.SetActive(true);
        }
Ejemplo n.º 23
0
        private void severFuelLine()
        {
            Events["dropEVAFuelLine"].active = false;
            Events["pickupEVAFuelLine"].active = true;
            Events["cutEVAFuelLine"].active = false;
            Events["openEVAFuelTransfer"].active = false;
            Events["closeEVAFuelTransfer"].active = false;
            Events["cutEVAFuelLine"].unfocusedRange = 4;
            Events["openEVAFuelTransfer"].unfocusedRange = 5;
            Events["closeEVAFuelTransfer"].unfocusedRange = 5;

            if (evaWindow != null)
            {
                evaWindow.severConnection();
            }

            OnTargetLost();

            targetVessel = null;

            compoundPart.target = null;

            compoundPart.direction = Vector3.zero;
            compoundPart.targetPosition = Vector3.zero;
            compoundPart.targetRotation = Quaternion.identity;

            compoundPart.attachState = CompoundPart.AttachState.Detached;
            EVAAttachState = CompoundPart.AttachState.Detached;
        }