public override void PostExposeData() { base.PostExposeData(); Scribe_Values.Look <float>(ref this.storedBlood, "storedBlood", 0f, false); CompProperties_BloodTank props = this.Props; if (this.storedBlood > props.storedBloodMax) { this.storedBlood = props.storedBloodMax; } Thing thing = null; if (Scribe.mode == LoadSaveMode.Saving && this.connectParent != null) { thing = this.connectParent.parent; } Scribe_References.Look <Thing>(ref thing, "parentThing", false); if (thing != null) { this.connectParent = ((ThingWithComps)thing).GetComp <CompBloodTank>(); } if (Scribe.mode == LoadSaveMode.PostLoadInit && this.connectParent != null) { //this.ConnectToTransmitter(this.connectParent, true); } }
public override string CompInspectStringExtra() { CompProperties_BloodTank props = this.Props; StringBuilder s = new StringBuilder(); s.AppendLine(base.CompInspectStringExtra()); s.AppendLine("BloodTankStored".Translate() + ": " + this.storedBlood.ToString("F") + " / " + props.storedBloodMax.ToString("F") + " " + "BloodTankLitres".Translate()); s.AppendLine("BloodTankEfficiency".Translate() + ": " + (props.efficiency * 100f).ToString("F0") + "%"); return(s.ToString().TrimEndNewlines()); }