private static void InterfaceToggleTab(InspectTabBase tab, IInspectPane pane)
 {
     if (!TutorSystem.TutorialMode || InspectPaneUtility.IsOpen(tab, pane) || TutorSystem.AllowAction("ITab-" + tab.tutorTag + "-Open"))
     {
         InspectPaneUtility.ToggleTab(tab, pane);
     }
 }
Exemple #2
0
 private static void ToggleTab(InspectTabBase tab, IInspectPane pane)
 {
     if (InspectPaneUtility.IsOpen(tab, pane) || (tab == null && pane.OpenTabType == null))
     {
         pane.OpenTabType = null;
         SoundDefOf.TabClose.PlayOneShotOnCamera(null);
     }
     else
     {
         tab.OnOpen();
         pane.OpenTabType = tab.GetType();
         SoundDefOf.TabOpen.PlayOneShotOnCamera(null);
     }
 }
        public static InspectTabBase OpenTab(Type inspectTabType)
        {
            MainTabWindow_Inspect mainTabWindow_Inspect = (MainTabWindow_Inspect)MainButtonDefOf.Inspect.TabWindow;
            InspectTabBase        inspectTabBase        = (from t in mainTabWindow_Inspect.CurTabs
                                                           where inspectTabType.IsAssignableFrom(t.GetType())
                                                           select t).FirstOrDefault <InspectTabBase>();

            if (inspectTabBase != null)
            {
                if (Find.MainTabsRoot.OpenTab != MainButtonDefOf.Inspect)
                {
                    Find.MainTabsRoot.SetCurrentTab(MainButtonDefOf.Inspect, true);
                }
                if (!InspectPaneUtility.IsOpen(inspectTabBase, mainTabWindow_Inspect))
                {
                    InspectPaneUtility.ToggleTab(inspectTabBase, mainTabWindow_Inspect);
                }
            }
            return(inspectTabBase);
        }