Пример #1
0
        private static void DoCountdownTimer(Rect rect, TimedDetectionRaids timedForcedExit)
        {
            string detectionCountdownTimeLeftString = timedForcedExit.DetectionCountdownTimeLeftString;
            string text  = "CaravanDetectedRaidCountdown".Translate(detectionCountdownTimeLeftString);
            float  x     = Text.CalcSize(text).x;
            Rect   rect2 = new Rect(rect.xMax - x, rect.y, x, rect.height);

            if (Mouse.IsOver(rect2))
            {
                Widgets.DrawHighlight(rect2);
            }
            TooltipHandler.TipRegionByKey(rect2, "CaravanDetectedRaidCountdownTip", detectionCountdownTimeLeftString);
            Widgets.Label(rect2, text);
        }
Пример #2
0
 public void GlobalControlsOnGUI()
 {
     if (Event.current.type != EventType.Layout)
     {
         float num  = (float)UI.screenWidth - 200f;
         float num2 = UI.screenHeight;
         num2 -= 35f;
         GenUI.DrawTextWinterShadow(new Rect(UI.screenWidth - 270, UI.screenHeight - 450, 270f, 450f));
         num2 -= 4f;
         GlobalControlsUtility.DoPlaySettings(rowVisibility, worldView: false, ref num2);
         num2 -= 4f;
         GlobalControlsUtility.DoTimespeedControls(num, 200f, ref num2);
         num2 -= 4f;
         GlobalControlsUtility.DoDate(num, 200f, ref num2);
         Rect rect = new Rect(num - 22f, num2 - 26f, 230f, 26f);
         Find.CurrentMap.weatherManager.DoWeatherGUI(rect);
         num2 -= rect.height;
         Rect rect2 = new Rect(num - 100f, num2 - 26f, 293f, 26f);
         Text.Anchor = TextAnchor.MiddleRight;
         Widgets.Label(rect2, TemperatureString());
         Text.Anchor = TextAnchor.UpperLeft;
         num2       -= 26f;
         float num3  = 154f;
         float num4  = Find.CurrentMap.gameConditionManager.TotalHeightAt(num3);
         Rect  rect3 = new Rect((float)UI.screenWidth - num3, num2 - num4, num3, num4);
         Find.CurrentMap.gameConditionManager.DoConditionsUI(rect3);
         num2 -= rect3.height;
         if (Prefs.ShowRealtimeClock)
         {
             GlobalControlsUtility.DoRealtimeClock(num, 200f, ref num2);
         }
         TimedDetectionRaids component = Find.CurrentMap.Parent.GetComponent <TimedDetectionRaids>();
         if (component != null && component.NextRaidCountdownActiveAndVisible)
         {
             Rect rect4 = new Rect(num, num2 - 26f, 193f, 26f);
             Text.Anchor = TextAnchor.MiddleRight;
             DoCountdownTimer(rect4, component);
             Text.Anchor = TextAnchor.UpperLeft;
             num2       -= 26f;
         }
         num2 -= 10f;
         Find.LetterStack.LettersOnGUI(num2);
     }
 }