Example #1
0
        static void Postfix(Rect timerRect)
        {
            long        until_unpause = SafePause.MillisecondsUntilCanUnpause();
            TickManager mgr           = Find.TickManager;

            if (SafePause.speed_this_tick == TimeSpeed.Paused &&
                mgr.CurTimeSpeed != TimeSpeed.Paused)
            {
                if (until_unpause != 0)
                {
                    mgr.CurTimeSpeed = TimeSpeed.Paused;
                }
                SafePause.last_unpause_input = Stopwatch.StartNew();
            }
            if (until_unpause != 0 && mgr.CurTimeSpeed == TimeSpeed.Paused)
            {
                Vector2 line_start = timerRect.position;
                line_start.x += TimeControls.TimeButSize.x;
                line_start.y += TimeControls.TimeButSize.y / 2f;
                float total_width = TimeControls.TimeButSize.x * 3;
                Widgets.DrawLineHorizontal(line_start.x, line_start.y, total_width);
                float timeout_ratio = 1f - ((float)until_unpause / (float)SafePauseSettings.max_timeout);
                GUI.DrawTexture(new Rect(line_start.x, line_start.y, total_width * timeout_ratio, 1f), TimeoutTex);
            }
        }
Example #2
0
 static bool Prefix()
 {
     return(SafePause.speed_this_tick != TimeSpeed.Paused ||
            SafePause.MillisecondsUntilCanUnpause() == 0);
 }