Exemplo n.º 1
0
        public void Initialize(UserInterface userInterface)
        {
            MainTabWindow_Inspect mainTabWindow_Inspect = userInterface.FindMainTabOfType <MainTabWindow_Inspect>();

            if (mainTabWindow_Inspect != null)
            {
                this.ResetReplacementTabs(mainTabWindow_Inspect);
            }
        }
Exemplo n.º 2
0
        public void ResetReplacementTabs(MainTabWindow_Inspect window)
        {
            ReplacementTabs replacementTabs = this.CreateReplacementTabs();

            if (!replacementTabs.Empty)
            {
                window.ReplacementTabs = this.CreateReplacementTabs();
            }
            else
            {
                window.ReplacementTabs = null;
            }
        }
Exemplo n.º 3
0
 public void Update()
 {
     if (this.dirtyFlag)
     {
         UserInterface userInterface = Find.UIRoot_Map as UserInterface;
         if (userInterface != null)
         {
             MainTabWindow_Inspect mainTabWindow_Inspect = userInterface.FindMainTabOfType <MainTabWindow_Inspect>();
             if (mainTabWindow_Inspect != null)
             {
                 this.ResetReplacementTabs(mainTabWindow_Inspect);
             }
         }
         this.dirtyFlag = false;
     }
 }
Exemplo n.º 4
0
        public void DoTabGui(ITab tab)
        {
            MainTabWindow_Inspect inspectWorker = (MainTabWindow_Inspect)MainTabDefOf.Inspect.Window;

            this.updateSizeMethod.Invoke(tab, null);
            Vector2 vector  = (Vector2)this.sizeField.GetValue(tab);
            float   y       = vector.y;
            float   top     = inspectWorker.PaneTopY - 30f - y;
            Rect    outRect = new Rect(0f, top, vector.x, y);

            Find.WindowStack.ImmediateWindow(235086, outRect, WindowLayer.GameUI, delegate
            {
                if (Find.MainTabsRoot.OpenTab != MainTabDefOf.Inspect || !this.CurTabs.Contains(tab) || !tab.IsVisible)
                {
                    return;
                }
                if (Widgets.CloseButtonFor(outRect.AtZero()))
                {
                    inspectWorker.CloseOpenTab();
                }
                try
                {
                    this.fillTabMethod.Invoke(tab, null);
                }
                catch (Exception ex)
                {
                    Log.ErrorOnce(string.Concat(new object[]
                    {
                        "Exception filling tab ",
                        this.GetType(),
                        ": ",
                        ex.ToString()
                    }), 49827);
                }
            }, true, false, 1f);
        }