예제 #1
0
 private void DrawPawnPriorities(ref float curY, float width)
 {
     try
     {
         if (!PawnForWork.Dead)
         {
             string pawnKey            = PawnForWork.GetUniqueLoadID();
             YouDoYou_MapComponent ydy = Find.CurrentMap.GetComponent <YouDoYou_MapComponent>();
             if (ydy.pawnFree == null)
             {
                 ydy.pawnFree = new Dictionary <string, bool>();
             }
             if (!ydy.pawnFree.ContainsKey(pawnKey))
             {
                 ydy.pawnFree[pawnKey] = true;
             }
             foreach (KeyValuePair <WorkTypeDef, Priority> pair in (
                          from x in ydy.GetPriorities(PawnForWork)
                          orderby x.Value descending, x.Key.naturalPriority descending
                          select x
                          ))
             {
                 DrawPawnWorkPriority(ref curY, width, pair.Key, pair.Value);
             }
         }
     }
     catch
     {
         Logger.Message("could not draw pawn priorities");
     }
 }
예제 #2
0
 private void DrawPawnInterestText(ref float curY, float width)
 {
     try
     {
         Text.Font   = GameFont.Small;
         Text.Anchor = TextAnchor.UpperLeft;
         GUI.color   = new Color(0.9f, 0.9f, 0.9f);
         Rect rect2 = new Rect(0f, curY, width, 25f);
         if (PawnForWork.Map.GetComponent <YouDoYou_MapComponent>().pawnFree[PawnForWork.GetUniqueLoadID()])
         {
             Widgets.Label(rect2, "WorkPreference".Translate());
         }
         else
         {
             Widgets.Label(rect2, "WorkAssignment".Translate());
         }
     }
     catch
     {
         Logger.Message("could not draw pawn interest text");
     }
     curY += 25f;
 }