Esempio n. 1
0
        /// <summary>
        /// Stuff
        /// </summary>

        void Start()
        {
            Debug.Log("Running Start () ");
            GameEvents.onNewVesselCreated.Add(CheckNewVessel);
            GameEvents.OnFlightGlobalsReady.Add(FindKerbinKillerAsteroids);
            GameEvents.onPlanetariumTargetChanged.Add(OnCameraVesselChange);
            //GameEvents.onTimeWarpRateChanged.Add(AddContracts);



            AutoAddKACALarm = true;
            AutoTrack       = true;
            CheckAltitude   = 100000;
            DeadlyAsteroidList.Clear();
            KACWrapper.InitKACWrapper();
            if (KACWrapper.APIReady)
            {
                //All good to go
                Debug.Log("KACWrapper Ready");
            }
            if (FlightGlobals.ready)
            {
                FindKerbinKillerAsteroids();
                //AddContracts ();
            }
            else
            {
                Debug.Log("FlightGlobal Not Ready. Still waiting to find killer asteroids");
                //@@@TODO:Check for Tracking Station Scene.
                FindKerbinKillerAsteroids();
                //AddContracts ();
            }
        }
Esempio n. 2
0
        internal override void Start()
        {
            LogFormatted("Searching for RSS");
            AssemblyLoader.loadedAssemblies.TypeOperation(t =>
            {
                if (t.FullName == ("RealSolarSystem.RSSWatchDog"))
                {
                    settings.RSSActive = true;
                    if (!settings.RSSShowCalendarToggled)
                    {
                        settings.ShowCalendarToggle     = true;
                        settings.RSSShowCalendarToggled = true;
                    }
                }
            });

            //Init the KAC Integration
            KACWrapper.InitKACWrapper();
            if (KACWrapper.APIReady)
            {
                LogFormatted("Successfully Hooked the KAC");

                KACWrapper.KAC.onAlarmStateChanged += KAC_onAlarmStateChanged;
            }

            //Ensure no lagging locks
            RemoveInputLock();
        }
Esempio n. 3
0
        private void Start()
        {
            available = (PSystemSetup.Instance.GetSpaceCenterFacility("TrackingStation").GetFacilityLevel() > 0);
            lastTime  = DateTime.Now;
            config    = PluginConfiguration.CreateForType <FlightPlan> ();
            config.load();

            UI = new UICore.UICore();
            UI.LoadConfig("GameData/FlightPlan/Skin/FlightPlan.cfg");

            winId    = GUIUtility.GetControlID(FocusType.Passive);
            winRect  = config.GetValue <Rect> (this.name, new Rect(0, 0, Screen.width / 2, Screen.height / 2));
            showAsUT = config.GetValue <bool> ("showAsUT", false);

            GameEvents.onGUIApplicationLauncherReady.Add(CreateLauncher);
            GameEvents.onHideUI.Add(OnHide);
            GameEvents.onShowUI.Add(OnUnHide);
            GameEvents.onGamePause.Add(OnHide);
            GameEvents.onGameUnpause.Add(OnUnHide);

            KACWrapper.InitKACWrapper();
            if (KACWrapper.APIReady)
            {
                KACWrapper.KAC.onAlarmStateChanged += KACWrapper_KAC_onAlarmStateChanged;
            }
        }
Esempio n. 4
0
 void Start()
 {
     if (!KACinited)
     {
         KACinited  = true;
         KACpresent = KACWrapper.InitKACWrapper();
     }
     UpdateGUIState();
 }
        internal override void Start()
        {
            LogFormatted("Start");
            KACWrapper.InitKACWrapper();

            //Register the event handler
            if (KACWrapper.APIReady)
            {
                KACWrapper.KAC.onAlarmStateChanged += KAC_onAlarmStateChanged;
            }
        }
 void KAC_onAlarmStateChanged(KACWrapper.KACAPI.AlarmStateChangedEventArgs e)
 {
     //LogFormatted("AlarmStateChanged:{0}-{1}", e.alarm.Name, e.eventType);
 }
Esempio n. 7
0
 private void KAC_onAlarmStateChanged(KACWrapper.KACAPI.AlarmStateChangedEventArgs e)
 {
     //output whats happened
     Debug.Log(string.Format("{0}, caught Event from alarm {1}, event type {2}", KSPLogger.LOGGER_PREFIX, e.alarm.Name, e.eventType));
 }
Esempio n. 8
0
 public KACAlarmWrapper(KACWrapper.KACAPI.KACAlarm init)
 {
     alarm = init;
     InitializeSuffixes();
 }
Esempio n. 9
0
 private int SortDates(KACWrapper.KACAPI.KACAlarm x, KACWrapper.KACAPI.KACAlarm y)
 {
     return x.AlarmTime.CompareTo(y.AlarmTime);
 }
Esempio n. 10
0
 private void KAC_onAlarmStateChanged(KACWrapper.KACAPI.AlarmStateChangedEventArgs e)
 {
     //This is triggered whenever the KAC API triggers an Alarm event.
     //So we have to check it is an alarm we are interested in and we are only interested in the Triggered EventType.
      Utilities.Log_Debug("KAC Alarm triggered " + e.alarm.Name + "->" + e.eventType);
     /*   EventType = Created,Triggered,Closed,Deleted */
     if (e.eventType == KACWrapper.KACAPI.KACAlarm.AlarmStateEventsEnum.Triggered)
     {
         //Is it an alarm we are tracking? If so, break it down.
         if (DeepFreeze.Instance.DFgameSettings.knownKACAlarms.ContainsKey(e.alarm.ID))
         {
              Utilities.Log_Debug("Alarm is known so set Execute to true");
             DeepFreeze.Instance.DFgameSettings.knownKACAlarms[e.alarm.ID].AlarmExecute = true;
             // Do some messages if the LoadedScene is not flight or the active vessel is not the one we just got the alarm for.
             //The user has to manually switch to that vessel. Maybe we can automate this in a later version.
             if (!HighLogic.LoadedSceneIsFlight)
             {
                 SwitchVslAlarmMsg(DeepFreeze.Instance.DFgameSettings.knownKACAlarms[e.alarm.ID].Name);
             }
             else
             {
                 if (FlightGlobals.ActiveVessel.id != DeepFreeze.Instance.DFgameSettings.knownKACAlarms[e.alarm.ID].VesselID)
                 {
                     SwitchVslAlarmMsg(DeepFreeze.Instance.DFgameSettings.knownKACAlarms[e.alarm.ID].Name);
                 }
             }
         }
     }
 }
Esempio n. 11
0
 internal void ModifyKACAlarm(KACWrapper.KACAPI.KACAlarm alarm, List<string> InFrzKbls, List<string> InThwKbls)
 {
     // First we strip out any existing DeepFreeze Events from the notes.
     List<string> _FrzKbls;
     List<string> _ThwKbls;
     string notes = ParseKACNotes(alarm.Notes, out _FrzKbls, out _ThwKbls);
     //Now we add our new DeepFreeze Events back in.
     string newnotes = CreateKACNotes(notes, InFrzKbls, InThwKbls);
      Utilities.Log_Debug("ModifyKACAlarm oldnotes= \r\n" + alarm.Notes);
      Utilities.Log_Debug("Stripped out notes= \r\n" + notes);
      Utilities.Log_Debug("NewNotes= \r\n" + newnotes);
     alarm.Notes = newnotes;
 }
Esempio n. 12
0
 private void UpdateKACAlarmInfo(AlarmInfo alarmInfo, KACWrapper.KACAPI.KACAlarm alarm)
 {
     alarmInfo.AlarmType = alarm.AlarmType;
     alarmInfo.AlarmTime = alarm.AlarmTime;
     alarmInfo.AlarmMargin = alarm.AlarmMargin;
     alarmInfo.Notes = alarm.Notes;
     string tmpnotes = ParseKACNotes(alarm.Notes, out alarmInfo.FrzKerbals, out alarmInfo.ThwKerbals);
 }
Esempio n. 13
0
 void Start()
 {
     KACWrapper.InitKACWrapper();
     Debug.Log(KACWrapper.KAC.Alarms.Count);
 }