public static void GetReport_PostFix(ref AlertReport __result, Alert_ColonistsIdle __instance) { if (__result.culprits != null) { Utility.RemoveTenantsFromList(ref __result.culprits); __result.active = __result.AnyCulpritValid; } }
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); }
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); }