Пример #1
0
 private static string GetBadgeDescription(BadgeDef badgeDef)
 {
     if (badgeDef.defName == "")
     {
         return("PawnBadge.NoBadge".Translate());
     }
     return(badgeDef.description);
 }
        private static bool TryGetBadgeDef(CompBadge compBadge, int index, out BadgeDef badgeDef)
        {
            badgeDef = DefDatabase <BadgeDef> .GetNamedSilentFail(compBadge.badges[index]);

            if (badgeDef == null)
            {
                Log.Warning($"Pawn Badge failed to find badge def with name \"{compBadge.badges[index]}\". Resetting badge to empty.");
                compBadge.badges[index] = "";
                return(false);
            }
            return(true);
        }