Jump to content

[Solved] Need to disable toolbar button in Editor


Recommended Posts

I have the following code to add a button to the stock toolbar:

        private void OnGuiAppLauncherReady ()
        {
            try {
                button = ApplicationLauncher.Instance.AddModApplication (
                    GUIToggle, GUIToggle,     
                    null, null,
                    null, null,
                    ApplicationLauncher.AppScenes.VAB | ApplicationLauncher.AppScenes.SPH, //visibleInScenes
                    GameDatabase.Instance.GetTexture (texPathDefault, false) //texture
                );
            } catch (Exception ex) {
                Log.Error ("Error adding ApplicationLauncher button: " + ex.Message);
            }

        }

 

there are times I want the button to be disabled, and to be greyed out (like the launch icon gets greyed out when there isn't a ship to launch).  I have the code to do this, how can I disable/enable the toolbar button?

Thanks

Edited by linuxgurugamer
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...