private void RefreshBio() { MinionIdentity component = selectedTarget.GetComponent <MinionIdentity>(); if (!(bool)component) { bioPanel.SetActive(false); } else { bioPanel.SetActive(true); bioPanel.GetComponent <CollapsibleDetailContentPanel>().HeaderLabel.text = UI.DETAILTABS.PERSONALITY.GROUPNAME_BIO; bioDrawer.BeginDrawing().NewLabel(DUPLICANTS.NAMETITLE + component.name).NewLabel((string)DUPLICANTS.ARRIVALTIME + ((float)GameClock.Instance.GetCycle() - component.arrivalTime) + " Cycles") .Tooltip(string.Format(DUPLICANTS.ARRIVALTIME_TOOLTIP, component.arrivalTime, component.name)) .NewLabel(DUPLICANTS.GENDERTITLE + string.Format(Strings.Get($"STRINGS.DUPLICANTS.GENDER.{component.genderStringKey.ToUpper()}.NAME"), component.gender)) .NewLabel(string.Format(Strings.Get($"STRINGS.DUPLICANTS.PERSONALITIES.{component.nameStringKey.ToUpper()}.DESC"), component.name)) .Tooltip(string.Format(Strings.Get(string.Format("STRINGS.DUPLICANTS.DESC_TOOLTIP", component.nameStringKey.ToUpper())), component.name)); MinionResume component2 = selectedTarget.GetComponent <MinionResume>(); if ((Object)component2 != (Object)null && component2.AptitudeBySkillGroup.Count > 0) { bioDrawer.NewLabel(UI.DETAILTABS.PERSONALITY.RESUME.APTITUDES.NAME + "\n").Tooltip(string.Format(UI.DETAILTABS.PERSONALITY.RESUME.APTITUDES.TOOLTIP, selectedTarget.name)); foreach (KeyValuePair <HashedString, float> item in component2.AptitudeBySkillGroup) { if (item.Value != 0f) { SkillGroup skillGroup = Db.Get().SkillGroups.Get(item.Key); bioDrawer.NewLabel(" • " + skillGroup.Name).Tooltip(string.Format(DUPLICANTS.ROLES.GROUPS.APTITUDE_DESCRIPTION, skillGroup.Name, item.Value)); } } } bioDrawer.EndDrawing(); } }
/// <summary> /// Draws the extra descriptors (attributes and details) for the selected object. /// </summary> /// <param name="drawer">The renderer for the details.</param> private void DetailDescriptors(DetailsPanelDrawer drawer) { var target = lastSelection.target; var attributes = target.GetAttributes(); var descriptors = GameUtil.GetAllDescriptors(target); int n; if (attributes != null) { n = attributes.Count; for (int i = 0; i < n; i++) { var instance = attributes.AttributeTable[i]; var attr = instance.Attribute; if (DlcManager.IsDlcListValidForCurrentContent(attr.DLCIds) && (attr. ShowInUI == Attribute.Display.Details || attr.ShowInUI == Attribute.Display.Expectation)) { drawer.NewLabel(instance.modifier.Name + ": " + instance. GetFormattedValue()).Tooltip(instance.GetAttributeValueTooltip()); } } } n = descriptors.Count; for (int i = 0; i < n; i++) { var descriptor = descriptors[i]; if (descriptor.type == Descriptor.DescriptorType.Detail) { drawer.NewLabel(descriptor.text).Tooltip(descriptor.tooltipText); } } }
static void Prefix(ref SimpleInfoScreen __instance, GameObject target) { if (target != null && target.GetComponent <Klei.AI.Traits>() != null && target.GetComponent <KPrefabID>() != null && target.HasTag(GameTags.Creature)) { InitTraitsPanel(__instance); TraitsPanel.gameObject.SetActive(true); TraitsPanel.HeaderLabel.text = "TRAITS"; TraitsDrawer.BeginDrawing(); foreach (Trait trait in target.GetComponent <Klei.AI.Traits>().TraitList) { if (!Traits.AllTraits.IsSupportedTrait(trait.Id)) { continue; } var color = trait.PositiveTrait ? Constants.POSITIVE_COLOR : Constants.NEGATIVE_COLOR; TraitsDrawer.NewLabel($"<color=#{color.ToHexString()}>{trait.Name}</color>").Tooltip(trait.GetTooltip()); } TraitsDrawer.EndDrawing(); } else { TraitsPanel?.gameObject?.SetActive(false); } }
private void RefreshAttributes() { MinionIdentity component = selectedTarget.GetComponent <MinionIdentity>(); if (!(bool)component) { attributesPanel.SetActive(false); } else { attributesPanel.SetActive(true); attributesPanel.GetComponent <CollapsibleDetailContentPanel>().HeaderLabel.text = UI.DETAILTABS.STATS.GROUPNAME_ATTRIBUTES; List <AttributeInstance> list = new List <AttributeInstance>(selectedTarget.GetAttributes().AttributeTable); List <AttributeInstance> list2 = list.FindAll((AttributeInstance a) => a.Attribute.ShowInUI == Attribute.Display.Skill); attributesDrawer.BeginDrawing(); if (list2.Count > 0) { foreach (AttributeInstance item in list2) { attributesDrawer.NewLabel($"{item.Name}: {item.GetFormattedValue()}").Tooltip(item.GetAttributeValueTooltip()); } } attributesDrawer.EndDrawing(); } }
/// <summary> /// Draws the state change and radiation (if enabled) information of an element. /// </summary> /// <param name="drawer">The renderer for the details.</param> /// <param name="element">The element to display.</param> private void AddPhaseChangeInfo(DetailsPanelDrawer drawer, Element element) { // Phase change points if (element.IsSolid) { var overheat = lastSelection.overheat; lastSelection.boil.AddLine(drawer); if (!string.IsNullOrEmpty(overheat.text)) { overheat.AddLine(drawer); } } else if (element.IsLiquid) { lastSelection.freeze.AddLine(drawer); lastSelection.boil.AddLine(drawer); } else if (element.IsGas) { lastSelection.freeze.AddLine(drawer); } // Radiation absorption if (DlcManager.FeatureRadiationEnabled()) { string radAbsorb = lastSelection.radiationAbsorption; drawer.NewLabel(drawer.Format(STRINGS.UI.DETAILTABS.DETAILS. RADIATIONABSORPTIONFACTOR.NAME, radAbsorb)).Tooltip(drawer.Format(STRINGS. UI.DETAILTABS.DETAILS.RADIATIONABSORPTIONFACTOR.TOOLTIP, radAbsorb)); } }
static void Prefix(ref SimpleInfoScreen __instance, GameObject target) { if (target != null && (target.GetComponent <Klei.AI.Traits>() != null || target.GetComponent <AIGeneticTraits>() != null) && (target.HasTag(GameTags.Creature) || target.HasTag(GameTags.Egg))) { InitTraitsPanel(__instance); TraitsPanel.gameObject.SetActive(true); TraitsPanel.HeaderLabel.text = "GENETIC TRAITS"; TraitsDrawer.BeginDrawing(); List <Trait> traits = null; if (target.HasTag(GameTags.Egg) && target.GetComponent <AIGeneticTraits>() != null) { traits = target.GetComponent <AIGeneticTraits>().TraitList; } else { traits = target.GetComponent <Klei.AI.Traits>().TraitList; } foreach (Trait trait in traits) { if (!GeneticTraits.GeneticTraits.IsSupportedTrait(trait.Id)) { continue; } var color = trait.PositiveTrait ? Constants.POSITIVE_COLOR : Constants.NEGATIVE_COLOR; TraitsDrawer.NewLabel($"<color=#{color.ToHexString()}>{trait.Name}</color>").Tooltip(trait.GetTooltip()); var traitComponent = GeneticTraits.GeneticTraits.getTrait(trait.Id); if (traitComponent.CustomDescription) { var textholders = target.GetComponents <StringHolderComponent>(); if (textholders != null) { var text = textholders.Where(x => x.id == trait.Id).First(); if (text.text != null) { TraitsDrawer.NewLabel(text.text); } } } } TraitsDrawer.EndDrawing(); } else { TraitsPanel?.gameObject?.SetActive(false); } }
private void RefreshResume() { MinionResume component = selectedTarget.GetComponent <MinionResume>(); if (!(bool)component) { resumePanel.SetActive(false); } else { resumePanel.SetActive(true); resumePanel.GetComponent <CollapsibleDetailContentPanel>().HeaderLabel.text = string.Format(UI.DETAILTABS.PERSONALITY.GROUPNAME_RESUME, selectedTarget.name.ToUpper()); resumeDrawer.BeginDrawing(); List <Skill> list = new List <Skill>(); foreach (KeyValuePair <string, bool> item2 in component.MasteryBySkillID) { if (item2.Value) { Skill item = Db.Get().Skills.Get(item2.Key); list.Add(item); } } resumeDrawer.NewLabel(UI.DETAILTABS.PERSONALITY.RESUME.MASTERED_SKILLS).Tooltip(UI.DETAILTABS.PERSONALITY.RESUME.MASTERED_SKILLS_TOOLTIP); if (list.Count == 0) { resumeDrawer.NewLabel(" • " + UI.DETAILTABS.PERSONALITY.RESUME.NO_MASTERED_SKILLS.NAME).Tooltip(string.Format(UI.DETAILTABS.PERSONALITY.RESUME.NO_MASTERED_SKILLS.TOOLTIP, selectedTarget.name)); } else { foreach (Skill item3 in list) { string text = string.Empty; foreach (SkillPerk perk in item3.perks) { text = text + " • " + perk.Name + "\n"; } resumeDrawer.NewLabel(" • " + item3.Name).Tooltip(item3.description + "\n" + text); } } resumeDrawer.EndDrawing(); } }
/// <summary> /// Draws the thermal properties of the constituent element. /// </summary> /// <param name="drawer">The renderer for the details.</param> private void AddElementInfo(DetailsPanelDrawer drawer) { string tempStr = GameUtil.GetFormattedTemperature(lastSelection.Temperature); byte diseaseIdx = lastSelection.DiseaseIndex; int diseaseCount = lastSelection.DiseaseCount; drawer.NewLabel(drawer.Format(ELEMENTAL.TEMPERATURE.NAME, tempStr)). Tooltip(drawer.Format(ELEMENTAL.TEMPERATURE.TOOLTIP, tempStr)). NewLabel(drawer.Format(ELEMENTAL.DISEASE.NAME, GameUtil. GetFormattedDisease(diseaseIdx, diseaseCount, false))). Tooltip(drawer.Format(ELEMENTAL.DISEASE.TOOLTIP, GameUtil.GetFormattedDisease( diseaseIdx, diseaseCount, true))); lastSelection.specificHeat.AddLine(drawer); lastSelection.thermalConductivity.AddLine(drawer); if (lastSelection.insulator) { drawer.NewLabel(STRINGS.UI.GAMEOBJECTEFFECTS.INSULATED.NAME).Tooltip( STRINGS.UI.GAMEOBJECTEFFECTS.INSULATED.TOOLTIP); } }
private void RefreshStress() { MinionIdentity identity = (!((UnityEngine.Object)selectedTarget != (UnityEngine.Object)null)) ? null : selectedTarget.GetComponent <MinionIdentity>(); if ((UnityEngine.Object)identity == (UnityEngine.Object)null) { stressPanel.SetActive(false); } else { List <ReportManager.ReportEntry.Note> stressNotes = new List <ReportManager.ReportEntry.Note>(); stressPanel.SetActive(true); stressPanel.GetComponent <CollapsibleDetailContentPanel>().HeaderLabel.text = UI.DETAILTABS.STATS.GROUPNAME_STRESS; ReportManager.ReportEntry reportEntry = ReportManager.Instance.TodaysReport.reportEntries.Find((ReportManager.ReportEntry entry) => entry.reportType == ReportManager.ReportType.StressDelta); stressDrawer.BeginDrawing(); float num = 0f; stressNotes.Clear(); int num2 = reportEntry.contextEntries.FindIndex((ReportManager.ReportEntry entry) => entry.context == identity.GetProperName()); ReportManager.ReportEntry reportEntry2 = (num2 == -1) ? null : reportEntry.contextEntries[num2]; if (reportEntry2 != null) { reportEntry2.IterateNotes(delegate(ReportManager.ReportEntry.Note note) { stressNotes.Add(note); }); stressNotes.Sort((ReportManager.ReportEntry.Note a, ReportManager.ReportEntry.Note b) => a.value.CompareTo(b.value)); for (int i = 0; i < stressNotes.Count; i++) { DetailsPanelDrawer detailsPanelDrawer = stressDrawer; string[] obj = new string[6]; ReportManager.ReportEntry.Note note2 = stressNotes[i]; obj[0] = ((!(note2.value > 0f)) ? string.Empty : UIConstants.ColorPrefixRed); ReportManager.ReportEntry.Note note3 = stressNotes[i]; obj[1] = note3.note; obj[2] = ": "; ReportManager.ReportEntry.Note note4 = stressNotes[i]; obj[3] = Util.FormatTwoDecimalPlace(note4.value); obj[4] = "%"; ReportManager.ReportEntry.Note note5 = stressNotes[i]; obj[5] = ((!(note5.value > 0f)) ? string.Empty : UIConstants.ColorSuffix); detailsPanelDrawer.NewLabel(string.Concat(obj)); float num3 = num; ReportManager.ReportEntry.Note note6 = stressNotes[i]; num = num3 + note6.value; } } stressDrawer.NewLabel(((!(num > 0f)) ? string.Empty : UIConstants.ColorPrefixRed) + string.Format(UI.DETAILTABS.DETAILS.NET_STRESS, Util.FormatTwoDecimalPlace(num)) + ((!(num > 0f)) ? string.Empty : UIConstants.ColorSuffix)); stressDrawer.EndDrawing(); } }
/// <summary> /// Draws the building's creation time, or nothing if the data is not available. /// </summary> /// <param name="drawer">The renderer for the details.</param> /// <param name="changed">true if the target changed, or false otherwise.</param> private void AddCreationTime(DetailsPanelDrawer drawer, bool changed) { var bc = lastSelection.buildingComplete; float creationTime; if (bc != null && (creationTime = bc.creationTime) > 0.0f) { string time = lastSelection.creationTimeCached; if (changed || time == null) { time = Util.FormatTwoDecimalPlace((GameClock.Instance.GetTime() - creationTime) / Constants.SECONDS_PER_CYCLE); lastSelection.creationTimeCached = time; } drawer.NewLabel(drawer.Format(ELEMENTAL.AGE.NAME, time)).Tooltip( drawer.Format(ELEMENTAL.AGE.TOOLTIP, time)); } }
private void RefreshTraits() { MinionIdentity component = selectedTarget.GetComponent <MinionIdentity>(); if (!(bool)component) { traitsPanel.SetActive(false); } else { traitsPanel.SetActive(true); traitsPanel.GetComponent <CollapsibleDetailContentPanel>().HeaderLabel.text = UI.DETAILTABS.STATS.GROUPNAME_TRAITS; traitsDrawer.BeginDrawing(); foreach (Trait trait in selectedTarget.GetComponent <Traits>().TraitList) { traitsDrawer.NewLabel(trait.Name).Tooltip(trait.GetTooltip()); } traitsDrawer.EndDrawing(); } }
/// <summary> /// Collects the stress change reasons and displays them in the UI. /// </summary> /// <param name="stressEntries">The stress change entries in the report entry.</param> /// <param name="stressDrawer">The renderer for this info screen.</param> /// <returns>The total stress change.</returns> private static float CompileNotes(Dictionary <NoteEntryKey, float> stressEntries, DetailsPanelDrawer stressDrawer) { var stringTable = ReportManager.Instance.noteStorage.stringTable; var stressNotes = ListPool <ReportEntry.Note, SimpleInfoScreen> .Allocate(); string pct = STRINGS.UI.UNITSUFFIXES.PERCENT; var text = CACHED_BUILDER; int n = stressEntries.Count; float total = 0.0f; foreach (var pair in stressEntries) { string hash = stringTable.GetStringByHash(pair.Key.noteHash); stressNotes.Add(new ReportEntry.Note(pair.Value, hash)); } stressNotes.Sort(StressNoteComparer.Instance); for (int i = 0; i < n; i++) { var note = stressNotes[i]; float stressDelta = note.value; text.Clear(); if (stressDelta > 0.0f) { text.Append(UIConstants.ColorPrefixRed); } text.Append(note.note).Append(": "); stressDelta.ToRyuHardString(text, 2); text.Append(pct); if (stressDelta > 0.0f) { text.Append(UIConstants.ColorSuffix); } stressDrawer.NewLabel(text.ToString()); total += stressDelta; } stressNotes.Recycle(); return(total); }
/// <summary> /// Draws the uptime statistics of the building if available. /// </summary> /// <param name="drawer">The renderer for the details.</param> /// <param name="changed">true if the target changed, or false otherwise.</param> private void AddUptimeStats(DetailsPanelDrawer drawer, bool changed) { var operational = lastSelection.operational; float thisCycle; if (operational != null && lastSelection.showUptime && (thisCycle = operational. GetCurrentCycleUptime()) >= 0.0f) { float lastCycle = operational.GetLastCycleUptime(), prevCycles = operational.GetUptimeOverCycles(NUM_CYCLES); string label = lastSelection.uptimeCached; if (changed || label == null) { var text = CACHED_BUILDER; label = text.Clear().Append(uptimeStr). Replace("{0}", GameUtil.GetFormattedPercent(thisCycle * 100.0f)). Replace("{1}", GameUtil.GetFormattedPercent(lastCycle * 100.0f)). Replace("{2}", GameUtil.GetFormattedPercent(prevCycles * 100.0f)). ToString(); lastSelection.uptimeCached = label; } drawer.NewLabel(label); } }
private void RefreshDetails() { detailsPanel.SetActive(true); detailsPanel.GetComponent <CollapsibleDetailContentPanel>().HeaderLabel.text = UI.DETAILTABS.DETAILS.GROUPNAME_DETAILS; PrimaryElement component = selectedTarget.GetComponent <PrimaryElement>(); CellSelectionObject component2 = selectedTarget.GetComponent <CellSelectionObject>(); float mass; float temperature; Element element; byte diseaseIdx; int diseaseCount; if ((Object)component != (Object)null) { mass = component.Mass; temperature = component.Temperature; element = component.Element; diseaseIdx = component.DiseaseIdx; diseaseCount = component.DiseaseCount; } else { if (!((Object)component2 != (Object)null)) { return; } mass = component2.Mass; temperature = component2.temperature; element = component2.element; diseaseIdx = component2.diseaseIdx; diseaseCount = component2.diseaseCount; } bool flag = element.id == SimHashes.Vacuum || element.id == SimHashes.Void; float specificHeatCapacity = element.specificHeatCapacity; float highTemp = element.highTemp; float lowTemp = element.lowTemp; BuildingComplete component3 = selectedTarget.GetComponent <BuildingComplete>(); float num = (!((Object)component3 != (Object)null)) ? (-1f) : component3.creationTime; LogicPorts component4 = selectedTarget.GetComponent <LogicPorts>(); EnergyConsumer component5 = selectedTarget.GetComponent <EnergyConsumer>(); Operational component6 = selectedTarget.GetComponent <Operational>(); Battery component7 = selectedTarget.GetComponent <Battery>(); float num2; float num3; float num4; if ((Object)component6 != (Object)null && ((Object)component4 != (Object)null || (Object)component5 != (Object)null || (Object)component7 != (Object)null)) { num2 = component6.GetUptimeForTimeSpan(10f); num3 = component6.GetUptimeForTimeSpan(600f); num4 = component6.GetUptimeForTimeSpan(6000f); } else { num2 = -1f; num3 = -1f; num4 = -1f; } drawer.NewLabel(drawer.Format(UI.ELEMENTAL.PRIMARYELEMENT.NAME, element.name)).Tooltip(drawer.Format(UI.ELEMENTAL.PRIMARYELEMENT.TOOLTIP, element.name)).NewLabel(drawer.Format(UI.ELEMENTAL.MASS.NAME, GameUtil.GetFormattedMass(mass, GameUtil.TimeSlice.None, GameUtil.MetricMassFormat.UseThreshold, true, "{0:0.#}"))) .Tooltip(drawer.Format(UI.ELEMENTAL.MASS.TOOLTIP, GameUtil.GetFormattedMass(mass, GameUtil.TimeSlice.None, GameUtil.MetricMassFormat.UseThreshold, true, "{0:0.#}"))); if (num > 0f) { drawer.NewLabel(drawer.Format(UI.ELEMENTAL.AGE.NAME, Util.FormatTwoDecimalPlace((GameClock.Instance.GetTime() - num) / 600f))).Tooltip(drawer.Format(UI.ELEMENTAL.AGE.TOOLTIP, Util.FormatTwoDecimalPlace((GameClock.Instance.GetTime() - num) / 600f))); } else { drawer.NewLabel(drawer.Format(UI.ELEMENTAL.AGE.NAME, UI.ELEMENTAL.AGE.UNKNOWN)).Tooltip(UI.ELEMENTAL.AGE.UNKNOWN_TOOLTIP); } if (num2 >= 0f) { string text = UI.ELEMENTAL.UPTIME.NAME; text = text.Replace("{0}", GameUtil.GetFormattedTime(10f)); text = text.Replace("{1}", GameUtil.GetFormattedTime(600f)); text = text.Replace("{2}", GameUtil.GetFormattedTime(6000f)); text = text.Replace("{3}", GameUtil.GetFormattedPercent(num2 * 100f, GameUtil.TimeSlice.None)); text = text.Replace("{4}", GameUtil.GetFormattedPercent(num3 * 100f, GameUtil.TimeSlice.None)); text = text.Replace("{5}", GameUtil.GetFormattedPercent(num4 * 100f, GameUtil.TimeSlice.None)); drawer.NewLabel(text); } if (!flag) { bool flag2 = false; float num5 = element.thermalConductivity; Building component8 = selectedTarget.GetComponent <Building>(); if ((Object)component8 != (Object)null) { num5 *= component8.Def.ThermalConductivity; flag2 = (component8.Def.ThermalConductivity < 1f); } string temperatureUnitSuffix = GameUtil.GetTemperatureUnitSuffix(); float shc = specificHeatCapacity * 1f; string text2 = string.Format(UI.ELEMENTAL.SHC.NAME, GameUtil.GetDisplaySHC(shc).ToString("0.000")); string text3 = UI.ELEMENTAL.SHC.TOOLTIP; text3 = text3.Replace("{SPECIFIC_HEAT_CAPACITY}", text2 + GameUtil.GetSHCSuffix()); text3 = text3.Replace("{TEMPERATURE_UNIT}", temperatureUnitSuffix); string text4 = string.Format(UI.ELEMENTAL.THERMALCONDUCTIVITY.NAME, GameUtil.GetDisplayThermalConductivity(num5).ToString("0.000")); string text5 = UI.ELEMENTAL.THERMALCONDUCTIVITY.TOOLTIP; text5 = text5.Replace("{THERMAL_CONDUCTIVITY}", text4 + GameUtil.GetThermalConductivitySuffix()); text5 = text5.Replace("{TEMPERATURE_UNIT}", temperatureUnitSuffix); drawer.NewLabel(drawer.Format(UI.ELEMENTAL.TEMPERATURE.NAME, GameUtil.GetFormattedTemperature(temperature, GameUtil.TimeSlice.None, GameUtil.TemperatureInterpretation.Absolute, true, false))).Tooltip(drawer.Format(UI.ELEMENTAL.TEMPERATURE.TOOLTIP, GameUtil.GetFormattedTemperature(temperature, GameUtil.TimeSlice.None, GameUtil.TemperatureInterpretation.Absolute, true, false))).NewLabel(drawer.Format(UI.ELEMENTAL.DISEASE.NAME, GameUtil.GetFormattedDisease(diseaseIdx, diseaseCount, false))) .Tooltip(drawer.Format(UI.ELEMENTAL.DISEASE.TOOLTIP, GameUtil.GetFormattedDisease(diseaseIdx, diseaseCount, true))) .NewLabel(text2) .Tooltip(text3) .NewLabel(text4) .Tooltip(text5); if (flag2) { drawer.NewLabel(UI.GAMEOBJECTEFFECTS.INSULATED.NAME).Tooltip(UI.GAMEOBJECTEFFECTS.INSULATED.TOOLTIP); } } if (element.IsSolid) { drawer.NewLabel(drawer.Format(UI.ELEMENTAL.MELTINGPOINT.NAME, GameUtil.GetFormattedTemperature(highTemp, GameUtil.TimeSlice.None, GameUtil.TemperatureInterpretation.Absolute, true, false))).Tooltip(drawer.Format(UI.ELEMENTAL.MELTINGPOINT.TOOLTIP, GameUtil.GetFormattedTemperature(highTemp, GameUtil.TimeSlice.None, GameUtil.TemperatureInterpretation.Absolute, true, false))); ElementChunk component9 = selectedTarget.GetComponent <ElementChunk>(); if ((Object)component9 != (Object)null) { AttributeModifier attributeModifier = component.Element.attributeModifiers.Find((AttributeModifier m) => m.AttributeId == Db.Get().BuildingAttributes.OverheatTemperature.Id); if (attributeModifier != null) { drawer.NewLabel(drawer.Format(UI.ELEMENTAL.OVERHEATPOINT.NAME, attributeModifier.GetFormattedString(selectedTarget.gameObject))).Tooltip(drawer.Format(UI.ELEMENTAL.OVERHEATPOINT.TOOLTIP, attributeModifier.GetFormattedString(selectedTarget.gameObject))); } } } else if (element.IsLiquid) { drawer.NewLabel(drawer.Format(UI.ELEMENTAL.FREEZEPOINT.NAME, GameUtil.GetFormattedTemperature(lowTemp, GameUtil.TimeSlice.None, GameUtil.TemperatureInterpretation.Absolute, true, false))).Tooltip(drawer.Format(UI.ELEMENTAL.FREEZEPOINT.TOOLTIP, GameUtil.GetFormattedTemperature(lowTemp, GameUtil.TimeSlice.None, GameUtil.TemperatureInterpretation.Absolute, true, false))).NewLabel(drawer.Format(UI.ELEMENTAL.VAPOURIZATIONPOINT.NAME, GameUtil.GetFormattedTemperature(highTemp, GameUtil.TimeSlice.None, GameUtil.TemperatureInterpretation.Absolute, true, false))) .Tooltip(drawer.Format(UI.ELEMENTAL.VAPOURIZATIONPOINT.TOOLTIP, GameUtil.GetFormattedTemperature(highTemp, GameUtil.TimeSlice.None, GameUtil.TemperatureInterpretation.Absolute, true, false))); } else if (!flag) { drawer.NewLabel(drawer.Format(UI.ELEMENTAL.DEWPOINT.NAME, GameUtil.GetFormattedTemperature(lowTemp, GameUtil.TimeSlice.None, GameUtil.TemperatureInterpretation.Absolute, true, false))).Tooltip(drawer.Format(UI.ELEMENTAL.DEWPOINT.TOOLTIP, GameUtil.GetFormattedTemperature(lowTemp, GameUtil.TimeSlice.None, GameUtil.TemperatureInterpretation.Absolute, true, false))); } Attributes attributes = selectedTarget.GetAttributes(); if (attributes != null) { for (int i = 0; i < attributes.Count; i++) { AttributeInstance attributeInstance = attributes.AttributeTable[i]; if (attributeInstance.Attribute.ShowInUI == Attribute.Display.Details || attributeInstance.Attribute.ShowInUI == Attribute.Display.Expectation) { drawer.NewLabel(attributeInstance.modifier.Name + ": " + attributeInstance.GetFormattedValue()).Tooltip(attributeInstance.GetAttributeValueTooltip()); } } } List <Descriptor> detailDescriptors = GameUtil.GetDetailDescriptors(GameUtil.GetAllDescriptors(selectedTarget, false)); for (int j = 0; j < detailDescriptors.Count; j++) { Descriptor descriptor = detailDescriptors[j]; drawer.NewLabel(descriptor.text).Tooltip(descriptor.tooltipText); } }
/// <summary> /// Adds this info descriptor to the details screen. /// </summary> /// <param name="drawer">The renderer for the details.</param> public void AddLine(DetailsPanelDrawer drawer) { drawer.NewLabel(text).Tooltip(tooltip); }