예제 #1
0
 public void PrepareDependencies(UserInterface userInterface)
 {
     userInterface.globalControls.PreferenceAmPm = this.preferenceAmPm;
     userInterface.globalControls.PreferenceEnableAlternateTimeDisplay = this.preferenceEnableAlternateTimeDisplay;
     userInterface.globalControls.PreferenceMinuteInterval             = this.preferenceMinuteInterval;
     DateReadout.Reinit();
 }
예제 #2
0
        public void GlobalControlsOnGUI()
        {
            float num  = (float)Screen.width - 134f;
            float num2 = (float)Screen.height;

            num2 -= 35f;
            GenUI.DrawTextWinterShadow(new Rect((float)(Screen.width - 270), (float)(Screen.height - 450), 270f, 450f));
            num2 -= 4f;
            float y = num2 - TimeControls.TimeButSize.y;

            this.rowVisibility.Init((float)Screen.width, y, UIDirection.LeftThenUp, 141f, 29f);
            Find.PlaySettings.DoPlaySettingsGlobalControls(this.rowVisibility);
            num2  = this.rowVisibility.FinalY;
            num2 -= 4f;
            float y2        = TimeControls.TimeButSize.y;
            Rect  timerRect = new Rect(num, num2 - y2, 134f, y2);

            TimeControls.DoTimeControlsGUI(timerRect);
            num2 -= timerRect.height;
            num2 -= 4f;
            if (this.preferenceEnableAlternateTimeDisplay == null || !this.preferenceEnableAlternateTimeDisplay.Value)
            {
                Rect dateRect = new Rect(num, num2 - 22f, 134f, 22f);
                DateReadout.DateOnGUI(dateRect);
                num2 -= dateRect.height;
            }
            else
            {
                Rect dateRect2 = new Rect(num - 48f, num2 - 22f, 182f, 22f);
                DateReadout.AlternateDateOnGUI(dateRect2, this.preferenceAmPm.Value, this.preferenceMinuteInterval.Value);
                num2 -= dateRect2.height;
            }
            Rect rect = new Rect(num - 30f, num2 - 26f, 164f, 26f);

            Find.WeatherManager.DoWeatherGUI(rect);
            num2 -= rect.height;
            Rect rect2 = new Rect(num - 100f, num2 - 26f, 227f, 26f);

            Text.Anchor = TextAnchor.MiddleRight;
            Widgets.Label(rect2, GlobalControls.TemperatureString());
            Text.Anchor = TextAnchor.UpperLeft;
            num2       -= 26f;
            float num3  = 164f;
            float num4  = Find.MapConditionManager.TotalHeightAt(num3 - 15f);
            Rect  rect3 = new Rect(num - 30f, num2 - num4, num3, num4);

            Find.MapConditionManager.DoConditionsUI(rect3);
            num2 -= rect3.height;
            num2 -= 10f;
            Find.LetterStack.LettersOnGUI(num2);
        }