private void Refresh() { if ((Object)selectedTarget == (Object)null) { return; } List <Descriptor> allDescriptors = GameUtil.GetAllDescriptors(selectedTarget, true); Sicknesses sicknesses = selectedTarget.GetSicknesses(); if (sicknesses != null) { for (int i = 0; i < sicknesses.Count; i++) { allDescriptors.AddRange(sicknesses[i].GetDescriptors()); } } allDescriptors = allDescriptors.FindAll((Descriptor e) => e.type == Descriptor.DescriptorType.DiseaseSource); if (allDescriptors.Count > 0) { for (int j = 0; j < allDescriptors.Count; j++) { CollapsibleDetailContentPanel collapsibleDetailContentPanel = diseaseSourcePanel; string id = "source_" + j.ToString(); Descriptor descriptor = allDescriptors[j]; string text = descriptor.text; Descriptor descriptor2 = allDescriptors[j]; collapsibleDetailContentPanel.SetLabel(id, text, descriptor2.tooltipText); } } if (!CreateImmuneInfo()) { goto IL_00ee; } goto IL_00ee; IL_00ee: if (!CreateDiseaseInfo()) { currentGermsPanel.SetTitle(UI.DETAILTABS.DISEASE.NO_CURRENT_GERMS); currentGermsPanel.SetLabel("nodisease", UI.DETAILTABS.DISEASE.DETAILS.NODISEASE, UI.DETAILTABS.DISEASE.DETAILS.NODISEASE_TOOLTIP); } diseaseSourcePanel.Commit(); immuneSystemPanel.Commit(); currentGermsPanel.Commit(); infoPanel.Commit(); infectionPanel.Commit(); }
private void RefreshBreedingChance() { if ((UnityEngine.Object)selectedTarget == (UnityEngine.Object)null) { fertilityPanel.gameObject.SetActive(false); } else { FertilityMonitor.Instance sMI = selectedTarget.GetSMI <FertilityMonitor.Instance>(); if (sMI == null) { fertilityPanel.gameObject.SetActive(false); } else { int num = 0; foreach (FertilityMonitor.BreedingChance breedingChance in sMI.breedingChances) { List <FertilityModifier> forTag = Db.Get().FertilityModifiers.GetForTag(breedingChance.egg); if (forTag.Count > 0) { string text = string.Empty; foreach (FertilityModifier item in forTag) { text += string.Format(UI.DETAILTABS.EGG_CHANCES.CHANCE_MOD_FORMAT, item.GetTooltip()); } fertilityPanel.SetLabel("breeding_" + num++, string.Format(UI.DETAILTABS.EGG_CHANCES.CHANCE_FORMAT, breedingChance.egg.ProperName(), GameUtil.GetFormattedPercent(breedingChance.weight * 100f, GameUtil.TimeSlice.None)), string.Format(UI.DETAILTABS.EGG_CHANCES.CHANCE_FORMAT_TOOLTIP, breedingChance.egg.ProperName(), GameUtil.GetFormattedPercent(breedingChance.weight * 100f, GameUtil.TimeSlice.None), text)); } else { fertilityPanel.SetLabel("breeding_" + num++, string.Format(UI.DETAILTABS.EGG_CHANCES.CHANCE_FORMAT, breedingChance.egg.ProperName(), GameUtil.GetFormattedPercent(breedingChance.weight * 100f, GameUtil.TimeSlice.None)), string.Format(UI.DETAILTABS.EGG_CHANCES.CHANCE_FORMAT_TOOLTIP_NOMOD, breedingChance.egg.ProperName(), GameUtil.GetFormattedPercent(breedingChance.weight * 100f, GameUtil.TimeSlice.None))); } } fertilityPanel.Commit(); } } }