void AddToolbarButton(toolbarType type, bool useStockIfProblem)
        {
            if (type == toolbarType.BLIZZY)
            {
                if (ToolbarManager.ToolbarAvailable)
                {
                    {
                        activeToolbar = toolbarType.BLIZZY;
                        wcbutton = ToolbarManager.Instance.add("WernherChecker", "wcbutton"); //creating toolbar button
                        wcbutton.TexturePath = "WernherChecker/Data/icon_24";
                        wcbutton.ToolTip = "WernherChecker";
                        wcbutton.OnClick += (e) =>
                        {
                            if (minimizedManually)
                                MiniOff();
                            else
                                MiniOn();
                        };
                    }
                }
                else if (useStockIfProblem)
                    AddToolbarButton(toolbarType.STOCK, true);
            }

            if(type == toolbarType.STOCK)
            {
                activeToolbar = toolbarType.STOCK;
                if (ApplicationLauncher.Ready)
                    CreateAppButton();
                GameEvents.onGUIApplicationLauncherReady.Add(CreateAppButton);
                GameEvents.onGUIApplicationLauncherUnreadifying.Add(DestroyAppButton);
            }
        }
示例#2
0
 void AddToolbarButton(toolbarType type, bool useStockIfProblem)
 {
     CreateAppButton();
 }