public static void _Postfix(ITab_Pawn_Needs __instance) { if (Find.CurrentMap == null) { return; } if (!TableDiner.settings.useExtraFeatures) { return; } Pawn SelPawn = Find.Selector.SingleSelectedThing as Pawn; if (SelPawn != null && SelPawn.IsColonist) { Vector2 size = NeedsCardUtility.GetSize(SelPawn); Rect tabRect = new Rect(20, size.y - (ITab_Table.WinSize.y) + 10, ITab_Table.WinSize.x - 40, ITab_Table.WinSize.y - 20); Rect tabRectBig = new Rect(10, size.y - (ITab_Table.WinSize.y) + 5, ITab_Table.WinSize.x - 20, ITab_Table.WinSize.y - 10); float tr = TableDinerGlobal.GetTableRadius(SelPawn.ThingID); GUI.color = Color.white; if (tr > TableDiner.settings.tableDistance) { GUI.color = Color.yellow; } if (Mouse.IsOver(tabRect)) { Widgets.DrawHighlight(tabRectBig); mOver = true; } TableDinerGlobal.tableRadii[SelPawn.ThingID] = Mathf.Pow(Widgets.HorizontalSlider(tabRect, Mathf.Sqrt(tr), 0, 23, true, tr < 1 ? "TDiner.Ignored".Translate() : Mathf.Round(tr).ToString(), "TDiner.TRSlideLabel".Translate()), 2); GUI.color = Color.white; } }
protected override void UpdateSize() { size = NeedsCardUtility.GetSize(PawnForNeeds); }