public MainTabWindow_Manager()
 {
     if (CurrentTab == null)
     {
         CurrentTab = DefaultTab;
     }
 }
 public MainTabWindow_Manager()
 {
     if ( CurrentTab == null )
     {
         CurrentTab = DefaultTab;
     }
 }
 public void DrawTabIcon(Rect rect, ManagerTab tab)
 {
     if (tab.Enabled)
     {
         if (tab == CurrentTab)
         {
             GUI.color = GenUI.MouseoverColor;
             if (Widgets.ButtonImage(rect, tab.Icon, GenUI.MouseoverColor))
             {
                 tab.Selected = null;
             }
             GUI.color = Color.white;
         }
         else if (Widgets.ButtonImage(rect, tab.Icon))
         {
             GoTo(tab);
         }
         TooltipHandler.TipRegion(rect, tab.Label);
     }
     else
     {
         GUI.color = Color.grey;
         GUI.DrawTexture(rect, tab.Icon);
         GUI.color = Color.white;
         TooltipHandler.TipRegion(rect, tab.Label + "FM.TabDisabledBecause".Translate(tab.DisabledReason));
     }
 }
        public static void GoTo( ManagerTab tab, ManagerJob job = null )
        {
            // call pre/post open/close methods
            ManagerTab old = CurrentTab;
            old.PreClose();
            tab.PreOpen();
            CurrentTab = tab;
            old.PostClose();
            tab.PostOpen();

            // if desired, set selected.
            if ( job != null )
            {
                tab.Selected = job;
            }
        }
        public static void GoTo(ManagerTab tab, ManagerJob job = null)
        {
            // call pre/post open/close methods
            ManagerTab old = CurrentTab;

            old.PreClose();
            tab.PreOpen();
            CurrentTab = tab;
            old.PostClose();
            tab.PostOpen();

            // if desired, set selected.
            if (job != null)
            {
                tab.Selected = job;
            }
        }
 public void DrawTabIcon(Rect rect, ManagerTab tab)
 {
     if (tab == CurrentTab)
     {
         GUI.color = GenUI.MouseoverColor;
         if (Widgets.ButtonImage(rect, tab.Icon, GenUI.MouseoverColor))
         {
             tab.Selected = null;
         }
         GUI.color = Color.white;
     }
     else if (Widgets.ButtonImage(rect, tab.Icon))
     {
         GoTo(tab);
     }
     TooltipHandler.TipRegion(rect, tab.Label);
 }
        public override void PreOpen()
        {
            base.PreOpen();

            // TODO: reimplement help dialog
            //if ( !Manager.For( Find.CurrentMap ).HelpShown )
            //{
            //    Find.WindowStack.Add( new Dialog_Message( "FM.HelpMessage".Translate(), "FM.HelpTitle".Translate() ) );
            //    Manager.For( Find.CurrentMap ).HelpShown = true;
            //}

            // make sure the currently open tab is for this map
            if (CurrentTab.manager.map != Find.CurrentMap)
            {
                CurrentTab = DefaultTab;
            }
            CurrentTab.PreOpen();
        }
        public override void PreOpen()
        {
            base.PreOpen();

            // TODO: reimplement help dialog
            //if ( !Manager.For( Find.VisibleMap ).HelpShown )
            //{
            //    Find.WindowStack.Add( new Dialog_Message( "FM.HelpMessage".Translate(), "FM.HelpTitle".Translate() ) );
            //    Manager.For( Find.VisibleMap ).HelpShown = true;
            //}

            Manager.For(Find.VisibleMap).RefreshTabs();
            Manager.For(Find.VisibleMap).AddPowerTabIfUnlocked();

            // don't show tabs for other maps
            if (CurrentTab.manager.map != Find.VisibleMap)
            {
                CurrentTab = DefaultTab;
            }
            CurrentTab.PreOpen();
        }
        public override void PreOpen()
        {
            base.PreOpen();

            // TODO: reimplement help dialog
            //if ( !Manager.For( Find.VisibleMap ).HelpShown )
            //{
            //    Find.WindowStack.Add( new Dialog_Message( "FM.HelpMessage".Translate(), "FM.HelpTitle".Translate() ) );
            //    Manager.For( Find.VisibleMap ).HelpShown = true;
            //}

            Manager.For( Find.VisibleMap ).RefreshTabs();
            Manager.For( Find.VisibleMap ).AddPowerTabIfUnlocked();

            // don't show tabs for other maps
            if ( CurrentTab.manager.map != Find.VisibleMap )
                CurrentTab = DefaultTab;
            CurrentTab.PreOpen();
        }
 public void DrawTabIcon( Rect rect, ManagerTab tab )
 {
     if ( tab == CurrentTab )
     {
         GUI.color = GenUI.MouseoverColor;
         if ( Widgets.ButtonImage( rect, tab.Icon, GenUI.MouseoverColor ) )
         {
             tab.Selected = null;
         }
         GUI.color = Color.white;
     }
     else if ( Widgets.ButtonImage( rect, tab.Icon ) )
     {
         GoTo( tab );
     }
     TooltipHandler.TipRegion( rect, tab.Label );
 }