Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        public static bool DoTimeControlsGUI(Rect timerRect)
        {
            if (Event.current.type != EventType.KeyDown)
            {
                return(true);
            }

            if (!Find.WindowStack.WindowsForcePause)
            {
                if (KeyBindingDefOf.TimeSpeed_Fast.KeyDownEvent ||
                    KeyBindingDefOf.TimeSpeed_Superfast.KeyDownEvent ||
                    KeyBindingDefOf.TimeSpeed_Ultrafast.KeyDownEvent
                    )
                {
                    if (lastTickForcedSlow)
                    {
                        overrideForcedSlow = true;
                    }
                }
            }

            //allow speed 4 even if not dev mode
            if (Prefs.DevMode)
            {
                return(true);
            }
            TickManager tickManager = Find.TickManager;

            if (KeyBindingDefOf.TimeSpeed_Ultrafast.KeyDownEvent)
            {
                tickManager.CurTimeSpeed = TimeSpeed.Ultrafast;
                TimeControls.PlaySoundOf(tickManager.CurTimeSpeed);
                Event.current.Use();
            }
            if (!KeyBindingDefOf.Dev_TickOnce.KeyDownEvent || tickManager.CurTimeSpeed != TimeSpeed.Paused)
            {
                return(true);
            }
            tickManager.DoSingleTick();
            SoundDefOf.Clock_Stop.PlayOneShotOnCamera();

            return(true);
        }
Exemplo n.º 3
0
 public GameplayActions(TimeControls wrapper)
 {
     m_Wrapper = wrapper;
 }