public void CheckActiveAlerts() { try { UIRoot_Play ui = Find.UIRoot as UIRoot_Play; if (ui == null) { return; } bool foundAlertNeedWarmClothes = false; foreach (Alert alert in (List <Alert>)activeAlertsField.GetValue(ui.alerts)) { if (!alert.Active) { continue; } if (!foundAlertNeedWarmClothes) { this.alertNeedWarmClothes = alert as Alert_NeedWarmClothes; if (alertNeedWarmClothes != null) { foundAlertNeedWarmClothes = true; } } } if (!foundAlertNeedWarmClothes) { this.alertNeedWarmClothes = null; } } catch { Logger.Error("could not check active alerts"); } }
internal AlertSleeper() { UIRoot_Play ui = (UIRoot_Play)Find.UIRoot; alertsReadout = ui.alerts; }