Ejemplo n.º 1
0
        public void Start()
        {
            settings = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> ();

            timer = new WaitForSeconds(.5f);

            vessel = this.GetComponent <Vessel> ();

            // Check for the right type
            if (vessel.vesselType == VesselType.Debris || vessel.vesselType == VesselType.EVA ||
                vessel.vesselType == VesselType.Flag || vessel.vesselType == VesselType.SpaceObject)
            {
                Destroy(this);
            }

            // Check for controllable vessel
            if (settings.onlyForControllable)
            {
                if (!vessel.IsControllable)
                {
                    Destroy(this);
                }
            }

            // Destroy if vessel are too close
            if (GetDistance() < settings.distance)
            {
                Destroy(this);
            }

            StartCoroutine("StartMorseLight");
        }
Ejemplo n.º 2
0
        private void DoStart()
        {
            if (HighLogic.fetch.currentGame == null)
            {
                return;
            }

            morseAlph = Asset.Texture2D.LoadFromFile("International_Morse_Code");

            morseSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> ();
            ParseSettings();
        }
Ejemplo n.º 3
0
        private void DoStart()
        {
            if (HighLogic.fetch.currentGame == null)
            {
                return;
            }

            morseAlph = (Texture)GameDatabase.Instance.GetTexture("CrewLight/International_Morse_Code", false);

            morseSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> ();
            ParseSettings();
        }
Ejemplo n.º 4
0
        void Start()
        {
            CL_GeneralSettings settings = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> ();

            disableCrewAG = settings.disableCrewAG;
            disableAllAG  = settings.disableAllAG;

            if (disableCrewAG || disableAllAG)
            {
                GameEvents.onEditorPartEvent.Add(CheckForLight);
            }
        }
Ejemplo n.º 5
0
        void Start()
        {
            windowPos         = new Vector2d(Screen.width / 2 + 120, Screen.height / 2 - 150);
            morseSettingsRect = new Rect((float)windowPos.x, (float)windowPos.y, 1, 1);
            morseAlphabetRect = new Rect((float)windowPos.x - 680, (float)windowPos.y, 450, 450);

            morseSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings>();
            morseAlph     = (Texture)GameDatabase.Instance.GetTexture("CrewLight/International_Morse_Code", false);

            Init();
            completed = false;
            Instance  = this;
        }
Ejemplo n.º 6
0
//		private CL_EVALightSettings evaSettings;

        public override void OnStart(StartState state)
        {
            generalSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> ();
//			evaSettings = HighLogic.CurrentGame.Parameters.CustomParams<CL_EVALightSettings> ();

            if ((part.Modules.Contains <ModuleLight> () || part.Modules.Contains("ModuleKELight") ||
                 (part.Modules.Contains("ModuleNavLight") && generalSettings.onAviationLights)) &&
                generalSettings.useVesselLightsOnEVA)
            {
                ogSymPart = new List <Part> (part.symmetryCounterparts);
            }
            else
            {
                Destroy(this);
            }
        }
Ejemplo n.º 7
0
        public void Start()
        {
            settings               = HighLogic.CurrentGame.Parameters.CustomParams <CL_SunLightSettings> ();
            generalSettings        = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> ();
            aviationLightsSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_AviationLightsSettings> ();

            vessel = this.GetComponent <Vessel> ();

            // Checking for the type cannot be done earlier unfortunalely, it won't be correctly assigned
            if (vessel.vesselType == VesselType.Debris || vessel.vesselType == VesselType.EVA ||
                vessel.vesselType == VesselType.Flag || vessel.vesselType == VesselType.SpaceObject)
            {
                Destroy(this);
            }

            StartCoroutine("StartSunLight");
        }
Ejemplo n.º 8
0
//		private CL_HeadlightSettings headLightSettings;

        public void Start()
        {
            this.RegisterEventHandlers();

            generalSettings  = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> ();
            sunLightSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_SunLightSettings> ();
//			headLightSettings = HighLogic.CurrentGame.Parameters.CustomParams<CL_HeadlightSettings> ();
            // CrewLight :
            if (generalSettings.useTransferCrew)
            {
                GameEvents.onCrewTransferred.Add(CrewLightTransfer);
                GameEvents.onVesselChange.Add(CrewLightVessel);
                CrewLightVessel(FlightGlobals.ActiveVessel);
            }

            // EVALight :
            if (generalSettings.useSunLightEVA)
            {
                GameEvents.onCrewOnEva.Add(SunLightEVA);
                Vessel vessel = FlightGlobals.ActiveVessel;
                if (vessel.isEVA)
                {
                    SunLightEVA(vessel, vessel.FindPartModulesImplementing <KerbalEVA> () [0]);
                }
            }

            // MorseLight :
            if (generalSettings.useMorseCode)
            {
                GameEvents.onVesselLoaded.Add(MorseLightAddVessel);
            }

            // SunLight :
            if (sunLightSettings.useSunLight)
            {
                GameEvents.onVesselGoOffRails.Add(SunLightAddVessel);
                GameEvents.onVesselCreate.Add(SunLightAddVessel);
                GameEvents.onVesselPartCountChanged.Add(SunLightVesselChanged);
            }
        }
Ejemplo n.º 9
0
 private static void LoadSettings()
 {
     generalSettings   = HighLogic.CurrentGame.Parameters.CustomParams <CL_GeneralSettings> ();
     aviationLSettings = HighLogic.CurrentGame.Parameters.CustomParams <CL_AviationLightsSettings> ();
     settingsLoaded    = true;
 }