コード例 #1
0
 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);
     }
 }
コード例 #2
0
        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);
        }