public string TraitsBetweenDegrees() { StringBuilder builder = new StringBuilder(); for (int i = minDegree; i < maxDegree; i++) { if (i == maxDegree) { builder.Append($"{trait.DataAtDegree(i).label}"); } else { builder.Append($"{trait.DataAtDegree(i).label} / "); } } return(builder.ToString()); }
public override void ResolveReferences() { base.ResolveReferences(); label = traitDef.DataAtDegree(traitDegree).label; if (label.NullOrEmpty()) { Log.Message("Missing label for: " + traitDef.defName + "/" + traitDegree); } }
public override void DoEditInterface(Listing_ScenEdit listing) { Rect rect = listing.GetScenPartRect(this, RowHeight * 5); Rect[] rows = rect.SplitRows(1, 4); if (Widgets.ButtonText(rows[0], trait.DataAtDegree(degree).label.CapitalizeFirst(), true, false, true)) { var defs = from def in DefDatabase <TraitDef> .AllDefs from deg in def.degreeDatas orderby def.label ascending select new { Trait = def, Degree = deg }; FloatMenuUtility.MakeMenu(defs, (x) => x.Degree.label.CapitalizeFirst(), (x) => () => { trait = x.Trait; degree = x.Degree.degree; }); } DoContextEditInterface(rows[1]); }