void updateToolbarButton()
        {
            if (failure.failurecomplete)
            {
                launcherButton.SetTexture(GetImage("KerbalLaunchFailure/Textures/failed", 38, 38));
                failure.failurecomplete = false;
                return;
            }
            if (!isFailureScriptActive || (!failure.alarmDisabled && !KerbalLaunchFailureController.soundPlaying))
            {
                return;
            }
            if (Planetarium.GetUniversalTime() - lastUpdate > 1)
            {
                lastUpdate = Planetarium.GetUniversalTime();

                abortButtonYellow = !abortButtonYellow;
                if (abortButtonYellow)
                {
                    launcherButton.SetTexture(GetImage("KerbalLaunchFailure/Textures/warning", 38, 38));
                }
                else
                {
                    launcherButton.SetTexture(GetImage("KerbalLaunchFailure/Textures/warning2", 38, 38));
                }
            }
        }
Beispiel #2
0
 void Update()
 {
     if (button == null)
     {
         return;                             // button not yet initialised ?
     }
     KSPSerialPort.ConnectionStatus status = KSPit.SerialPorts[0].portStatus;
     if (status == KSPSerialPort.ConnectionStatus.CLOSED || status == KSPSerialPort.ConnectionStatus.ERROR)
     {
         button.SetTexture(iconRed);
     }
     else if (status == KSPSerialPort.ConnectionStatus.WAITING_HANDSHAKE || status == KSPSerialPort.ConnectionStatus.HANDSHAKE)
     {
         button.SetTexture(iconOrange);
     }
     else if (status == KSPSerialPort.ConnectionStatus.CONNECTED || status == KSPSerialPort.ConnectionStatus.IDLE)
     {
         button.SetTexture(iconGreen);
     }
     else
     {
         //All cases should be covered, this should not happen.
         button.SetTexture(iconRed);
     }
 }
        /** Called every frame */
        public void FixedUpdate()
        {
            if (statusHasChanged() || timeIsUp())
            {
                statusUpdate();
            }
            if (possExperiments.Count > 0 && etButton != null && !expGUI)
            {
                etButton.SetTexture(onReady);
            }
            else if (etButton != null)
            {
                etButton.SetTexture(getButtonTexture());
            }
            expListRect.width  = windowWidth;
            expListRect.height = windowHeight;

            /** Comment out the following code pre release!!! */

            /**
             * if (Input.GetKeyDown(KeyCode.End))
             * {
             *  ResearchAndDevelopment.Instance.CheatAddScience(100000);
             *  Reputation.Instance.AddReputation(100000, TransactionReasons.Cheating);
             *  Funding.Instance.AddFunds(100000, TransactionReasons.Cheating);
             * }
             */
        }
Beispiel #4
0
        void SetTime(EditorTime newTime)
        {
            if (firstTime)
            {
                Setup();
            }
            currentTime = newTime;

            Debug.Log("LightsOut: Switching to " + newTime + " Mode");

            // Toggle Shaders
            Debug.Log("LightsOut: Updating Shaders");
            shaderManager.SetShaderMode(newTime);

            // Toggle ambient settings
            Debug.Log("LightsOut: Updating Ambient Light and Skybox");
            ambientManager.SetAmbientMode(newTime);

            //toggle VAB/SPH lights
            Debug.Log("LightsOut: Updating VAB/SPH Lights");
            externalLightsManager.SetExternalLightsMode(newTime, FindObjectsOfType(typeof(Light)) as Light[]);

            // Toggle all part lights
            SetPartLights(newTime == EditorTime.Night);

            if (newTime == EditorTime.Night)
            {
                launcherButton.SetTexture((Texture)GameDatabase.Instance.GetTexture(sunIcon, false));
            }
            else
            {
                launcherButton.SetTexture((Texture)GameDatabase.Instance.GetTexture(munIcon, false));
            }
        }
 public void set_AS_Button_active()
 {
     Log.Info("set_AS_Button_active   AS.doSnapshots: " + AS.doSnapshots.ToString() + "   AS.configuration.autoSave: " + AS.configuration.autoSave.ToString());
     if (!AS.configuration.useBlizzyToolbar)
     {
         if (AS_Button == null)
         {
             Log.Info("AS_Button == null");
         }
         if (AS.doSnapshots == false && AS.configuration.autoSave == false)
         {
             AS_Button.SetTexture(AS_button_off);
         }
         if (AS.doSnapshots == true && AS.configuration.autoSave == false)
         {
             AS_Button.SetTexture(AS_button_snapshot);
         }
         if (AS.doSnapshots == false && AS.configuration.autoSave == true)
         {
             AS_Button.SetTexture(AS_button_save);
         }
         if (AS.doSnapshots == true && AS.configuration.autoSave == true)
         {
             AS_Button.SetTexture(AS_button_snapshot_save);
         }
     }
 }
Beispiel #6
0
        private void OnAppLauncherReady()
        {
            GameEvents.onGUIApplicationLauncherReady.Remove(OnAppLauncherReady);
            GameEvents.onGUIApplicationLauncherUnreadifying.Add(OnAppLauncherUnreadifying);

            switch (HighLogic.LoadedScene)
            {
            case GameScenes.FLIGHT:
                stockButton = ApplicationLauncher.Instance.AddModApplication(
                    (delegate {
                    ShowInfo = true;
                    stockButton.SetTexture(toolbarBtnOn);
                }),
                    (delegate {
                    ShowInfo = false;
                    stockButton.SetTexture(toolbarBtnOff);
                }),
                    null, null, // TODO tooltip?
                    null, null,
                    ApplicationLauncher.AppScenes.FLIGHT,
                    toolbarBtnOff
                    );
                break;
            }
        }
        private static void CreateStockToolbarButton()
        {
            if (stock_toolbar_button == null)
            {
                stock_toolbar_button = ApplicationLauncher.Instance.AddModApplication(
                    OnStockTrue,
                    OnStockFalse,
                    null,
                    null,
                    null,
                    null,
                    ApplicationLauncher.AppScenes.MAPVIEW | ApplicationLauncher.AppScenes.FLIGHT,
                    normal_icon_texture
                    );

                if (current_iconstyle == IconStyleType.ACTIVE)
                {
                    stock_toolbar_button.SetTexture(active_icon_texture);
                }

                if (current_iconstyle == IconStyleType.AUTO)
                {
                    stock_toolbar_button.SetTexture(auto_icon_texture);
                }

                if (Settings.fetch.MainGUIEnabled || Settings.fetch.GUIEnabled)
                {
                    stock_toolbar_button.SetTrue(false);
                }
            }
        }
Beispiel #8
0
        private static void ChangeIcon(IconStyle style)
        {
            if (appButton == null)
            {
                return;
            }
            switch (style)
            {
            case IconStyle.ABS:
                appButton.SetTexture(app_icon_ABS);
                currentIcon = IconStyle.ABS;
                break;

            case IconStyle.SAB:
                appButton.SetTexture(app_icon_SAB);
                currentIcon = IconStyle.SAB;
                break;

            case IconStyle.ACTIVE:
                appButton.SetTexture(app_icon_active);
                currentIcon = IconStyle.ACTIVE;
                break;

            default:
                appButton.SetTexture(app_icon_normal);
                currentIcon = IconStyle.NORMAL;
                break;
            }
        }
 public void ShowGUI()
 {
     kalkulatorUI.rect.position = toolbarButton.GetAnchorUL();
     kalkulatorUI.rect.position = new Vector3(kalkulatorUI.rect.position.x, kalkulatorUI.rect.position.y + ((kalkulatorUI.rect.rect.height / 2) * GameSettings.UI_SCALE));
     K3InfoWindow.SetActive(true);
     toolbarButton.SetTexture(GameDatabase.Instance.GetTexture("KerbalismCompanionCalculator/Icon/AppButton_active", false));
 }
Beispiel #10
0
        protected void OnToolbarButtonToggle()
        {
            Utils.Log("[UI]: Toolbar Button Toggled", LogType.UI);

            stockToolbarButton.SetTexture((Texture)GameDatabase.Instance.GetTexture(showWindow ? toolbarUIIconURLOn : toolbarUIIconURLOff, false));
            ToggleAppLauncher();
        }
Beispiel #11
0
 public void onAppLaunchToggle()
 {
     GuiVisible = !GuiVisible;
     if (stockToolbarButton != null)
     {
         stockToolbarButton.SetTexture(GuiVisible ? appbtnTexON : appbtnTexOFF);
     }
 }
Beispiel #12
0
 protected void OnToolbarButtonToggle()
 {
     if (Settings.DebugUIMode)
     {
         Utils.Log("[UI]: Toolbar Button Toggled");
     }
     ToggleWindow();
     stockToolbarButton.SetTexture((Texture)GameDatabase.Instance.GetTexture(showWindow ? UIConstants.UIApplicationButton_On : UIConstants.UIApplicationButton_Off, false));
 }
 protected void OnToolbarButtonToggle()
 {
     if (Settings.DebugUIMode)
     {
         Utils.Log("[UI]: Toolbar Button Toggled");
     }
     ToggleWindow();
     stockToolbarButton.SetTexture((Texture)GameDatabase.Instance.GetTexture(showWindow ? toolbarUIIconURLOn : toolbarUIIconURLOff, false));
 }
Beispiel #14
0
        protected void OnToolbarButtonToggle()
        {
            if (SystemHeatSettings.DebugUI)
            {
                Utils.Log("[ReactorToolbar]: Toolbar Button Toggled");
            }

            stockToolbarButton.SetTexture((Texture)GameDatabase.Instance.GetTexture(showWindow ? toolbarUIIconURLOn : toolbarUIIconURLOff, false));
            ToggleAppLauncher();
        }
Beispiel #15
0
		// Activate app
		private void Activate()
		{
			if (isActive) return;
			isActive = true;
			ShutdownEngines();
			appLauncherButton.SetTexture(
				GameDatabase.Instance.GetTexture("DockSafe/Textures/ds_active", false)
			);
			ScreenMessages.PostScreenMessage("DockSafe: Engines safety override active");
		}
 private void ToggleIcon()
 {
     if (guiVisible)
     {
         appLauncherButton.SetTexture(iconEnableTexture);
     }
     else
     {
         appLauncherButton.SetTexture(iconDisableTexture);
     }
 }
 public void set_WASD_Button_active(bool i)
 {
     if (!i)
     {
         WASD_Button.SetTexture(WASD_button_off);
     }
     else
     {
         WASD_Button.SetTexture(WASD_button_on);
     }
 }
 public void Update()
 {
     if (Historian.Instance.Suppressed)
     {
         button.SetTexture(suppressedTexture);
     }
     else
     {
         button.SetTexture(normalTexture);
     }
 }
 public static void SetDefaultButton()
 {
     if (TCAToolbarButton != null)
     {
         TCAToolbarButton.TexturePath = TB_ICON_MAN;
     }
     if (TCAButton != null)
     {
         TCAButton.SetTexture(textureMan);
     }
 }
        // button callbacks

        public void onTrue()
        {
            // ie when clicked on

            btnIsPressed = true;

            if (atStation)
            {
                grapesBtn.SetTexture(grapesTextureOn);
            }
        }
Beispiel #21
0
 public void OnButtonTrue()
 {
     window.Visible = true;
     if (appButton != null)
     {
         appButton.SetTexture(icon_on);
     }
     if (blizzyToolbarButton != null)
     {
         blizzyToolbarButton.TexturePath = iconPath_blizzy;
     }
 }
Beispiel #22
0
 private void ToggleVariantListener()
 {
     variantListenerEnabled = !variantListenerEnabled;
     if (variantListenerEnabled)
     {
         toolbarButton.SetTexture(GameDatabase.Instance.GetTexture("ConsistentVariants/IconON", false));
     }
     else
     {
         toolbarButton.SetTexture(GameDatabase.Instance.GetTexture("ConsistentVariants/IconOFF", false));
     }
 }
Beispiel #23
0
 public static void setBtnState(bool state, bool click = false)
 {
     if (state)
     {
         btnLauncher.SetTrue(click);
         btnLauncher.SetTexture(retrograde);
     }
     else
     {
         btnLauncher.SetFalse(click);
         btnLauncher.SetTexture(prograde);
     }
 }
Beispiel #24
0
 static void toggleServer()
 {
     if (httpServerStarted)
     {
         httpServer.Terminate();
         httpServer = null;
         toolbarButton.SetTexture(inactiveTexture);
     }
     else
     {
         httpServer = new HttpServer(port);
         toolbarButton.SetTexture(activeTexture);
     }
 }
Beispiel #25
0
 public void setLauncherOnOffIcon(bool state)
 {
     if (launcher_btn == null)
     {
         return;
     }
     if (state)
     {
         launcher_btn.SetTexture(launcher_btn_textore_on);
     }
     else
     {
         launcher_btn.SetTexture(launcher_btn_textore_off);
     }
 }
Beispiel #26
0
        void InitUI()
        {
            // Layout extensions
            GUILayoutExtensions.Init(gameObject);

            // Disconnect client dialog
            clientDisconnectDialog = gameObject.AddComponent <ClientDisconnectDialog> ();

            // Info window
            infoWindow          = gameObject.AddComponent <InfoWindow> ();
            infoWindow.Closable = true;
            infoWindow.Visible  = config.InfoWindowVisible;
            infoWindow.Position = config.InfoWindowPosition;

            // Main window
            mainWindow          = gameObject.AddComponent <MainWindow> ();
            mainWindow.Config   = config;
            mainWindow.Server   = server;
            mainWindow.Visible  = config.MainWindowVisible;
            mainWindow.Position = config.MainWindowPosition;
            mainWindow.ClientDisconnectDialog = clientDisconnectDialog;
            mainWindow.InfoWindow             = infoWindow;

            // New connection dialog
            clientConnectingDialog = gameObject.AddComponent <ClientConnectingDialog> ();

            // Set up events
            InitEvents();

            // Add button to the applauncher
            mainWindow.Closable = true;
            textureOnline       = GameDatabase.Instance.GetTexture("kRPC/icons/applauncher-online", false);
            textureOffline      = GameDatabase.Instance.GetTexture("kRPC/icons/applauncher-offline", false);
            GameEvents.onGUIApplicationLauncherReady.Add(OnGUIApplicationLauncherReady);
            GameEvents.onGUIApplicationLauncherDestroyed.Add(OnGUIApplicationLauncherDestroyed);
            server.OnStarted += (s, e) => {
                if (applauncherButton != null)
                {
                    applauncherButton.SetTexture(textureOnline);
                }
            };
            server.OnStopped += (s, e) => {
                if (applauncherButton != null)
                {
                    applauncherButton.SetTexture(textureOffline);
                }
            };
        }
 public void SetTexture()
 {
     if (button != null)
     {
         if (MasterSwitch.IsEnabled)
         {
             button.SetTrue(false);
             button.SetTexture(MasterSwitch.IsRepeatEnabled ? onRepeatTexture : onTexture);
         }
         else
         {
             button.SetFalse(false);
             button.SetTexture(offTexture);
         }
     }
 }
Beispiel #28
0
        //Toolbar button click handlers
        internal static void OnRMRosterToggle()
        {
            //Debug.Log("[RosterManager]:  RosterManagerAddon.OnRMRosterToggle");
            try
            {
                if (HighLogic.LoadedScene != GameScenes.SPACECENTER && HighLogic.LoadedScene != GameScenes.EDITOR &&
                    HighLogic.LoadedScene != GameScenes.TRACKSTATION && HighLogic.LoadedScene != GameScenes.FLIGHT)
                {
                    return;
                }
                WindowRoster.ShowWindow = !WindowRoster.ShowWindow;
                if (RMSettings.EnableBlizzyToolbar)
                {
                    _rmRosterBlizzy.TexturePath = WindowRoster.ShowWindow ? TextureFolder + "Icon_On_24" : TextureFolder + "Icon_Off_24";
                }
                else
                {
                    _rmRosterStock.SetTexture(GameDatabase.Instance.GetTexture(WindowRoster.ShowWindow ? TextureFolder + "Icon_On_128" : TextureFolder + "Icon_Off_128", false));
                }

                if (!WindowRoster.ShowWindow)
                {
                    return;
                }
                WindowRoster.DisplayMode = WindowRoster.DisplayModes.Index;
                WindowRoster.UpdateRosterList();
                //AllCrew.Clear();
                //if (RMLifeSpan.Instance != null)
                //    AllCrew = RMLifeSpan.Instance.rmkerbals.ALLRMKerbals.ToList();
            }
            catch (Exception ex)
            {
                RmUtils.LogMessage("Error in:  RosterManagerAddon.OnRMRosterToggle.  " + ex, "Error", true);
            }
        }
Beispiel #29
0
        // Stock Toolbar Startup and cleanup
        private void OnGuiAppLauncherReady()
        {
            RmUtils.LogMessage("RosterManagerAddon.OnGUIAppLauncherReady active...", "Info", RMSettings.VerboseLogging);
            try
            {
                // Setup Roster Button
                if ((HighLogic.LoadedScene != GameScenes.SPACECENTER && HighLogic.LoadedScene != GameScenes.EDITOR &&
                     HighLogic.LoadedScene != GameScenes.TRACKSTATION && HighLogic.LoadedScene != GameScenes.FLIGHT) ||
                    _rmRosterStock != null || RMSettings.EnableBlizzyToolbar)
                {
                    return;
                }
                const string iconfile = "Icon_Off_128";
                _rmRosterStock = ApplicationLauncher.Instance.AddModApplication(
                    OnRMRosterToggle,
                    OnRMRosterToggle,
                    DummyVoid,
                    DummyVoid,
                    DummyVoid,
                    DummyVoid,
                    ApplicationLauncher.AppScenes.SPACECENTER | ApplicationLauncher.AppScenes.FLIGHT |
                    ApplicationLauncher.AppScenes.MAPVIEW | ApplicationLauncher.AppScenes.SPH | ApplicationLauncher.AppScenes.VAB |
                    ApplicationLauncher.AppScenes.TRACKSTATION,
                    GameDatabase.Instance.GetTexture(TextureFolder + iconfile, false));

                if (WindowRoster.ShowWindow)
                {
                    _rmRosterStock.SetTexture(GameDatabase.Instance.GetTexture(WindowRoster.ShowWindow ? TextureFolder + "Icon_On_128" : TextureFolder + "Icon_Off_128", false));
                }
            }
            catch (Exception ex)
            {
                RmUtils.LogMessage("Error in:  RosterManagerAddon.OnGUIAppLauncherReady.  " + ex, "Error", true);
            }
        }
Beispiel #30
0
        // Toolbar button click handler
        internal static void OnToolbarButtonToggle()
        {
            try
            {
                if (HighLogic.LoadedScene != GameScenes.SPACECENTER && HighLogic.LoadedScene != GameScenes.FLIGHT)
                {
                    return;
                }

                WindowSettings.showWindow = !WindowSettings.showWindow;

                if (LtSettings.enableBlizzyToolbar)
                {
                    _blizzyButton.TexturePath = WindowSettings.showWindow ? BlizzyOn : BlizzyOff;
                }
                else
                {
                    _stockButton.SetTexture(GameDatabase.Instance.GetTexture(WindowSettings.showWindow ? StockOn : StockOff, false));
                }
            }
            catch (Exception ex)
            {
                Util.LogMessage("LTAddon.OnToolbarButtonToggle. Error: " + ex, Util.LogType.Error);
            }
        }
Beispiel #31
0
        // Stock Toolbar Startup and cleanup
        private void OnGuiAppLauncherReady()
        {
            try
              {
            // Setup SM WIndow button
            if (HighLogic.LoadedSceneIsFlight && _smButtonStock == null && !SMSettings.EnableBlizzyToolbar)
            {
              string iconfile = "IconOff_38";
              _smButtonStock = ApplicationLauncher.Instance.AddModApplication(
            OnSmButtonClicked,
            OnSmButtonClicked,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW,
            GameDatabase.Instance.GetTexture(TextureFolder + iconfile, false));

              if (WindowManifest.ShowWindow)
            _smButtonStock.SetTexture(
              GameDatabase.Instance.GetTexture(
                WindowManifest.ShowWindow ? TextureFolder + "IconOn_38" : TextureFolder + "IconOff_38", false));
            }

            // Setup Settings Button
            if (HighLogic.LoadedScene == GameScenes.SPACECENTER && _smSettingsStock == null &&
            !SMSettings.EnableBlizzyToolbar)
            {
              string iconfile = "IconS_Off_38";
              _smSettingsStock = ApplicationLauncher.Instance.AddModApplication(
            OnSmSettingsClicked,
            OnSmSettingsClicked,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            ApplicationLauncher.AppScenes.SPACECENTER,
            GameDatabase.Instance.GetTexture(TextureFolder + iconfile, false));

              if (WindowSettings.ShowWindow)
            _smSettingsStock.SetTexture(
              GameDatabase.Instance.GetTexture(
                WindowSettings.ShowWindow ? TextureFolder + "IconS_On_38" : TextureFolder + "IconS_Off_38", false));
            }

            // Setup Roster Button
            if (HighLogic.LoadedScene != GameScenes.SPACECENTER || _smRosterStock != null || SMSettings.EnableBlizzyToolbar)
              return;
            {
              string iconfile = "IconR_Off_38";
              _smRosterStock = ApplicationLauncher.Instance.AddModApplication(
            OnSmRosterClicked,
            OnSmRosterClicked,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            DummyHandler,
            ApplicationLauncher.AppScenes.SPACECENTER,
            GameDatabase.Instance.GetTexture(TextureFolder + iconfile, false));

              if (WindowRoster.ShowWindow)
            _smRosterStock.SetTexture(
              GameDatabase.Instance.GetTexture(
                WindowRoster.ShowWindow ? TextureFolder + "IconR_On_38" : TextureFolder + "IconR_Off_38", false));
            }
              }
              catch (Exception ex)
              {
            Utilities.LogMessage("Error in:  SMAddon.OnGUIAppLauncherReady.  " + ex, Utilities.LogType.Error, true);
              }
        }
Beispiel #32
0
    // Stock Toolbar Startup and cleanup
    private void OnGUIAppLauncherReady()
    {
      Utilities.LogMessage("SMAddon.OnGUIAppLauncherReady active...", "Info", SMSettings.VerboseLogging);
      try
      {
        // Setup SM WIndow button
        if (HighLogic.LoadedSceneIsFlight && SMButton_Stock == null && !SMSettings.EnableBlizzyToolbar)
        {
          string Iconfile = "IconOff_38";
          SMButton_Stock = ApplicationLauncher.Instance.AddModApplication(
              OnSMButtonToggle,
              OnSMButtonToggle,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW,
              (Texture)GameDatabase.Instance.GetTexture(TextureFolder + Iconfile, false));

          if (WindowManifest.ShowWindow)
            SMButton_Stock.SetTexture((Texture)GameDatabase.Instance.GetTexture(WindowManifest.ShowWindow ? TextureFolder + "IconOn_38" : TextureFolder + "IconOff_38", false));
        }

        // Setup Settings Button
        if (HighLogic.LoadedScene == GameScenes.SPACECENTER && SMSettings_Stock == null && !SMSettings.EnableBlizzyToolbar)
        {
          string Iconfile = "IconS_Off_38";
          SMSettings_Stock = ApplicationLauncher.Instance.AddModApplication(
              OnSMSettingsToggle,
              OnSMSettingsToggle,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              ApplicationLauncher.AppScenes.SPACECENTER,
              (Texture)GameDatabase.Instance.GetTexture(TextureFolder + Iconfile, false));

          if (WindowSettings.ShowWindow)
            SMSettings_Stock.SetTexture((Texture)GameDatabase.Instance.GetTexture(WindowSettings.ShowWindow ? TextureFolder + "IconS_On_38" : TextureFolder + "IconS_Off_38", false));
        }

        // Setup Roster Button
        if (HighLogic.LoadedScene == GameScenes.SPACECENTER && SMRoster_Stock == null && !SMSettings.EnableBlizzyToolbar)
        {
          string Iconfile = "IconR_Off_38";
          SMRoster_Stock = ApplicationLauncher.Instance.AddModApplication(
              OnSMRosterToggle,
              OnSMRosterToggle,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              DummyHandler,
              ApplicationLauncher.AppScenes.SPACECENTER,
              (Texture)GameDatabase.Instance.GetTexture(TextureFolder + Iconfile, false));

          if (WindowRoster.ShowWindow)
            SMRoster_Stock.SetTexture((Texture)GameDatabase.Instance.GetTexture(WindowRoster.ShowWindow ? TextureFolder + "IconR_On_38" : TextureFolder + "IconR_Off_38", false));
        }

      }
      catch (Exception ex)
      {
        Utilities.LogMessage("Error in:  ShipManifestAddon.OnGUIAppLauncherReady.  " + ex.ToString(), "Error", true);
      }
    }
        private void OnGUIAppLauncherReady()
        {
            // Setup PW Stock Toolbar button
            bool hidden = false;
            if(ApplicationLauncher.Ready && (partWizardStockButton == null || !ApplicationLauncher.Instance.Contains(partWizardStockButton, out hidden)))
            {
                partWizardStockButton = ApplicationLauncher.Instance.AddModApplication(
                    ToggleVisibility,
                    ToggleVisibility,
                    DummyHandler,
                    DummyHandler,
                    DummyHandler,
                    DummyHandler,
                    ApplicationLauncher.AppScenes.VAB | ApplicationLauncher.AppScenes.SPH,
                    (Texture)GameDatabase.Instance.GetTexture(StockToolbarIconActive, false));

                if(this.partWizardWindow.Visible)
                {
                    partWizardStockButton.SetTexture((Texture)GameDatabase.Instance.GetTexture(this.partWizardWindow.Visible ? this.toolbarIconActive : this.toolbarIconInactive, false));
                }
            }
        }
Beispiel #34
0
        // Stock Toolbar Startup and cleanup
        private void OnGUIAppLauncherReady()
        {
            Utilities.LogMessage("RosterManagerAddon.OnGUIAppLauncherReady active...", "Info", RMSettings.VerboseLogging);
            try
            {
                // Setup Roster Button
                if (HighLogic.LoadedScene == GameScenes.SPACECENTER && RMRoster_Stock == null && !RMSettings.EnableBlizzyToolbar)
                {
                    string Iconfile = "Icon_Off_38";
                    RMRoster_Stock = ApplicationLauncher.Instance.AddModApplication(
                        OnRMRosterToggle,
                        OnRMRosterToggle,
                        DummyVoid,
                        DummyVoid,
                        DummyVoid,
                        DummyVoid,
                        ApplicationLauncher.AppScenes.SPACECENTER,
                        (Texture)GameDatabase.Instance.GetTexture(TextureFolder + Iconfile, false));

                    if (WindowRoster.ShowWindow)
                        RMRoster_Stock.SetTexture((Texture)GameDatabase.Instance.GetTexture(WindowRoster.ShowWindow ? TextureFolder + "Icon_On_38" : TextureFolder + "Icon_Off_38", false));
                }

            }
            catch (Exception ex)
            {
                Utilities.LogMessage("Error in:  RosterManagerAddon.OnGUIAppLauncherReady.  " + ex.ToString(), "Error", true);
            }
        }