Chatterer.ToolbarButtonWrapper.SetButtonVisibility C# (CSharp) Method

SetButtonVisibility() public method

Sets this button's visibility. Can be used in addition to or as a replacement for Visible.
public SetButtonVisibility ( ) : void
return void
        public void SetButtonVisibility(params GameScenes[] gameScenes)
        {
            object GameScenesVisibilityObj = Activator.CreateInstance(this.GameScenesVisibilityType, gameScenes);
            this.ButtonVisibility.SetValue(this.Button, GameScenesVisibilityObj, null);
        }

Usage Example

Example #1
0
        //////////////////////////////////////////////////
        //////////////////////////////////////////////////
        //GUI
        //integration with blizzy78's Toolbar plugin
        internal chatterer()
        {
            if (ToolbarButtonWrapper.ToolbarManagerPresent)
            {
                if (debugging) Debug.Log("[CHATR] blizzy78's Toolbar plugin found ! Set toolbar button.");

                chatterer_toolbar_button = ToolbarButtonWrapper.TryWrapToolbarButton("Chatterer", "UI");
                chatterer_toolbar_button.TexturePath = "Chatterer/Textures/chatterer_icon_toolbar";
                chatterer_toolbar_button.ToolTip = "Open/Close Chatterer UI";
                chatterer_toolbar_button.SetButtonVisibility(GameScenes.FLIGHT);
                chatterer_toolbar_button.AddButtonClickHandler((e) =>
                {
                    if (debugging) Debug.Log("[CHATR] Toolbar UI button clicked, when hide_all_windows = " + hide_all_windows);

                    if (launcherButton == null && ToolbarButtonWrapper.ToolbarManagerPresent)
                    {
                        UIToggle();
                    }
                    else if (launcherButton != null)
                    {
                        if (hide_all_windows)
                        {
                            launcherButton.SetTrue();
                            if (debugging) Debug.Log("[CHATR] Blizzy78's Toolbar UI button clicked, launcherButton.State = " + launcherButton.toggleButton.CurrentState);
                        }
                        else if (!hide_all_windows)
                        {
                            launcherButton.SetFalse();
                            if (debugging) Debug.Log("[CHATR] Blizzy78's Toolbar UI button clicked, saving settings... & launcherButton.State = " + launcherButton.toggleButton.CurrentState);
                        }
                    }
                });
            }
        }