Exemple #1
0
        public override string GetInspectString()
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(base.GetInspectString());
            WorldRoutePlanner worldRoutePlanner = Find.WorldRoutePlanner;

            if (worldRoutePlanner.Active)
            {
                int num = worldRoutePlanner.waypoints.IndexOf(this);
                if (num >= 1)
                {
                    int ticksToWaypoint = worldRoutePlanner.GetTicksToWaypoint(num);
                    if (stringBuilder.Length != 0)
                    {
                        stringBuilder.AppendLine();
                    }
                    stringBuilder.Append("EstimatedTimeToWaypoint".Translate(new object[]
                    {
                        ticksToWaypoint.ToStringTicksToDays("0.#")
                    }));
                    if (num >= 2)
                    {
                        int ticksToWaypoint2 = worldRoutePlanner.GetTicksToWaypoint(num - 1);
                        stringBuilder.AppendLine();
                        stringBuilder.Append("EstimatedTimeToWaypointFromPrevious".Translate(new object[]
                        {
                            (ticksToWaypoint - ticksToWaypoint2).ToStringTicksToDays("0.#")
                        }));
                    }
                }
            }
            return(stringBuilder.ToString());
        }
		public void DrawInspectGizmos()
		{
			WorldInspectPane.tmpObjectsList.Clear();
			WorldRoutePlanner worldRoutePlanner = Find.WorldRoutePlanner;
			List<WorldObject> selected = this.Selected;
			for (int i = 0; i < selected.Count; i++)
			{
				if (!worldRoutePlanner.Active || selected[i] is RoutePlannerWaypoint)
				{
					WorldInspectPane.tmpObjectsList.Add(selected[i]);
				}
			}
			InspectGizmoGrid.DrawInspectGizmoGridFor(WorldInspectPane.tmpObjectsList);
			WorldInspectPane.tmpObjectsList.Clear();
		}
        public void DrawInspectGizmos()
        {
            tmpObjectsList.Clear();
            WorldRoutePlanner  worldRoutePlanner = Find.WorldRoutePlanner;
            List <WorldObject> selected          = Selected;

            for (int i = 0; i < selected.Count; i++)
            {
                if (!worldRoutePlanner.Active || selected[i] is RoutePlannerWaypoint)
                {
                    tmpObjectsList.Add(selected[i]);
                }
            }
            InspectGizmoGrid.DrawInspectGizmoGridFor(tmpObjectsList, out mouseoverGizmo);
            tmpObjectsList.Clear();
        }