コード例 #1
0
 public static void GetReport_PostFix(ref AlertReport __result, Alert_ColonistsIdle __instance)
 {
     if (__result.culprits != null)
     {
         Utility.RemoveTenantsFromList(ref __result.culprits);
         __result.active = __result.AnyCulpritValid;
     }
 }
コード例 #2
0
        public static bool GetLabel_PreFix(ref string __result, Alert_ColonistsIdle __instance)
        {
            IEnumerable <Pawn> IdleColonists = Traverse.Create(__instance).Property("IdleColonists").GetValue <IEnumerable <Pawn> >();
            int x = 0;

            foreach (Pawn idleColonist in IdleColonists)
            {
                Tenant tenantComp = idleColonist.GetTenantComponent();
                if (tenantComp != null && !tenantComp.IsTenant)
                {
                    x++;
                }
            }
            __result = "ColonistsIdle".Translate(x.ToStringCached());
            return(false);
        }
コード例 #3
0
        public static bool GetExplanation_PreFix(ref string __result, Alert_ColonistsIdle __instance)
        {
            StringBuilder      stringBuilder = new StringBuilder();
            IEnumerable <Pawn> IdleColonists = Traverse.Create(__instance).Property("IdleColonists").GetValue <IEnumerable <Pawn> >();

            foreach (Pawn idleColonist in IdleColonists)
            {
                Tenant tenantComp = idleColonist.GetTenantComponent();
                if (tenantComp != null && !tenantComp.IsTenant)
                {
                    stringBuilder.AppendLine("    " + idleColonist.LabelShort.CapitalizeFirst());
                }
            }
            __result = "ColonistsIdleDesc".Translate(stringBuilder.ToString());

            return(false);
        }