Ejemplo n.º 1
0
        protected virtual void DrawPawnRow(Rect r, Droid p)
        {
            float num = 175f;

            Text.Font = GameFont.Medium;
            for (int i = 0; i < OTab_Droid_Work.VisibleWorkTypeDefsInPriorityOrder.Count; i++)
            {
                WorkTypeDef workTypeDef = OTab_Droid_Work.VisibleWorkTypeDefsInPriorityOrder[i];
                Vector2     topLeft     = new Vector2(num, r.y + 2.5f);
                if (p.story != null && p.work.Contains(workTypeDef))
                {
                    WidgetsWork.DrawWorkBoxFor(topLeft, p, workTypeDef);
                }
                Rect rect2 = new Rect(topLeft.x, topLeft.y, 25f, 25f);
                TooltipHandler.TipRegion(rect2, WidgetsWork.TipForPawnWorker(p, workTypeDef));
                num += this.workColumnSpacing;
            }
        }
Ejemplo n.º 2
0
        public static string TipForPawnWorker(Pawn pawn, WorkTypeDef worktype, bool incapableBecauseOfCapacities)
        {
            string tip = WidgetsWork.TipForPawnWorker(pawn, worktype, incapableBecauseOfCapacities);

            var tracker = PriorityManager.Get[pawn];

            if (tracker.EverScheduled(worktype))
            {
                tip += "\n\n" + "WorkTab.XIsAssignedToY".Translate(pawn.Name.ToStringShort, worktype.gerundLabel);
            }

            if (tracker.TimeScheduled(worktype))
            {
                tip += tracker.TimeScheduledTip(worktype);
            }

            return(tip);
        }
 public override void DoCell(Rect rect, Pawn pawn, PawnTable table)
 {
     if (pawn is Droid)
     {
         Droid droid = pawn as Droid;
         if (!pawn.Dead && pawn.workSettings != null && pawn.workSettings.EverWork)
         {
             Text.Font = GameFont.Medium;
             float x         = rect.x + (rect.width - 25f) / 2f;
             float y         = rect.y + 2.5f;
             bool  incapable = false;// IsIncapableOfWholeWorkType(pawn, def.workType);
             if (droid.aiPackages.CapableOfWorkType(def.workType))
             {
                 WidgetsWork.DrawWorkBoxFor(x, y, pawn, def.workType, incapable);
             }
             Rect rect2 = new Rect(x, y, 25f, 25f);
             TooltipHandler.TipRegion(rect2, () => WidgetsWork.TipForPawnWorker(pawn, def.workType, incapable), pawn.thingIDNumber ^ def.workType.GetHashCode());
             Text.Font = GameFont.Small;
         }
     }
 }