示例#1
0
 public static int GetTicksPerMove(CaravanTicksPerMoveUtility.CaravanInfo caravanInfo, StringBuilder explanation = null)
 {
     return(CaravanTicksPerMoveUtility.GetTicksPerMove(caravanInfo.pawns, caravanInfo.massUsage, caravanInfo.massCapacity, explanation));
 }
示例#2
0
        private void DoRouteDetailsBox()
        {
            float   num = (float)UI.screenWidth;
            Vector2 bottomWindowSize = BottomWindowSize;
            float   x    = (num - bottomWindowSize.x) / 2f;
            float   num2 = (float)UI.screenHeight;
            Vector2 bottomWindowSize2 = BottomWindowSize;
            float   y = num2 - bottomWindowSize2.y - 45f;
            Vector2 bottomWindowSize3 = BottomWindowSize;
            float   x2 = bottomWindowSize3.x;
            Vector2 bottomWindowSize4 = BottomWindowSize;
            Rect    rect = new Rect(x, y, x2, bottomWindowSize4.y);

            if (Current.ProgramState == ProgramState.Entry)
            {
                rect.y -= 22f;
            }
            Find.WindowStack.ImmediateWindow(1373514241, rect, WindowLayer.Dialog, delegate
            {
                if (!active)
                {
                    return;
                }
                GUI.color   = Color.white;
                Text.Anchor = TextAnchor.UpperCenter;
                Text.Font   = GameFont.Small;
                float num3  = 6f;
                if (waypoints.Count >= 2)
                {
                    Widgets.Label(new Rect(0f, num3, rect.width, 25f), "RoutePlannerEstTimeToFinalDest".Translate(GetTicksToWaypoint(waypoints.Count - 1).ToStringTicksToDays("0.#")));
                }
                else if (cantRemoveFirstWaypoint)
                {
                    Widgets.Label(new Rect(0f, num3, rect.width, 25f), "RoutePlannerAddOneOrMoreWaypoints".Translate());
                }
                else
                {
                    Widgets.Label(new Rect(0f, num3, rect.width, 25f), "RoutePlannerAddTwoOrMoreWaypoints".Translate());
                }
                num3 += 20f;
                if (CaravanInfo.HasValue)
                {
                    CaravanTicksPerMoveUtility.CaravanInfo value = CaravanInfo.Value;
                    if (value.pawns.Any())
                    {
                        if (currentFormCaravanDialog == null && CaravanAtTheFirstWaypoint != null)
                        {
                            GUI.color = Color.gray;
                            Widgets.Label(new Rect(0f, num3, rect.width, 25f), "RoutePlannerUsingTicksPerMoveOfCaravan".Translate(CaravanAtTheFirstWaypoint.LabelCap));
                        }
                        goto IL_0200;
                    }
                }
                GUI.color = new Color(0.8f, 0.6f, 0.6f);
                Widgets.Label(new Rect(0f, num3, rect.width, 25f), "RoutePlannerUsingAverageTicksPerMoveWarning".Translate());
                goto IL_0200;
                IL_0200:
                num3     += 20f;
                GUI.color = Color.gray;
                Widgets.Label(new Rect(0f, num3, rect.width, 25f), "RoutePlannerPressRMBToAddAndRemoveWaypoints".Translate());
                num3 += 20f;
                if (currentFormCaravanDialog != null)
                {
                    Widgets.Label(new Rect(0f, num3, rect.width, 25f), "RoutePlannerPressEscapeToReturnToCaravanFormationDialog".Translate());
                }
                else
                {
                    Widgets.Label(new Rect(0f, num3, rect.width, 25f), "RoutePlannerPressEscapeToExit".Translate());
                }
                num3       += 20f;
                GUI.color   = Color.white;
                Text.Anchor = TextAnchor.UpperLeft;
            });
        }