コード例 #1
0
 public virtual void UIRootOnGUI()
 {
     UnityGUIBugsFixer.OnGUI();
     Text.StartOfOnGUI();
     CheckOpenLogWindow();
     DelayedErrorWindowRequest.DelayedErrorWindowRequestOnGUI();
     DebugInputLogger.InputLogOnGUI();
     if (!screenshotMode.FiltersCurrentEvent)
     {
         debugWindowOpener.DevToolStarterOnGUI();
     }
     windows.HandleEventsHighPriority();
     screenshotMode.ScreenshotModesOnGUI();
     if (!screenshotMode.FiltersCurrentEvent)
     {
         TooltipHandler.DoTooltipGUI();
         feedbackFloaters.FeedbackOnGUI();
         DragSliderManager.DragSlidersOnGUI();
         Messages.MessagesDoGUI();
     }
     shortcutKeys.ShortcutKeysOnGUI();
     NoiseDebugUI.NoiseDebugOnGUI();
     Debug.developerConsoleVisible = false;
     if (Current.Game != null)
     {
         GameComponentUtility.GameComponentOnGUI();
     }
 }
コード例 #2
0
        public static void LongEventsOnGUI()
        {
            if (currentEvent == null)
            {
                GameplayTipWindow.ResetTipTimer();
                return;
            }
            float num = StatusRectSize.x;

            lock (CurrentEventTextLock)
            {
                Text.Font = GameFont.Small;
                num       = Mathf.Max(num, Text.CalcSize(currentEvent.eventText + "...").x + 40f);
            }
            bool    flag   = Find.UIRoot != null && !currentEvent.UseStandardWindow && currentEvent.showExtraUIInfo;
            bool    flag2  = Find.UIRoot != null && Current.Game != null && !currentEvent.UseStandardWindow && currentEvent.showExtraUIInfo;
            Vector2 vector = flag2 ? ModSummaryWindow.GetEffectiveSize() : Vector2.zero;
            float   num2   = StatusRectSize.y;

            if (flag2)
            {
                num2 += 17f + vector.y;
            }
            if (flag)
            {
                num2 += 17f + GameplayTipWindow.WindowSize.y;
            }
            float   num3    = ((float)UI.screenHeight - num2) / 2f;
            Vector2 offset  = new Vector2(((float)UI.screenWidth - GameplayTipWindow.WindowSize.x) / 2f, num3 + StatusRectSize.y + 17f);
            Vector2 offset2 = new Vector2(((float)UI.screenWidth - vector.x) / 2f, offset.y + GameplayTipWindow.WindowSize.y + 17f);
            Rect    r       = new Rect(((float)UI.screenWidth - num) / 2f, num3, num, StatusRectSize.y);

            r = r.Rounded();
            if (!currentEvent.UseStandardWindow || Find.UIRoot == null || Find.WindowStack == null)
            {
                if (UIMenuBackgroundManager.background == null)
                {
                    UIMenuBackgroundManager.background = new UI_BackgroundMain();
                }
                UIMenuBackgroundManager.background.BackgroundOnGUI();

                Widgets.DrawShadowAround(r);
                Widgets.DrawWindowBackground(r);
                DrawLongEventWindowContents(r);
                if (flag)
                {
                    GameplayTipWindow.DrawWindow(offset, useWindowStack: false);
                }
                if (flag2)
                {
                    ModSummaryWindow.DrawWindow(offset2, useWindowStack: false);
                    TooltipHandler.DoTooltipGUI();
                }
            }
            else
            {
                DrawLongEventWindow(r);
                if (flag)
                {
                    GameplayTipWindow.DrawWindow(offset, useWindowStack: true);
                }
            }
        }