示例#1
0
 public static void LongEventsOnGUI()
 {
     if (LongEventHandler.currentEvent != null)
     {
         float  num = LongEventHandler.GUIRectSize.x;
         object currentEventTextLock = LongEventHandler.CurrentEventTextLock;
         lock (currentEventTextLock)
         {
             Text.Font = GameFont.Small;
             num       = Mathf.Max(num, Text.CalcSize(LongEventHandler.currentEvent.eventText + "...").x + 40f);
         }
         Rect rect = new Rect(((float)UI.screenWidth - num) / 2f, ((float)UI.screenHeight - LongEventHandler.GUIRectSize.y) / 2f, num, LongEventHandler.GUIRectSize.y);
         rect = rect.Rounded();
         if (!LongEventHandler.currentEvent.UseStandardWindow || Find.UIRoot == null || Find.WindowStack == null)
         {
             if (UIMenuBackgroundManager.background == null)
             {
                 UIMenuBackgroundManager.background = new UI_BackgroundMain();
             }
             UIMenuBackgroundManager.background.BackgroundOnGUI();
             Widgets.DrawShadowAround(rect);
             Widgets.DrawWindowBackground(rect);
             LongEventHandler.DrawLongEventWindowContents(rect);
         }
         else
         {
             Find.WindowStack.ImmediateWindow(62893994, rect, WindowLayer.Super, delegate
             {
                 LongEventHandler.DrawLongEventWindowContents(rect.AtZero());
             }, true, false, 1f);
         }
     }
 }
 public static void LongEventsOnGUI()
 {
     if (LongEventHandler.currentEvent != null)
     {
         Vector2 gUIRectSize          = LongEventHandler.GUIRectSize;
         float   num                  = gUIRectSize.x;
         object  currentEventTextLock = LongEventHandler.CurrentEventTextLock;
         Monitor.Enter(currentEventTextLock);
         try
         {
             Text.Font = GameFont.Small;
             float   a      = num;
             Vector2 vector = Text.CalcSize(LongEventHandler.currentEvent.eventText + "...");
             num = Mathf.Max(a, (float)(vector.x + 40.0));
         }
         finally
         {
             Monitor.Exit(currentEventTextLock);
         }
         double  x            = ((float)UI.screenWidth - num) / 2.0;
         float   num2         = (float)UI.screenHeight;
         Vector2 gUIRectSize2 = LongEventHandler.GUIRectSize;
         double  y            = (num2 - gUIRectSize2.y) / 2.0;
         float   width        = num;
         Vector2 gUIRectSize3 = LongEventHandler.GUIRectSize;
         Rect    rect         = new Rect((float)x, (float)y, width, gUIRectSize3.y);
         rect = rect.Rounded();
         if (!LongEventHandler.currentEvent.UseStandardWindow || Find.UIRoot == null || Find.WindowStack == null)
         {
             if (UIMenuBackgroundManager.background == null)
             {
                 UIMenuBackgroundManager.background = new UI_BackgroundMain();
             }
             UIMenuBackgroundManager.background.BackgroundOnGUI();
             Widgets.DrawShadowAround(rect);
             Widgets.DrawWindowBackground(rect);
             LongEventHandler.DrawLongEventWindowContents(rect);
         }
         else
         {
             Find.WindowStack.ImmediateWindow(62893994, rect, WindowLayer.Super, delegate
             {
                 LongEventHandler.DrawLongEventWindowContents(rect.AtZero());
             }, true, false, 1f);
         }
     }
 }
示例#3
0
 internal void <> m__0()
 {
     LongEventHandler.DrawLongEventWindowContents(this.rect.AtZero());
 }