This is the behaviour object that we hook events on to for flight
Inheritance: MonoBehaviourExtended
コード例 #1
0
        internal ApplicationLauncherButton InitAppLauncherButton()
        {
            ApplicationLauncherButton retButton = null;

            ApplicationLauncherButton[] lstButtons = KerbalAlarmClock.FindObjectsOfType <ApplicationLauncherButton>();
            //LogFormatted("AppLauncher: Creating Button-BEFORE", lstButtons.Length);
            try
            {
                retButton = ApplicationLauncher.Instance.AddModApplication(
                    onAppLaunchToggleOn, onAppLaunchToggleOff,
                    onAppLaunchHoverOn, onAppLaunchHoverOff,
                    null, null,
                    ApplicationLauncher.AppScenes.ALWAYS,
                    (Texture)KACResources.toolbariconNorm);

                //AppLauncherButtonMutuallyExclusive(settings.AppLauncherMutuallyExclusive);

                //appButton = ApplicationLauncher.Instance.AddApplication(
                //    onAppLaunchToggleOn, onAppLaunchToggleOff,
                //    onAppLaunchHoverOn, onAppLaunchHoverOff,
                //    null, null,
                //    (Texture)Resources.texAppLaunchIcon);
                //appButton.VisibleInScenes = ApplicationLauncher.AppScenes.FLIGHT;
            }
            catch (Exception ex)
            {
                Log.error(ex, "AppLauncher: Failed to set up App Launcher Button");
                retButton = null;
            }
            lstButtons = KerbalAlarmClock.FindObjectsOfType <ApplicationLauncherButton>();
            //LogFormatted("AppLauncher: Creating Button-AFTER", lstButtons.Length);

            return(retButton);
        }
コード例 #2
0
        private static ITargetable TargetDeserialize(String strInput)
        {
            ITargetable tReturn = null;

            String[] TargetParts = strInput.Split(",".ToCharArray());
            switch (TargetParts[0])
            {
            case "Vessel":
                if (KerbalAlarmClock.StoredVesselExists(TargetParts[1]))
                {
                    tReturn = KerbalAlarmClock.StoredVessel(TargetParts[1]);
                }
                break;

            case "CelestialBody":
                if (KerbalAlarmClock.CelestialBodyExists(TargetParts[1]))
                {
                    tReturn = KerbalAlarmClock.CelestialBody(TargetParts[1]);
                }
                break;

            default:
                break;
            }
            return(tReturn);
        }
コード例 #3
0
        //Init the API Hooks
        private void APIAwake()
        {
            //set up the hookable object
            APIInstance = this;

            //set up any events we need from the core code

            //flag it ready
            Log.detail("API Ready");
            APIReady = true;
        }
コード例 #4
0
 internal void DestroyAppLauncherButton()
 {
     //LogFormatted("AppLauncher: Destroying Button-BEFORE NULL CHECK");
     if (btnAppLauncher != null)
     {
         ApplicationLauncherButton[] lstButtons = KerbalAlarmClock.FindObjectsOfType <ApplicationLauncherButton>();
         Log.detail("AppLauncher: Destroying Button-Button Count:{0}", lstButtons.Length);
         ApplicationLauncher.Instance.RemoveModApplication(btnAppLauncher);
         btnAppLauncher = null;
     }
     //LogFormatted("AppLauncher: Destroying Button-AFTER NULL CHECK");
 }
コード例 #5
0
        private void APIDestroy()
        {
            //tear it down
            APIInstance = null;

            //Tear down any events we need to remove
            //try {

            //} catch (Exception) { }

            Log.detail("API Cleaned up");
            APIReady = false;
        }
コード例 #6
0
 public KACWorker_ViewOnly(KerbalAlarmClock parent) : base(parent)
 {
 }
コード例 #7
0
        private void APIDestroy()
        {
            //tear it down
            APIInstance = null;

            //Tear down any events we need to remove
            //try {

            //} catch (Exception) { }

            LogFormatted("API Cleaned up");
            APIReady = false;
        }
コード例 #8
0
        //Init the API Hooks
        private void APIAwake()
        {
            //set up the hookable object
            APIInstance = this;

            //set up any events we need from the core code

            //flag it ready
            LogFormatted("API Ready");
            APIReady = true;
        }
コード例 #9
0
        public KACWorker(KerbalAlarmClock parent)
        {
            parentBehaviour = parent;
            Settings = KerbalAlarmClock.Settings;

            InitWorkerVariables();

            //Event for when the vessel changes (within a scene).
            KACWorkerGameState.VesselChanged += KACWorkerGameState_VesselChanged;
        }