private static void DoRow(Rect rect, TransferableImmutable thing, Caravan caravan) { GUI.BeginGroup(rect); Rect rect2 = rect.AtZero(); if (thing.TotalStackCount != 1) { CaravanThingsTabUtility.DoAbandonSpecificCountButton(rect2, thing, caravan); } rect2.width -= 24f; CaravanThingsTabUtility.DoAbandonButton(rect2, thing, caravan); rect2.width -= 24f; Widgets.InfoCardButton(rect2.width - 24f, (rect.height - 24f) / 2f, thing.AnyThing); rect2.width -= 24f; Rect rect3 = rect2; rect3.xMin = rect3.xMax - 60f; CaravanThingsTabUtility.DrawMass(thing, rect3); rect2.width -= 60f; Widgets.DrawHighlightIfMouseover(rect2); Rect rect4 = new Rect(4f, (rect.height - 27f) / 2f, 27f, 27f); Widgets.ThingIcon(rect4, thing.AnyThing, 1f); Rect rect5 = new Rect(rect4.xMax + 4f, 0f, 300f, 30f); Text.Anchor = TextAnchor.MiddleLeft; Text.WordWrap = false; Widgets.Label(rect5, thing.LabelCapWithTotalStackCount.Truncate(rect5.width, null)); Text.Anchor = TextAnchor.UpperLeft; Text.WordWrap = true; GUI.EndGroup(); }
public static void DrawMass(TransferableImmutable transferable, Rect rect) { float num = 0f; for (int i = 0; i < transferable.things.Count; i++) { num += transferable.things[i].GetStatValue(StatDefOf.Mass, true) * (float)transferable.things[i].stackCount; } CaravanThingsTabUtility.DrawMass(num, rect); }
public static void DrawMass(Thing thing, Rect rect) { float mass = thing.GetStatValue(StatDefOf.Mass, true) * (float)thing.stackCount; CaravanThingsTabUtility.DrawMass(mass, rect); }