public override IEnumerable <StatDrawEntry> SpecialDisplayStats(StatRequest req) { using (IEnumerator <StatDrawEntry> enumerator = base.SpecialDisplayStats(req).GetEnumerator()) { if (enumerator.MoveNext()) { StatDrawEntry s = enumerator.Current; yield return(s); /*Error: Unable to find new state assignment for yield return*/; } } if (((ThingDef)req.Def).building.IsTurret) { StatCategoryDef building = StatCategoryDefOf.Building; string label = "RearmCost".Translate(); string valueString = GenLabel.ThingLabel(fuelFilter.AnyAllowedDef, null, (int)(fuelCapacity / FuelMultiplierCurrentDifficulty)).CapitalizeFirst(); string overrideReportText = "RearmCostExplanation".Translate(); yield return(new StatDrawEntry(building, label, valueString, 0, overrideReportText)); /*Error: Unable to find new state assignment for yield return*/; } yield break; IL_01be: /*Error near IL_01bf: Unexpected return in MoveNext()*/; }
internal IEnumerable <StatDrawEntry> SpecialDisplayStats() { if (joy > 0f) { StatCategoryDef category = ((drugCategory != 0) ? StatCategoryDefOf.Drug : StatCategoryDefOf.Basics); yield return(new StatDrawEntry(category, "Joy".Translate(), joy.ToStringPercent("F0") + " (" + JoyKind.label + ")", "Stat_Thing_Ingestible_Joy_Desc".Translate(), 4751)); } if (HumanEdible) { RoyalTitleDef royalTitleDef = MaxSatisfiedTitle(); if (royalTitleDef != null) { yield return(new StatDrawEntry(StatCategoryDefOf.Basics, "Stat_Thing_Ingestible_MaxSatisfiedTitle".Translate(), royalTitleDef.GetLabelCapForBothGenders(), "Stat_Thing_Ingestible_MaxSatisfiedTitle_Desc".Translate(), 4752)); } } if (outcomeDoers == null) { yield break; } for (int i = 0; i < outcomeDoers.Count; i++) { foreach (StatDrawEntry item in outcomeDoers[i].SpecialDisplayStats(parent)) { yield return(item); } } }
public IEnumerable <StatDrawEntry> SpecialDisplayStats(ThingDef parentDef, StatRequest req) { if (joyKind != null) { yield return(new StatDrawEntry(StatCategoryDefOf.Building, "StatsReport_JoyKind".Translate(), joyKind.LabelCap, 0, string.Empty)); /*Error: Unable to find new state assignment for yield return*/; } if (parentDef.Minifiable) { yield return(new StatDrawEntry(StatCategoryDefOf.Building, "StatsReport_WorkToUninstall".Translate(), uninstallWork.ToStringWorkAmount(), 0, string.Empty)); /*Error: Unable to find new state assignment for yield return*/; } if (typeof(Building_TrapDamager).IsAssignableFrom(parentDef.thingClass)) { float armorPenetration = StatDefOf.TrapMeleeDamage.Worker.GetValue(req) * 0.015f; StatCategoryDef building = StatCategoryDefOf.Building; string label = "TrapArmorPenetration".Translate(); string valueString = armorPenetration.ToStringPercent(); string overrideReportText = "ArmorPenetrationExplanation".Translate(); yield return(new StatDrawEntry(building, label, valueString, 0, overrideReportText)); /*Error: Unable to find new state assignment for yield return*/; } }
public StatDrawEntry(StatCategoryDef category, StatDef stat) { this.category = category; this.stat = stat; this.labelInt = null; this.value = 0f; this.valueStringInt = "-"; this.displayOrderWithinCategory = 0; this.numberSense = ToStringNumberSense.Undefined; }
public StatDrawEntry(StatCategoryDef category, StatDef stat) { this.category = category; this.stat = stat; labelInt = null; value = 0f; valueStringInt = "-"; displayOrderWithinCategory = stat.displayPriorityInCategory; numberSense = ToStringNumberSense.Undefined; }
public StatDrawEntry(StatCategoryDef category, string label, string valueString, int displayPriorityWithinCategory = 0, string overrideReportText = "") { this.category = category; this.stat = null; this.labelInt = label; this.value = 0f; this.valueStringInt = valueString; this.displayOrderWithinCategory = displayPriorityWithinCategory; this.numberSense = ToStringNumberSense.Absolute; this.overrideReportText = overrideReportText; }
public StatDrawEntry(StatCategoryDef category, string label, string valueString, string reportText, int displayPriorityWithinCategory, string overrideReportTitle = null, IEnumerable <Dialog_InfoCard.Hyperlink> hyperlinks = null, bool forceUnfinalizedMode = false) { this.category = category; stat = null; labelInt = label; value = 0f; valueStringInt = valueString; displayOrderWithinCategory = displayPriorityWithinCategory; numberSense = ToStringNumberSense.Absolute; overrideReportText = reportText; this.overrideReportTitle = overrideReportTitle; this.hyperlinks = hyperlinks; this.forceUnfinalizedMode = forceUnfinalizedMode; }
public StatDrawEntry(StatCategoryDef category, StatDef stat, float value, StatRequest optionalReq, ToStringNumberSense numberSense = ToStringNumberSense.Undefined) { this.category = category; this.stat = stat; this.labelInt = null; this.value = value; this.valueStringInt = null; this.displayOrderWithinCategory = 0; this.optionalReq = optionalReq; this.hasOptionalReq = true; if (numberSense == ToStringNumberSense.Undefined) { this.numberSense = stat.toStringNumberSense; } else { this.numberSense = numberSense; } }
public StatDrawEntry(StatCategoryDef category, StatDef stat, float value, StatRequest optionalReq, ToStringNumberSense numberSense = ToStringNumberSense.Undefined, int?overrideDisplayPriorityWithinCategory = null, bool forceUnfinalizedMode = false) { this.category = category; this.stat = stat; labelInt = null; this.value = value; valueStringInt = null; displayOrderWithinCategory = (overrideDisplayPriorityWithinCategory.HasValue ? overrideDisplayPriorityWithinCategory.Value : stat.displayPriorityInCategory); this.optionalReq = optionalReq; this.forceUnfinalizedMode = forceUnfinalizedMode; hasOptionalReq = true; if (numberSense == ToStringNumberSense.Undefined) { this.numberSense = stat.toStringNumberSense; } else { this.numberSense = numberSense; } }
public override IEnumerable <StatDrawEntry> SpecialDisplayStats(StatRequest req) { foreach (StatDrawEntry s in base.SpecialDisplayStats(req)) { yield return(s); } if (((ThingDef)req.Def).building.IsTurret) { StatCategoryDef building = StatCategoryDefOf.Building; string text = "RearmCost".Translate(); string valueString = GenLabel.ThingLabel(this.fuelFilter.AnyAllowedDef, null, (int)(this.fuelCapacity / this.FuelMultiplierCurrentDifficulty)).CapitalizeFirst(); string text2 = "RearmCostExplanation".Translate(); yield return(new StatDrawEntry(building, text, valueString, 0, text2)); building = StatCategoryDefOf.Building; text2 = "ShotsBeforeRearm".Translate(); valueString = ((int)this.fuelCapacity).ToString(); text = "ShotsBeforeRearmExplanation".Translate(); yield return(new StatDrawEntry(building, text2, valueString, 0, text)); } }